diff --git a/src/platform/x86_pc/ioapic.cpp b/src/platform/x86_pc/ioapic.cpp index 8dd09b5aa..a0588d6a3 100644 --- a/src/platform/x86_pc/ioapic.cpp +++ b/src/platform/x86_pc/ioapic.cpp @@ -106,6 +106,12 @@ namespace x86 } } + [[noreturn]] static void ioapic_panic(uint32_t entry) { + printf("Entry: %u\n", entry); + assert(0 && "Could not match I/O APIC to entry"); + std::abort(); + } + inline IOapic& get_ioapic_for(uint32_t entry) { uint32_t current = 0; @@ -115,8 +121,7 @@ namespace x86 } current += a.entries(); } - printf("Entry: %u\n", entry); - assert(0 && "Could not match I/O APIC to entry"); + ioapic_panic(entry); } void IOAPIC::enable(uint8_t cpu, const ACPI::override_t& redir) diff --git a/vmbuild/elf_syms.cpp b/vmbuild/elf_syms.cpp index ec0e5b12b..3167b9a3a 100644 --- a/vmbuild/elf_syms.cpp +++ b/vmbuild/elf_syms.cpp @@ -206,9 +206,13 @@ static int prune_elf_symbols(char* location) assert(hdr->e_ident[EI_MAG2] == ELFMAG2); assert(hdr->e_ident[EI_MAG3] == ELFMAG3); - if (hdr->e_ident[EI_CLASS] == ELFCLASS32) - return prune_elf32_symbols(location); - else if (hdr->e_ident[EI_CLASS] == ELFCLASS64) - return prune_elf64_symbols(location); - assert(0 && "Unknown ELF class"); + switch (hdr->e_ident[EI_CLASS]) { + case ELFCLASS32: + return prune_elf32_symbols(location); + case ELFCLASS64: + return prune_elf64_symbols(location); + default: + assert(false && "Unknown ELF class"); + return 0; + } }