From aa9d32a5dfbdb401f8c63d0753e67e77da80f8fe Mon Sep 17 00:00:00 2001
From: Amelia Coutard <eliottulio.coutard@gmail.com>
Date: Sat, 8 Oct 2022 16:07:58 +0200
Subject: [PATCH] Fixed priority of operations in address rounding

---
 src/kernel.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/kernel.cpp b/src/kernel.cpp
index fe6a38c..90a0704 100644
--- a/src/kernel.cpp
+++ b/src/kernel.cpp
@@ -58,7 +58,7 @@ extern "C" void kmain(unsigned long magic, os::phys_ptr<const multiboot2::info_s
 			for (std::size_t i = 0; i < multiboot2::memory_map_number_of_entries(it); i++) {
 				if (multiboot2::memory_map_type(it, i) == 1) {
 					const os::phys_ptr<os::paging::page> s{(multiboot2::memory_map_base_addr(it, i) + 0x1000 - 1) / 0x1000 * 0x1000};
-					const os::phys_ptr<os::paging::page> e{multiboot2::memory_map_base_addr(it, i) + multiboot2::memory_map_length(it, i) / 0x1000 * 0x1000};
+					const os::phys_ptr<os::paging::page> e{(multiboot2::memory_map_base_addr(it, i) + multiboot2::memory_map_length(it, i)) / 0x1000 * 0x1000};
 					if (s < e) {
 						remove_some_mem(
 						s, e, kernel_start, kernel_end,
-- 
2.46.0