[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 05/08: goops: Fix 'instance?' to work on objects that ar
From: |
Mark H. Weaver |
Subject: |
[Guile-commits] 05/08: goops: Fix 'instance?' to work on objects that aren't structs. |
Date: |
Mon, 11 Jun 2018 10:22:24 -0400 (EDT) |
mhw pushed a commit to branch stable-2.2
in repository guile.
commit ff2adb04cb4be9309abeb3feeee7cad97976fc2d
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 3c787d7..837a667 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 Free Software
Foundation, Inc.
+;;;; Copyright (C) 1998-2003, 2006, 2009-2011, 2013-2015, 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
@@ -279,7 +280,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))
- [Guile-commits] branch stable-2.2 updated (9a72e21 -> ac9f083), Mark H. Weaver, 2018/06/11
- [Guile-commits] 01/08: Fix typo in comment within numbers.c, Mark H. Weaver, 2018/06/11
- [Guile-commits] 05/08: goops: Fix 'instance?' to work on objects that aren't structs.,
Mark H. Weaver <=
- [Guile-commits] 06/08: Fix error reporting in 'load-thunk-from-memory'., Mark H. Weaver, 2018/06/11
- [Guile-commits] 02/08: Revert "Minor CSE run-time optimization", Mark H. Weaver, 2018/06/11
- [Guile-commits] 08/08: Add copyright header for (language elisp falias), and fix typo., Mark H. Weaver, 2018/06/11
- [Guile-commits] 07/08: elisp: Fix cross-compilation support., Mark H. Weaver, 2018/06/11
- [Guile-commits] 03/08: Fix type inference for bitwise logical operators., Mark H. Weaver, 2018/06/11
- [Guile-commits] 04/08: Avoid inexact arithmetic in the type inferrer for 'sqrt'., Mark H. Weaver, 2018/06/11