diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm-binary.h | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h index 58d641dc9..9e68ca330 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -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 @@ -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 |