Skip to content

[Bug] Impossible regular expression in macro lead to ArrayIndexOut [sf#104] #106

@lsf37

Description

@lsf37

*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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugNot working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions