diff options
author | Dave Lee <davelee.com@gmail.com> | 2025-04-24 10:09:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-24 10:09:05 -0700 |
commit | 7a276c8acfc3977de8c3ceb0af67fcf603834946 (patch) | |
tree | 13c4dc70bdccf275a5702054b7bea35148cf1f76 /clang/lib/Frontend/CompilerInstance.cpp | |
parent | 2de936b6eb38e7a37224a97c2a22aa79b9dfb9dc (diff) | |
download | llvm-7a276c8acfc3977de8c3ceb0af67fcf603834946.zip llvm-7a276c8acfc3977de8c3ceb0af67fcf603834946.tar.gz llvm-7a276c8acfc3977de8c3ceb0af67fcf603834946.tar.bz2 |
[lldb] Fix logic error in AppleObjCTypeEncodingParser (#137067)
Fixes parsing of an ObjC type encoding such as `{?="a""b"}`. Parsing of such a type
encoding would lead to an assert. This was observed when running `language objc
class-table dump`.
The function `ReadQuotedString` consumes the closing quote, however one of its two
callers (`ReadStructElement`) was also consuming a quote. For the above type encoding,
where two quoted strings occur back to back, the parser would unintentionally consume
the opening quote of the second quoted string - leaving the remaining text with an
unbalanced quote.
This changes fixes `ReadStructElement` to not consume a quote after calling
`ReadQuotedString`.
For callers to know whether a string was successfully parsed, `ReadQuotedString` now
returns an optional string.
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
0 files changed, 0 insertions, 0 deletions