[all-commits] [llvm/llvm-project] 7f08b5: [lldb][DIL] Fix infinite loop parsing cv-qualifier...

Yao Qi via All-commits all-commits at lists.llvm.org
Thu Jun 25 22:30:15 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7f08b5508201caca4033c9af69237f970e55d902
      https://github.com/llvm/llvm-project/commit/7f08b5508201caca4033c9af69237f970e55d902
  Author: Yao Qi <yao_qi at apple.com>
  Date:   2026-06-25 (Thu, 25 Jun 2026)

  Changed paths:
    M lldb/source/ValueObject/DILParser.cpp
    M lldb/test/API/commands/frame/var-dil/expr/Casts/TestFrameVarDILCast.py

  Log Message:
  -----------
  [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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list