From: Mike Pall Date: Sat, 22 Oct 2011 00:01:44 +0000 (+0200) Subject: x64: Fix math.random() code generation. X-Git-Tag: v2.0.0-beta9~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e5c0870bcde0fee3cb8fd31de27d30beaa9617e;p=thirdparty%2FLuaJIT.git x64: Fix math.random() code generation. --- 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); }