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