-rw-r--r-- | jit/jit-rules-interp.c | 14 |
diff --git a/jit/jit-rules-interp.c b/jit/jit-rules-interp.c index 181ebb1..74aaa9f 100644 --- a/jit/jit-rules-interp.c +++ b/jit/jit-rules-interp.c @@ -504,7 +504,7 @@ int _jit_create_call_return_insns return 0; } } - else + else if(return_type->kind != JIT_TYPE_VOID) { if(!jit_insn_return_reg(func, return_value, 0)) { @@ -1027,7 +1027,6 @@ void _jit_gen_insn(jit_gencode_t gen, jit_function_t func, /* Not reached */ case JIT_OP_CALL: - case JIT_OP_CALL_EXTERNAL: { /* Call a function, whose pointer is supplied explicitly */ jit_cache_opcode(&(gen->posn), insn->opcode); @@ -1035,6 +1034,17 @@ void _jit_gen_insn(jit_gencode_t gen, jit_function_t func, } break; + case JIT_OP_CALL_EXTERNAL: + { + /* Call a native function, whose pointer is supplied explicitly */ + jit_cache_opcode(&(gen->posn), insn->opcode); + jit_cache_native(&(gen->posn), (jit_nint)(insn->value2)); + jit_cache_native(&(gen->posn), (jit_nint)(insn->dest)); + jit_cache_native(&(gen->posn), (jit_nint) + (jit_type_num_params((jit_type_t)(insn->value2)))); + } + break; + case JIT_OP_CALL_INDIRECT: case JIT_OP_CALL_VTABLE_PTR: { |