Bug 1230910 Use gcc intrinsic for return address on MinGW
MozReview-Commit-ID: BqGpQycTtf5
--- a/dom/media/gmp/rlz/GMPDeviceBinding.cpp
+++ b/dom/media/gmp/rlz/GMPDeviceBinding.cpp
@@ -57,17 +57,21 @@ namespace gmp {
#if defined(XP_WIN) && defined(HASH_NODE_ID_WITH_DEVICE_ID)
MOZ_NEVER_INLINE
static bool
GetStackAfterCurrentFrame(uint8_t** aOutTop, uint8_t** aOutBottom)
{
// "Top" of the free space on the stack is directly after the memory
// holding our return address.
+ #ifndef __MINGW32__
uint8_t* top = (uint8_t*)_AddressOfReturnAddress();
+ #else
+ uint8_t* top = (uint8_t*)__builtin_return_address(0);
+ #endif
// Look down the stack until we find the guard page...
MEMORY_BASIC_INFORMATION memInfo = {0};
uint8_t* bottom = top;
while (1) {
if (!VirtualQuery(bottom, &memInfo, sizeof(memInfo))) {
return false;
}