File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -459,6 +459,16 @@ void Profiler::DumpStackTrace(void* context) {
459
459
#endif
460
460
}
461
461
462
+ // We need the call to DumpStackTrace to be a non-tail call and this function to
463
+ // not get the shrink wrap optimization, otherwise the frame from which we start
464
+ // our stack walk may be clobbered before the stack walk begins.
465
+ #ifdef _MSC_VER
466
+ #pragma optimize("", off)
467
+ #elif __clang__
468
+ __attribute__ ((optnone))
469
+ #elif __GNUC__
470
+ __attribute__ ((optimize(0 )))
471
+ #endif
462
472
void Profiler::DumpStackTrace (bool for_crash) {
463
473
uintptr_t sp = OSThread::GetCurrentStackPointer ();
464
474
uintptr_t fp = 0 ;
@@ -468,6 +478,9 @@ void Profiler::DumpStackTrace(bool for_crash) {
468
478
469
479
DumpStackTrace (sp, fp, pc, for_crash);
470
480
}
481
+ #ifdef _MSC_VER
482
+ #pragma optimize("", on)
483
+ #endif
471
484
472
485
static void DumpCompilerState (Thread* thread) {
473
486
#if !defined(DART_PRECOMPILED_RUNTIME)
You can’t perform that action at this time.
0 commit comments