https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117118

            Bug ID: 117118
           Summary: internal compiler error: Segmentation fault in
                    c_lex_with_flags(tree_node**, unsigned int*, unsigned
                    char*, int)
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: yihan4845 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/nT16x49sE

The following program:
```cpp
#pragma message "" = R""
```

will trigger segmentation fault for gcc trunk.

The stack dump:
```
0x2867155 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x287af35 internal_error(char const*, ...)
        ???:0
0x28fd642 _cpp_lex_direct
        ???:0
0x28ff4b0 _cpp_lex_token
        ???:0
0xdde522 c_lex_with_flags(tree_node**, unsigned int*, unsigned char*, int)
        ???:0
0xc9a0da c_parse_file()
        ???:0
0xdf1f69 c_common_parse_file()
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1
```

Reply via email to