diff options
author | 2014-12-02 18:58:03 +0000 | |
---|---|---|
committer | 2014-12-02 20:28:07 +0000 | |
commit | 92a6ed2014278c78b60d7ef00751f15e6727aae0 (patch) | |
tree | 2b8dec6f14999ede3f4b33bfff5aef76931d4021 /compiler/optimizing/nodes.h | |
parent | f25c2ec6b63e116f24f359a10b59c78768fde67a (diff) |
Fix new-instance node.
new-instance may throw when called on:
- interfaces
- abstract/innaccessible/unknown classes
Change-Id: Id55dbb95b906a58c946b14adad934ee0e3498c0a
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r-- | compiler/optimizing/nodes.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 9d0b4a971e..4706b3beab 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -1669,7 +1669,12 @@ class HNewInstance : public HExpression<0> { 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); |