mirror of
https://github.com/corda/corda.git
synced 2025-01-22 12:28:11 +00:00
adjust stack if necessary after non-tail-call in case where callee pops arguments
This commit is contained in:
parent
3113ae74eb
commit
de84afe2fe
@ -2486,6 +2486,20 @@ class CallEvent: public Event {
|
||||
padIndex, padding);
|
||||
}
|
||||
|
||||
if ((flags & Compiler::TailJump) == 0) {
|
||||
unsigned footprint = c->arch->argumentFootprint(stackArgumentFootprint);
|
||||
if (footprint > c->arch->stackAlignmentInWords()) {
|
||||
Assembler::Register stack(c->arch->stack());
|
||||
ResolvedPromise adjustmentPromise
|
||||
((footprint - c->arch->stackAlignmentInWords()) * BytesPerWord);
|
||||
Assembler::Constant adjustmentConstant(&adjustmentPromise);
|
||||
c->assembler->apply
|
||||
(Subtract, BytesPerWord, ConstantOperand, &adjustmentConstant,
|
||||
BytesPerWord, RegisterOperand, &stack,
|
||||
BytesPerWord, RegisterOperand, &stack);
|
||||
}
|
||||
}
|
||||
|
||||
clean(c, this, stackBefore, localsBefore, reads, popIndex);
|
||||
|
||||
if (resultSize and live(result)) {
|
||||
|
Loading…
Reference in New Issue
Block a user