From 354502cc203fd388db18fa10e681cae639cbf8aa Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 28 Jun 2024 21:57:19 +0200 Subject: [PATCH] fix AND Logical Operation --- .../java/de/maishai/typedast/typedclass/TypedBinary.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/java/de/maishai/typedast/typedclass/TypedBinary.java b/src/main/java/de/maishai/typedast/typedclass/TypedBinary.java index 5f94d76..530c6f6 100644 --- a/src/main/java/de/maishai/typedast/typedclass/TypedBinary.java +++ b/src/main/java/de/maishai/typedast/typedclass/TypedBinary.java @@ -3,17 +3,14 @@ package de.maishai.typedast.typedclass; import de.maishai.ast.Operator; import de.maishai.ast.records.Binary; import de.maishai.typedast.MethodContext; -import de.maishai.typedast.TypedExpression; import de.maishai.typedast.Type; +import de.maishai.typedast.TypedExpression; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import org.objectweb.asm.Label; -import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.Opcodes; -import java.util.Map; - import static de.maishai.typedast.Help.TypedExpressionHelp.convertExpression; @Data @@ -78,9 +75,9 @@ public class TypedBinary implements TypedExpression { Label returnTrue = new Label(); Label returnFalse = new Label(); left.codeGen(ctx); - ctx.getMv().visitJumpInsn(Opcodes.IFNE, returnFalse); + ctx.getMv().visitJumpInsn(Opcodes.IFEQ, returnFalse); right.codeGen(ctx); - ctx.getMv().visitJumpInsn(Opcodes.IFNE, returnFalse); + ctx.getMv().visitJumpInsn(Opcodes.IFEQ, returnFalse); ctx.getMv().visitJumpInsn(Opcodes.GOTO, returnTrue); ctx.getMv().visitLabel(returnFalse);