Module: wine Branch: master Commit: 9d1175a4649706d8d46a7bd8d5aa291b6528bfc4 URL: https://gitlab.winehq.org/wine/wine/-/commit/9d1175a4649706d8d46a7bd8d5aa291...
Author: Rémi Bernon rbernon@codeweavers.com Date: Fri Nov 4 19:47:35 2022 +0100
winebuild: Avoid calling asm_name twice in function arguments.
It returns a static buffer pointer and will free the first returned pointer on the second call.
---
tools/winebuild/utils.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c index 16d9c28d918..2148dc58a95 100644 --- a/tools/winebuild/utils.c +++ b/tools/winebuild/utils.c @@ -1021,8 +1021,11 @@ const char *asm_globl( const char *func ) break; case PLATFORM_MINGW: case PLATFORM_WINDOWS: - buffer = strmake( "\t.globl %s\n%s:", asm_name( func ), asm_name( func ) ); + { + const char *name = asm_name( func ); + buffer = strmake( "\t.globl %s\n%s:", name, name ); break; + } default: buffer = strmake( "\t.globl %s\n\t.hidden %s\n%s:", func, func, func ); break;