Fix drop opcode not clear frame ref issue (#2360)

This commit is contained in:
Xu Jun 2023-07-18 15:54:47 +08:00 committed by GitHub
parent 61b692eacc
commit f906585b56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -1763,12 +1763,24 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
HANDLE_OP(WASM_OP_DROP)
{
frame_sp--;
#if WASM_ENABLE_GC != 0
frame_ref_tmp = FRAME_REF(frame_sp);
*frame_ref_tmp = 0;
#endif
HANDLE_OP_END();
}
HANDLE_OP(WASM_OP_DROP_64)
{
frame_sp -= 2;
#if WASM_ENABLE_GC != 0
frame_ref_tmp = FRAME_REF(frame_sp);
*frame_ref_tmp = 0;
*(frame_ref_tmp + 1) = 0;
#endif
HANDLE_OP_END();
}

View File

@ -480,7 +480,6 @@ alloc_hmu_ex(gc_heap_t *heap, gc_size_t size)
#if GC_IN_EVERY_ALLOCATION != 0
if (GC_SUCCESS != do_gc_heap(heap))
return NULL;
return alloc_hmu(heap, size);
#else
if (heap->total_free_size < heap->gc_threshold) {
if (GC_SUCCESS != do_gc_heap(heap))