fix stack corruption due to spurious pop events generated for jsr bytecodes

This commit is contained in:
Joel Dice 2008-10-09 17:14:52 -06:00
parent aeafb52bcb
commit 81cb951b08
3 changed files with 8 additions and 6 deletions

View File

@ -851,9 +851,9 @@ class Frame {
pushedLong();
}
void pop(unsigned count) {
void pop(unsigned count, bool isEvent = true) {
popped(count);
c->popped(count);
c->popped(count, isEvent);
}
Compiler::Operand* popInt() {
@ -2805,7 +2805,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned ip,
compile(t, frame, newIp);
if (UNLIKELY(t->exception)) return;
frame->pop(1);
frame->pop(1, false);
} break;
case l2d: {

View File

@ -2794,8 +2794,10 @@ class MyCompiler: public Compiler {
}
}
virtual void popped(unsigned count) {
appendPop(&c, count, true);
virtual void popped(unsigned count, bool isEvent) {
if (isEvent) {
appendPop(&c, count, true);
}
for (unsigned i = count; i;) {
Stack* s = c.state->stack;

View File

@ -69,7 +69,7 @@ class Compiler {
virtual void push(unsigned size, Operand* value) = 0;
virtual Operand* pop(unsigned size) = 0;
virtual void pushed(unsigned count) = 0;
virtual void popped(unsigned count) = 0;
virtual void popped(unsigned count, bool isEvent) = 0;
virtual Operand* peek(unsigned size, unsigned index) = 0;
virtual Operand* call(Operand* address,