Fix invalid use after free in compileTopLevelDocument.

This commit is contained in:
Matthieu Nottale 2016-06-13 20:44:02 +02:00
parent 365e399036
commit 41aef27643

View file

@ -1697,8 +1697,9 @@ void MainWindow::compileTopLevelDocument()
delete this->root_module;
this->root_module = NULL;
auto fnameba = this->fileName.toLocal8Bit();
const char* fname =
this->fileName.isEmpty() ? "" : this->fileName.toLocal8Bit();
this->fileName.isEmpty() ? "" : fnameba;
this->root_module = parse(fulltext.c_str(), fs::path(fname), false);
}