Index: src/wasm/ast-decoder.cc |
diff --git a/src/wasm/ast-decoder.cc b/src/wasm/ast-decoder.cc |
index 798f9d393a5bf10dba8e1c5b5ebb944e1d0f171e..5d541705b21a580933307d9902a73d853d26fc3b 100644 |
--- a/src/wasm/ast-decoder.cc |
+++ b/src/wasm/ast-decoder.cc |
@@ -1850,10 +1850,12 @@ class WasmFullDecoder : public WasmDecoder { |
break; |
case kExprSetLocal: { |
LocalIndexOperand operand(this, pc); |
- if (assigned->length() > 0 && |
- static_cast<int>(operand.index) < assigned->length()) { |
- // Unverified code might have an out-of-bounds index. |
- assigned->Add(operand.index); |
+ if (Validate(pc_, operand)) { |
titzer
2016/09/01 13:12:44
I think if you just remove the static_cast to int,
ahaas
2016/09/01 13:53:15
Done. I think that calling Validate() would have a
|
+ if (assigned->length() > 0 && |
+ static_cast<int>(operand.index) < assigned->length()) { |
+ // Unverified code might have an out-of-bounds index. |
+ assigned->Add(operand.index); |
+ } |
} |
length = 1 + operand.length; |
break; |