[PATCH] Accept that a charset's tag list may legitimately be nil.

Aidan Kehoe kehoea at parhasard.net
Fri Dec 8 11:30:43 EST 2006


 Ar an séiú lá de mí na Nollaig, scríobh Stephen J. Turnbull: 

 > I was running a git diff in a shell buffer.
 > 
 > Any ideas, Aidan?
 > 
 > (gdb) up 4
 > #4  0x0024d520 in charset_matches_specifier_tag_set_p (charset={...}, tag_set={...}, stage=initial) at /Users/steve/Software/XEmacs/git-staging/src/specifier.c:1003
 > 1003          assert (!NILP(XVECTOR_DATA
 > (gdb) pobj charset

See specifier.c:1342, setup_charset_initial_specifier_tags for where this
can happen. The crash didn’t happen if define-specifier-tag had been called
at least once with a third argument, which is why I found it difficult to
reproduce; fortunately, I regularly use a TTY build, where using the charset
predicate is a waste of time in lots of ways, and managed to reproduce it
consistently today. Building with this patch eliminates that crash. 

Steve, I unsubscribed from xemacs-patches as an experiment to see if that
woul eliminate the duplicated messages I was getting from it. I then sent
17785.27430.262538.827891 at parhasard.net to it, which has yet to appear--is
it currently subscriber-only? I suppose I’ll see whether this appears. 

src/ChangeLog addition:

2006-12-08  Aidan Kehoe  <kehoea at parhasard.net>

	* specifier.c (charset_matches_specifier_tag_set_p):
	A charset's entry in Vcharset_tag_lists may be nil, if, when that
	charset was created, no tags with associated charset predicates
	existed. Accept this posibility, treat it as the tag not matching
	that charset. 


XEmacs Trunk source patch:
Diff command:   cvs -q diff -u
Files affected: src/specifier.c
===================================================================
RCS

Index: src/specifier.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/specifier.c,v
retrieving revision 1.50
diff -u -r1.50 specifier.c
--- src/specifier.c	2006/11/15 21:12:17	1.50
+++ src/specifier.c	2006/12/08 16:13:04
@@ -997,12 +997,16 @@
       Lisp_Object tag = XCAR (rest);
       Lisp_Object assoc;
 
-      /* This function will not ever be called with a charset for which the
-	 relevant information hasn't been calculated (the information is
-	 calculated with the creation of every charset).  */
-      assert (!NILP(XVECTOR_DATA
-		    (Vcharset_tag_lists)[XCHARSET_LEADING_BYTE(charset) 
-					 - MIN_LEADING_BYTE]));
+      /* In the event that, during the creation of a charset, no specifier
+         tags exist for which CHARSET-PREDICATE has been specified, then
+         that charset's entry in Vcharset_tag_lists will be nil, and this
+         charset shouldn't match. */
+
+      if (NILP (XVECTOR_DATA(Vcharset_tag_lists)[XCHARSET_LEADING_BYTE(charset) 
+                                                 - MIN_LEADING_BYTE]))
+        {
+          return 0;
+        }
 
       /* Now, find out what the pre-calculated value is. */
       assoc = assq_no_quit(tag,

-- 
Santa Maradona, priez pour moi!




More information about the XEmacs-Beta mailing list