x86_64-asm: fix copy-out registers

If the destination is an indirect pointer access (which ends up
as VT_LLOCAL) the intermediate pointer must be loaded as VT_PTR,
not as whatever the pointed to type is.
This commit is contained in:
Michael Matz
2016-10-03 05:34:01 +02:00
parent ad723a419f
commit 0bca6cab06
2 changed files with 11 additions and 1 deletions

View File

@ -1605,8 +1605,10 @@ ST_FUNC void asm_gen_code(ASMOperand *operands, int nb_operands,
SValue sv;
sv = *op->vt;
sv.r = (sv.r & ~VT_VALMASK) | VT_LOCAL;
sv.type.t = VT_PTR;
load(out_reg, &sv);
sv = *op->vt;
sv.r = (sv.r & ~VT_VALMASK) | out_reg;
store(op->reg, &sv);
}