[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 21/58: goops: Fix 'instance?' to work on objects that ar
From: |
Andy Wingo |
Subject: |
[Guile-commits] 21/58: goops: Fix 'instance?' to work on objects that aren't structs. |
Date: |
Tue, 7 Aug 2018 06:58:31 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit 9fd1dc2fcce421f6b044398f3735b6e37459baa0
Author: Mark H Weaver <address@hidden>
Date: Mon May 28 12:19:41 2018 -0400
goops: Fix 'instance?' to work on objects that aren't structs.
Fixes <https://bugs.gnu.org/31606>
Reported by Tommi Höynälänmaa <address@hidden>
* module/oop/goops.scm (instance?): Check that OBJ is a struct
before applying 'struct-vtable' to it.
---
module/oop/goops.scm | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/module/oop/goops.scm b/module/oop/goops.scm
index 4bde684..df6df4f 100644
--- a/module/oop/goops.scm
+++ b/module/oop/goops.scm
@@ -1,6 +1,7 @@
;;;; goops.scm -- The Guile Object-Oriented Programming System
;;;;
-;;;; Copyright (C) 1998-2003,2006,2009-2011,2013-2015,2017 Free Software
Foundation, Inc.
+;;;; Copyright (C) 1998-2003,2006,2009-2011,2013-2015,2017-2018
+;;;; Free Software Foundation, Inc.
;;;; Copyright (C) 1993-1998 Erick Gallesio - I3S-CNRS/ESSI <address@hidden>
;;;;
;;;; This library is free software; you can redistribute it and/or
@@ -285,7 +286,8 @@
(class-has-flags? (struct-vtable obj) vtable-flag-goops-slot)))
(define-inlinable (instance? obj)
- (class-has-flags? (struct-vtable obj) vtable-flag-goops-class))
+ (and (struct? obj)
+ (class-has-flags? (struct-vtable obj) vtable-flag-goops-class)))
(define (class-has-statically-allocated-slots? class)
(class-has-flags? class vtable-flag-goops-static-slot-allocation))
- [Guile-commits] 18/58: Fix typo in comment within numbers.c, (continued)
- [Guile-commits] 18/58: Fix typo in comment within numbers.c, Andy Wingo, 2018/08/07
- [Guile-commits] 08/58: Revert "Honor '%fresh-auto-compile'.", Andy Wingo, 2018/08/07
- [Guile-commits] 15/58: Fix eta-conversion edge cases in peval., Andy Wingo, 2018/08/07
- [Guile-commits] 17/58: Fix minor typo in the PEG documentation., Andy Wingo, 2018/08/07
- [Guile-commits] 20/58: Avoid inexact arithmetic in the type inferrer for 'sqrt'., Andy Wingo, 2018/08/07
- [Guile-commits] 16/58: Fix a few typos in the manual., Andy Wingo, 2018/08/07
- [Guile-commits] 05/58: compile: Load language modules upfront., Andy Wingo, 2018/08/07
- [Guile-commits] 11/58: doc: Fix typo about SRFI-4 syntax., Andy Wingo, 2018/08/07
- [Guile-commits] 09/58: 'select' returns empty sets upon EINTR and EAGAIN., Andy Wingo, 2018/08/07
- [Guile-commits] 14/58: Recognize RISC-V compilation targets., Andy Wingo, 2018/08/07
- [Guile-commits] 21/58: goops: Fix 'instance?' to work on objects that aren't structs.,
Andy Wingo <=
- [Guile-commits] 10/58: build: Use 'sed' invocation compatible with BSD sed., Andy Wingo, 2018/08/07
- [Guile-commits] 24/58: Add copyright header for (language elisp falias), and fix typo., Andy Wingo, 2018/08/07
- [Guile-commits] 29/58: get-bytevector-n and get-bytevector-n! can now read more than 4 GB, Andy Wingo, 2018/08/07
- [Guile-commits] 26/58: tests: Add SRFI-71 test., Andy Wingo, 2018/08/07
- [Guile-commits] 34/58: Add 'scm_to_stringn' shortcut when converting to UTF-8., Andy Wingo, 2018/08/07
- [Guile-commits] 12/58: srfi-18: When timeout is a number, it's a relative number of seconds., Andy Wingo, 2018/08/07
- [Guile-commits] 22/58: Fix error reporting in 'load-thunk-from-memory'., Andy Wingo, 2018/08/07
- [Guile-commits] 19/58: Fix type inference for bitwise logical operators., Andy Wingo, 2018/08/07
- [Guile-commits] 23/58: elisp: Fix cross-compilation support., Andy Wingo, 2018/08/07
- [Guile-commits] 33/58: Module import obarrays are accessed in a critical section., Andy Wingo, 2018/08/07