Skip to content

Commit ee0c044

Browse files
committed
Bug 1574865 - Wasm: Update encoding of nullref to match proposal. r=lth
This commit updates the encoding of nullref to match the one given in the reference types proposal. Spec: WebAssembly/reference-types#66 Differential Revision: https://phabricator.services.mozilla.com/D58882
1 parent 1869138 commit ee0c044

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

js/src/jit-test/lib/wasm-binary.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const F32Code = 0x7d;
4141
const F64Code = 0x7c;
4242
const AnyFuncCode = 0x70;
4343
const AnyrefCode = 0x6f;
44-
const RefCode = 0x6e;
44+
const RefCode = 0x6d;
4545
const FuncCode = 0x60;
4646
const VoidCode = 0x40;
4747

js/src/wasm/WasmConstants.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,13 @@ enum class TypeCode {
6262
FuncRef = 0x70, // SLEB128(-0x10)
6363

6464
// A reference to any type.
65-
AnyRef = 0x6f,
65+
AnyRef = 0x6f, // SLEB128(-0x11)
66+
67+
// A null reference.
68+
NullRef = 0x6e, // SLEB128(-0x12)
6669

6770
// Type constructor for reference types.
68-
Ref = 0x6e,
71+
Ref = 0x6d,
6972

7073
// Type constructor for function types
7174
Func = 0x60, // SLEB128(-0x20)
@@ -76,9 +79,6 @@ enum class TypeCode {
7679
// The 'empty' case of blocktype.
7780
BlockVoid = 0x40, // SLEB128(-0x40)
7881

79-
// Type designator for null - unofficial, will not appear in the binary format
80-
NullRef = 0x39,
81-
8282
Limit = 0x80
8383
};
8484

0 commit comments

Comments
 (0)