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

Unified Diff: runtime/vm/ast.cc

Issue 25456005: Add type check to const conditional expression evaluation (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | runtime/vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/ast.cc
===================================================================
--- runtime/vm/ast.cc (revision 28166)
+++ runtime/vm/ast.cc (working copy)
@@ -386,6 +386,7 @@
const Instance* ConditionalExprNode::EvalConstExpr() const {
const Instance* cond = this->condition()->EvalConstExpr();
if ((cond != NULL) &&
+ cond->IsBool() &&
(this->true_expr()->EvalConstExpr() != NULL) &&
(this->false_expr()->EvalConstExpr() != NULL)) {
return cond;
« no previous file with comments | « no previous file | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698