Program: 6319
Project: 6319
Buggy source:
private void doInvoke(String methodName,InstructionHandle stmt,Context context,Map<List<HashedString>,Map<Location,ValueMapping>> input,Interpreter<List<HashedString>,Map<Location,ValueMapping>> interpreter,Map<InstructionHandle,ContextMap<List<HashedString>,Map<Location,ValueMapping>>> state,Map<List<HashedString>,Map<Location,ValueMapping>> result){
  AppInfo p=interpreter.getProgram();
  MethodInfo mi=p.getMethod(methodName);
  MethodGen method=mi.getMethodGen();
  methodName=method.getClassName() + "String_Node_Str" + method.getName()+ method.getSignature();
  if (method.isNative()) {
    handleNative(method,context,input,result);
  }
 else {
    int varPtr=context.stackPtr - MethodHelper.getArgSize(method);
    Context c=new Context(context);
    c.stackPtr=method.getMaxLocals();
    c.constPool=method.getConstantPool();
    if (method.isSynchronized()) {
      c.syncLevel=context.syncLevel + 1;
    }
    c.method=methodName;
    c.callString=new LinkedList<HashedString>(context.callString);
    c.callString.add(new HashedString(context.method + "String_Node_Str" + stmt.getPosition()));
    while (c.callString.size() > CALLSTRING_LENGTH) {
      c.callString.removeFirst();
    }
    Map<Location,ValueMapping> in=input.get(context.callString);
    Map<Location,ValueMapping> out=new HashMap<Location,ValueMapping>();
    for (Iterator<Location> k=in.keySet().iterator(); k.hasNext(); ) {
      Location l=k.next();
      if (l.stackLoc < 0) {
        out.put(l,in.get(l));
      }
      if (l.stackLoc >= varPtr) {
        out.put(new Location(l.stackLoc - varPtr),new ValueMapping(in.get(l),false));
      }
    }
    ContextMap<List<HashedString>,Map<Location,ValueMapping>> tmpresult=new ContextMap<List<HashedString>,Map<Location,ValueMapping>>(c,new HashMap<List<HashedString>,Map<Location,ValueMapping>>());
    tmpresult.put(c.callString,out);
    InstructionHandle entry=mi.getMethodGen().getInstructionList().getStart();
    state.put(entry,join(tmpresult,state.get(entry)));
    Map<InstructionHandle,ContextMap<List<HashedString>,Map<Location,ValueMapping>>> r=interpreter.interpret(c,entry,state,false);
    InstructionHandle exit=mi.getMethodGen().getInstructionList().getEnd();
    if (r.get(exit) != null) {
      Map<Location,ValueMapping> returned=r.get(exit).get(c.callString);
      if (returned != null) {
        for (Iterator<Location> i=returned.keySet().iterator(); i.hasNext(); ) {
          Location l=i.next();
          if (l.stackLoc < 0) {
            ValueMapping m=new ValueMapping(returned.get(l),true);
            m.join(result.get(context.callString).get(l));
            result.get(context.callString).put(l,m);
          }
          if (l.stackLoc >= 0) {
            ValueMapping m=new ValueMapping(returned.get(l),false);
            Location loc=new Location(l.stackLoc + varPtr);
            m.join(result.get(context.callString).get(loc));
            result.get(context.callString).put(loc,m);
          }
        }
      }
    }
    for (Iterator<Location> i=in.keySet().iterator(); i.hasNext(); ) {
      Location l=i.next();
      if (l.stackLoc >= 0 && l.stackLoc < context.stackPtr - MethodHelper.getArgSize(method)) {
        result.get(context.callString).put(l,new ValueMapping(in.get(l),true));
      }
    }
  }
}

Fixed version (ground truth):
private void doInvoke(String methodName,InstructionHandle stmt,Context context,Map<List<HashedString>,Map<Location,ValueMapping>> input,Interpreter<List<HashedString>,Map<Location,ValueMapping>> interpreter,Map<InstructionHandle,ContextMap<List<HashedString>,Map<Location,ValueMapping>>> state,Map<List<HashedString>,Map<Location,ValueMapping>> result){
  DFAAppInfo p=interpreter.getProgram();
  MethodInfo mi=p.getMethod(methodName);
  MethodGen method=mi.getMethodGen();
  methodName=method.getClassName() + "String_Node_Str" + method.getName()+ method.getSignature();
  if (method.isNative()) {
    handleNative(method,context,input,result);
  }
 else {
    int varPtr=context.stackPtr - MethodHelper.getArgSize(method);
    Context c=new Context(context);
    c.stackPtr=method.getMaxLocals();
    c.constPool=method.getConstantPool();
    if (method.isSynchronized()) {
      c.syncLevel=context.syncLevel + 1;
    }
    c.method=methodName;
    c.callString=new LinkedList<HashedString>(context.callString);
    c.callString.add(new HashedString(context.method + "String_Node_Str" + stmt.getPosition()));
    while (c.callString.size() > CALLSTRING_LENGTH) {
      c.callString.removeFirst();
    }
    Map<Location,ValueMapping> in=input.get(context.callString);
    Map<Location,ValueMapping> out=new HashMap<Location,ValueMapping>();
    for (Iterator<Location> k=in.keySet().iterator(); k.hasNext(); ) {
      Location l=k.next();
      if (l.stackLoc < 0) {
        out.put(l,in.get(l));
      }
      if (l.stackLoc >= varPtr) {
        out.put(new Location(l.stackLoc - varPtr),new ValueMapping(in.get(l),false));
      }
    }
    ContextMap<List<HashedString>,Map<Location,ValueMapping>> tmpresult=new ContextMap<List<HashedString>,Map<Location,ValueMapping>>(c,new HashMap<List<HashedString>,Map<Location,ValueMapping>>());
    tmpresult.put(c.callString,out);
    InstructionHandle entry=mi.getMethodGen().getInstructionList().getStart();
    state.put(entry,join(tmpresult,state.get(entry)));
    Map<InstructionHandle,ContextMap<List<HashedString>,Map<Location,ValueMapping>>> r=interpreter.interpret(c,entry,state,false);
    InstructionHandle exit=mi.getMethodGen().getInstructionList().getEnd();
    if (r.get(exit) != null) {
      Map<Location,ValueMapping> returned=r.get(exit).get(c.callString);
      if (returned != null) {
        for (Iterator<Location> i=returned.keySet().iterator(); i.hasNext(); ) {
          Location l=i.next();
          if (l.stackLoc < 0) {
            ValueMapping m=new ValueMapping(returned.get(l),true);
            m.join(result.get(context.callString).get(l));
            result.get(context.callString).put(l,m);
          }
          if (l.stackLoc >= 0) {
            ValueMapping m=new ValueMapping(returned.get(l),false);
            Location loc=new Location(l.stackLoc + varPtr);
            m.join(result.get(context.callString).get(loc));
            result.get(context.callString).put(loc,m);
          }
        }
      }
    }
    for (Iterator<Location> i=in.keySet().iterator(); i.hasNext(); ) {
      Location l=i.next();
      if (l.stackLoc >= 0 && l.stackLoc < context.stackPtr - MethodHelper.getArgSize(method)) {
        result.get(context.callString).put(l,new ValueMapping(in.get(l),true));
      }
    }
  }
}