Fix new-instance node.
new-instance may throw when called on:
- interfaces
- abstract/innaccessible/unknown classes
Change-Id: Id55dbb95b906a58c946b14adad934ee0e3498c0a
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index 9d0b4a9..4706b3b 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -1669,7 +1669,12 @@
uint16_t GetTypeIndex() const { return type_index_; }
// Calls runtime so needs an environment.
- virtual bool NeedsEnvironment() const { return true; }
+ bool NeedsEnvironment() const OVERRIDE { return true; }
+ // It may throw when called on:
+ // - interfaces
+ // - abstract/innaccessible/unknown classes
+ // TODO: optimize when possible.
+ bool CanThrow() const OVERRIDE { return true; }
DECLARE_INSTRUCTION(NewInstance);