[compiler-rt] [HWASan] Fix symbol indexing (PR #135967)

Florian Mayer via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 16 14:18:46 PDT 2025


================
@@ -268,13 +284,16 @@ class Symbolizer:
         for fn in fnames:
           filename = os.path.join(dname, fn)
           try:
-            bid = get_buildid(filename)
+            found_symbols, bid = read_elf(filename)
           except FileNotFoundError:
             continue
           except Exception as e:
             print("Failed to parse {}: {}".format(filename, e), file=sys.stderr)
             continue
-          if bid is not None:
+          if found_symbols and bid is not None:
----------------
fmayer wrote:

because this is the only place we use `bid`, we could keep the signature and make it return `None` if we don't find symbols. but note my comment about your logic about finding symbols above

https://github.com/llvm/llvm-project/pull/135967


More information about the llvm-commits mailing list