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 { ...@@ -174,9 +174,14 @@ public class SimplifyVisitor extends AbstractVisitor {
iwa = (InsnWrapArg)argInsn.getArg(0); iwa = (InsnWrapArg)argInsn.getArg(0);
argInd = 3; // Cause for loop below to skip to after the constructor argInd = 3; // Cause for loop below to skip to after the constructor
} else { } else {
ConstStringNode csn = (ConstStringNode)chain.get(0); InsnNode firstNode = chain.get(0);
if (firstNode instanceof ConstStringNode) {
ConstStringNode csn = (ConstStringNode) firstNode;
iwa = new InsnWrapArg(csn); iwa = new InsnWrapArg(csn);
argInd = 2; // Cause for loop below to skip to after the constructor argInd = 2; // Cause for loop below to skip to after the constructor
} else {
return null;
}
} }
concatInsn.addArg(iwa); 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