diff options
| -rw-r--r-- | src/compile/compile.c | 4 | ||||
| -rw-r--r-- | src/interp.c | 6 | 
2 files changed, 8 insertions, 2 deletions
| diff --git a/src/compile/compile.c b/src/compile/compile.c index d2fd3dc..ef3efcd 100644 --- a/src/compile/compile.c +++ b/src/compile/compile.c @@ -16,12 +16,12 @@ static void free_arena(void *arena, size_t size)  static size_t grploc_count(struct ejit_func *f)  { -	return f->gpr >= jit_v_num() ? 0 : f->gpr - jit_v_num(); +	return f->gpr < jit_v_num() ? 0 : f->gpr - jit_v_num();  }  static size_t frploc_count(struct ejit_func *f)  { -	return f->fpr >= jit_vf_num() ? 0 : f->fpr - jit_vf_num(); +	return f->fpr < jit_vf_num() ? 0 : f->fpr - jit_vf_num();  }  static size_t stack_size(struct ejit_func *f) diff --git a/src/interp.c b/src/interp.c index 4f034f7..9c3aea3 100644 --- a/src/interp.c +++ b/src/interp.c @@ -34,6 +34,8 @@ union interp_ret ejit_interp(struct ejit_func *f, size_t argc, struct ejit_arg a  		[RET_F] = &&RET_F,  		[RET_FI] = &&RET_FI, +		[RETVAL] = &&RETVAL, +  		[ARG] = &&ARG,  		[ARG_I] = &&ARG_I,  		[ARG_F] = &&ARG_F, @@ -158,6 +160,10 @@ union interp_ret ejit_interp(struct ejit_func *f, size_t argc, struct ejit_arg a  	JUMP(i.r0);  	DISPATCH(); +	DO(RETVAL); +	gpr[i.r0] = retval; +	DISPATCH(); +  	DO(PARAM);  	gpr[i.r2] = args[i.r0].l;  	DISPATCH(); | 
