Skip to content

Commit

Permalink
GROOVY-10920: SC: convert void and non-primitive operands to boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed Sep 18, 2024
1 parent 59b02b5 commit 6312fec
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ public void visit(final GroovyCodeVisitor visitor) {
int mark = os.getStackLength();
getExpression().visit(visitor);

if (ClassHelper.isPrimitiveType(type) && !ClassHelper.isPrimitiveVoid(type)) { // GROOVY-10920
BytecodeHelper.convertPrimitiveToBoolean(mv, type);
if (ClassHelper.isPrimitiveType(os.getTopOperand())) { // GROOVY-10920
BytecodeHelper.convertPrimitiveToBoolean(mv, os.getTopOperand());
os.replace(ClassHelper.boolean_TYPE);
return;
}
Expand Down

0 comments on commit 6312fec

Please sign in to comment.