diff options
author | Michael BrĂ¼ning <michael.bruning@digia.com> | 2014-05-23 14:00:58 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-06-04 13:51:35 +0200 |
commit | 2748cfb515a8668695d4962eaa3d7ce76504c97c (patch) | |
tree | b5a4fbe3a5dab988ca7dfa4f631e88421ad52f98 | |
parent | 26f7b24daa8810d13d0582b8a160a3bf8e5d42c2 (diff) | |
download | qtwebkit-2748cfb515a8668695d4962eaa3d7ce76504c97c.tar.gz |
Account for extra uncommitted memory size also in ASSERTs.
The fix for the stack layout in applications that are loading .NET
libraries in addition did not update the assertions that make sure
that the actual end of the stack is where it should be.
Task-number: QTBUG-38067
Change-Id: Ib8be1228bc9f10baf8d3484bb280a3a5c8021ab8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
-rw-r--r-- | Source/WTF/wtf/StackBounds.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/WTF/wtf/StackBounds.cpp b/Source/WTF/wtf/StackBounds.cpp index c1a163a2d..061cae7ad 100644 --- a/Source/WTF/wtf/StackBounds.cpp +++ b/Source/WTF/wtf/StackBounds.cpp @@ -186,6 +186,7 @@ void StackBounds::initialize() MEMORY_BASIC_INFORMATION uncommittedMemory; VirtualQuery(stackOrigin.AllocationBase, &uncommittedMemory, sizeof(uncommittedMemory)); SIZE_T extraGuardPageRegionSize = 0; + SIZE_T extraUncommittedMemoryRegionSize = 0; if (uncommittedMemory.Protect & PAGE_GUARD) { extraGuardPageRegionSize = uncommittedMemory.RegionSize; VirtualQuery(static_cast<char*>(uncommittedMemory.BaseAddress) + uncommittedMemory.RegionSize, &uncommittedMemory, sizeof(uncommittedMemory)); @@ -199,6 +200,7 @@ void StackBounds::initialize() // Within a .NET application the stack layout will sometimes be different. It will contain 2 blocks of uncommited memory instead of one. // This can be reproduced always on WindowsXP and sometimes on Windows 7 // So search one block further if we didn't find the guard page yet. + extraUncommittedMemoryRegionSize = guardPage.RegionSize; VirtualQuery(static_cast<char*>(guardPage.BaseAddress) + guardPage.RegionSize, &guardPage, sizeof(guardPage)); } @@ -210,7 +212,7 @@ void StackBounds::initialize() VirtualQuery(static_cast<char*>(guardPage.BaseAddress) + guardPage.RegionSize, &committedMemory, sizeof(committedMemory)); ASSERT(committedMemory.State == MEM_COMMIT); - void* computedEnd = static_cast<char*>(m_origin) - (uncommittedMemory.RegionSize + extraGuardPageRegionSize + guardPage.RegionSize + committedMemory.RegionSize); + void* computedEnd = static_cast<char*>(m_origin) - (uncommittedMemory.RegionSize + extraUncommittedMemoryRegionSize + extraGuardPageRegionSize + guardPage.RegionSize + committedMemory.RegionSize); ASSERT(stackOrigin.AllocationBase == uncommittedMemory.AllocationBase); ASSERT(stackOrigin.AllocationBase == guardPage.AllocationBase); |