You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*Reported by anonymous on 2009-04-16 17:25 UTC
Hello,
one of the developer on my project has declared a new macro with an impossible regular expression:
ALPHA_NUMERIC = [a-Z0-9]
This one does not create any warning during Java code generation but:
Warning : Macro "ALPHA_NUMERIC" has been declared but never used.
However at runtime, it throws the following exception:
Caused by: java.lang.ArrayIndexOutOfBoundsException: 65536
at TestCase.zzUnpackCMap
at TestCase.<clinit>
... 6 more
In fact the regular expression [a-Z] is impossible because of ASCII char order, the developer meant [A-z].
public class Main {
public static void main(String[] args) throws IOException {
new TestCase(new ByteArrayInputStream("Hello\nWorld!".getBytes())).readMessage();
}
}
Regards,
Loïc
The text was updated successfully, but these errors were encountered:
lsf37
changed the title
Impossible regular expression in macro lead to ArrayIndexOut
[Bug] Impossible regular expression in macro lead to ArrayIndexOut [sf#104]
Feb 15, 2015
*Reported by anonymous on 2009-04-16 17:25 UTC
Hello,
one of the developer on my project has declared a new macro with an impossible regular expression:
ALPHA_NUMERIC = [a-Z0-9]
This one does not create any warning during Java code generation but:
Warning : Macro "ALPHA_NUMERIC" has been declared but never used.
However at runtime, it throws the following exception:
Caused by: java.lang.ArrayIndexOutOfBoundsException: 65536
at TestCase.zzUnpackCMap
at TestCase.<clinit>
... 6 more
In fact the regular expression [a-Z] is impossible because of ASCII char order, the developer meant [A-z].
Please find attached a testcase TestCase.flex.
The following Main.java class can be used:
import java.io.ByteArrayInputStream;
import java.io.IOException;
public class Main {
public static void main(String[] args) throws IOException {
new TestCase(new ByteArrayInputStream("Hello\nWorld!".getBytes())).readMessage();
}
}
Regards,
Loïc
The text was updated successfully, but these errors were encountered: