Skip to content

Commit

Permalink
ELFParser: Stop using a VLA
Browse files Browse the repository at this point in the history
Clang-18 complains about this, use a vector instead.
  • Loading branch information
Sonicadvance1 committed Mar 23, 2024
1 parent 002ca36 commit 50f6266
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/Tools/CommonTools/Linux/Utils/ELFParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ struct ELFParser {
}

if (type == ::ELFLoader::ELFContainer::TYPE_X86_32) {
Elf32_Phdr phdrs32[ehdr.e_phnum];
fextl::vector<Elf32_Phdr> phdrs32(ehdr.e_phnum);

if (pread(fd, phdrs32, sizeof(Elf32_Phdr) * ehdr.e_phnum, ehdr.e_phoff) == -1) {
if (pread(fd, phdrs32.data(), sizeof(Elf32_Phdr) * ehdr.e_phnum, ehdr.e_phoff) == -1) {
LogMan::Msg::EFmt("Failed to read phdr32 from '{}'", fd);
return false;
}
Expand Down

0 comments on commit 50f6266

Please sign in to comment.