:: commit de46c9523a2a653dc10f4f61140a443537b91cf9

Mintsuki <mintsuki@protonmail.com> — 2026-04-01 23:55

parents: 74ddd08758

protos/multiboot2: Fix GCC build error with break in statement expression

diff --git a/common/protos/multiboot2.c b/common/protos/multiboot2.c
index 5bd0bb10..734fbf8f 100644
--- a/common/protos/multiboot2.c
+++ b/common/protos/multiboot2.c
@@ -151,10 +151,11 @@ noreturn void multiboot2_load(char *config, char* cmdline) {
     // Iterate through the entries...
     for (struct multiboot_header_tag *tag = (struct multiboot_header_tag*)(header + 1); // header + 1 to skip the header struct.
        tag < (struct multiboot_header_tag *)((uintptr_t)header + header->header_length) && tag->type != MULTIBOOT_HEADER_TAG_END;
-       tag = (struct multiboot_header_tag *)((uintptr_t)tag + ALIGN_UP(tag->size, MULTIBOOT_TAG_ALIGN, break))) {
+       ) {
         if (tag->size == 0) {
             break;
         }
+        size_t tag_stride = ALIGN_UP(tag->size, MULTIBOOT_TAG_ALIGN, break);
         bool is_required = !(tag->flags & MULTIBOOT_HEADER_TAG_OPTIONAL);
         switch (tag->type) {
             case MULTIBOOT_HEADER_TAG_INFORMATION_REQUEST: {
@@ -267,6 +268,7 @@ noreturn void multiboot2_load(char *config, char* cmdline) {
                     }
                 }
         }
+        tag = (struct multiboot_header_tag *)((uintptr_t)tag + tag_stride);
     }
 
     bool section_hdr_info_valid = false;
tab: 248 wrap: offon