-
Bug
-
Resolution: Fixed
-
P5
-
9
In rule
dup2Form1IsTypeSafe(Environment, InputOperandStack, OutputOperandStack):-
popCategory1(InputOperandStack, Type1, TempStack),
popCategory1(TempStack, Type2, _),
canSafelyPushList(Environment, InputOperandStack, [Type1, Type2],
OutputOperandStack).
[Type1, Type2] needs to be [Type2, Type1].
canSafelyPushList pushes types one by one so that the tail of the list becomes the top of the stack.
In case of this dup2 rule, Type1 needs to be on top of the stack after the operation.
dup2Form1IsTypeSafe(Environment, InputOperandStack, OutputOperandStack):-
popCategory1(InputOperandStack, Type1, TempStack),
popCategory1(TempStack, Type2, _),
canSafelyPushList(Environment, InputOperandStack, [Type1, Type2],
OutputOperandStack).
[Type1, Type2] needs to be [Type2, Type1].
canSafelyPushList pushes types one by one so that the tail of the list becomes the top of the stack.
In case of this dup2 rule, Type1 needs to be on top of the stack after the operation.