Bug 1624490 - Allow ref.null in declared segments. r=lth
☠☠ backed out by cdf202c2682e ☠ ☠
authorRyan Hunt <rhunt@eqrion.net>
Wed, 25 Mar 2020 07:30:41 +0000
changeset 520394 b89a4862242cf93166205e15ccdff8e9c04de9b5
parent 520393 38cdc01220e8eeec4ac7837fee9c494a5cb9263e
child 520395 73b4073fe12e1062ac6a2b64618c3c6a9fdb145c
push id37249
push userdvarga@mozilla.com
push dateWed, 25 Mar 2020 21:39:06 +0000
treeherdermozilla-central@b3c3f7d0f044 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslth
bugs1624490
milestone76.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1624490 - Allow ref.null in declared segments. r=lth Differential Revision: https://phabricator.services.mozilla.com/D68129
js/src/wasm/WasmValidate.cpp
--- a/js/src/wasm/WasmValidate.cpp
+++ b/js/src/wasm/WasmValidate.cpp
@@ -2510,20 +2510,16 @@ static bool DecodeElemSection(Decoder& d
         }
 
         RefType initType = RefType::any();
         switch (op.b0) {
           case uint16_t(Op::RefFunc):
             initType = RefType::func();
             break;
           case uint16_t(Op::RefNull):
-            if (kind == ElemSegmentKind::Declared) {
-              return d.fail(
-                  "declared element segments cannot contain ref.null");
-            }
             initType = RefType::null();
             needIndex = false;
             break;
           default:
             return d.fail("failed to read initializer operation");
         }
         if (!env->isRefSubtypeOf(ValType(initType), ValType(elemType))) {
           return d.fail("initializer type must be subtype of element type");