aboutsummaryrefslogtreecommitdiff
path: root/lib/std/start.zig
diff options
context:
space:
mode:
authorKoakuma <koachan@protonmail.com>2023-09-17 19:18:59 +0700
committerAndrew Kelley <andrew@ziglang.org>2023-10-12 16:13:32 -0700
commit375bb5f4a1ebfc1d002e252d97077da7e1db7e4d (patch)
treee216296d7a47dd4c53117a96abac506f844bba43 /lib/std/start.zig
parent67ee68fc9eb02b78d7a2c26c617a16f60f91012d (diff)
downloadzig-375bb5f4a1ebfc1d002e252d97077da7e1db7e4d.tar.gz
zig-375bb5f4a1ebfc1d002e252d97077da7e1db7e4d.zip
lib: Fix asm code in _start for SPARC
SPARCs have delayed branches, that is, it will unconditionally run the next instruction following a branch. Slightly reorder the _start code sequence to prevent it from accidentally executing stray instructions, which may result in odd program behavior.
Diffstat (limited to 'lib/std/start.zig')
-rw-r--r--lib/std/start.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/std/start.zig b/lib/std/start.zig
index 36379960a4..63675c1074 100644
--- a/lib/std/start.zig
+++ b/lib/std/start.zig
@@ -327,8 +327,8 @@ fn _start() callconv(.Naked) noreturn {
// argc is stored after a register window (16 registers) plus stack bias
\\ mov %%g0, %%i6
\\ add %%o6, 2175, %%l0
- \\ stx %%l0, %[argc_argv_ptr]
\\ ba %[posixCallMainAndExit]
+ \\ stx %%l0, %[argc_argv_ptr]
,
else => @compileError("unsupported arch"),
}