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

[EH] Use random value for exnref encoding when legacy GC is used #6166

Merged
merged 5 commits into from
Dec 12, 2023
Merged
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
26 changes: 20 additions & 6 deletions src/wasm-binary.h
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,15 @@ enum EncodedType {
nullable = -0x14, // 0x6c
nonnullable = -0x15, // 0x6b
#endif
#if STANDARD_GC_ENCODINGS
// exception handling
exnref = -0x17, // 0x69
exnref = -0x17, // 0x69
#else
// Currently the legacy GC encoding's nullexternref encoding overlaps with
// exnref's. We assume the legacy GC encoding won't be used with the exnref
// for the moment and assign a random value to it to prevent the clash.
exnref = -0xfe,
#endif
nullexnref = -0xff, // TODO
// string reference types
#if STANDARD_GC_ENCODINGS
Expand Down Expand Up @@ -456,11 +463,18 @@ enum EncodedHeapType {
nofunc = -0x18, // 0x68
none = -0x1b, // 0x65
#endif
func = -0x10, // 0x70
ext = -0x11, // 0x6f
any = -0x12, // 0x6e
eq = -0x13, // 0x6d
exn = -0x17, // 0x69
func = -0x10, // 0x70
ext = -0x11, // 0x6f
any = -0x12, // 0x6e
eq = -0x13, // 0x6d
#if STANDARD_GC_ENCODINGS
exn = -0x17, // 0x69
#else
// Currently the legacy GC encoding's nullexternref encoding overlaps with
// exnref's. We assume the legacy GC encoding won't be used with the exnref
// for the moment and assign a random value to it to prevent the clash.
exn = -0xfe,
#endif
noexn = -0xff, // TODO
#if STANDARD_GC_ENCODINGS
i31 = -0x14, // 0x6c
Expand Down
Loading