[BPF] Don't crash on missing line info
authorTamir Duberstein <tamird@gmail.com>
Thu, 27 Jul 2023 14:26:58 +0000 (10:26 -0400)
committerTobias Hieta <tobias@hieta.se>
Mon, 14 Aug 2023 08:34:02 +0000 (10:34 +0200)
commitf3e3c5a922c72c2b483f2ec6dc1dfdb938382203
tree69c2c986fa06da315491dbb3e5570621930faca1
parent2f49cd1a773da7d2227fa7db952f50137a812300
[BPF] Don't crash on missing line info

When compiling Rust code we may end up with calls to functions provided
by other code units. Presently this code crashes on a null pointer
dereference - this patch avoids that crash and adds a test.

Reviewed By: ast

Differential Revision: https://reviews.llvm.org/D156446

(cherry picked from commit 055893beacb34441467eb997a270a620c57c138f)
llvm/lib/Target/BPF/BTFDebug.cpp
llvm/test/CodeGen/BPF/BTF/incomplete-debuginfo.ll [new file with mode: 0644]