From 5b417b97bd0e89ecd16d2215e0ff2eca5284e013 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Mon, 10 Mar 2014 14:18:35 -0700 Subject: Fix old stack frame size check The test underestimates the frame size for JNI frames, as not enough overhead is accounted for. Cherry-picked from commit 291088a2983ff954c137dddcc2ba7cb1c4cc95d2 Change-Id: I6ad96bc9b8eaecd6c888b91b3ffcfc4aeddc5eb8 --- runtime/stack.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'runtime/stack.cc') diff --git a/runtime/stack.cc b/runtime/stack.cc index abaea6f..15b288e 100644 --- a/runtime/stack.cc +++ b/runtime/stack.cc @@ -280,10 +280,12 @@ void StackVisitor::SanityCheckFrame() const { // Frame sanity. size_t frame_size = method->GetFrameSizeInBytes(); CHECK_NE(frame_size, 0u); - // A rough guess at an upper size we expect to see for a frame. The 256 is - // a dex register limit. The 16 incorporates callee save spills and - // outgoing argument set up. - const size_t kMaxExpectedFrameSize = 256 * sizeof(word) + 16; + // A rough guess at an upper size we expect to see for a frame. + // 256 registers + // 2 words Sirt overhead + // 3+3 register spills + // TODO: this seems architecture specific for the case of JNI frames. + const size_t kMaxExpectedFrameSize = (256 + 2 + 3 + 3) * sizeof(word); CHECK_LE(frame_size, kMaxExpectedFrameSize); size_t return_pc_offset = method->GetReturnPcOffsetInBytes(); CHECK_LT(return_pc_offset, frame_size); -- cgit v1.1