From caa75150ab4982c5ca0e48e606dd4f81087e7a3d Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Thu, 11 May 2023 11:53:01 -0700 Subject: til: add setup assert in til_module_create_context() If the module has a .setup() method, it should be able to just blindly expect a valid baked setup to come in @ context create. Let's enforce that here, and let the module code providing setup hooks just go forth and access the setup assuming it's at least present and as valid as their setup method produces. --- src/til.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/til.c b/src/til.c index aae1875..729d447 100644 --- a/src/til.c +++ b/src/til.c @@ -232,6 +232,7 @@ int til_module_create_context(const til_module_t *module, til_stream_t *stream, assert(module); assert(parent_path); + assert(setup || !module->setup); /* if a module provides a .setup() method, it can assume a provided setup */ assert(res_context); { -- cgit v1.2.1