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
No known key found for this signature in database

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);