mirror of
https://github.com/corda/corda.git
synced 2025-01-09 14:33:30 +00:00
fix code ordering bug in popNow()
This commit is contained in:
parent
13d6ab023f
commit
482065f91a
@ -1677,6 +1677,10 @@ popNow(Context* c, Stack* stack, unsigned count, bool ignore)
|
|||||||
unsigned ignored = 0;
|
unsigned ignored = 0;
|
||||||
for (unsigned i = count; i and s;) {
|
for (unsigned i = count; i and s;) {
|
||||||
if (s->pushed) {
|
if (s->pushed) {
|
||||||
|
removeSite(c, s->value, s->pushSite);
|
||||||
|
s->pushSite = 0;
|
||||||
|
s->pushed = false;
|
||||||
|
|
||||||
if (s->value->reads and (not ignore)) {
|
if (s->value->reads and (not ignore)) {
|
||||||
::ignore(c, ignored);
|
::ignore(c, ignored);
|
||||||
|
|
||||||
@ -1697,10 +1701,6 @@ popNow(Context* c, Stack* stack, unsigned count, bool ignore)
|
|||||||
|
|
||||||
ignored += s->size;
|
ignored += s->size;
|
||||||
}
|
}
|
||||||
|
|
||||||
removeSite(c, s->value, s->pushSite);
|
|
||||||
s->pushSite = 0;
|
|
||||||
s->pushed = false;
|
|
||||||
} else {
|
} else {
|
||||||
if (DebugStack) {
|
if (DebugStack) {
|
||||||
fprintf(stderr, "%p not pushed\n", s);
|
fprintf(stderr, "%p not pushed\n", s);
|
||||||
@ -1876,9 +1876,7 @@ readSource(Context* c, Stack* stack, Read* r)
|
|||||||
|
|
||||||
if (target and copyCost) {
|
if (target and copyCost) {
|
||||||
addSite(c, stack, r->size, r->value, target);
|
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;
|
return target;
|
||||||
} else {
|
} else {
|
||||||
return site;
|
return site;
|
||||||
|
Loading…
Reference in New Issue
Block a user