diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2018-11-12 09:27:33 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2018-11-14 10:51:06 +0000 |
commit | 89a1d4ff3f829635d80a90112f6b2d44cc274b1b (patch) | |
tree | f6a636a7e0e283667b2514e3e5f07b0ca1f3e3f7 /src/3rdparty | |
parent | 80d26c15080c92012f0a51f7675d3c70ad56a8bd (diff) |
masm: Don't call fclose(nullptr) and initialize statics
Otherwise our disassembler crashes on QV4_SHOW_ASM.
Change-Id: I63b20c0932452fe852773f91ebecaa7f31dd040d
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/3rdparty')
-rw-r--r-- | src/3rdparty/masm/stubs/WTFStubs.cpp | 2 | ||||
-rw-r--r-- | src/3rdparty/masm/wtf/FilePrintStream.cpp | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/3rdparty/masm/stubs/WTFStubs.cpp b/src/3rdparty/masm/stubs/WTFStubs.cpp index b26d10b3ab..f408b355f5 100644 --- a/src/3rdparty/masm/stubs/WTFStubs.cpp +++ b/src/3rdparty/masm/stubs/WTFStubs.cpp @@ -66,7 +66,7 @@ uint32_t cryptographicallyRandomNumber() return 0; } -static FilePrintStream* s_dataFile; +static FilePrintStream* s_dataFile = nullptr; void setDataFile(FilePrintStream *ps) { diff --git a/src/3rdparty/masm/wtf/FilePrintStream.cpp b/src/3rdparty/masm/wtf/FilePrintStream.cpp index a56b36526e..8ddf8487bd 100644 --- a/src/3rdparty/masm/wtf/FilePrintStream.cpp +++ b/src/3rdparty/masm/wtf/FilePrintStream.cpp @@ -39,7 +39,8 @@ FilePrintStream::~FilePrintStream() { if (m_adoptionMode == Borrow) return; - fclose(m_file); + if (m_file) + fclose(m_file); } std::unique_ptr<FilePrintStream> FilePrintStream::open(const char* filename, const char* mode) |