Skip to content

Commit

Permalink
Prevent Unknown casts in .NET
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcMil committed Nov 13, 2024
1 parent 71116ce commit ff19b7a
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ public Value jimplifyExpr(Body jb) {
break;
}
argument = simplifyComplexExpression(jb, argument);
if (convType instanceof UnknownType) {
//Decompilation errors might happen. But even in this case, we do not
//want to cast to unknown. In this case, let the type assigner figure something out.
return argument;
}

if (instruction.getCheckForOverflow()) {
return Jimple.v().newCheckedCastExpr(argument, convType);
Expand Down

0 comments on commit ff19b7a

Please sign in to comment.