kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

commit 103b2604d4bdae9a61892266f750ddd7589637c6
parent 6a316b3761492fae0efe911dc7473b16abcc10b6
Author: Ryan Sepassi <rsepassi@gmail.com>
Date:   Thu, 16 Jul 2026 11:10:27 -0700

cpp: initialize include-cache metadata

Diffstat:
Mlang/cpp/pp/pp_directive.c | 2+-
Atest/pp/cases/96_inc.h | 1+
Atest/pp/cases/96_include_repeated_unguarded.c | 2++
Atest/pp/cases/96_include_repeated_unguarded.expected | 2++
4 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/lang/cpp/pp/pp_directive.c b/lang/cpp/pp/pp_directive.c @@ -793,7 +793,7 @@ static int open_include_cached(Pp* pp, const char* path, const u8** data_out, } if (!try_open_include(pp, path, data_out, size_out)) return 0; if (key) { - IncEntry e; + IncEntry e = {0}; e.data = *data_out; e.size = *size_out; IncCache_set(&pp->inc_cache, key, e); diff --git a/test/pp/cases/96_inc.h b/test/pp/cases/96_inc.h @@ -0,0 +1 @@ +repeated_include_token diff --git a/test/pp/cases/96_include_repeated_unguarded.c b/test/pp/cases/96_include_repeated_unguarded.c @@ -0,0 +1,2 @@ +#include "96_inc.h" +#include "96_inc.h" diff --git a/test/pp/cases/96_include_repeated_unguarded.expected b/test/pp/cases/96_include_repeated_unguarded.expected @@ -0,0 +1,2 @@ +repeated_include_token +repeated_include_token