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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 11369219: Check result type of redirecting factory in checked mode. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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') | runtime/vm/parser.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
===================================================================
--- runtime/vm/flow_graph_builder.cc (revision 14858)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -606,7 +606,22 @@
// type: AbstractType
// dst_name: String }
void EffectGraphVisitor::VisitAssignableNode(AssignableNode* node) {
- UNREACHABLE();
+ ValueGraphVisitor for_value(owner(), temp_index(), loop_depth());
+ node->expr()->Visit(&for_value);
+ Append(for_value);
+ Definition* checked_value;
+ if (CanSkipTypeCheck(node->expr()->token_pos(),
+ for_value.value(),
+ node->type(),
+ node->dst_name())) {
+ checked_value = for_value.value()->definition(); // No check needed.
+ } else {
+ checked_value = BuildAssertAssignable(node->expr()->token_pos(),
+ for_value.value(),
+ node->type(),
+ node->dst_name());
+ }
srdjan 2012/11/13 18:33:35 Why are you not using BuildAssignableValue as belo
regis 2012/11/13 18:38:53 I tried, but it does not get simpler. BuildAssertA
+ ReturnDefinition(checked_value);
}
« no previous file with comments | « no previous file | runtime/vm/parser.cc » ('j') | runtime/vm/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698