Skip to content

add check for invalid reftype #4300

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Septa2112
Copy link
Contributor

Update reftype validation in load_init_expr when ref.null.

@@ -820,7 +820,7 @@ load_init_expr(WASMModule *module, const uint8 **p_buf, const uint8 *buf_end,
#else
cur_value.gc_obj = NULL_REF;

if (!is_byte_a_type(type1)
if (!is_byte_a_type(type1) || !wasm_is_type_reftype(type1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems not quite fitting the spec requirement: https://webassembly.github.io/gc/core/valid/instructions.html#xref-syntax-instructions-syntax-instr-ref-mathsf-ref-null-mathit-ht. it requires a heaptype instead.

I know that our GC implementation doesn't sync up with the latest GC spec. Please help me confirm that the new condition combination equals heaptype. TWO types of heaptype need to be covered. https://webassembly.github.io/gc/core/binary/types.html#heap-types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants