Skip to content

Commit 2fc17a5

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:4b13c86d980a into amd-gfx:78bf28786d44
Local branch amd-gfx 78bf287 Merged main:8d203100e898 into amd-gfx:a01f70e2edd5 Remote branch main 4b13c86 [ORC] Fix heap-use-after-free error in MachODebugObjectSynthesizer.cpp
2 parents 78bf287 + 4b13c86 commit 2fc17a5

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,7 @@ ClangExpressionParser::ClangExpressionParser(
575575
lang_opts.GNUMode = true;
576576
lang_opts.GNUKeywords = true;
577577
lang_opts.CPlusPlus11 = true;
578+
lang_opts.BuiltinHeadersInSystemModules = true;
578579

579580
// The Darwin libc expects this macro to be set.
580581
lang_opts.GNUCVersion = 40201;

llvm/include/llvm/Config/llvm-config.h.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
/* Indicate that this is LLVM compiled from the amd-gfx branch. */
1818
#define LLVM_HAVE_BRANCH_AMD_GFX
19-
#define LLVM_MAIN_REVISION 476438
19+
#define LLVM_MAIN_REVISION 476440
2020

2121
/* Define if LLVM_ENABLE_DUMP is enabled */
2222
#cmakedefine LLVM_ENABLE_DUMP

llvm/lib/ExecutionEngine/Orc/Debugging/DebuggerSupportPlugin.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class MachODebugObjectSynthesizer : public MachODebugObjectSynthesizerBase {
156156
}
157157
}
158158

159-
std::optional<std::string> FileName;
159+
std::optional<StringRef> FileName;
160160
if (!DebugLineSectionData.empty()) {
161161
auto DWARFCtx = DWARFContext::create(DebugSectionMap, G.getPointerSize(),
162162
G.getEndianness());
@@ -169,15 +169,13 @@ class MachODebugObjectSynthesizer : public MachODebugObjectSynthesizerBase {
169169
// Try to parse line data. Consume error on failure.
170170
if (auto Err = LineTable.parse(DebugLineData, &Offset, *DWARFCtx, nullptr,
171171
consumeError)) {
172-
handleAllErrors(
173-
std::move(Err),
174-
[&](ErrorInfoBase &EIB) {
175-
LLVM_DEBUG({
176-
dbgs() << "Cannot parse line table for \"" << G.getName() << "\": ";
177-
EIB.log(dbgs());
178-
dbgs() << "\n";
179-
});
172+
handleAllErrors(std::move(Err), [&](ErrorInfoBase &EIB) {
173+
LLVM_DEBUG({
174+
dbgs() << "Cannot parse line table for \"" << G.getName() << "\": ";
175+
EIB.log(dbgs());
176+
dbgs() << "\n";
180177
});
178+
});
181179
} else {
182180
if (!LineTable.Prologue.FileNames.empty())
183181
FileName = *dwarf::toString(LineTable.Prologue.FileNames[0].Name);
@@ -187,7 +185,7 @@ class MachODebugObjectSynthesizer : public MachODebugObjectSynthesizerBase {
187185
// If no line table (or unable to use) then use graph name.
188186
// FIXME: There are probably other debug sections we should look in first.
189187
if (!FileName)
190-
FileName = G.getName();
188+
FileName = StringRef(G.getName());
191189

192190
Builder.addSymbol("", MachO::N_SO, 0, 0, 0);
193191
Builder.addSymbol(*FileName, MachO::N_SO, 0, 0, 0);

0 commit comments

Comments
 (0)