diff --git a/src/platform-win32.cc b/src/platform-win32.cc index d55cde91f8..bee517364a 100644 --- a/src/platform-win32.cc +++ b/src/platform-win32.cc @@ -1251,10 +1251,10 @@ int OS::StackWalk(Vector frames) { DWORD64 symbol_displacement; SmartPointer symbol( NewArray(kStackWalkMaxNameLen)); - if (!symbol) return kStackWalkError; // Out of memory. + if (symbol.is_empty()) return kStackWalkError; // Out of memory. memset(*symbol, 0, sizeof(IMAGEHLP_SYMBOL64) + kStackWalkMaxNameLen); - symbol->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL64); - symbol->MaxNameLength = kStackWalkMaxNameLen; + (*symbol)->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL64); + (*symbol)->MaxNameLength = kStackWalkMaxNameLen; ok = _SymGetSymFromAddr64(process_handle, // hProcess stack_frame.AddrPC.Offset, // Address &symbol_displacement, // Displacement @@ -1276,13 +1276,13 @@ int OS::StackWalk(Vector frames) { SNPrintF(MutableCStrVector(frames[frames_count].text, kStackWalkMaxTextLen), "%s %s:%d:%d", - symbol->Name, Line.FileName, Line.LineNumber, + (*symbol)->Name, Line.FileName, Line.LineNumber, line_displacement); } else { SNPrintF(MutableCStrVector(frames[frames_count].text, kStackWalkMaxTextLen), "%s", - symbol->Name); + (*symbol)->Name); } // Make sure line termination is in place. frames[frames_count].text[kStackWalkMaxTextLen - 1] = '\0';