diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-08-24 16:35:51 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2022-08-24 16:37:11 +0200 |
commit | bcdd2cb33797412cce1f1014d265a71461676cff (patch) | |
tree | 24f66afaedf7e9aa9c59c19640635fca5ffe0c1b /examples/state-reset.c | |
parent | ee1946fad8a81b1917052292accafe91b7a1bb89 (diff) |
examples: add module search path initialization and freeing
Since commit 3c168b5 ("vm, cli: move search path into global config...")
it is required to explicitly initialize the module search path in the
configuration structure for compile time module imports and run time
require operations to work.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'examples/state-reset.c')
-rw-r--r-- | examples/state-reset.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/state-reset.c b/examples/state-reset.c index ce61e7f..92d48e0 100644 --- a/examples/state-reset.c +++ b/examples/state-reset.c @@ -59,6 +59,9 @@ int main(int argc, char **argv) return 1; } + /* initialize default module search path */ + uc_search_path_init(&config.module_search_path); + /* execute compiled program function five times */ for (int i = 0; i < 5; i++) { /* initialize VM context */ @@ -87,5 +90,8 @@ int main(int argc, char **argv) /* release program function */ uc_program_put(program); + /* free search module path vector */ + uc_search_path_free(&config.module_search_path); + return exit_code; } |