summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-05-11 11:53:01 -0700
committerVito Caputo <vcaputo@pengaru.com>2023-05-11 15:19:25 -0700
commitcaa75150ab4982c5ca0e48e606dd4f81087e7a3d (patch)
treeba6d11660deb82c56384580359711dd1b6d4938f
parentdaf765c1351e551266682a48e148812195d97905 (diff)
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.
-rw-r--r--src/til.c1
1 files changed, 1 insertions, 0 deletions
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);
{
© All Rights Reserved