Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ front-end cannot parse names that resemble integer suffixes #1294

Open
wandernauta opened this issue Dec 11, 2024 · 1 comment
Open

C++ front-end cannot parse names that resemble integer suffixes #1294

wandernauta opened this issue Dec 11, 2024 · 1 comment
Labels
A-Bug F-CPP Frontend: C++ Fuzzing Found by fuzzing

Comments

@wandernauta
Copy link
Contributor

When verifying a C++ program, any variable, function or namespace name that looks like u, ul, ull, l, lu, llu (case insensitive) cannot be parsed:

namespace u {
}

It appears that the token is recognized as an integer suffix instead of an identifier.

======================================
At /tmp/vercors-interpreted-10485601513190727955.ipp
--------------------------------------
    6  # 1 "" 2
    7  # 1 "" 2
                [-
    8  namespace u {
                 -]
    9  }
   10
--------------------------------------
[1/1] Parsing failed: no viable alternative at input 'namespaceu'
======================================
[INFO] Done: VerCors (at 16:23:50, duration: 00:00:00)

The problem seems specific to the C++ front-end and does not occur with C.

Version: 077f8b9 (dev branch).

This issue was found by fuzzing.

@superaxander superaxander added A-Bug Fuzzing Found by fuzzing F-CPP Frontend: C++ labels Dec 11, 2024
@superaxander
Copy link
Member

Yes I think you're right. Compared to https://github.com/antlr/grammars-v4/blob/master/cpp/CPP14Lexer.g4 the order between the Identifier and IntegerSuffix tokens is reversed which is probably the cause of the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Bug F-CPP Frontend: C++ Fuzzing Found by fuzzing
Projects
None yet
Development

No branches or pull requests

2 participants