[all-commits] [llvm/llvm-project] 7a276c: [lldb] Fix logic error in AppleObjCTypeEncodingPar...
Dave Lee via All-commits
all-commits at lists.llvm.org
Thu Apr 24 10:09:26 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 7a276c8acfc3977de8c3ceb0af67fcf603834946
https://github.com/llvm/llvm-project/commit/7a276c8acfc3977de8c3ceb0af67fcf603834946
Author: Dave Lee <davelee.com at gmail.com>
Date: 2025-04-24 (Thu, 24 Apr 2025)
Changed paths:
M lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
M lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.h
Log Message:
-----------
[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.
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