Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronize the GC spec tests to the commit from December 9. 2024. #4022

Merged
merged 5 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/spec_test_on_nuttx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ jobs:
wamr_feature_option:
# Empty option for default
- { option: "", mode: "" }
- { option: "CONFIG_INTERPRETERS_WAMR_GC CONFIG_INTERPRETERS_WAMR_AOT_STACK_FRAME", mode: "-G" }
# need to install menhir
# - { option: "CONFIG_INTERPRETERS_WAMR_GC CONFIG_INTERPRETERS_WAMR_AOT_STACK_FRAME", mode: "-G" }
lum1n0us marked this conversation as resolved.
Show resolved Hide resolved

exclude:
# XIP is not fully supported yet on RISCV64, some relocations can not be resolved
Expand Down
8 changes: 4 additions & 4 deletions core/iwasm/common/wasm_runtime_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -3014,17 +3014,17 @@ static const char *exception_msgs[] = {
"wasm operand stack overflow", /* EXCE_OPERAND_STACK_OVERFLOW */
"failed to compile fast jit function", /* EXCE_FAILED_TO_COMPILE_FAST_JIT_FUNC */
/* GC related exceptions */
"null function object", /* EXCE_NULL_FUNC_OBJ */
"null structure object", /* EXCE_NULL_STRUCT_OBJ */
"null array reference", /* EXCE_NULL_ARRAY_OBJ */
"null function reference", /* EXCE_NULL_FUNC_OBJ */
"null structure reference", /* EXCE_NULL_STRUCT_OBJ */
"null array reference", /* EXCE_NULL_ARRAY_OBJ */
"null i31 reference", /* EXCE_NULL_I31_OBJ */
"null reference", /* EXCE_NULL_REFERENCE */
"create rtt type failed", /* EXCE_FAILED_TO_CREATE_RTT_TYPE */
"create struct object failed", /* EXCE_FAILED_TO_CREATE_STRUCT_OBJ */
"create array object failed", /* EXCE_FAILED_TO_CREATE_ARRAY_OBJ */
"create externref object failed", /* EXCE_FAILED_TO_CREATE_EXTERNREF_OBJ */
"cast failure", /* EXCE_CAST_FAILURE */
"out of bounds array access", /* EXCE_ARRAY_IDX_OOB */
"out of bounds array access", /* EXCE_ARRAY_IDX_OOB */
/* stringref related exceptions */
"create string object failed", /* EXCE_FAILED_TO_CREATE_STRING */
"create stringref failed", /* EXCE_FAILED_TO_CREATE_STRINGREF */
Expand Down
10 changes: 6 additions & 4 deletions core/iwasm/interpreter/wasm_interp_classic.c
Original file line number Diff line number Diff line change
Expand Up @@ -2649,7 +2649,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
read_leb_uint32(frame_ip, frame_ip_end, type_index);
func_obj = POP_REF();
if (!func_obj) {
wasm_set_exception(module, "null function object");
wasm_set_exception(module, "null function reference");
goto got_exception;
}

Expand All @@ -2666,7 +2666,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
read_leb_uint32(frame_ip, frame_ip_end, type_index);
func_obj = POP_REF();
if (!func_obj) {
wasm_set_exception(module, "null function object");
wasm_set_exception(module, "null function reference");
goto got_exception;
}

Expand Down Expand Up @@ -2813,7 +2813,8 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
struct_obj = POP_REF();

if (!struct_obj) {
wasm_set_exception(module, "null structure object");
wasm_set_exception(module,
"null structure reference");
goto got_exception;
}

Expand Down Expand Up @@ -2869,7 +2870,8 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,

struct_obj = POP_REF();
if (!struct_obj) {
wasm_set_exception(module, "null structure object");
wasm_set_exception(module,
"null structure reference");
goto got_exception;
}

Expand Down
10 changes: 6 additions & 4 deletions core/iwasm/interpreter/wasm_interp_fast.c
Original file line number Diff line number Diff line change
Expand Up @@ -1992,7 +1992,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
#endif
func_obj = POP_REF();
if (!func_obj) {
wasm_set_exception(module, "null function object");
wasm_set_exception(module, "null function reference");
goto got_exception;
}

Expand All @@ -2007,7 +2007,7 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
#endif
func_obj = POP_REF();
if (!func_obj) {
wasm_set_exception(module, "null function object");
wasm_set_exception(module, "null function reference");
goto got_exception;
}

Expand Down Expand Up @@ -2148,7 +2148,8 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
struct_obj = POP_REF();

if (!struct_obj) {
wasm_set_exception(module, "null structure object");
wasm_set_exception(module,
"null structure reference");
goto got_exception;
}

Expand Down Expand Up @@ -2204,7 +2205,8 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,

struct_obj = POP_REF();
if (!struct_obj) {
wasm_set_exception(module, "null structure object");
wasm_set_exception(module,
"null structure reference");
goto got_exception;
}

Expand Down
5 changes: 3 additions & 2 deletions core/iwasm/interpreter/wasm_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -2135,8 +2135,9 @@ load_type_section(const uint8 *buf, const uint8 *buf_end, WASMModule *module,
if (!wasm_type_is_subtype_of(cur_type, parent_type,
module->types,
module->type_count)) {
set_error_buf(error_buf, error_buf_size,
"sub type does not match super type");
set_error_buf_v(error_buf, error_buf_size,
"sub type %u does not match super type",
processed_type_count + j);
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion core/iwasm/interpreter/wasm_runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -4660,7 +4660,7 @@ llvm_jit_table_init(WASMModuleInstance *module_inst, uint32 tbl_idx,
if (!(func_obj = wasm_create_func_obj(module_inst,
init_values[i].u.ref_index,
true, NULL, 0))) {
wasm_set_exception(module_inst, "null function object");
wasm_set_exception(module_inst, "null function reference");
return;
}
table_elems[i] = func_obj;
Expand Down
7 changes: 6 additions & 1 deletion tests/wamr-test-suites/spec-test-script/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,12 @@ def ignore_the_case(
return True

if gc_flag:
if case_name in ["array_init_elem", "array_init_data"]:
if case_name in [
"array_init_elem",
"array_init_data",
"array_new_data",
"array_new_elem"
]:
return True

if sgx_flag:
Expand Down
Loading
Loading