Commit b4767626 authored by Skylot's avatar Skylot

core: prevent ClassCastException in StringBuilder chain converter

parent 84edfac8
......@@ -174,9 +174,14 @@ public class SimplifyVisitor extends AbstractVisitor {
iwa = (InsnWrapArg)argInsn.getArg(0);
argInd = 3; // Cause for loop below to skip to after the constructor
} else {
ConstStringNode csn = (ConstStringNode)chain.get(0);
InsnNode firstNode = chain.get(0);
if (firstNode instanceof ConstStringNode) {
ConstStringNode csn = (ConstStringNode) firstNode;
iwa = new InsnWrapArg(csn);
argInd = 2; // Cause for loop below to skip to after the constructor
} else {
return null;
}
}
concatInsn.addArg(iwa);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment