Skip to content

Commit

Permalink
Fix the logic in DWARFContext thread safety selection (#11)
Browse files Browse the repository at this point in the history
The patch triggered some TSAN reports. Looks like the logic which decided if the thread safe or thread unsafe implementation should be used is inverted. The test is passing with this patch in place.
  • Loading branch information
kstoimenov authored Sep 19, 2023
1 parent 5a58e98 commit 44e9645
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ DWARFContext::DWARFContext(std::unique_ptr<const DWARFObject> DObj,
: DIContext(CK_DWARF),
RecoverableErrorHandler(RecoverableErrorHandler),
WarningHandler(WarningHandler), DObj(std::move(DObj)) {
if (ThreadSafe)
if (!ThreadSafe)
State.reset(new ThreadUnsafeDWARFContextState(*this, DWPName));
else
State.reset(new ThreadSafeState(*this, DWPName));
Expand Down

0 comments on commit 44e9645

Please sign in to comment.