3 # Copyright (C) 2006 Free Software Foundation, Inc.
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public License
7 # as published by the Free Software Foundation; either version 3 of
8 # the License, or (at your option) any later version.
10 # This library is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 # Test for %fast-slot-ref, which was previously implemented such that
21 # an out-of-range slot index could escape being properly detected, and
22 # could then cause a segmentation fault.
24 # Prior to the change in this commit to goops.c, the following
25 # sequence reliably causes a segmentation fault on my GNU/Linux when
26 # executing the (%fast-slot-ref i 3) line. For reasons as yet
27 # unknown, it does not cause a segmentation fault if the same code is
28 # loaded as a script; that is why we run it here using "guile -q <<EOF".
29 exec guile
-q >/dev
/null
2>&1 <<EOF
30 (use-modules (oop goops))
31 (define-module (oop goops))
32 (define-class <c> () (a #:init-value 1) (b #:init-value 2) (c #:init-value 3))