Skip to content

Commit

Permalink
Setting the program length limit to zero disables it.
Browse files Browse the repository at this point in the history
  • Loading branch information
Olliroxx authored and fnuecke committed Jan 6, 2023
1 parent c463eab commit 30ae5c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public final class CommonConfig {
/**
* The maximum number of lines a program may have.
*/
@Path("module.execution") @Min(1) @Max(200)
@Comment("The maximum number of lines an ASM program for an execution node may have.")
@Path("module.execution") @Min(0) @Max(200)
@Comment("The maximum number of lines an ASM program for an execution node may have. Use zero to remove the limit.")
@Translation("maxLinesPerProgram")
public static int maxLinesPerProgram = 40;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static void compile(final Iterable<String> code, final MachineState state
state.clear();

final String[] lines = Iterables.toArray(code, String.class);
if (lines.length > CommonConfig.maxLinesPerProgram) {
if (lines.length > CommonConfig.maxLinesPerProgram && CommonConfig.maxLinesPerProgram > 0) {
throw new ParseException(Strings.MESSAGE_TOO_MANY_LINES, CommonConfig.maxLinesPerProgram, 0, 0);
}
for (int lineNumber = 0; lineNumber < lines.length; lineNumber++) {
Expand Down

0 comments on commit 30ae5c9

Please sign in to comment.