Skip to content

Commit 8479fd7

Browse files
committed
Revert "Merge pull request #55 from fglock/fix-bop-test"
This reverts commit cd504ef, reversing changes made to 89e92dd.
1 parent cd504ef commit 8479fd7

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

src/main/java/org/perlonjava/codegen/EmitBinaryOperatorNode.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ public static void emitBinaryOperatorNode(EmitterVisitor emitterVisitor, BinaryO
8181
"==", "!=", "eq", "ne" -> EmitOperatorChained.emitChainedComparison(emitterVisitor, node);
8282

8383
// Binary operators
84-
case "%", "&", "&.", "binary&", "*", "**", "+", "-", "/", "^^", "xor",
85-
"<<", "<=>", ">>", "^", "^.", "binary^", "|", "|.", "binary|",
84+
case "%", "&", "&.", "*", "**", "+", "-", "/", "^^", "xor",
85+
"<<", "<=>", ">>", "^", "^.", "|", "|.",
8686
"bless", "cmp", "isa" -> EmitBinaryOperator.handleBinaryOperator(emitterVisitor, node,
8787
OperatorHandler.get(node.operator));
8888

src/main/java/org/perlonjava/codegen/EmitOperator.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -893,15 +893,7 @@ static void handleCreateReference(EmitterVisitor emitterVisitor, OperatorNode no
893893
node.operand.accept(emitterVisitor.with(RuntimeContextType.LIST));
894894
}
895895
} else {
896-
// For most cases, evaluate in SCALAR context to get a reference to the value
897-
// Only use LIST context for actual list-producing operations
898-
int contextType = RuntimeContextType.SCALAR;
899-
if (node.operand instanceof ListNode ||
900-
(node.operand instanceof OperatorNode op &&
901-
(op.operator.equals("@") || op.operator.equals("%")))) {
902-
contextType = RuntimeContextType.LIST;
903-
}
904-
node.operand.accept(emitterVisitor.with(contextType));
896+
node.operand.accept(emitterVisitor.with(RuntimeContextType.LIST));
905897
emitterVisitor.ctx.mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL,
906898
"org/perlonjava/runtime/RuntimeBase",
907899
"createReference",

0 commit comments

Comments
 (0)