Skip to content

Commit 9901d2c

Browse files
committed
add argument count cap 255
1 parent ee955c3 commit 9901d2c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/org/python/compiler/ArgListCompiler.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import org.python.antlr.ast.expr_contextType;
1919
import org.python.antlr.base.expr;
2020
import org.python.antlr.base.stmt;
21+
import org.python.core.Py;
2122

2223
public class ArgListCompiler extends Visitor
2324
{
@@ -113,6 +114,9 @@ public void visitArgs(arguments args) throws Exception {
113114
defaults.add(val);
114115
}
115116
}
117+
if (names.size() > 255) {
118+
throw Py.SyntaxError("more than 255 arguments");
119+
}
116120
}
117121

118122
@Override

0 commit comments

Comments
 (0)