From 5305df84f8870f21eab8b44bb0c89530889e17b7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 21 Feb 2008 08:43:54 +0000 Subject: [PATCH] Fix bug #22369: segfault in `scm_add_slot ()'. --- NEWS | 7 +++++++ libguile/ChangeLog | 7 +++++++ libguile/goops.c | 5 +++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 0daf78bdb..a4e090053 100644 --- a/NEWS +++ b/NEWS @@ -36,6 +36,13 @@ indicating length of the `scm_t_option' array. +Changes in 1.8.5 (since 1.8.4) + +* Bugs fixed + +** `scm add_slot ()' no longer segfaults (fixes bug #22369) + + Changes in 1.8.4 (since 1.8.3) * Bugs fixed diff --git a/libguile/ChangeLog b/libguile/ChangeLog index ca99ccfd0..bcf171c7a 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,10 @@ +2008-02-21 Ludovic Courtès + + Fix bug #22369. + + * goops.c (scm_add_slot): Add `SCM_UNDEFINED' as last argument + to `scm_list_n ()'. Thanks to the anonymous reporter. + 2008-02-17 Ludovic Courtès * script.c (scm_compile_shell_switches): Update copyright year. diff --git a/libguile/goops.c b/libguile/goops.c index 9cebeb215..8e398e365 100644 --- a/libguile/goops.c +++ b/libguile/goops.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998,1999,2000,2001,2002,2003,2004 +/* Copyright (C) 1998,1999,2000,2001,2002,2003,2004,2008 * Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or @@ -2870,7 +2870,8 @@ scm_add_slot (SCM class, char *slot_name, SCM slot_class, scm_list_1 (slot)))); { SCM n = SCM_SLOT (class, scm_si_nfields); - SCM gns = scm_list_n (name, SCM_BOOL_F, get, set, n, scm_from_int (1)); + SCM gns = scm_list_n (name, SCM_BOOL_F, get, set, n, scm_from_int (1), + SCM_UNDEFINED); SCM_SET_SLOT (class, scm_si_getters_n_setters, scm_append_x (scm_list_2 (SCM_SLOT (class, scm_si_getters_n_setters), scm_list_1 (gns)))); -- 2.20.1