[Libreoffice-commits] core.git: sal/osl
Noel Grandin
noel at peralex.com
Tue Jan 10 08:50:53 UTC 2017
sal/osl/w32/backtrace.cxx | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
New commits:
commit f207e13136f4ff211cd1fe0c9703f35655a23d38
Author: Noel Grandin <noel at peralex.com>
Date: Tue Jan 10 10:46:55 2017 +0200
fix windows build
VS2013 does not like stack-allocated arrays with runtime size
Change-Id: I58bd3a9feb6e2bef1b4a4f775669e5e3e03de5f7
Reviewed-on: https://gerrit.libreoffice.org/32922
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sal/osl/w32/backtrace.cxx b/sal/osl/w32/backtrace.cxx
index e4e71c2..6c24698 100644
--- a/sal/osl/w32/backtrace.cxx
+++ b/sal/osl/w32/backtrace.cxx
@@ -16,6 +16,7 @@
#include <DbgHelp.h>
#include <rtl/ustrbuf.hxx>
+#include <memory>
rtl_uString *osl_backtraceAsString(int maxNoStackFramesToDisplay)
{
@@ -24,8 +25,8 @@ rtl_uString *osl_backtraceAsString(int maxNoStackFramesToDisplay)
HANDLE hProcess = GetCurrentProcess();
SymInitialize( hProcess, nullptr, true );
- void * aStack[ maxNoStackFramesToDisplay ];
- sal_uInt32 nFrames = CaptureStackBackTrace( 0, maxNoStackFramesToDisplay, aStack, nullptr );
+ std::unique_ptr<void*[]> aStack(new void*[ maxNoStackFramesToDisplay ]);
+ sal_uInt32 nFrames = CaptureStackBackTrace( 0, maxNoStackFramesToDisplay, aStack.get(), nullptr );
SYMBOL_INFO * pSymbol;
pSymbol = static_cast<SYMBOL_INFO *>(calloc( sizeof( SYMBOL_INFO ) + 1024 * sizeof( char ), 1 ));
More information about the Libreoffice-commits
mailing list