# HG changeset patch # Parent 4e9749cc32f15251d9b2d0eab4373529952902a3 # User mhaupt 8149451: fix bytecode generation issue after 8149186 diff -r 4e9749cc32f1 -r 0b138267b59d src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/BooleanType.java --- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/BooleanType.java Mon Feb 08 17:43:02 2016 +0100 +++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/types/BooleanType.java Tue Feb 09 12:29:04 2016 +0000 @@ -39,6 +39,7 @@ import jdk.internal.org.objectweb.asm.MethodVisitor; import jdk.nashorn.internal.codegen.CompilerConstants; +import jdk.nashorn.internal.runtime.JSType; /** * The boolean type class @@ -134,8 +135,12 @@ @Override public Type add(final MethodVisitor method, final int programPoint) { // Adding booleans in JavaScript is perfectly valid, they add as if false=0 and true=1 - assert programPoint == INVALID_PROGRAM_POINT; - method.visitInsn(IADD); + if (programPoint == INVALID_PROGRAM_POINT) { + method.visitInsn(IADD); + } else { + ldc(method, programPoint); + JSType.ADD_EXACT.invoke(method); + } return INT; } }