Fix SEGV when dumping MIR CFG
I turned on kDebugDumpCFG to try to dump the CFGs, and I found
that they caused a segmentation violation. The problem was that
the orig_sreg was -1, and IsConst then blew up.
Change-Id: Ib9acda0b11ce486e878ef2ccfae3b1bc1f82fdfb
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
diff --git a/compiler/dex/mir_graph.h b/compiler/dex/mir_graph.h
index bffec39..76c13f3 100644
--- a/compiler/dex/mir_graph.h
+++ b/compiler/dex/mir_graph.h
@@ -467,7 +467,7 @@
}
bool IsConst(RegLocation loc) const {
- return (IsConst(loc.orig_sreg));
+ return loc.orig_sreg < 0 ? false : IsConst(loc.orig_sreg);
}
int32_t ConstantValue(RegLocation loc) const {