[PATCH] [llvm-objcopy][COFF] Fix test for debug dir presence
authorAlfonso Sánchez-Beato <alfonso.sanchez-beato@canonical.com>
Fri, 10 Sep 2021 08:55:26 +0000 (09:55 +0100)
committerEmilio Pozuelo Monfort <pochu@debian.org>
Thu, 16 Jun 2022 10:00:08 +0000 (11:00 +0100)
commit757fa1499833aad43d6009358ce964fabf065116
tree49638134bb553960e4d1d0c9337d743bbfca2b42
parent25ef8ac24f30e3edd79b11b64d74b633aa0ab92f
[PATCH] [llvm-objcopy][COFF] Fix test for debug dir presence

If the number of directories was 6 (equal to the DEBUG_DIRECTORY
index), patchDebugDirectory() was run even though the debug directory
is actually the 7th entry. Use <= in the comparison to fix that.

This fixes https://llvm.org/PR51243

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

Reviewed by: jhenderson

Gbp-Pq: Name llvm-objcopy-COFF-Fix-test-for-debug-dir-presence.patch
llvm/test/tools/llvm-objcopy/COFF/check-debug-dir-present.test [new file with mode: 0644]
llvm/tools/llvm-objcopy/COFF/Writer.cpp