diff options
author | Yonghong Song <yhs@fb.com> | 2021-11-06 17:46:40 -0700 |
---|---|---|
committer | Yonghong Song <yhs@fb.com> | 2021-11-06 18:19:00 -0700 |
commit | bbab17c6c987d7a6612855c02a4e8988dac0dc17 (patch) | |
tree | 1fd7d2065e1260b9df180cf49ec21a54516e3137 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | d9e2c8f54ddefa89e5599f0a011f946cab1a8534 (diff) | |
download | llvm-bbab17c6c987d7a6612855c02a4e8988dac0dc17.zip llvm-bbab17c6c987d7a6612855c02a4e8988dac0dc17.tar.gz llvm-bbab17c6c987d7a6612855c02a4e8988dac0dc17.tar.bz2 |
[Clang][Attr] fix a btf_type_attr CGDebugInfo codegen bug
Nathan Chancellor reported a crash due to commit
3466e00716e1 (Reland "[Attr] support btf_type_tag attribute").
The following test can reproduce the crash:
$ cat efi.i
typedef unsigned long efi_query_variable_info_t(int);
typedef struct {
struct {
efi_query_variable_info_t __attribute__((regparm(0))) * query_variable_info;
};
} efi_runtime_services_t;
efi_runtime_services_t efi_0;
$ clang -m32 -O2 -g -c -o /dev/null efi.i
The reason is that FunctionTypeLoc.getParam(Idx) may return a
nullptr which should be checked before dereferencing the
result pointer. This patch fixed this issue.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions