Index: src/ast/ast.h |
diff --git a/src/ast/ast.h b/src/ast/ast.h |
index 3bc5690f033a764018c4c3b824526fe61bb8cb16..dc0e03d03bb4e11960c2bf00c1e05a36ae5e777f 100644 |
--- a/src/ast/ast.h |
+++ b/src/ast/ast.h |
@@ -483,7 +483,10 @@ class Block final : public BreakableStatement { |
} |
void MarkTail() override { |
- if (!statements_.is_empty()) statements_.last()->MarkTail(); |
+ for (int i = 0; i < statements_.length(); i++) { |
+ Statement* stmt = statements_.at(i); |
+ stmt->MarkTail(); |
+ } |
} |
Scope* scope() const { return scope_; } |
@@ -968,7 +971,6 @@ class ExpressionStatement final : public Statement { |
void set_expression(Expression* e) { expression_ = e; } |
Expression* expression() const { return expression_; } |
bool IsJump() const override { return expression_->IsThrow(); } |
- void MarkTail() override { expression_->MarkTail(); } |
protected: |
ExpressionStatement(Zone* zone, Expression* expression, int pos) |
@@ -1026,6 +1028,8 @@ class ReturnStatement final : public JumpStatement { |
void set_expression(Expression* e) { expression_ = e; } |
+ void MarkTail() override { expression_->MarkTail(); } |
+ |
protected: |
explicit ReturnStatement(Zone* zone, Expression* expression, int pos) |
: JumpStatement(zone, pos), expression_(expression) { } |
@@ -1095,7 +1099,10 @@ class CaseClause final : public Expression { |
TypeFeedbackId CompareId() { return TypeFeedbackId(local_id(1)); } |
void MarkTail() override { |
- if (!statements_->is_empty()) statements_->last()->MarkTail(); |
+ for (int i = 0; i < statements_->length(); i++) { |
+ Statement* stmt = statements_->at(i); |
+ stmt->MarkTail(); |
+ } |
} |
Type* compare_type() { return compare_type_; } |
@@ -1131,7 +1138,10 @@ class SwitchStatement final : public BreakableStatement { |
void set_tag(Expression* t) { tag_ = t; } |
void MarkTail() override { |
- if (!cases_->is_empty()) cases_->last()->MarkTail(); |
+ for (int i = 0; i < cases_->length(); i++) { |
+ CaseClause* clause = cases_->at(i); |
+ clause->MarkTail(); |
+ } |
} |
protected: |