From 6678d31d5c3d5e6974405a559b54f7f18a1ab398 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Thu, 5 Jul 2007 19:10:23 -0600 Subject: [PATCH] fix stack overflow calculation --- src/vm.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vm.cpp b/src/vm.cpp index 5231275321..12fd192e4f 100644 --- a/src/vm.cpp +++ b/src/vm.cpp @@ -4642,8 +4642,10 @@ run(Thread* t) } else { unsigned parameterFootprint = methodParameterFootprint(t, code); unsigned base = sp - parameterFootprint; - if (UNLIKELY(codeMaxStack(t, methodCode(t, code)) - + codeMaxLocals(t, methodCode(t, code)) + base + if (UNLIKELY(base + + codeMaxLocals(t, methodCode(t, code)) + + FrameFootprint + + codeMaxStack(t, methodCode(t, code)) > Thread::StackSizeInWords / 2)) { exception = makeStackOverflowError(t);