bug fixed

fixed SIGSEGV when failed to load file in nasal_lexer::openfile
This commit is contained in:
Valk Richard Li
2021-06-06 19:17:02 +08:00
parent b25a1bc3f4
commit 9f2c31149a
3 changed files with 9 additions and 4 deletions
+4 -3
View File
@@ -87,18 +87,19 @@ nasal_ast nasal_import::file_import(nasal_ast& node)
import_lex.scanner();
if(import_lex.get_error())
{
this->die(filename,"lexer");
die(filename,"lexer");
return tmp;
}
import_par.set_toklist(import_lex.get_token_list());
import_lex.get_token_list().clear();
import_par.main_process();
if(import_par.get_error())
{
this->die(filename,"parser");
die(filename,"parser");
return tmp;
}
tmp=import_par.get_root();
import_par.get_root().clear();
// check if tmp has 'import'
return load(tmp);
}