Skip to content

Commit

Permalink
Bug 1574865 - Wasm: Update encoding of nullref to match proposal. r=lth
Browse files Browse the repository at this point in the history
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
  • Loading branch information
eqrion committed Jan 24, 2020
1 parent 2c89f08 commit de19ba8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion js/src/jit-test/lib/wasm-binary.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const F32Code = 0x7d;
const F64Code = 0x7c;
const AnyFuncCode = 0x70;
const AnyrefCode = 0x6f;
const RefCode = 0x6e;
const RefCode = 0x6d;
const FuncCode = 0x60;
const VoidCode = 0x40;

Expand Down
10 changes: 5 additions & 5 deletions js/src/wasm/WasmConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,13 @@ enum class TypeCode {
FuncRef = 0x70, // SLEB128(-0x10)

// A reference to any type.
AnyRef = 0x6f,
AnyRef = 0x6f, // SLEB128(-0x11)

// A null reference.
NullRef = 0x6e, // SLEB128(-0x12)

// Type constructor for reference types.
Ref = 0x6e,
Ref = 0x6d,

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

// Type designator for null - unofficial, will not appear in the binary format
NullRef = 0x39,

Limit = 0x80
};

Expand Down

0 comments on commit de19ba8

Please sign in to comment.