diff options
author | Flavian Kaufmann <flavian@flaviankaufmann.ch> | 2025-05-26 22:11:16 +0200 |
---|---|---|
committer | Flavian Kaufmann <flavian@flaviankaufmann.ch> | 2025-05-26 22:11:16 +0200 |
commit | b5067e66cc320e6fbd5cf9c9af8788bcb905993d (patch) | |
tree | 4d0215e9bf41f0edefc38e43267df4f349f16a46 /src/driver.c | |
parent | 041fcfd0b17e7a6f654fc155108847aac8293144 (diff) | |
download | imp-master.tar.gz imp-master.zip |
Diffstat (limited to 'src/driver.c')
-rw-r--r-- | src/driver.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/driver.c b/src/driver.c index c43b899..d8cd143 100644 --- a/src/driver.c +++ b/src/driver.c @@ -20,6 +20,7 @@ int imp_driver_interpret_file (IMP_InterpreterContext *context, const char *path yyin = fopen(path, "r"); if (!yyin) return -1; yyrestart(yyin); + ast_root = NULL; if (yyparse()) { imp_ast_destroy(ast_root); fclose(yyin); @@ -37,6 +38,7 @@ int imp_driver_interpret_file (IMP_InterpreterContext *context, const char *path int imp_driver_interpret_str (IMP_InterpreterContext *context, const char *str) { YY_BUFFER_STATE buf = yy_scan_string(str); + ast_root = NULL; if (yyparse()) { imp_ast_destroy(ast_root); yy_delete_buffer(buf); |