浏览代码

fixed HVIRTUAL dynamic call in x64

ncannasse 7 年之前
父节点
当前提交
9c7587aeea
共有 1 个文件被更改,包括 6 次插入5 次删除
  1. 6 5
      src/jit.c

+ 6 - 5
src/jit.c

@@ -3429,12 +3429,13 @@ int hl_jit_function( jit_ctx *ctx, hl_module *m, hl_function *f ) {
 
 					jit_buf(ctx);
 
-					size = begin_native_call(ctx, 5);
-					if( !need_dyn )
+					if( !need_dyn ) {
+						size = begin_native_call(ctx, 5);
 						set_native_arg(ctx, pconst(&p,0));
-					else {
-						preg *rtmp = alloc_native_arg(ctx);
-						op64(ctx,LEA,rtmp,pmem(&p,Esp,paramsSize - sizeof(vdynamic) + (size - HL_WSIZE*5)));
+					} else {
+						preg *rtmp = alloc_reg(ctx,RCPU);
+						op64(ctx,LEA,rtmp,pmem(&p,Esp,paramsSize - sizeof(vdynamic)));
+						size = begin_native_call(ctx, 5);
 						set_native_arg(ctx,rtmp);
 						if( !IS_64 ) RUNLOCK(rtmp);
 					}