From 0bca6cab06405ede5343bc22f8571b1a88aa8c22 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Mon, 3 Oct 2016 05:34:01 +0200 Subject: 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. --- i386-asm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'i386-asm.c') diff --git a/i386-asm.c b/i386-asm.c index 336ef1b..1d1ebcf 100644 --- a/i386-asm.c +++ b/i386-asm.c @@ -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); } -- cgit v1.3.1