Program: 29319
Project: 29319
Buggy source:
@Override protected Statement visitVeLogNode(VeLogNode node){
  final Label restartPoint=new Label();
  final Expression hasLogger=parameterLookup.getRenderContext().hasLogger();
  final boolean hasLogonlyExpression=node.getLogonlyExpression() != null;
  final Expression logonlyExpression=hasLogonlyExpression ? exprCompiler.compile(node.getLogonlyExpression(),restartPoint).unboxAs(boolean.class) : BytecodeUtils.constant(false);
  final Statement enterStatement=appendableExpression.enterLoggableElement(MethodRef.LOG_STATEMENT_CREATE.invoke(BytecodeUtils.constant(node.getLoggingId()),node.getConfigExpression() == null ? BytecodeUtils.constantNull(BytecodeUtils.MESSAGE_TYPE) : exprCompiler.compile(node.getConfigExpression(),restartPoint).unboxAs(Message.class),logonlyExpression)).toStatement();
  final Statement body=Statement.concat(visitChildren(node));
  final Statement exitStatement=appendableExpression.exitLoggableElement().toStatement();
  return new Statement(){
    @Override protected void doGen(    CodeBuilder cb){
      Label noLogger=new Label();
      hasLogger.gen(cb);
      cb.ifZCmp(EQ,noLogger);
      enterStatement.gen(cb);
      if (hasLogonlyExpression) {
        Label bodyLabel=new Label();
        cb.goTo(bodyLabel);
        cb.mark(noLogger);
        logonlyExpression.gen(cb);
        cb.ifZCmp(EQ,bodyLabel);
        cb.throwException(BytecodeUtils.ILLEGAL_STATE_EXCEPTION_TYPE,"String_Node_Str");
        cb.mark(bodyLabel);
      }
 else {
        cb.mark(noLogger);
      }
      body.gen(cb);
      Label end=new Label();
      hasLogger.gen(cb);
      cb.ifZCmp(EQ,end);
      exitStatement.gen(cb);
      cb.mark(end);
    }
  }
.labelStart(restartPoint);
}

Fixed version (ground truth):
@Override protected Statement visitVeLogNode(final VeLogNode node){
  final Label restartPoint=new Label();
  final Expression configExpression=node.getConfigExpression() == null ? BytecodeUtils.constantNull(BytecodeUtils.MESSAGE_TYPE) : exprCompiler.compile(node.getConfigExpression(),restartPoint).unboxAs(Message.class);
  final Expression hasLogger=parameterLookup.getRenderContext().hasLogger();
  final Statement body=Statement.concat(visitChildren(node));
  final Statement exitStatement=ControlFlow.IfBlock.create(hasLogger,appendableExpression.exitLoggableElement().toStatement()).asStatement();
  if (node.getLogonlyExpression() != null) {
    final Expression logonlyExpression=exprCompiler.compile(node.getLogonlyExpression(),restartPoint).unboxAs(boolean.class);
    final Expression appendable=appendableExpression;
    return new Statement(){
      @Override protected void doGen(      CodeBuilder cb){
        cb.mark(restartPoint);
        logonlyExpression.gen(cb);
        Label noLogger=new Label();
        hasLogger.gen(cb);
        cb.ifZCmp(EQ,noLogger);
        cb.pushLong(node.getLoggingId());
        cb.dup2X1();
        cb.pop2();
        configExpression.gen(cb);
        cb.swap();
        MethodRef.LOG_STATEMENT_CREATE.invokeUnchecked(cb);
        appendable.gen(cb);
        cb.swap();
        AppendableExpression.ENTER_LOGGABLE_STATEMENT.invokeUnchecked(cb);
        cb.pop();
        Label bodyLabel=new Label();
        cb.goTo(bodyLabel);
        cb.mark(noLogger);
        cb.ifZCmp(EQ,bodyLabel);
        cb.throwException(BytecodeUtils.ILLEGAL_STATE_EXCEPTION_TYPE,"String_Node_Str");
        cb.mark(bodyLabel);
        body.gen(cb);
        exitStatement.gen(cb);
      }
    }
;
  }
 else {
    final Statement enterStatement=ControlFlow.IfBlock.create(hasLogger,appendableExpression.enterLoggableElement(MethodRef.LOG_STATEMENT_CREATE.invoke(BytecodeUtils.constant(node.getLoggingId()),configExpression,BytecodeUtils.constant(false))).toStatement().labelStart(restartPoint)).asStatement();
    ;
    return Statement.concat(enterStatement,body,exitStatement);
  }
}