mirror of
https://github.com/corda/corda.git
synced 2025-01-24 05:18:24 +00:00
ignore contents of stack location in popNow if the value already resides elsewhere besides the stack
This commit is contained in:
parent
633ef83fa1
commit
94f7efc160
@ -1969,22 +1969,23 @@ popNow(Context* c, Stack* stack, unsigned count, bool ignore)
|
|||||||
s->pushSite = 0;
|
s->pushSite = 0;
|
||||||
s->pushed = false;
|
s->pushed = false;
|
||||||
|
|
||||||
if (s->value->reads and (not ignore)) {
|
Value* v = s->value;
|
||||||
|
if (v->reads and v->sites == 0 and (not ignore)) {
|
||||||
::ignore(c, ignored);
|
::ignore(c, ignored);
|
||||||
|
|
||||||
Site* target = targetOrRegister(c, s->value);
|
Site* target = targetOrRegister(c, v);
|
||||||
|
|
||||||
if (DebugStack) {
|
if (DebugStack) {
|
||||||
fprintf(stderr, "pop %p value: %p target: %p\n",
|
fprintf(stderr, "pop %p value: %p target: %p\n",
|
||||||
s, s->value, target);
|
s, s->value, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
addSite(c, stack, s->size * BytesPerWord, s->value, target);
|
addSite(c, stack, s->size * BytesPerWord, v, target);
|
||||||
|
|
||||||
apply(c, Pop, BytesPerWord * s->size, target);
|
apply(c, Pop, BytesPerWord * s->size, target);
|
||||||
} else {
|
} else {
|
||||||
if (DebugStack) {
|
if (DebugStack) {
|
||||||
fprintf(stderr, "ignore %p value: %p\n", s, s->value);
|
fprintf(stderr, "ignore %p value: %p\n", s, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
ignored += s->size;
|
ignored += s->size;
|
||||||
|
Loading…
Reference in New Issue
Block a user