diff options
author | Andy Wingo <wingo@pobox.com> | 2017-04-17 11:26:17 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2017-04-18 21:27:45 +0200 |
commit | 6e573a0885d24d9ed36141ddf561c8b8b2e288e9 (patch) | |
tree | f3a6b348517b69856194efa2f0fcbec79286c4e6 /libguile/symbols.c | |
parent | d7778b3d6a5f11ef4744c80e70457193d672aeda (diff) | |
download | guile-6e573a0885d24d9ed36141ddf561c8b8b2e288e9.tar.gz |
Attempt to mutate residualized literal pair throws exception
* libguile/validate.h (SCM_VALIDATE_MUTABLE_PAIR):
* libguile/pairs.h (scm_is_mutable_pair): New internal definitions.
* libguile/pairs.c (scm_set_car_x, scm_set_cdr_x): Validate mutable
pairs.
* libguile/alist.c (scm_assq_set_x, scm_assv_set_x, scm_assoc_set_x):
* libguile/list.c (scm_reverse_x, scm_list_set_x, scm_list_cdr_set_x):
* libguile/srcprop.c (scm_make_srcprops):
* libguile/srfi-1.c (scm_srfi1_append_reverse_x)
(scm_srfi1_delete_duplicates_x):
* libguile/symbols.c (scm_symbol_fset_x, scm_symbol_pset_x):
* libguile/sort.c (scm_merge_list_x): Use scm_set_car_x / scm_set_cdr_x
instead of the macros, so as to check for mutable pairs.
(SCM_VALIDATE_MUTABLE_LIST): New internal helper macro.
(scm_sort_x, scm_stable_sort_x, scm_sort_list_x): Use
SCM_VALIDATE_MUTABLE_LIST.
* libguile/vm-engine.c (VM_VALIDATE_MUTABLE_PAIR): New definition.
(set-car!, set-cdr!): Use VM_VALIDATE_MUTABLE_PAIR. Fix error message
for set-cdr!.
Diffstat (limited to 'libguile/symbols.c')
-rw-r--r-- | libguile/symbols.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libguile/symbols.c b/libguile/symbols.c index 71d982730..ab4b2cdd1 100644 --- a/libguile/symbols.c +++ b/libguile/symbols.c @@ -449,7 +449,7 @@ SCM_DEFINE (scm_symbol_fset_x, "symbol-fset!", 2, 0, 0, #define FUNC_NAME s_scm_symbol_fset_x { SCM_VALIDATE_SYMBOL (1, s); - SCM_SETCAR (SCM_CELL_OBJECT_3 (s), val); + scm_set_car_x (SCM_CELL_OBJECT_3 (s), val); return SCM_UNSPECIFIED; } #undef FUNC_NAME @@ -461,7 +461,7 @@ SCM_DEFINE (scm_symbol_pset_x, "symbol-pset!", 2, 0, 0, #define FUNC_NAME s_scm_symbol_pset_x { SCM_VALIDATE_SYMBOL (1, s); - SCM_SETCDR (SCM_CELL_OBJECT_3 (s), val); + scm_set_cdr_x (SCM_CELL_OBJECT_3 (s), val); return SCM_UNSPECIFIED; } #undef FUNC_NAME |