fast-interp: Fix GC opcode ref.as_non_null (#3156)

The issue was found in https://github.com/bytecodealliance/wasm-micro-runtime/issues/3151.
This commit is contained in:
Wenyong Huang
2024-02-17 11:54:49 +08:00
committed by GitHub
parent b0c54c8a86
commit 3a0e86454e
4 changed files with 9 additions and 7 deletions

View File

@ -1967,12 +1967,12 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
}
HANDLE_OP(WASM_OP_REF_AS_NON_NULL)
{
opnd_off = GET_OFFSET();
gc_obj = GET_REF_FROM_ADDR(frame_lp + opnd_off);
gc_obj = POP_REF();
if (gc_obj == NULL_REF) {
wasm_set_exception(module, "null reference");
goto got_exception;
}
PUSH_REF(gc_obj);
HANDLE_OP_END();
}
HANDLE_OP(WASM_OP_REF_EQ)