aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build/Fuzz/WebServer.zig
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2024-08-16 11:09:52 +0200
committerAlex Rønne Petersen <alex@alexrp.com>2024-08-18 07:27:23 +0200
commitd4973c992203ed6fb761d3f3b871dd9849541b5a (patch)
tree8dc1a3f1b684ca5526ea78615fdd5f2c77a09ec5 /lib/std/Build/Fuzz/WebServer.zig
parentbcf41c859430301fe8117514b90e2610ae107276 (diff)
downloadzig-d4973c992203ed6fb761d3f3b871dd9849541b5a.tar.gz
zig-d4973c992203ed6fb761d3f3b871dd9849541b5a.zip
std.os.linux: Fix syscall errno value handling for mips.
The kernel sets r7 to 0 (success) or -1 (error), and stores the result in r2. When r7 is -1 and the result is positive, it needs to be negated to get the errno value that higher-level code, such as errnoFromSyscall(), expects to see. The old code was missing the check that r2 is positive, but was also doing the r7 check incorrectly; since it can only be set to 0 or -1, the blez instruction would always branch. In practice, this fix is necessary for e.g. the ENOSYS error to be interpreted correctly. This manifested as hitting an unreachable branch when calling process_vm_readv() in std.debug.MemoryAccessor.
Diffstat (limited to 'lib/std/Build/Fuzz/WebServer.zig')
0 files changed, 0 insertions, 0 deletions