diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-10-02 23:57:30 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-10-02 23:57:30 -0400 |
| commit | baea09062482674220a3686d488a283e6b9b8821 (patch) | |
| tree | 33df470af1db2be53fabac50762c375951acb84e /src/parse | |
| parent | 126050a6357d7ec1fd9901256de50923b6dd7c49 (diff) | |
| parent | 597699243a6f935231ad83e63d22bf6ff9e4e547 (diff) | |
Merge branch 'zero-nones' into dev
Diffstat (limited to 'src/parse')
| -rw-r--r-- | src/parse/files.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/parse/files.c b/src/parse/files.c index caecbbe8..5e0dc29c 100644 --- a/src/parse/files.c +++ b/src/parse/files.c @@ -17,7 +17,6 @@ #include "statements.h" #include "text.h" #include "typedefs.h" -#include "types.h" #include "utils.h" // The cache of {filename -> parsed AST} will hold at most this many entries: @@ -67,7 +66,7 @@ ast_t *parse_file(const char *path, jmp_buf *on_err) { // hold more than PARSE_CACHE_SIZE entries (see below), but each entry's // AST holds onto a reference to the file it came from, so they could // potentially be somewhat large. - static Table_t cached = {}; + static Table_t cached = EMPTY_TABLE; ast_t *ast = Table$str_get(cached, path); if (ast) return ast; @@ -106,6 +105,7 @@ ast_t *parse_file(const char *path, jmp_buf *on_err) { const char *path; ast_t *ast; } *to_remove = Table$entry(cached, 1); + assert(to_remove); Table$str_remove(&cached, to_remove->path); } |
