summaryrefslogtreecommitdiff
path: root/compiler/optimizing/graph_checker.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2014-12-17 10:13:46 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2014-12-17 14:11:29 +0000
commit7c5367badfe61b96c5836d495d286cee64861579 (patch)
tree0468316d467302abc1f9feae3af8e64c2877610b /compiler/optimizing/graph_checker.cc
parent240016da1d6615b26c8342bdeb4bae381570ac47 (diff)
Fix ids and remove invoke when inlining.
Bugs found by Razvan Lupusoru. Change-Id: I3a5a9af280d8700d18f52abb4a2cff0e3a9aac74
Diffstat (limited to 'compiler/optimizing/graph_checker.cc')
-rw-r--r--compiler/optimizing/graph_checker.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc
index 5d712feb2b..e55175faec 100644
--- a/compiler/optimizing/graph_checker.cc
+++ b/compiler/optimizing/graph_checker.cc
@@ -16,9 +16,9 @@
#include "graph_checker.h"
-#include <string>
#include <map>
#include <sstream>
+#include <string>
#include "base/bit_vector-inl.h"
@@ -123,6 +123,14 @@ void GraphChecker::VisitBasicBlock(HBasicBlock* block) {
}
void GraphChecker::VisitInstruction(HInstruction* instruction) {
+ if (seen_ids_.IsBitSet(instruction->GetId())) {
+ std::stringstream error;
+ error << "Duplicate id in graph " << instruction->GetId() << ".";
+ errors_.push_back(error.str());
+ } else {
+ seen_ids_.SetBit(instruction->GetId());
+ }
+
// Ensure `instruction` is associated with `current_block_`.
if (instruction->GetBlock() != current_block_) {
std::stringstream error;