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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 10972010: Check for a NULL value before passing it to a function that assumes non-NULL. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc
index 578b8b41b152b1196e125cda3d8f241946f48c2f..ed6d9582d9120e4e3964909d6b1ec195606b2de4 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -1460,8 +1460,8 @@ static Range* ConstraintRange(Token::Kind op, Definition* boundary) {
ConstraintInstr* RangeAnalysis::InsertConstraintFor(Definition* defn,
- Range* constraint_range,
- Instruction* after) {
+ Range* constraint_range,
+ Instruction* after) {
// No need to constrain constants.
if (defn->IsConstant()) return NULL;
@@ -1504,8 +1504,8 @@ void RangeAnalysis::InsertConstraintsFor(Definition* defn) {
// Constrain definition at the true successor.
ConstraintInstr* true_constraint =
InsertConstraintFor(defn,
- ConstraintRange(op_kind, boundary),
- branch->true_successor());
+ ConstraintRange(op_kind, boundary),
+ branch->true_successor());
// Mark true_constraint an artificial use of boundary. This ensures
// that constraint's range is recalculated if boundary's range changes.
if (true_constraint != NULL) true_constraint->AddDependency(boundary);
@@ -1530,9 +1530,11 @@ void RangeAnalysis::InsertConstraints() {
CheckSmiInstr* check = smi_checks_[i];
ConstraintInstr* constraint =
InsertConstraintFor(check->value()->definition(),
- Range::Unknown(),
- check);
- InsertConstraintsFor(constraint); // Constrain uses further.
+ Range::Unknown(),
+ check);
+ if (constraint != NULL) {
+ InsertConstraintsFor(constraint); // Constrain uses further.
+ }
}
for (intptr_t i = 0; i < smi_values_.length(); i++) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698