llvm-project
7f08b550 - [lldb][DIL] Fix infinite loop parsing cv-qualifiers in a C-style cast (#205087)

Commit
79 days ago
[lldb][DIL] Fix infinite loop parsing cv-qualifiers in a C-style cast (#205087) `ParseBuiltinType` loops over identifier tokens to assemble a builtin type name. When it encountered the "const" or "volatile" qualifier it executed `continue` to skip the qualifier without first advancing the lexer, so the loop re-examined the same token forever. Any cast expression beginning with a cv-qualifier therefore hung the parser before any evaluation took place. Advance past the qualifier token before continuing the loop. Reproduce (hangs forever before the fix): ``` $ ./bin/lldb ./bin/lldb (lldb) breakpoint set -n main (lldb) run (lldb) frame variable '(const int)1' ``` After the fix the qualifier is consumed and the cast evaluates normally ("(const int)1" -> 1); a bare qualifier with no type name is reported as an ordinary parse error instead of hanging. Adds regression coverage to the DIL Casts API test.
Author
Parents
Loading