diff options
| author | Volodymyr Sapsai <vsapsai@apple.com> | 2025-04-17 17:09:26 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-17 17:09:26 -0700 |
| commit | ebe084f927f14be707d3ca64dab0faaf6c0eee9d (patch) | |
| tree | 9f2a56db877ac226452f08aea370c1fb4e6e6747 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp | |
| parent | 62b9cbd8782b2ded15efed67ae10419e75ea0fa7 (diff) | |
[Modules] Fix the inconsistency of which `Decl` should be serialized for an identifier. (#135887)
Fixes the assertion failure
> Assertion failed: (DeclIDs.contains(D) && "Declaration not emitted!"),
function getDeclID, file ASTWriter.cpp, line 6873.
We prepare to serialize a `Decl` by adding it to `DeclIDs` in
`ASTWriter::GetDeclRef`. But the checks before this call aren't the same
as when we are actually serializing a `Decl` in
`ASTIdentifierTableTrait::EmitData` and
`ASTWriter::WriteIdentifierTable`. That's how we can end up serializing
a `Decl` not present in `DeclIDs` and hitting the assertion. With the
assertions disabled clang crashes when trying to use a deserialized null
`Decl`.
Fix by making the code checks before `ASTWriter::GetDeclRef` call
similar to those we have before the serialization.
rdar://139319683
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
0 files changed, 0 insertions, 0 deletions
