Program: 85193
Project: 85193
Buggy source:
public static Type eval_(Typing tg,Value expr,Stmt stmt,JimpleBody jb){
  if (expr instanceof ThisRef) {
    return ((ThisRef)expr).getType();
  }
 else   if (expr instanceof ParameterRef) {
    return ((ParameterRef)expr).getType();
  }
 else   if (expr instanceof Local) {
    Local ex=(Local)expr;
    if (tg == null) {
      return null;
    }
 else {
      return tg.get(ex);
    }
  }
 else   if (expr instanceof BinopExpr) {
    BinopExpr be=(BinopExpr)expr;
    Value opl=be.getOp1(), opr=be.getOp2();
    Type tl=eval_(tg,opl,stmt,jb), tr=eval_(tg,opr,stmt,jb);
    if (expr instanceof CmpExpr || expr instanceof CmpgExpr || expr instanceof CmplExpr) {
      return ByteType.v();
    }
 else     if (expr instanceof GeExpr || expr instanceof GtExpr || expr instanceof LeExpr|| expr instanceof LtExpr|| expr instanceof EqExpr|| expr instanceof NeExpr) {
      return BooleanType.v();
    }
 else     if (expr instanceof ShlExpr) {
      if (tl instanceof IntegerType) {
        return IntType.v();
      }
 else {
        return tl;
      }
    }
 else     if (expr instanceof ShrExpr || expr instanceof UshrExpr) {
      return tl;
    }
 else     if (expr instanceof AddExpr || expr instanceof SubExpr || expr instanceof MulExpr|| expr instanceof DivExpr|| expr instanceof RemExpr) {
      if (tl instanceof IntegerType) {
        return IntType.v();
      }
 else {
        return tl;
      }
    }
 else     if (expr instanceof AndExpr || expr instanceof OrExpr || expr instanceof XorExpr) {
      if (tl instanceof IntegerType && tr instanceof IntegerType) {
        if (tl instanceof BooleanType) {
          if (tr instanceof BooleanType) {
            return BooleanType.v();
          }
 else {
            return tr;
          }
        }
 else         if (tr instanceof BooleanType) {
          return tl;
        }
 else {
          Collection<Type> rs=AugHierarchy.lcas_(tl,tr);
          for (          Type r : rs) {
            return r;
          }
          throw new RuntimeException();
        }
      }
 else {
        return tl;
      }
    }
 else {
      throw new RuntimeException("String_Node_Str" + expr);
    }
  }
 else   if (expr instanceof NegExpr) {
    Type t=eval_(tg,((NegExpr)expr).getOp(),stmt,jb);
    if (t instanceof IntegerType) {
      if (t instanceof Integer1Type || t instanceof BooleanType || t instanceof Integer127Type|| t instanceof ByteType) {
        return ByteType.v();
      }
 else       if (t instanceof ShortType || t instanceof Integer32767Type) {
        return ShortType.v();
      }
 else {
        return IntType.v();
      }
    }
 else {
      return t;
    }
  }
 else   if (expr instanceof CaughtExceptionRef) {
    RefType r=null;
    RefType throwableType=Scene.v().getRefType("String_Node_Str");
    for (    RefType t : TrapManager.getExceptionTypesOf(stmt,jb)) {
      if (r == null) {
        r=t;
      }
 else       if (t.getSootClass().isPhantom() || r.getSootClass().isPhantom()) {
        r=throwableType;
      }
 else {
        r=BytecodeHierarchy.lcsc(r,t,throwableType);
      }
    }
    if (r == null) {
      throw new RuntimeException("String_Node_Str" + "String_Node_Str");
    }
    return r;
  }
 else   if (expr instanceof ArrayRef) {
    Local av=(Local)((ArrayRef)expr).getBase();
    Type at=tg.get(av);
    if (at instanceof ArrayType) {
      return ((ArrayType)at).getElementType();
    }
 else     if (at instanceof RefType) {
      RefType ref=(RefType)at;
      if (ref.getSootClass().getName().equals("String_Node_Str") || ref.getSootClass().getName().equals("String_Node_Str") || ref.getSootClass().getName().equals("String_Node_Str")) {
        return ref;
      }
 else {
        return BottomType.v();
      }
    }
 else {
      return BottomType.v();
    }
  }
 else   if (expr instanceof NewArrayExpr) {
    return ((NewArrayExpr)expr).getBaseType().makeArrayType();
  }
 else   if (expr instanceof NewMultiArrayExpr) {
    return ((NewMultiArrayExpr)expr).getBaseType();
  }
 else   if (expr instanceof CastExpr) {
    return ((CastExpr)expr).getCastType();
  }
 else   if (expr instanceof InstanceOfExpr) {
    return BooleanType.v();
  }
 else   if (expr instanceof LengthExpr) {
    return IntType.v();
  }
 else   if (expr instanceof InvokeExpr) {
    return ((InvokeExpr)expr).getMethodRef().returnType();
  }
 else   if (expr instanceof NewExpr) {
    return ((NewExpr)expr).getBaseType();
  }
 else   if (expr instanceof FieldRef) {
    return ((FieldRef)expr).getType();
  }
 else   if (expr instanceof DoubleConstant) {
    return DoubleType.v();
  }
 else   if (expr instanceof FloatConstant) {
    return FloatType.v();
  }
 else   if (expr instanceof IntConstant) {
    int value=((IntConstant)expr).value;
    if (value >= 0 && value < 2) {
      return Integer1Type.v();
    }
 else     if (value >= 2 && value < 128) {
      return Integer127Type.v();
    }
 else     if (value >= -128 && value < 0) {
      return ByteType.v();
    }
 else     if (value >= 128 && value < 32768) {
      return Integer32767Type.v();
    }
 else     if (value >= -32768 && value < -128) {
      return ShortType.v();
    }
 else     if (value >= 32768 && value < 65536) {
      return CharType.v();
    }
 else {
      return IntType.v();
    }
  }
 else   if (expr instanceof LongConstant) {
    return LongType.v();
  }
 else   if (expr instanceof NullConstant) {
    return NullType.v();
  }
 else   if (expr instanceof StringConstant) {
    return RefType.v("String_Node_Str");
  }
 else   if (expr instanceof ClassConstant) {
    return RefType.v("String_Node_Str");
  }
 else   if (expr instanceof MethodHandle) {
    return RefType.v("String_Node_Str");
  }
 else {
    throw new RuntimeException("String_Node_Str" + expr);
  }
}

