Program: 82864
Project: 82864
Buggy source:
private void generateSwitch(MethodWriter writer,Object frameType) throws BytecodeException {
}

Fixed version (ground truth):
private void generateSwitch(MethodWriter writer,Object frameType) throws BytecodeException {
  MatchCase defaultCase=null;
  Label defaultLabel=null;
  int cases=0;
  int low=Integer.MAX_VALUE;
  int high=Integer.MIN_VALUE;
  boolean switchVar=false;
  for (int i=0; i < this.caseCount; i++) {
    MatchCase matchCase=this.cases[i];
    IPattern pattern=matchCase.pattern;
    if (switchVar || pattern.switchCheck()) {
      switchVar=true;
    }
    if (pattern.isExhaustive()) {
      defaultCase=matchCase;
      defaultLabel=new Label();
      continue;
    }
    int min=pattern.minValue();
    if (min < low) {
      low=min;
    }
    int max=pattern.maxValue();
    if (max > high) {
      high=max;
    }
    cases+=pattern.subPatterns();
  }
  final Label endLabel=new Label();
  Label matchErrorLabel=null;
  if (!this.exhaustive) {
    switchVar=true;
    matchErrorLabel=new Label();
    if (defaultLabel == null) {
      defaultLabel=matchErrorLabel;
    }
  }
 else   if (defaultLabel == null) {
    defaultLabel=endLabel;
  }
  final boolean expr=frameType != null;
  final IType matchedType=this.matchedValue.getType();
  this.matchedValue.writeExpression(writer,null);
  int varIndex=-1;
  if (switchVar) {
    varIndex=writer.localCount();
    writer.visitVarInsn(matchedType.getStoreOpcode(),varIndex);
    writer.visitVarInsn(matchedType.getLoadOpcode(),varIndex);
  }
  if (!matchedType.isPrimitive()) {
    writer.visitMethodInsn(Opcodes.INVOKEVIRTUAL,"String_Node_Str","String_Node_Str","String_Node_Str",false);
  }
  final int localCount=writer.localCount();
  final KeyCache keyCache=new KeyCache(cases);
  for (int i=0; i < this.caseCount; i++) {
    final MatchCase matchCase=this.cases[i];
    final IPattern pattern=matchCase.pattern;
    final int subPatterns=pattern.subPatterns();
    for (int j=0; j < subPatterns; j++) {
      final IPattern subPattern=pattern.subPattern(j);
      if (subPattern.isExhaustive()) {
        continue;
      }
      final int switchValue=subPattern.switchValue();
      keyCache.add(switchValue,matchCase,subPattern);
    }
  }
  final Collection<KeyCache.Entry> entries=keyCache.uniqueEntries();
  for (  KeyCache.Entry topEntry : entries) {
    for (KeyCache.Entry entry=topEntry; entry != null; entry=entry.next) {
      entry.switchLabel=new Label();
    }
  }
  if (useTableSwitch(low,high,cases)) {
    this.writeTableSwitch(writer,entries,defaultLabel,low,high);
  }
 else {
    this.writeLookupSwitch(writer,entries,defaultLabel,cases);
  }
  for (  KeyCache.Entry topEntry : entries) {
    KeyCache.Entry entry=topEntry;
    final int key=entry.key;
    do {
      final KeyCache.Entry next=entry.next;
      final MatchCase matchCase=entry.matchCase;
      final IPattern pattern=entry.pattern;
      Label elseLabel;
      if (next != null && next.key == key) {
        elseLabel=next.switchLabel;
        if (elseLabel == null) {
          elseLabel=next.switchLabel=new Label();
        }
      }
 else {
        elseLabel=defaultLabel;
      }
      writer.visitTargetLabel(entry.switchLabel);
      if (pattern.switchCheck()) {
        pattern.writeInvJump(writer,varIndex,matchedType,elseLabel);
      }
      if (matchCase.condition != null) {
        matchCase.condition.writeInvJump(writer,elseLabel);
      }
      this.writeAction(writer,expr,frameType,matchCase.action);
      writer.resetLocals(localCount);
      writer.visitJumpInsn(Opcodes.GOTO,endLabel);
      entry=next;
    }
 while (entry != null && entry.key == key);
  }
  if (defaultCase != null) {
    writer.visitTargetLabel(defaultLabel);
    if (defaultCase.pattern.switchCheck()) {
      defaultCase.pattern.writeInvJump(writer,varIndex,matchedType,matchErrorLabel);
    }
    if (defaultCase.condition != null) {
      defaultCase.condition.writeInvJump(writer,matchErrorLabel);
    }
    this.writeAction(writer,expr,frameType,defaultCase.action);
    writer.resetLocals(localCount);
    writer.visitJumpInsn(Opcodes.GOTO,endLabel);
  }
  if (matchErrorLabel != null) {
    writer.visitLabel(matchErrorLabel);
    this.writeMatchError(writer,varIndex,matchedType);
  }
  writer.visitLabel(endLabel);
  if (switchVar) {
    writer.resetLocals(varIndex);
  }
}