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

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

Issue 2411793006: [wasm] Let BranchTableIterator::has_next return false if decoder->failed() (Closed)
Patch Set: Created 4 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/ast-decoder.h
diff --git a/src/wasm/ast-decoder.h b/src/wasm/ast-decoder.h
index 001dfb4c5c292713c6744d9448aac366ac76926c..74e05841dd57649ba3ba9b710874ef4d4b73ca55 100644
--- a/src/wasm/ast-decoder.h
+++ b/src/wasm/ast-decoder.h
@@ -234,7 +234,7 @@ struct BranchTableOperand {
class BranchTableIterator {
public:
unsigned cur_index() { return index_; }
- bool has_next() { return index_ <= table_count_; }
+ bool has_next() { return decoder_->ok() && index_ <= table_count_; }
titzer 2016/10/13 13:46:10 Does this obviate the previous fix?
ahaas 2016/10/13 13:53:44 This change does not prevent any crashes, it just
uint32_t next() {
DCHECK(has_next());
index_++;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698