mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Fix erroneous check in `set-procedure-properties!'.
* libguile/procprop.c (scm_set_procedure_properties_x)[SCM_ENABLE_DEPRECATED == 1]: Pass arguments to `scm_assq' in the right order, and check its return value with `scm_is_true'. Reported by Mike Gran <spk121@yahoo.com>.
This commit is contained in:
parent
f78a1ccede
commit
fe2400c993
2 changed files with 12 additions and 5 deletions
|
@ -1,4 +1,5 @@
|
||||||
/* Copyright (C) 1995,1996,1998,2000,2001,2003,2004, 2006, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
|
/* Copyright (C) 1995, 1996, 1998, 2000, 2001, 2003, 2004, 2006,
|
||||||
|
* 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public License
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
|
@ -175,7 +176,7 @@ SCM_DEFINE (scm_set_procedure_properties_x, "set-procedure-properties!", 2, 0, 0
|
||||||
SCM_VALIDATE_PROC (1, proc);
|
SCM_VALIDATE_PROC (1, proc);
|
||||||
|
|
||||||
#if (SCM_ENABLE_DEPRECATED == 1)
|
#if (SCM_ENABLE_DEPRECATED == 1)
|
||||||
if (scm_assq (alist, scm_sym_arity))
|
if (scm_is_true (scm_assq (scm_sym_arity, alist)))
|
||||||
SCM_MISC_ERROR ("arity is a read-only property", SCM_EOL);
|
SCM_MISC_ERROR ("arity is a read-only property", SCM_EOL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
;;;; procprop.test --- Procedure properties -*- mode: scheme; coding: utf-8; -*-
|
;;;; procprop.test --- Procedure properties -*- mode: scheme; coding: utf-8; -*-
|
||||||
;;;; Ludovic Courtès <ludo@gnu.org>
|
;;;; Ludovic Courtès <ludo@gnu.org>
|
||||||
;;;;
|
;;;;
|
||||||
;;;; Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
|
;;;; Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
|
||||||
;;;;
|
;;;;
|
||||||
;;;; This library is free software; you can redistribute it and/or
|
;;;; This library is free software; you can redistribute it and/or
|
||||||
;;;; modify it under the terms of the GNU Lesser General Public
|
;;;; modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -72,4 +72,10 @@
|
||||||
(pass-if "opt, eval"
|
(pass-if "opt, eval"
|
||||||
(equal? (procedure-minimum-arity (eval '(lambda* (a b #:optional c) #t)
|
(equal? (procedure-minimum-arity (eval '(lambda* (a b #:optional c) #t)
|
||||||
(current-module)))
|
(current-module)))
|
||||||
'(2 1 #f))))
|
'(2 1 #f)))
|
||||||
|
|
||||||
|
(if (include-deprecated-features)
|
||||||
|
(pass-if-exception "set-procedure-properties! arity"
|
||||||
|
'(misc-error . "arity is a read-only property")
|
||||||
|
(set-procedure-properties! (lambda x x) '((arity . 3))))
|
||||||
|
#t))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue