1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-27 08:43:40 -07:00

Force stackhot not to be inlined, avoiding the problem described in <https://info.ravenbrook.com/mail/2018/07/11/09-48-49/0/>

Copied from Perforce
 Change: 194577
This commit is contained in:
Gareth Rees 2018-07-11 10:57:28 +01:00
parent ace93858db
commit 60b4e0639b
3 changed files with 26 additions and 5 deletions

View file

@ -278,8 +278,20 @@
#define ATTRIBUTE_NO_SANITIZE_ADDRESS
#endif
/* Attribute for functions that must not be inlined.
* GCC: <http://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html>
* MSVC: <https://docs.microsoft.com/en-us/cpp/cpp/noinline>
*/
#if defined(MPS_BUILD_GC) || defined(MPS_BUILD_LL)
#define ATTRIBUTE_NOINLINE __attribute__((__noinline__))
#elif defined(MPS_BUILD_MV)
#define ATTRIBUTE_NOINLINE __declspec(noinline)
#else
#define ATTRIBUTE_NOINLINE
#endif
/* Attribute for functions that do not return.
* GCC: <http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html>
* GCC: <http://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html>
* Clang: <http://clang.llvm.org/docs/AttributeReference.html#id1>
*/
#if defined(MPS_BUILD_GC) || defined(MPS_BUILD_LL)
@ -289,7 +301,7 @@
#endif
/* Attribute for functions that may be unused in some build configurations.
* GCC: <http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html>
* GCC: <http://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html>
*
* This attribute must be applied to all Check functions, otherwise
* the RASH variety fails to compile with -Wunused-function. (It

View file

@ -32,6 +32,7 @@ SRCID(ss, "$Id$");
* is a hot stack pointer. See design.mps.ss.sol.stack.hot.
*/
ATTRIBUTE_NOINLINE
void StackHot(void **stackOut)
{
*stackOut = &stackOut;