From 5f7a40856372142372d3b67c9dd737373932f088 Mon Sep 17 00:00:00 2001 From: fanzha02 Date: Tue, 21 Nov 2023 06:52:54 +0000 Subject: [PATCH] runtime: change the name of variables in asan-related assembly functions Variables in functions implemented in assembly should have the same names as when they were defined. The names of some variables in asan-related assembly functions do not follow the above rule, which will cause the runtime test to fail. This CL fixes this issue. Updates #64257 Change-Id: I261f4db807d25e460513ef1c92cd1b707cdd1a16 Reviewed-on: https://go-review.googlesource.com/c/go/+/543837 Run-TryBot: Fannie Zhang TryBot-Result: Gopher Robot Reviewed-by: Cherry Mui Reviewed-by: Bryan Mills --- src/runtime/asan_amd64.s | 10 +++++----- src/runtime/asan_arm64.s | 10 +++++----- src/runtime/asan_loong64.s | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/runtime/asan_amd64.s b/src/runtime/asan_amd64.s index ac09ec1105..195faf4e6d 100644 --- a/src/runtime/asan_amd64.s +++ b/src/runtime/asan_amd64.s @@ -28,7 +28,7 @@ // func runtime·doasanread(addr unsafe.Pointer, sz, sp, pc uintptr) TEXT runtime·doasanread(SB), NOSPLIT, $0-32 MOVQ addr+0(FP), RARG0 - MOVQ size+8(FP), RARG1 + MOVQ sz+8(FP), RARG1 MOVQ sp+16(FP), RARG2 MOVQ pc+24(FP), RARG3 // void __asan_read_go(void *addr, uintptr_t sz, void *sp, void *pc); @@ -38,7 +38,7 @@ TEXT runtime·doasanread(SB), NOSPLIT, $0-32 // func runtime·doasanwrite(addr unsafe.Pointer, sz, sp, pc uintptr) TEXT runtime·doasanwrite(SB), NOSPLIT, $0-32 MOVQ addr+0(FP), RARG0 - MOVQ size+8(FP), RARG1 + MOVQ sz+8(FP), RARG1 MOVQ sp+16(FP), RARG2 MOVQ pc+24(FP), RARG3 // void __asan_write_go(void *addr, uintptr_t sz, void *sp, void *pc); @@ -48,7 +48,7 @@ TEXT runtime·doasanwrite(SB), NOSPLIT, $0-32 // func runtime·asanunpoison(addr unsafe.Pointer, sz uintptr) TEXT runtime·asanunpoison(SB), NOSPLIT, $0-16 MOVQ addr+0(FP), RARG0 - MOVQ size+8(FP), RARG1 + MOVQ sz+8(FP), RARG1 // void __asan_unpoison_go(void *addr, uintptr_t sz); MOVQ $__asan_unpoison_go(SB), AX JMP asancall<>(SB) @@ -56,7 +56,7 @@ TEXT runtime·asanunpoison(SB), NOSPLIT, $0-16 // func runtime·asanpoison(addr unsafe.Pointer, sz uintptr) TEXT runtime·asanpoison(SB), NOSPLIT, $0-16 MOVQ addr+0(FP), RARG0 - MOVQ size+8(FP), RARG1 + MOVQ sz+8(FP), RARG1 // void __asan_poison_go(void *addr, uintptr_t sz); MOVQ $__asan_poison_go(SB), AX JMP asancall<>(SB) @@ -64,7 +64,7 @@ TEXT runtime·asanpoison(SB), NOSPLIT, $0-16 // func runtime·asanregisterglobals(addr unsafe.Pointer, n uintptr) TEXT runtime·asanregisterglobals(SB), NOSPLIT, $0-16 MOVQ addr+0(FP), RARG0 - MOVQ size+8(FP), RARG1 + MOVQ n+8(FP), RARG1 // void __asan_register_globals_go(void *addr, uintptr_t n); MOVQ $__asan_register_globals_go(SB), AX JMP asancall<>(SB) diff --git a/src/runtime/asan_arm64.s b/src/runtime/asan_arm64.s index 697c98206e..dfa3f81bf2 100644 --- a/src/runtime/asan_arm64.s +++ b/src/runtime/asan_arm64.s @@ -17,7 +17,7 @@ // func runtime·doasanread(addr unsafe.Pointer, sz, sp, pc uintptr) TEXT runtime·doasanread(SB), NOSPLIT, $0-32 MOVD addr+0(FP), RARG0 - MOVD size+8(FP), RARG1 + MOVD sz+8(FP), RARG1 MOVD sp+16(FP), RARG2 MOVD pc+24(FP), RARG3 // void __asan_read_go(void *addr, uintptr_t sz, void *sp, void *pc); @@ -27,7 +27,7 @@ TEXT runtime·doasanread(SB), NOSPLIT, $0-32 // func runtime·doasanwrite(addr unsafe.Pointer, sz, sp, pc uintptr) TEXT runtime·doasanwrite(SB), NOSPLIT, $0-32 MOVD addr+0(FP), RARG0 - MOVD size+8(FP), RARG1 + MOVD sz+8(FP), RARG1 MOVD sp+16(FP), RARG2 MOVD pc+24(FP), RARG3 // void __asan_write_go(void *addr, uintptr_t sz, void *sp, void *pc); @@ -37,7 +37,7 @@ TEXT runtime·doasanwrite(SB), NOSPLIT, $0-32 // func runtime·asanunpoison(addr unsafe.Pointer, sz uintptr) TEXT runtime·asanunpoison(SB), NOSPLIT, $0-16 MOVD addr+0(FP), RARG0 - MOVD size+8(FP), RARG1 + MOVD sz+8(FP), RARG1 // void __asan_unpoison_go(void *addr, uintptr_t sz); MOVD $__asan_unpoison_go(SB), FARG JMP asancall<>(SB) @@ -45,7 +45,7 @@ TEXT runtime·asanunpoison(SB), NOSPLIT, $0-16 // func runtime·asanpoison(addr unsafe.Pointer, sz uintptr) TEXT runtime·asanpoison(SB), NOSPLIT, $0-16 MOVD addr+0(FP), RARG0 - MOVD size+8(FP), RARG1 + MOVD sz+8(FP), RARG1 // void __asan_poison_go(void *addr, uintptr_t sz); MOVD $__asan_poison_go(SB), FARG JMP asancall<>(SB) @@ -53,7 +53,7 @@ TEXT runtime·asanpoison(SB), NOSPLIT, $0-16 // func runtime·asanregisterglobals(addr unsafe.Pointer, n uintptr) TEXT runtime·asanregisterglobals(SB), NOSPLIT, $0-16 MOVD addr+0(FP), RARG0 - MOVD size+8(FP), RARG1 + MOVD n+8(FP), RARG1 // void __asan_register_globals_go(void *addr, uintptr_t n); MOVD $__asan_register_globals_go(SB), FARG JMP asancall<>(SB) diff --git a/src/runtime/asan_loong64.s b/src/runtime/asan_loong64.s index 70386fcb6e..0034a31687 100644 --- a/src/runtime/asan_loong64.s +++ b/src/runtime/asan_loong64.s @@ -17,7 +17,7 @@ // func runtime·doasanread(addr unsafe.Pointer, sz, sp, pc uintptr) TEXT runtime·doasanread(SB), NOSPLIT, $0-32 MOVV addr+0(FP), RARG0 - MOVV size+8(FP), RARG1 + MOVV sz+8(FP), RARG1 MOVV sp+16(FP), RARG2 MOVV pc+24(FP), RARG3 // void __asan_read_go(void *addr, uintptr_t sz, void *sp, void *pc); @@ -27,7 +27,7 @@ TEXT runtime·doasanread(SB), NOSPLIT, $0-32 // func runtime·doasanwrite(addr unsafe.Pointer, sz, sp, pc uintptr) TEXT runtime·doasanwrite(SB), NOSPLIT, $0-32 MOVV addr+0(FP), RARG0 - MOVV size+8(FP), RARG1 + MOVV sz+8(FP), RARG1 MOVV sp+16(FP), RARG2 MOVV pc+24(FP), RARG3 // void __asan_write_go(void *addr, uintptr_t sz, void *sp, void *pc); @@ -37,7 +37,7 @@ TEXT runtime·doasanwrite(SB), NOSPLIT, $0-32 // func runtime·asanunpoison(addr unsafe.Pointer, sz uintptr) TEXT runtime·asanunpoison(SB), NOSPLIT, $0-16 MOVV addr+0(FP), RARG0 - MOVV size+8(FP), RARG1 + MOVV sz+8(FP), RARG1 // void __asan_unpoison_go(void *addr, uintptr_t sz); MOVV $__asan_unpoison_go(SB), FARG JMP asancall<>(SB) @@ -45,7 +45,7 @@ TEXT runtime·asanunpoison(SB), NOSPLIT, $0-16 // func runtime·asanpoison(addr unsafe.Pointer, sz uintptr) TEXT runtime·asanpoison(SB), NOSPLIT, $0-16 MOVV addr+0(FP), RARG0 - MOVV size+8(FP), RARG1 + MOVV sz+8(FP), RARG1 // void __asan_poison_go(void *addr, uintptr_t sz); MOVV $__asan_poison_go(SB), FARG JMP asancall<>(SB) @@ -53,7 +53,7 @@ TEXT runtime·asanpoison(SB), NOSPLIT, $0-16 // func runtime·asanregisterglobals(addr unsafe.Pointer, n uintptr) TEXT runtime·asanregisterglobals(SB), NOSPLIT, $0-16 MOVV addr+0(FP), RARG0 - MOVV size+8(FP), RARG1 + MOVV n+8(FP), RARG1 // void __asan_register_globals_go(void *addr, uintptr_t n); MOVV $__asan_register_globals_go(SB), FARG JMP asancall<>(SB)