Skip to content

Commit 253b5ea

Browse files
committed
Fix ArrayOutOfBoundsException in __cast__() parsing
1 parent ddf74cd commit 253b5ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/laytonsmith/core/functions/Compiler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ public static ParseTree rewrite(List<ParseTree> list, boolean returnSConcat,
354354
}
355355

356356
// Rewrite cast operator.
357-
for(int i = list.size() - 1; i >= 0; i--) {
357+
for(int i = list.size() - 2; i >= 0; i--) {
358358
ParseTree node = list.get(i);
359359
if(node.getData() instanceof CFunction cf && cf.hasFunction() && cf.getFunction() != null
360360
&& cf.getFunction().getName().equals(Compiler.p.NAME) && node.numberOfChildren() == 1) {

0 commit comments

Comments
 (0)