From 2b10ebad76f6a04c9fb8511accbfd19853d0b1f1 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 7 Feb 2013 16:31:56 +0100 Subject: [PATCH] Implement thread stack base determination with the MSVC + x86 combination Change-Id: Idfb4961cc15f9740d3f3bdd126424d3fa7b3e454 Reviewed-by: Lars Knoll --- src/v4/qv4mm.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/v4/qv4mm.cpp b/src/v4/qv4mm.cpp index 81d775f..f29381b 100644 --- a/src/v4/qv4mm.cpp +++ b/src/v4/qv4mm.cpp @@ -347,6 +347,15 @@ void MemoryManager::collectFromStack() const quintptr *top = static_cast(stackBottom) + stackSize/sizeof(quintptr); #endif +#elif OS(WINDOWS) +#if COMPILER(MSVC) + NT_TIB *tib; + __asm { + mov eax, fs:[0x18] + mov [tib], eax + } +#endif + quintptr *top = static_cast(tib->StackBase); #endif // qDebug() << "stack:" << hex << stackTop << stackSize << (stackTop + stackSize); -- 2.7.4