mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-14 09:18:09 +00:00
fix incorrect impl of RDI_EvalOp_Swap
This commit is contained in:
@@ -1020,23 +1020,30 @@ e_interpret(String8 bytecode)
|
||||
// we do not assemble composites; for single-piece expressions the
|
||||
// value already on the stack is the result. for multi-piece, only
|
||||
// the first piece is returned (stack[0] is the final result).
|
||||
result.code = E_InterpretationCode_BadOp;
|
||||
goto done;
|
||||
}break;
|
||||
|
||||
case RDI_EvalOp_PartialValueBit:
|
||||
{
|
||||
// DW_OP_bit_piece marker. same caveat as PartialValue.
|
||||
result.code = E_InterpretationCode_BadOp;
|
||||
goto done;
|
||||
}break;
|
||||
|
||||
case RDI_EvalOp_Swap:
|
||||
{
|
||||
if(stack_count + 2 > stack_cap)
|
||||
if(stack_count >= 2)
|
||||
{
|
||||
E_Value swap = stack[stack_count-2];
|
||||
stack[stack_count-2] = stack[stack_count-1];
|
||||
stack[stack_count-1] = swap;
|
||||
}
|
||||
else
|
||||
{
|
||||
result.code = E_InterpretationCode_InsufficientStackSpace;
|
||||
goto done;
|
||||
}
|
||||
stack[stack_count + 0] = svals[1];
|
||||
stack[stack_count + 1] = svals[0];
|
||||
stack_count += 2;
|
||||
}break;
|
||||
|
||||
case RDI_EvalOp_PushCfa:
|
||||
|
||||
Reference in New Issue
Block a user