[PATCH] D76543: [llvm-dwp] Fix a possible out of bound access.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 2 16:50:21 PDT 2020


dblaikie added inline comments.


================
Comment at: llvm/test/tools/llvm-dwp/X86/unknown-section-id.s:1-8
+## The test checks that llvm-dwp avoids an out of bound access when there is
+## an unknown section identifier in an index section. Without the fix, the test
+## failed when LLVM is built with UBSan.
+## Note that additional sections (.debug_abbrev.dwo, .debug_info.dwo, and
+## .debug_types.dwo) are required to reach the test points in the code.
+
+# RUN: llvm-mc -triple x86_64-unknown-linux-gnu %s -filetype=obj -o %t.dwp
----------------
What does llvm-dwp do insteand of out of bounds access? Testing for "does anything other than crash" is usually a bad sign - presumably there's some specific behavior that we'd like llvm-dwp to have in these cases and should be testing for it here.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76543/new/

https://reviews.llvm.org/D76543





More information about the llvm-commits mailing list