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/execute-string.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/execute-string.c')
-rw-r--r-- | examples/execute-string.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/execute-string.c b/examples/execute-string.c index fe5e8e9..edfab8b 100644 --- a/examples/execute-string.c +++ b/examples/execute-string.c @@ -71,6 +71,9 @@ int main(int argc, char **argv) return 1; } + /* initialize default module search path */ + uc_search_path_init(&config.module_search_path); + /* initialize VM context */ uc_vm_t vm = { 0 }; uc_vm_init(&vm, &config); @@ -127,5 +130,8 @@ int main(int argc, char **argv) /* free VM context */ uc_vm_free(&vm); + /* free search module path vector */ + uc_search_path_free(&config.module_search_path); + return exit_code; } |