From d720a2011c215c1d03409cb4e5d4660f2d652e2d Mon Sep 17 00:00:00 2001 From: ywgrit Date: Sun, 26 Nov 2023 17:04:28 +0800 Subject: [PATCH] Remove assertions to make errors exposed in a customized way --- elf/mold.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/elf/mold.h b/elf/mold.h index 91ee6e781e..86e78dbd22 100644 --- a/elf/mold.h +++ b/elf/mold.h @@ -2417,8 +2417,6 @@ InputFile::get_string(Context &ctx, const ElfShdr &shdr) { template inline std::string_view InputFile::get_string(Context &ctx, i64 idx) { - assert(idx < elf_sections.size()); - if (elf_sections.size() <= idx) Fatal(ctx) << *this << ": invalid section index: " << idx; return this->get_string(ctx, elf_sections[idx]);