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>
This commit is contained in:
Ulf Hermann 2018-11-12 09:27:33 +01:00
parent 80d26c1508
commit 89a1d4ff3f
2 changed files with 3 additions and 2 deletions

View File

@ -66,7 +66,7 @@ uint32_t cryptographicallyRandomNumber()
return 0;
}
static FilePrintStream* s_dataFile;
static FilePrintStream* s_dataFile = nullptr;
void setDataFile(FilePrintStream *ps)
{

View File

@ -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)