[wasm] Let BranchTableIterator::has_next return false if decoder->failed()

R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/2411793006
Cr-Commit-Position: refs/heads/master@{#40287}
This commit is contained in:
ahaas 2016-10-13 11:32:00 -07:00 committed by Commit bot
parent 96a448aba3
commit 52cf416aa8

View File

@ -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_; }
uint32_t next() {
DCHECK(has_next());
index_++;