summaryrefslogtreecommitdiff
path: root/libguile/vm-i-loader.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2012-04-30 20:25:53 +0200
committerAndy Wingo <wingo@pobox.com>2012-04-30 21:29:11 +0200
commit53bdfcf03418c4709127140d64f12ede970c174b (patch)
tree426f86597bad304acf3db0acc1f20f9a78bf7a72 /libguile/vm-i-loader.c
parent7dbc03498a763ca6a45e26aabfa74e8c317b55bf (diff)
downloadguile-53bdfcf03418c4709127140d64f12ede970c174b.tar.gz
push error handlers out of line in the vm
* libguile/vm.c: (vm_error): (vm_error_bad_instruction): (vm_error_unbound): (vm_error_unbound_fluid): (vm_error_not_a_variable): (vm_error_not_a_thunk): (vm_error_apply_to_non_list): (vm_error_kwargs_length_not_even): (vm_error_kwargs_invalid_keyword): (vm_error_kwargs_unrecognized_keyword): (vm_error_too_many_args): (vm_error_wrong_num_args): (vm_error_wrong_type_apply): (vm_error_stack_overflow): (vm_error_stack_underflow): (vm_error_improper_list): (vm_error_not_a_pair): (vm_error_not_a_bytevector): (vm_error_not_a_struct): (vm_error_no_values): (vm_error_not_enough_values): (vm_error_continuation_not_rewindable): (vm_error_bad_wide_string_length): (vm_error_invalid_address): (vm_error_object): (vm_error_free_variable): New internal helpers, implementing VM error handling. * libguile/vm-engine.h (VM_ASSERT): New helper macro. (ASSERT, CHECK_OBJECT, CHECK_FREE_VARIABLE): (PRE_CHECK_UNDERFLOW, PUSH_LIST): Use the new helper. * libguile/vm-i-loader.c: * libguile/vm-i-scheme.c: * libguile/vm-i-system.c: Use VM_ASSERT and the out-of-line error handlers. * libguile/vm-engine.c (vm_engine): Remove inline error handlers, and remove a couple of local vars. Use VM_ASSERT. Have halt handle the return itself.
Diffstat (limited to 'libguile/vm-i-loader.c')
-rw-r--r--libguile/vm-i-loader.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/libguile/vm-i-loader.c b/libguile/vm-i-loader.c
index 6fa8eb2ea..c3231568e 100644
--- a/libguile/vm-i-loader.c
+++ b/libguile/vm-i-loader.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001,2008,2009,2010,2011 Free Software Foundation, Inc.
+/* Copyright (C) 2001,2008,2009,2010,2011,2012 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -105,11 +105,8 @@ VM_DEFINE_LOADER (107, load_wide_string, "load-wide-string")
scm_t_wchar *wbuf;
FETCH_LENGTH (len);
- if (SCM_UNLIKELY (len % 4))
- {
- finish_args = scm_list_1 (scm_from_size_t (len));
- goto vm_error_bad_wide_string_length;
- }
+ VM_ASSERT ((len % 4) == 0,
+ vm_error_bad_wide_string_length (len));
SYNC_REGISTER ();
PUSH (scm_i_make_wide_string (len / 4, &wbuf, 1));