emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 4fbfd7a: Fix circular read syntax for records.


From: Lars Brinkhoff
Subject: [Emacs-diffs] master 4fbfd7a: Fix circular read syntax for records.
Date: Sat, 8 Apr 2017 02:48:22 -0400 (EDT)

branch: master
commit 4fbfd7ad53810153371a588a9bd1a69230f60dd5
Author: Lars Brinkhoff <address@hidden>
Commit: Lars Brinkhoff <address@hidden>

    Fix circular read syntax for records.
    
    * lread.c (substitute_object_recurse): Work with records.
    
    * lread-tests.el (lread-record-1): New test.
---
 src/lread.c             | 3 ++-
 test/src/lread-tests.el | 4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/lread.c b/src/lread.c
index 6de9fe6..513f63e 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -3400,7 +3400,8 @@ substitute_object_recurse (Lisp_Object object, 
Lisp_Object placeholder, Lisp_Obj
        if (BOOL_VECTOR_P (subtree))
          return subtree;               /* No sub-objects anyway.  */
        else if (CHAR_TABLE_P (subtree) || SUB_CHAR_TABLE_P (subtree)
-                || COMPILEDP (subtree) || HASH_TABLE_P (subtree))
+                || COMPILEDP (subtree) || HASH_TABLE_P (subtree)
+                || RECORDP (subtree))
          length = ASIZE (subtree) & PSEUDOVECTOR_SIZE_MASK;
        else if (VECTORP (subtree))
          length = ASIZE (subtree);
diff --git a/test/src/lread-tests.el b/test/src/lread-tests.el
index a783afd..27f967f 100644
--- a/test/src/lread-tests.el
+++ b/test/src/lread-tests.el
@@ -112,4 +112,8 @@
   (should-error (read "#24r") :type 'invalid-read-syntax)
   (should-error (read "#") :type 'invalid-read-syntax))
 
+(ert-deftest lread-record-1 ()
+  (should (equal '(#s(foo) #s(foo))
+                 (read "(#1=#s(foo) #1#)"))))
+
 ;;; lread-tests.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]