summaryrefslogtreecommitdiff
path: root/compiler/optimizing/graph_checker.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/optimizing/graph_checker.cc')
-rw-r--r--compiler/optimizing/graph_checker.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc
index b061b401ff..f2662700c7 100644
--- a/compiler/optimizing/graph_checker.cc
+++ b/compiler/optimizing/graph_checker.cc
@@ -673,9 +673,15 @@ void GraphChecker::VisitInstruction(HInstruction* instruction) {
}
}
- if (instruction->NeedsEnvironment() && !instruction->HasEnvironment()) {
- AddError(StringPrintf("Instruction %s:%d in block %d requires an environment "
- "but does not have one.",
+ if (instruction->NeedsEnvironment() != instruction->HasEnvironment()) {
+ const char* str;
+ if (instruction->NeedsEnvironment()) {
+ str = "Instruction %s:%d in block %d requires an environment but does not have one.";
+ } else {
+ str = "Instruction %s:%d in block %d doesn't require an environment but it has one.";
+ }
+
+ AddError(StringPrintf(str,
instruction->DebugName(),
instruction->GetId(),
current_block_->GetBlockId()));