Remove HTemporary when building the SSA graph.
- They are useless afterwards. If we keep them around, they can
crash the dump of the graph, where they always assume a previous
instruction.
- In the call to HTemporary::GetType, check that the previous
instruction exists.
Change-Id: Ie7bf44d05cb61e3654a69725c1980925580dd3a6
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index 2dab605..36e286d 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -2114,7 +2114,11 @@
size_t GetIndex() const { return index_; }
- Primitive::Type GetType() const OVERRIDE { return GetPrevious()->GetType(); }
+ Primitive::Type GetType() const OVERRIDE {
+ // The previous instruction is the one that will be stored in the temporary location.
+ DCHECK(GetPrevious() != nullptr);
+ return GetPrevious()->GetType();
+ }
DECLARE_INSTRUCTION(Temporary);