Program: 186876
Project: 186876
Buggy source:
private void doInvoke(String methodName,InstructionHandle stmt,Context context,Map<CallString,Map<Location,ValueMapping>> input,Interpreter<CallString,Map<Location,ValueMapping>> interpreter,Map<InstructionHandle,ContextMap<CallString,Map<Location,ValueMapping>>> state,Map<CallString,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=c.callString.push(p.getMethod(context.method),stmt.getPosition(),callStringLength);
    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<CallString,Map<Location,ValueMapping>> tmpresult=new ContextMap<CallString,Map<Location,ValueMapping>>(c,new HashMap<CallString,Map<Location,ValueMapping>>());
    tmpresult.put(c.callString,out);
    InstructionHandle entry=mi.getCode().getInstructionList().getStart();
    state.put(entry,join(state.get(entry),tmpresult));
    Map<InstructionHandle,ContextMap<CallString,Map<Location,ValueMapping>>> r=interpreter.interpret(c,entry,state,false);
    InstructionHandle exit=mi.getCode().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<CallString,Map<Location,ValueMapping>> input,Interpreter<CallString,Map<Location,ValueMapping>> interpreter,Map<InstructionHandle,ContextMap<CallString,Map<Location,ValueMapping>>> state,Map<CallString,Map<Location,ValueMapping>> result){
  DFAAppInfo p=interpreter.getProgram();
  MethodInfo method=p.getMethod(methodName);
  methodName=method.getSignature().toString();
  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=c.callString.push(p.getMethod(context.method),stmt.getPosition(),callStringLength);
    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<CallString,Map<Location,ValueMapping>> tmpresult=new ContextMap<CallString,Map<Location,ValueMapping>>(c,new HashMap<CallString,Map<Location,ValueMapping>>());
    tmpresult.put(c.callString,out);
    InstructionHandle entry=method.getCode().getInstructionList().getStart();
    state.put(entry,join(state.get(entry),tmpresult));
    Map<InstructionHandle,ContextMap<CallString,Map<Location,ValueMapping>>> r=interpreter.interpret(c,entry,state,false);
    InstructionHandle exit=method.getCode().getInstructionList().getEnd();
    if (r.get(exit) != null) {
      Map<Location,ValueMapping> returned=r.get(exit).get(c.callString);
      if (returned != null) {
        for (        Location l : returned.keySet()) {
          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 (    Location l : in.keySet()) {
      if (l.stackLoc >= 0 && l.stackLoc < context.stackPtr - MethodHelper.getArgSize(method)) {
        result.get(context.callString).put(l,new ValueMapping(in.get(l),true));
      }
    }
  }
}