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

Unified Diff: src/compiler/verifier.cc

Issue 2672713002: [turbofan] Guard invariant that Branch/Select condition must be Boolean. (Closed)
Patch Set: Created 3 years, 11 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 | « src/compiler/simplified-lowering.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/verifier.cc
diff --git a/src/compiler/verifier.cc b/src/compiler/verifier.cc
index 7672ac593a15ac78f8c77a3ea7c40a6bf4bafc46..90b3f133bea2f79aec2fcd2a4e792683deb726c5 100644
--- a/src/compiler/verifier.cc
+++ b/src/compiler/verifier.cc
@@ -207,6 +207,8 @@ void Verifier::Visitor::Check(Node* node) {
}
CHECK_EQ(1, count_true);
CHECK_EQ(1, count_false);
+ // The condition must be a Boolean.
+ CheckValueInputIs(node, 0, Type::Boolean());
// Type is empty.
CheckNotTyped(node);
break;
@@ -408,6 +410,10 @@ void Verifier::Visitor::Check(Node* node) {
CHECK_EQ(0, effect_count);
CHECK_EQ(0, control_count);
CHECK_EQ(3, value_count);
+ // The condition must be a Boolean.
+ CheckValueInputIs(node, 0, Type::Boolean());
+ // Type can be anything.
+ CheckTypeIs(node, Type::Any());
break;
}
case IrOpcode::kPhi: {
« no previous file with comments | « src/compiler/simplified-lowering.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698