[LLVMbugs] [Bug 11019] New: ARM stack corruption due to byval parameter

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Sep 26 19:26:48 PDT 2011


           Summary: ARM stack corruption due to byval parameter
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: ARM
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: pdox at google.com
                CC: llvmbugs at cs.uiuc.edu

Created an attachment (id=7354)
 --> (http://llvm.org/bugs/attachment.cgi?id=7354)

The attached example demonstrates how the presence of a byval argument at a
callsite can corrupt the caller's stack. The return value of main will be 0
instead of the correct value of 100.

This bug is caused by a disagreement between CCInfo and the ByVal handling code
about how large the call frame is going to be.

CCInfo.getNextStackOffset() is returning 4, thus 4 bytes are reserved on the
stack for the call sequence. However, the actual byval expansion writes 8 bytes
above SP.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list