summaryrefslogtreecommitdiffhomepage
path: root/types.h
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-07-05 20:24:43 +0200
committerJo-Philipp Wich <jo@mein.io>2021-07-11 15:49:14 +0200
commit4ae056867d96b1795fec7f4cfd0f68b124e398cd (patch)
tree1d9ae3590b83cdd9ea9c37f35f2981d61d526efa /types.h
parent2f77657ae97f84edcd665c4cfe00ef91b9cde1bc (diff)
lib, vm: reimplement exit() as exception type
Instead of invoking exit(3) from uc_exit(), use a new EXCEPTION_EXIT exception type to instruct the VM to shutdown cleanly. This is required to not terminate the host program in case libucode is embedded and loaded scripts invoke the exit() function. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'types.h')
-rw-r--r--types.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/types.h b/types.h
index 710f6fc..b4c33fc 100644
--- a/types.h
+++ b/types.h
@@ -217,7 +217,8 @@ typedef enum {
EXCEPTION_RUNTIME,
EXCEPTION_TYPE,
EXCEPTION_REFERENCE,
- EXCEPTION_USER
+ EXCEPTION_USER,
+ EXCEPTION_EXIT
} uc_exception_type_t;
typedef struct {