浏览代码

x64: Fix math.random() code generation.

Mike Pall 14 年之前
父节点
当前提交
2e5c0870bc
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      src/lj_asm_x86.h

+ 1 - 2
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);
       }