Bug 1310149: Tighten the check in DecodeLimits; r=luke
authorBenjamin Bouvier <benj@benj.me>
Wed, 26 Oct 2016 12:09:28 +0200
changeset 319944 ddb7b94d3a6ae8a8c415e61f4bdf34794f09ba77
parent 319943 355c7ec8b68e965787e18517eeef2a693434992a
child 319945 c9ecc2d1411406a81d4204f6fe16831245410002
push id83275
push userbbouvier@mozilla.com
push dateFri, 28 Oct 2016 13:24:16 +0000
treeherdermozilla-inbound@94efce672651 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs1310149
milestone52.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 1310149: Tighten the check in DecodeLimits; r=luke MozReview-Commit-ID: 7uvBAqIY53I
js/src/asmjs/WasmBinaryFormat.cpp
--- a/js/src/asmjs/WasmBinaryFormat.cpp
+++ b/js/src/asmjs/WasmBinaryFormat.cpp
@@ -186,20 +186,18 @@ wasm::DecodeInitializerExpression(Decode
 
 bool
 wasm::DecodeLimits(Decoder& d, Limits* limits)
 {
     uint32_t flags;
     if (!d.readVarU32(&flags))
         return d.fail("expected flags");
 
-    // TODO (bug 1310149): tighten this check (s/3/1) when the AngryBots demo
-    // gets updated.
-    if (flags & ~uint32_t(0x3))
-        return d.fail("unexpected bits set in flags: %" PRIu32, (flags & ~uint32_t(0x3)));
+    if (flags & ~uint32_t(0x1))
+        return d.fail("unexpected bits set in flags: %" PRIu32, (flags & ~uint32_t(0x1)));
 
     if (!d.readVarU32(&limits->initial))
         return d.fail("expected initial length");
 
     if (flags & 0x1) {
         uint32_t maximum;
         if (!d.readVarU32(&maximum))
             return d.fail("expected maximum length");