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

Igor Kudrin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 2 22:45:47 PDT 2020


ikudrin marked 2 inline comments as done.
ikudrin 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
----------------
dblaikie wrote:
> 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.
It just ignores the unknown sections because there is little it can do with them anyway.


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

https://reviews.llvm.org/D76543





More information about the llvm-commits mailing list