Program: 136055
Project: 136055
Buggy source:
private final void collectPrimedLocsAppl(OpApplNode pred,Context c,ObjLongTable tbl){
  ExprOrOpArgNode[] args=pred.getArgs();
  SymbolNode opNode=pred.getOperator();
  int opcode=BuiltInOPs.getOpCode(opNode.getName());
switch (opcode) {
case OPCODE_fa:
{
      this.collectPrimedLocs(args[0],c,tbl);
      break;
    }
case OPCODE_ite:
{
    this.collectPrimedLocs(args[1],c,tbl);
    this.collectPrimedLocs(args[2],c,tbl);
    break;
  }
case OPCODE_case:
{
  for (int i=0; i < args.length; i++) {
    OpApplNode pair=(OpApplNode)args[i];
    this.collectPrimedLocs(pair.getArgs()[1],c,tbl);
  }
  break;
}
case OPCODE_eq:
case OPCODE_in:
{
SymbolNode var=this.getPrimedVar(args[0],c,false);
if (var != null && var.getName().getVarLoc() != -1) {
  tbl.put(pred.toString(),0);
}
break;
}
case OPCODE_cl:
case OPCODE_dl:
case OPCODE_be:
case OPCODE_bf:
case OPCODE_land:
case OPCODE_lor:
case OPCODE_implies:
{
for (int i=0; i < args.length; i++) {
this.collectPrimedLocs(args[i],c,tbl);
}
break;
}
case OPCODE_unchanged:
{
this.collectUnchangedLocs(args[0],c,tbl);
break;
}
case OPCODE_aa:
{
this.collectPrimedLocs(args[0],c,tbl);
break;
}
case OPCODE_sa:
{
this.collectPrimedLocs(args[0],c,tbl);
tbl.put(args[1].toString(),0);
break;
}
default :
{
if (opcode == 0) {
Object val=this.lookup(opNode,c,false);
if (val instanceof OpDefNode) {
OpDefNode opDef=(OpDefNode)val;
Context c1=this.getOpContext(opDef,args,c,true);
this.collectPrimedLocs(opDef.getBody(),c1,tbl);
}
 else if (val instanceof LazyValue) {
LazyValue lv=(LazyValue)val;
this.collectPrimedLocs(lv.expr,lv.con,tbl);
}
}
}
}
}

Fixed version (ground truth):
private final void collectPrimedLocsAppl(OpApplNode pred,Context c,ObjLongTable tbl){
  ExprOrOpArgNode[] args=pred.getArgs();
  SymbolNode opNode=pred.getOperator();
  int opcode=BuiltInOPs.getOpCode(opNode.getName());
switch (opcode) {
case OPCODE_fa:
{
      this.collectPrimedLocs(args[0],c,tbl);
      break;
    }
case OPCODE_ite:
{
    this.collectPrimedLocs(args[1],c,tbl);
    this.collectPrimedLocs(args[2],c,tbl);
    break;
  }
case OPCODE_case:
{
  for (int i=0; i < args.length; i++) {
    OpApplNode pair=(OpApplNode)args[i];
    this.collectPrimedLocs(pair.getArgs()[1],c,tbl);
  }
  break;
}
case OPCODE_eq:
case OPCODE_in:
{
SymbolNode var=this.getPrimedVar(args[0],c,false);
if (var != null && var.getName().getVarLoc() != -1) {
  tbl.put(pred.toString(),0);
}
break;
}
case OPCODE_cl:
case OPCODE_dl:
case OPCODE_be:
case OPCODE_bf:
case OPCODE_land:
case OPCODE_lor:
case OPCODE_implies:
case OPCODE_nop:
{
for (int i=0; i < args.length; i++) {
this.collectPrimedLocs(args[i],c,tbl);
}
break;
}
case OPCODE_unchanged:
{
this.collectUnchangedLocs(args[0],c,tbl);
break;
}
case OPCODE_aa:
{
this.collectPrimedLocs(args[0],c,tbl);
break;
}
case OPCODE_sa:
{
this.collectPrimedLocs(args[0],c,tbl);
tbl.put(args[1].toString(),0);
break;
}
default :
{
if (opcode == 0) {
Object val=this.lookup(opNode,c,false);
if (val instanceof OpDefNode) {
OpDefNode opDef=(OpDefNode)val;
Context c1=this.getOpContext(opDef,args,c,true);
this.collectPrimedLocs(opDef.getBody(),c1,tbl);
}
 else if (val instanceof LazyValue) {
LazyValue lv=(LazyValue)val;
this.collectPrimedLocs(lv.expr,lv.con,tbl);
}
}
}
}
}