This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 9800032722 checkasm/aarch64: fix operator precedence bug in ARG_STACK
9800032722 is described below

commit 9800032722e6954b982ef1186089e45bddf2a36e
Author:     Zhao Zhili <[email protected]>
AuthorDate: Tue Mar 17 16:34:26 2026 +0800
Commit:     Zhao Zhili <[email protected]>
CommitDate: Wed Mar 18 13:48:18 2026 +0000

    checkasm/aarch64: fix operator precedence bug in ARG_STACK
    
    The expression ((8*(MAX_ARGS - 8) + 15) & ~15 + 16)
    evaluates to zero on Apple platforms due to assembler operator
    precedence differences. LLVM's integrated assembler uses different
    precedence rules depending on the target:
    
    unsigned AsmParser::getBinOpPrecedence(AsmToken::TokenKind K,
                                       MCBinaryExpr::Opcode &Kind) {
        bool ShouldUseLogicalShr = MAI.shouldUseLogicalShr();
        return IsDarwin ? getDarwinBinOpPrecedence(K, Kind, ShouldUseLogicalShr)
                  : getGNUBinOpPrecedence(MAI, K, Kind, ShouldUseLogicalShr);
    }
    
    In Darwin mode (Apple targets), arithmetic operators (+, -) have
    higher precedence than bitwise operators (&, |, ^), similar to C.
    In GNU mode (ELF targets), bitwise operators have higher precedence
    than arithmetic operators.
---
 tests/checkasm/aarch64/checkasm.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/checkasm/aarch64/checkasm.S 
b/tests/checkasm/aarch64/checkasm.S
index 6d3c738801..4b2db86a9e 100644
--- a/tests/checkasm/aarch64/checkasm.S
+++ b/tests/checkasm/aarch64/checkasm.S
@@ -68,7 +68,7 @@ function checkasm_stack_clobber, export=1
 endfunc
 
 // + 16 for stack canary reference
-#define ARG_STACK ((8*(MAX_ARGS - 8) + 15) & ~15 + 16)
+#define ARG_STACK (((8*(MAX_ARGS - 8) + 15) & ~15) + 16)
 
 function checkasm_checked_call, export=1
         stp             x29, x30, [sp, #-16]!

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to