Bug 1566814 - nsXPTCStubBase::Stub##n functions shouldn't be build with stack-protector in nxptcstubs_sparc64_openbsd.cpp r=froydnj

Differential Revision: https://phabricator.services.mozilla.com/D39148

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Petr Sumbera 2019-07-24 09:54:10 +00:00
parent e7113463d0
commit f3628fdebc

View File

@ -87,8 +87,16 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint64_t methodIndex, uint64_t* args)
extern "C" nsresult SharedStub(int, int*);
/*
* Avoid GCC stack protector to wipe out input registers since the compiler
* thinks the function takes no arguments.
*/
#ifndef nostackprotector
#define nostackprotector __attribute__((__optimize__("no-stack-protector")))
#endif
#define STUB_ENTRY(n) \
nsresult nsXPTCStubBase::Stub##n() \
nsresult nostackprotector nsXPTCStubBase::Stub##n() \
{ \
int dummy; /* defeat tail-call optimization */ \
return SharedStub(n, &dummy); \