diff options
author | Tom Yang <toyang@fb.com> | 2023-08-03 00:14:18 -0700 |
---|---|---|
committer | Tom Yang <toyang@fb.com> | 2023-08-03 12:56:37 -0700 |
commit | 9a3f0cd717f68ccf9e348bce2d76a2372482f4f2 (patch) | |
tree | f274a58b0db11d69ceb409fcd11738cbed6f35b9 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 6537181de420c5967c427b40f26ef2cf746c2227 (diff) | |
download | llvm-9a3f0cd717f68ccf9e348bce2d76a2372482f4f2.zip llvm-9a3f0cd717f68ccf9e348bce2d76a2372482f4f2.tar.gz llvm-9a3f0cd717f68ccf9e348bce2d76a2372482f4f2.tar.bz2 |
Fix crash in lldb-vscode when missing function name
Summary:
In cases where the PC has no function name, lldb-vscode crashes.
`lldb::SBFrame::GetDisplayFunctionName()` returns a `nullptr`, and when we
attempt to construct an `std::string`, it raises an exception.
Test plan:
This can be observed with creating a test file (credit to @clayborg for
the example):
```
int main() {
typedef void (*FooCallback)();
FooCallback foo_callback = (FooCallback)0;
foo_callback(); // Crash at zero!
return 0;
}
```
and attempting to debug the file through VSCode.
I add a test case in D156732 which should cover this.
Differential Revision: https://reviews.llvm.org/D156970
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions