http://www.riscos.info/bugzilla3/show_bug.cgi?id=205
Summary: __gcc_alloca_restore() can erroneously delete chunks
associated with a parent stack frame
Product: GCC/GCCSDK
Version: other
Platform: Other
OS/Version: RISC OS
Status: NEW
Severity: normal
Priority: P1
Component: Unixlib and SharedCLibrary
AssignedTo: [email protected]
ReportedBy: [email protected]
Estimated Hours: 0.0
Created an attachment (id=76)
--> (http://www.riscos.info/bugzilla3/attachment.cgi?id=76)
Patch to fix __gcc_alloca_restore()
If a function directly or indirectly uses alloca() then GCC will emit code to
call __gcc_alloca_restore() during the function epilogue. However functions
with multiple flows of control sometimes result in __gcc_alloca_restore() being
called without any calls to alloca() having been made for that stack frame.
With the current implementation of __gcc_alloca_restore() this works fine if
this is the first function in the stack trace to use alloca(). But if alloca()
has been used by a parent stack frame then __gcc_alloca_restore() will
malfunction and delete that stack frame's data. The attached patch fixes this
issue, for both UnixLib and the SCL.
A simple test program to demonstrate the issue can be found in this mailing
list message: http://www.riscos.info/pipermail/gcc/2010-May/005284.html
--
Configure bugmail: http://www.riscos.info/bugzilla3/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
_______________________________________________
GCCSDK mailing list [email protected]
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK