fix code ordering bug in popNow()

This commit is contained in:
Joel Dice 2008-05-14 16:36:22 -06:00
parent 13d6ab023f
commit 482065f91a

View File

@ -1677,6 +1677,10 @@ popNow(Context* c, Stack* stack, unsigned count, bool ignore)
unsigned ignored = 0;
for (unsigned i = count; i and s;) {
if (s->pushed) {
removeSite(c, s->value, s->pushSite);
s->pushSite = 0;
s->pushed = false;
if (s->value->reads and (not ignore)) {
::ignore(c, ignored);
@ -1697,10 +1701,6 @@ popNow(Context* c, Stack* stack, unsigned count, bool ignore)
ignored += s->size;
}
removeSite(c, s->value, s->pushSite);
s->pushSite = 0;
s->pushed = false;
} else {
if (DebugStack) {
fprintf(stderr, "%p not pushed\n", s);
@ -1876,9 +1876,7 @@ readSource(Context* c, Stack* stack, Read* r)
if (target and copyCost) {
addSite(c, stack, r->size, r->value, target);
if (site) {
apply(c, Move, r->size, site, target);
}
apply(c, Move, r->size, site, target);
return target;
} else {
return site;