diff options
author | Ludovic Courtès <ludo@gnu.org> | 2008-09-10 23:09:30 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2008-09-10 23:09:30 +0200 |
commit | 6f03035fe80d1c25ffadc42ec59c473402f65f60 (patch) | |
tree | a552a077bafe408ced8737674aecdf3007f31679 /libguile/struct.c | |
parent | 328efeb9a66dddcf78a24fad96d3db58e9c3375d (diff) | |
parent | c5cd474d8c37bf32d7236e63d754a0eee9eb9071 (diff) | |
download | guile-6f03035fe80d1c25ffadc42ec59c473402f65f60.tar.gz |
Merge branch 'master' into boehm-demers-weiser-gc
Conflicts:
libguile/Makefile.am
libguile/coop-defs.h
libguile/gc-card.c
libguile/gc-freelist.c
libguile/gc-malloc.c
libguile/gc-mark.c
libguile/gc-segment.c
libguile/gc.c
libguile/gc.h
libguile/gc_os_dep.c
libguile/hashtab.c
libguile/hashtab.h
libguile/inline.h
libguile/private-gc.h
libguile/struct.c
libguile/struct.h
libguile/threads.c
libguile/threads.h
libguile/vectors.h
libguile/weaks.h
test-suite/tests/gc.test
Diffstat (limited to 'libguile/struct.c')
-rw-r--r-- | libguile/struct.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libguile/struct.c b/libguile/struct.c index a263f9667..e3afd51d7 100644 --- a/libguile/struct.c +++ b/libguile/struct.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996,1997,1998,1999,2000,2001, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 1996,1997,1998,1999,2000,2001, 2003, 2004, 2006, 2007, 2008 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 @@ -635,7 +635,11 @@ SCM_DEFINE (scm_struct_ref, "struct-ref", 2, 0, 0, fields_desc = scm_i_symbol_chars (layout); layout_len = scm_i_symbol_length (layout); - n_fields = data[scm_struct_i_n_words]; + if (SCM_STRUCT_VTABLE_FLAGS (handle) & SCM_STRUCTF_LIGHT) + /* no extra words */ + n_fields = layout_len / 2; + else + n_fields = data[scm_struct_i_n_words]; SCM_ASSERT_RANGE(1, pos, p < n_fields); @@ -712,7 +716,11 @@ SCM_DEFINE (scm_struct_set_x, "struct-set!", 3, 0, 0, fields_desc = scm_i_symbol_chars (layout); layout_len = scm_i_symbol_length (layout); - n_fields = data[scm_struct_i_n_words]; + if (SCM_STRUCT_VTABLE_FLAGS (handle) & SCM_STRUCTF_LIGHT) + /* no extra words */ + n_fields = layout_len / 2; + else + n_fields = data[scm_struct_i_n_words]; SCM_ASSERT_RANGE (1, pos, p < n_fields); |