Program: 37608
Project: 37608
Buggy source:
/** 
 * 右辺の型付きプロセス文脈を構築する 
 */
private void buildRHSTypedProcesses(){
  for (  ContextDef def : rs.typedProcessContexts.values()) {
    Iterator it2=def.rhsOccs.iterator();
    while (it2.hasNext()) {
      ProcessContext pc=(ProcessContext)it2.next();
      if (gc.typedCxtTypes.get(def) == GuardCompiler.UNARY_ATOM_TYPE) {
        int atompath=varcount++;
        body.add(new Instruction(Instruction.COPYATOM,atompath,rhsmemToPath(pc.mem),typedcxtToSrcPath(pc.def)));
        rhstypedcxtpaths.put(pc,atompath);
      }
 else       if (gc.typedCxtTypes.get(def) == GuardCompiler.GROUND_LINK_TYPE) {
        int retlistpath=varcount++;
        body.add(new Instruction(Instruction.COPYGROUND,retlistpath,groundToSrcPath(pc.def),rhsmemToPath(pc.mem)));
        int groundpath=varcount++;
        body.add(new Instruction(Instruction.GETFROMLIST,groundpath,retlistpath,0));
        int mappath=varcount++;
        body.add(new Instruction(Instruction.GETFROMLIST,mappath,retlistpath,1));
        rhsgroundpaths.put(pc,groundpath);
        rhsmappaths.put(pc,mappath);
      }
 else       if (gc.typedCxtTypes.get(def) == GuardCompiler.HLGROUND_LINK_TYPE) {
        int retlistpath=varcount++;
        Atom[] atoms=this.gc.hlgroundAttrs.get(def);
        List<Functor> attrs=this.gc.getHlgroundAttrs(atoms);
        body.add(new Instruction(Instruction.COPYHLGROUND,retlistpath,groundToSrcPath(pc.def),rhsmemToPath(pc.mem),attrs));
        int groundpath=varcount++;
        body.add(new Instruction(Instruction.GETFROMLIST,groundpath,retlistpath,0));
        int mappath=varcount++;
        body.add(new Instruction(Instruction.GETFROMLIST,mappath,retlistpath,1));
        rhsgroundpaths.put(pc,groundpath);
        rhsmappaths.put(pc,mappath);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * 右辺の型付きプロセス文脈を構築する 
 */
private void buildRHSTypedProcesses(){
  for (  ContextDef def : rs.typedProcessContexts.values()) {
    Iterator it2=def.rhsOccs.iterator();
    while (it2.hasNext()) {
      ProcessContext pc=(ProcessContext)it2.next();
      if (gc.typedCxtTypes.get(def) == GuardCompiler.UNARY_ATOM_TYPE) {
        int atompath=varcount++;
        body.add(new Instruction(Instruction.COPYATOM,atompath,rhsmemToPath(pc.mem),typedcxtToSrcPath(pc.def)));
        rhstypedcxtpaths.put(pc,atompath);
        rhsmappaths.put(pc,atompath);
      }
 else       if (gc.typedCxtTypes.get(def) == GuardCompiler.GROUND_LINK_TYPE) {
        int retlistpath=varcount++;
        body.add(new Instruction(Instruction.COPYGROUND,retlistpath,groundToSrcPath(pc.def),rhsmemToPath(pc.mem)));
        int groundpath=varcount++;
        body.add(new Instruction(Instruction.GETFROMLIST,groundpath,retlistpath,0));
        int mappath=varcount++;
        body.add(new Instruction(Instruction.GETFROMLIST,mappath,retlistpath,1));
        rhsgroundpaths.put(pc,groundpath);
        rhsmappaths.put(pc,mappath);
      }
 else       if (gc.typedCxtTypes.get(def) == GuardCompiler.HLGROUND_LINK_TYPE) {
        int retlistpath=varcount++;
        Atom[] atoms=this.gc.hlgroundAttrs.get(def);
        List<Functor> attrs=this.gc.getHlgroundAttrs(atoms);
        body.add(new Instruction(Instruction.COPYHLGROUND,retlistpath,groundToSrcPath(pc.def),rhsmemToPath(pc.mem),attrs));
        int groundpath=varcount++;
        body.add(new Instruction(Instruction.GETFROMLIST,groundpath,retlistpath,0));
        int mappath=varcount++;
        body.add(new Instruction(Instruction.GETFROMLIST,mappath,retlistpath,1));
        rhsgroundpaths.put(pc,groundpath);
        rhsmappaths.put(pc,mappath);
      }
    }
  }
}