diff options
author | Christopher Ferris <cferris@google.com> | 2015-04-27 15:19:41 -0700 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2015-05-04 12:10:07 -0700 |
commit | 241a9588c6d7d0fcb4c92da40c7141863930083a (patch) | |
tree | 4a6868893dc742f6322775d198a2305f645f2f3f /runtime/stack.h | |
parent | a93b104b47da67eaa50f8a6b7280cc6c438ef37b (diff) | |
download | art-241a9588c6d7d0fcb4c92da40c7141863930083a.zip art-241a9588c6d7d0fcb4c92da40c7141863930083a.tar.gz art-241a9588c6d7d0fcb4c92da40c7141863930083a.tar.bz2 |
Fix mismatched new[]/delete.
Another two cases where a new[] is used but only a delete occurs.
Bug: 18202869
Change-Id: If68264807150f3a9783e44ef8823cc366bff8df2
Diffstat (limited to 'runtime/stack.h')
-rw-r--r-- | runtime/stack.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/runtime/stack.h b/runtime/stack.h index e2af5ee..3f1bff8 100644 --- a/runtime/stack.h +++ b/runtime/stack.h @@ -74,12 +74,18 @@ class ShadowFrame { } // Create ShadowFrame in heap for deoptimization. - static ShadowFrame* Create(uint32_t num_vregs, ShadowFrame* link, - mirror::ArtMethod* method, uint32_t dex_pc) { + static ShadowFrame* CreateDeoptimizedFrame(uint32_t num_vregs, ShadowFrame* link, + mirror::ArtMethod* method, uint32_t dex_pc) { uint8_t* memory = new uint8_t[ComputeSize(num_vregs)]; return Create(num_vregs, link, method, dex_pc, memory); } + // Delete a ShadowFrame allocated on the heap for deoptimization. + static void DeleteDeoptimizedFrame(ShadowFrame* sf) { + uint8_t* memory = reinterpret_cast<uint8_t*>(sf); + delete[] memory; + } + // Create ShadowFrame for interpreter using provided memory. static ShadowFrame* Create(uint32_t num_vregs, ShadowFrame* link, mirror::ArtMethod* method, uint32_t dex_pc, void* memory) { |