diff --git a/llvm/include/llvm/Object/ELF.h b/llvm/include/llvm/Object/ELF.h index eb670c3e7560ce..18cc7abe1cd61c 100644 --- a/llvm/include/llvm/Object/ELF.h +++ b/llvm/include/llvm/Object/ELF.h @@ -573,7 +573,7 @@ Expected ELFFile::getEntry(const Elf_Shdr *Section, return createError("section " + getSecIndexForError(this, Section) + " has invalid sh_entsize: expected " + Twine(sizeof(T)) + ", but got " + Twine(Section->sh_entsize)); - uint64_t Pos = Section->sh_offset + Entry * sizeof(T); + uint64_t Pos = Section->sh_offset + (uint64_t)Entry * sizeof(T); if (Pos + sizeof(T) > Buf.size()) return createError("unable to access section " + getSecIndexForError(this, Section) + " data at 0x" +