summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-07-05 16:17:01 +0200
committerJo-Philipp Wich <jo@mein.io>2021-07-11 15:49:14 +0200
commitef0baf1d8f2ae5fc4ec48bd99dcc7424605356e6 (patch)
treefcf8b500fdc469325f7a42a904ee7bf0c434c74f
parentb11a2fa661058ef9788b9ff4d1e22ce98f1cbda7 (diff)
vm: cosmetic fix for outputting exceptions without source context
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--vm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/vm.c b/vm.c
index 94c99e6..24b2472 100644
--- a/vm.c
+++ b/vm.c
@@ -2017,7 +2017,10 @@ uc_vm_output_exception(uc_vm *vm)
ctx = ucv_object_get(ucv_array_get(vm->exception.stacktrace, 0), "context", NULL);
- fprintf(stderr, "%s\n\n", ucv_string_get(ctx));
+ if (ctx)
+ fprintf(stderr, "%s\n", ucv_string_get(ctx));
+
+ fprintf(stderr, "\n");
}
static uc_vm_status_t