aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2018-11-12 09:27:33 +0100
committerLars Knoll <lars.knoll@qt.io>2018-11-16 21:09:15 +0000
commit78745e5e778665f3a015e9cae109e77974d7fbe4 (patch)
tree90b93bbb216626a13d900890f09a715050307afd
parentae6f850ab50bfe07625df4f810c7bf975c224877 (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> (cherry picked from commit 89a1d4ff3f829635d80a90112f6b2d44cc274b1b) Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r--src/3rdparty/masm/stubs/WTFStubs.cpp2
-rw-r--r--src/3rdparty/masm/wtf/FilePrintStream.cpp3
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)