mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-06 11:19:09 +00:00
llvm-dwarfdump: Fix UB (unsequenced writes) introduced in e0fd87cc64d5
Unsequenced write due to "x &= f()" where 'f()' modifies 'x'. Detected by the llvm-clang-x86_64-expensive-checks-win buildbot. Investigated/identified by Galina - thanks!
This commit is contained in:
parent
1082de0fcb
commit
0118194836
@ -506,7 +506,8 @@ static bool handleBuffer(StringRef Filename, MemoryBufferRef Buffer,
|
||||
if (filterArch(*Obj)) {
|
||||
std::unique_ptr<DWARFContext> DICtx =
|
||||
DWARFContext::create(*Obj, nullptr, "", RecoverableErrorHandler);
|
||||
Result &= HandleObj(*Obj, *DICtx, Filename, OS);
|
||||
if (!HandleObj(*Obj, *DICtx, Filename, OS))
|
||||
Result = false;
|
||||
}
|
||||
}
|
||||
else if (auto *Fat = dyn_cast<MachOUniversalBinary>(BinOrErr->get()))
|
||||
@ -518,14 +519,16 @@ static bool handleBuffer(StringRef Filename, MemoryBufferRef Buffer,
|
||||
if (filterArch(Obj)) {
|
||||
std::unique_ptr<DWARFContext> DICtx =
|
||||
DWARFContext::create(Obj, nullptr, "", RecoverableErrorHandler);
|
||||
Result &= HandleObj(Obj, *DICtx, ObjName, OS);
|
||||
if (!HandleObj(Obj, *DICtx, ObjName, OS))
|
||||
Result = false;
|
||||
}
|
||||
continue;
|
||||
} else
|
||||
consumeError(MachOOrErr.takeError());
|
||||
if (auto ArchiveOrErr = ObjForArch.getAsArchive()) {
|
||||
error(ObjName, errorToErrorCode(ArchiveOrErr.takeError()));
|
||||
Result &= handleArchive(ObjName, *ArchiveOrErr.get(), HandleObj, OS);
|
||||
if (!handleArchive(ObjName, *ArchiveOrErr.get(), HandleObj, OS))
|
||||
Result = false;
|
||||
continue;
|
||||
} else
|
||||
consumeError(ArchiveOrErr.takeError());
|
||||
|
Loading…
Reference in New Issue
Block a user