Skip to content

Commit cb59eb8

Browse files
[lldb] Flip the conservative answer for StackID::IsCFAOnStack
The optimization in swiftlang#7877 accidentally changed the default answer for this function. It's important to default to "On Stack" when we don't know, because that's where most CFAs live, and because we don't want to trigger the expensive heap comparisons unless we're absolutely sure the CFA is on the heap. (cherry picked from commit 57757e9)
1 parent 03d7e3a commit cb59eb8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lldb/source/Target/StackID.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ using namespace lldb_private;
1919

2020
bool StackID::IsCFAOnStack(Process &process) const {
2121
if (m_cfa_on_stack == eLazyBoolCalculate) {
22-
m_cfa_on_stack = eLazyBoolNo;
22+
// Conservatively assume stack memory
23+
m_cfa_on_stack = eLazyBoolYes;
2324
if (m_cfa != LLDB_INVALID_ADDRESS) {
2425
MemoryRegionInfo mem_info;
2526
if (process.GetMemoryRegionInfo(m_cfa, mem_info).Success())
26-
if (mem_info.IsStackMemory() == MemoryRegionInfo::eYes)
27-
m_cfa_on_stack = eLazyBoolYes;
27+
if (mem_info.IsStackMemory() == MemoryRegionInfo::eNo)
28+
m_cfa_on_stack = eLazyBoolNo;
2829
}
2930
}
3031
return m_cfa_on_stack == eLazyBoolYes;

0 commit comments

Comments
 (0)