GNU bug report logs - #5082
23.1.50; print-circle and make-hash-table

Previous Next

Package: emacs;

Reported by: 川幡太一 <kawabata.taichi <at> gmail.com>

Date: Mon, 30 Nov 2009 15:15:04 UTC

Severity: normal

Done: Stefan Monnier <monnier <at> IRO.UMontreal.CA>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 5082-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: 川幡太一 <kawabata.taichi <at> gmail.com>
Subject: Re: bug#5082: 23.1.50; print-circle and make-hash-table
Date: Mon, 30 Nov 2009 16:08:38 -0500
> I've found an Emacs behavior that seems a bug concerning to `print-circle'
> and make-hash-table, so I would like to report it.

Thanks for catching this bug and for the clear testcase.  I've installed
the patch below which should fix it.


        Stefan


=== modified file 'src/print.c'
--- src/print.c	2009-11-24 15:30:54 +0000
+++ src/print.c	2009-11-30 21:03:36 +0000
@@ -1420,6 +1420,13 @@
 	    size &= PSEUDOVECTOR_SIZE_MASK;
 	  for (i = 0; i < size; i++)
 	    print_preprocess (XVECTOR (obj)->contents[i]);
+	  if (HASH_TABLE_P (obj))
+	    { /* For hash tables, the key_and_value slot is past
+	        `size' because it needs to be marked specially in case
+	        the table is weak.  */
+	      struct Lisp_Hash_Table *h = XHASH_TABLE (obj);
+	      print_preprocess (h->key_and_value);
+	    }
 	  break;
 
 	default:




This bug report was last modified 15 years and 236 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.