Fixed version (ground truth):
public static Type eval_(Typing tg,Value expr,Stmt stmt,JimpleBody jb){
  if (expr instanceof ThisRef) {
    return ((ThisRef)expr).getType();
  }
 else   if (expr instanceof ParameterRef) {
    return ((ParameterRef)expr).getType();
  }
 else   if (expr instanceof Local) {
    Local ex=(Local)expr;
    if (tg == null) {
      return null;
    }
 else {
      return tg.get(ex);
    }
  }
 else   if (expr instanceof BinopExpr) {
    BinopExpr be=(BinopExpr)expr;
    Value opl=be.getOp1(), opr=be.getOp2();
    Type tl=eval_(tg,opl,stmt,jb), tr=eval_(tg,opr,stmt,jb);
    if (expr instanceof CmpExpr || expr instanceof CmpgExpr || expr instanceof CmplExpr) {
      return ByteType.v();
    }
 else     if (expr instanceof GeExpr || expr instanceof GtExpr || expr instanceof LeExpr|| expr instanceof LtExpr|| expr instanceof EqExpr|| expr instanceof NeExpr) {
      return BooleanType.v();
    }
 else     if (expr instanceof ShlExpr) {
      if (tl instanceof IntegerType) {
        return IntType.v();
      }
 else {
        return tl;
      }
    }
 else     if (expr instanceof ShrExpr || expr instanceof UshrExpr) {
      return tl;
    }
 else     if (expr instanceof AddExpr || expr instanceof SubExpr || expr instanceof MulExpr|| expr instanceof DivExpr|| expr instanceof RemExpr) {
      if (tl instanceof IntegerType) {
        return IntType.v();
      }
 else {
        return tl;
      }
    }
 else     if (expr instanceof AndExpr || expr instanceof OrExpr || expr instanceof XorExpr) {
      if (tl instanceof IntegerType && tr instanceof IntegerType) {
        if (tl instanceof BooleanType) {
          if (tr instanceof BooleanType) {
            return BooleanType.v();
          }
 else {
            return tr;
          }
        }
 else         if (tr instanceof BooleanType) {
          return tl;
        }
 else {
          Collection<Type> rs=AugHierarchy.lcas_(tl,tr);
          for (          Type r : rs) {
            return r;
          }
          throw new RuntimeException();
        }
      }
 else {
        return tl;
      }
    }
 else {
      throw new RuntimeException("String_Node_Str" + expr);
    }
  }
 else   if (expr instanceof NegExpr) {
    Type t=eval_(tg,((NegExpr)expr).getOp(),stmt,jb);
    if (t instanceof IntegerType) {
      if (t instanceof Integer1Type || t instanceof BooleanType || t instanceof Integer127Type|| t instanceof ByteType) {
        return ByteType.v();
      }
 else       if (t instanceof ShortType || t instanceof Integer32767Type) {
        return ShortType.v();
      }
 else {
        return IntType.v();
      }
    }
 else {
      return t;
    }
  }
 else   if (expr instanceof CaughtExceptionRef) {
    RefType r=null;
    RefType throwableType=Scene.v().getRefType("String_Node_Str");
    for (    RefType t : TrapManager.getExceptionTypesOf(stmt,jb)) {
      if (r == null) {
        if (t.getSootClass().isPhantom()) {
          r=throwableType;
        }
 else {
          r=t;
        }
      }
 else {
        if (t.getSootClass().isPhantom()) {
          r=throwableType;
        }
 else {
          r=BytecodeHierarchy.lcsc(r,t,throwableType);
        }
      }
    }
    if (r == null) {
      throw new RuntimeException("String_Node_Str" + "String_Node_Str");
    }
    return r;
  }
 else   if (expr instanceof ArrayRef) {
    Local av=(Local)((ArrayRef)expr).getBase();
    Type at=tg.get(av);
    if (at instanceof ArrayType) {
      return ((ArrayType)at).getElementType();
    }
 else     if (at instanceof RefType) {
      RefType ref=(RefType)at;
      if (ref.getSootClass().getName().equals("String_Node_Str") || ref.getSootClass().getName().equals("String_Node_Str") || ref.getSootClass().getName().equals("String_Node_Str")) {
        return ref;
      }
 else {
        return BottomType.v();
      }
    }
 else {
      return BottomType.v();
    }
  }
 else   if (expr instanceof NewArrayExpr) {
    return ((NewArrayExpr)expr).getBaseType().makeArrayType();
  }
 else   if (expr instanceof NewMultiArrayExpr) {
    return ((NewMultiArrayExpr)expr).getBaseType();
  }
 else   if (expr instanceof CastExpr) {
    return ((CastExpr)expr).getCastType();
  }
 else   if (expr instanceof InstanceOfExpr) {
    return BooleanType.v();
  }
 else   if (expr instanceof LengthExpr) {
    return IntType.v();
  }
 else   if (expr instanceof InvokeExpr) {
    return ((InvokeExpr)expr).getMethodRef().returnType();
  }
 else   if (expr instanceof NewExpr) {
    return ((NewExpr)expr).getBaseType();
  }
 else   if (expr instanceof FieldRef) {
    return ((FieldRef)expr).getType();
  }
 else   if (expr instanceof DoubleConstant) {
    return DoubleType.v();
  }
 else   if (expr instanceof FloatConstant) {
    return FloatType.v();
  }
 else   if (expr instanceof IntConstant) {
    int value=((IntConstant)expr).value;
    if (value >= 0 && value < 2) {
      return Integer1Type.v();
    }
 else     if (value >= 2 && value < 128) {
      return Integer127Type.v();
    }
 else     if (value >= -128 && value < 0) {
      return ByteType.v();
    }
 else     if (value >= 128 && value < 32768) {
      return Integer32767Type.v();
    }
 else     if (value >= -32768 && value < -128) {
      return ShortType.v();
    }
 else     if (value >= 32768 && value < 65536) {
      return CharType.v();
    }
 else {
      return IntType.v();
    }
  }
 else   if (expr instanceof LongConstant) {
    return LongType.v();
  }
 else   if (expr instanceof NullConstant) {
    return NullType.v();
  }
 else   if (expr instanceof StringConstant) {
    return RefType.v("String_Node_Str");
  }
 else   if (expr instanceof ClassConstant) {
    return RefType.v("String_Node_Str");
  }
 else   if (expr instanceof MethodHandle) {
    return RefType.v("String_Node_Str");
  }
 else {
    throw new RuntimeException("String_Node_Str" + expr);
  }
}