Skip to content

ANTLR C target runs in infinite loop with wide strings (16bit characters) #104

@hubert13

Description

@hubert13

I had troubles with wide character strings when I called pANTLR3_INPUT_STREAM input = antlr3StringStreamNew((ANTLR3_UINT8*)stringAdress, ANTLR3_ENC_UTF16, stringSizeInBytes, (ANTLR3_UINT8*)"test"); . I think I have found the issue in the file antlr3inputstream.c, in the function antlr3UTF16Seek(). The while condition seems broken, the "smaller than"-comparison should be "greater than", so that the full line reads:

while (is->_LA(is, 1) != ANTLR3_CHARSTREAM_EOF && seekPoint > (ANTLR3_MARKER)input->nextChar)

Can anybody confirm that and fix the code if necessary?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions