Bug 1310149: Tighten the check in DecodeLimits; r=luke
authorBenjamin Bouvier <benj@benj.me>
Wed, 26 Oct 2016 12:09:28 +0200
changeset 320004 ddb7b94d3a6ae8a8c415e61f4bdf34794f09ba77
parent 320003 355c7ec8b68e965787e18517eeef2a693434992a
child 320005 c9ecc2d1411406a81d4204f6fe16831245410002
push id20749
push userryanvm@gmail.com
push dateSat, 29 Oct 2016 13:21:21 +0000
treeherderfx-team@1b170b39ed6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs1310149
milestone52.0a1
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");