fix handling of values which appear more than once on the stack in trySteal

This commit is contained in:
Joel Dice 2008-06-10 18:48:46 -06:00
parent b80a3cea85
commit 633ef83fa1

View File

@ -1008,7 +1008,7 @@ trySteal(Context* c, Register* r, Stack* stack)
unsigned count = 0; unsigned count = 0;
Stack* start = 0; Stack* start = 0;
for (Stack* s = stack; s and (not s->pushed); s = s->next) { for (Stack* s = stack; s and (not s->pushed); s = s->next) {
if (s->value == v) { if (start == 0 and s->value == v) {
start = s; start = s;
} }
if (start) { if (start) {