From 4cff48b9e12469e6455c6437686519f886699b59 Mon Sep 17 00:00:00 2001 From: Francesco Cozzuto Date: Wed, 15 Oct 2025 20:53:20 +0200 Subject: [PATCH] Add comment to wl_compiler_add explaining the lifetime requirements for the source files --- wl.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wl.h b/wl.h index 72e1823..2e5b94d 100644 --- a/wl.h +++ b/wl.h @@ -67,6 +67,10 @@ WL_Compiler *wl_compiler_init(WL_Arena *arena); // // WL_ADD_LINK all sources were processed and // the unit is ready for linking +// +// Note that the source of all files needs to +// stay alive until the program is linked as the +// compiler may keep references to it until then. WL_AddResult wl_compiler_add(WL_Compiler *compiler, WL_String path, WL_String content); // Links a compilation unit producing an executable.