diff options
author | Noel Grandin <noel@peralex.com> | 2017-01-10 10:46:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-10 08:50:30 +0000 |
commit | f207e13136f4ff211cd1fe0c9703f35655a23d38 (patch) | |
tree | 20e3844666e6bbcf396c265de04ba46cacce01d9 /sal | |
parent | f89d7692a36cc3c65a27690d7bb9e876dc4644bc (diff) |
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@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/w32/backtrace.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sal/osl/w32/backtrace.cxx b/sal/osl/w32/backtrace.cxx index e4e71c26ba3c..6c24698b1aa3 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 )); |