From: Keith Randall Date: Sat, 19 Jul 2025 16:34:04 +0000 (-0700) Subject: runtime: fix asan wrapper for riscv64 X-Git-Tag: go1.25rc3~5^2~7 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5dac42363b;p=gostls13.git runtime: fix asan wrapper for riscv64 Make sure we keep the M in X21. The instruction at line 87 needs to be loading from the M, not from the gsignal. Fixes #73979, maybe? Change-Id: I3aba1c35454636138b305bca26e20dbc8e6b1d6e Reviewed-on: https://go-review.googlesource.com/c/go/+/688975 Reviewed-by: Joel Sing Reviewed-by: Michael Pratt Reviewed-by: Keith Randall Reviewed-by: Meng Zhuo Reviewed-by: Mark Ryan Auto-Submit: Keith Randall LUCI-TryBot-Result: Go LUCI --- diff --git a/src/runtime/asan_riscv64.s b/src/runtime/asan_riscv64.s index eb76e61ffb..5a333361dd 100644 --- a/src/runtime/asan_riscv64.s +++ b/src/runtime/asan_riscv64.s @@ -81,13 +81,13 @@ TEXT asancall<>(SB), NOSPLIT, $0-0 MOV g_m(g), X21 // Switch to g0 stack if we aren't already on g0 or gsignal. - MOV m_gsignal(X21), X21 - BEQ X21, g, call + MOV m_gsignal(X21), X22 + BEQ X22, g, call - MOV m_g0(X21), X21 - BEQ X21, g, call + MOV m_g0(X21), X22 + BEQ X22, g, call - MOV (g_sched+gobuf_sp)(X21), X2 + MOV (g_sched+gobuf_sp)(X22), X2 call: JALR RA, X14