From 2e5c0870bcde0fee3cb8fd31de27d30beaa9617e Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Sat, 22 Oct 2011 02:01:44 +0200 Subject: [PATCH] x64: Fix math.random() code generation. --- src/lj_asm_x86.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lj_asm_x86.h b/src/lj_asm_x86.h index ae90309b..45afdc88 100644 --- a/src/lj_asm_x86.h +++ b/src/lj_asm_x86.h @@ -463,9 +463,8 @@ static void asm_setupresult(ASMState *as, IRIns *ir, const CCallInfo *ci) ra_free(as, dest); ra_modified(as, dest); emit_rr(as, XO_MOVD, dest|REX_64, RID_RET); /* Really MOVQ. */ - } else { - emit_movtomro(as, RID_RET|REX_64, RID_ESP, ofs); } + if (ofs) emit_movtomro(as, RID_RET|REX_64, RID_ESP, ofs); } else { ra_destreg(as, ir, RID_FPRET); } -- 2.11.4.GIT