Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(517)

Unified Diff: src/wasm/ast-decoder.cc

Issue 1961853002: [wasm] Verify expressions do not cross control boundaries in WASM. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/unittests/wasm/ast-decoder-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/ast-decoder.cc
diff --git a/src/wasm/ast-decoder.cc b/src/wasm/ast-decoder.cc
index 1432e152b084ceb9d1c6b1017dac97fadb9ec57f..f3dab7625665750f2774cd9a5d02503c23382241 100644
--- a/src/wasm/ast-decoder.cc
+++ b/src/wasm/ast-decoder.cc
@@ -1157,7 +1157,8 @@ class SR_WasmDecoder : public WasmDecoder {
}
Value Pop() {
- if (stack_.empty()) {
+ size_t limit = control_.empty() ? 0 : control_.back().stack_depth;
ahaas 2016/05/09 09:55:43 Could you add a comment at the declaration of cont
titzer 2016/05/09 09:57:20 Done.
+ if (stack_.size() <= limit) {
Value val = {pc_, nullptr, kAstStmt};
error(pc_, pc_, "%s found empty stack", SafeOpcodeNameAt(pc_));
return val;
« no previous file with comments | « no previous file | test/unittests/wasm/ast-decoder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698