Skip to content

Commit bc313ae

Browse files
[BPF] Add null check for File in BTFDebug::populateFileContent
Fixes #165202 Signed-off-by: varun-r-mallya <[email protected]>
1 parent 41bb6ed commit bc313ae

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/Target/BPF/BTFDebug.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,6 +1095,9 @@ void BTFDebug::visitMapDefType(const DIType *Ty, uint32_t &TypeId) {
10951095
std::string BTFDebug::populateFileContent(const DIFile *File) {
10961096
std::string FileName;
10971097

1098+
if (!File)
1099+
return "";
1100+
10981101
if (!File->getFilename().starts_with("/") && File->getDirectory().size())
10991102
FileName = File->getDirectory().str() + "/" + File->getFilename().str();
11001103
else

0 commit comments

Comments
 (0)