check result of mmap() call to handle a large base_addr value correctly

This commit is contained in:
Sean Stasiak
2025-03-26 19:22:07 -04:00
committed by Alex Rønne Petersen
parent 1423b38c45
commit 9025f73733
+1 -1
View File
@@ -516,7 +516,7 @@ pub fn initStatic(phdrs: []elf.Phdr) void {
-1,
0,
);
if (@as(isize, @bitCast(begin_addr)) < 0) @trap();
if (@call(.always_inline, linux.E.init, .{begin_addr}) != .SUCCESS) @trap();
const area_ptr: [*]align(page_size_min) u8 = @ptrFromInt(begin_addr);