1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/1f54a2879725/
Changeset:   1f54a2879725
User:        kehoea
Date:        2017-12-02 08:28:51+00:00
Summary:     Add some circularity checking, bytecode.c, eval.c, keymap.c
src/ChangeLog addition:
2017-12-02  Aidan Kehoe  <kehoea(a)parhasard.net>
	* bytecode.c (set_compiled_function_arglist):
	Check that NEW_ is a true list, avoid having a circular list in
	the compiled funcction down the line.
	* debug.c (Fset_debug_classes_to_check):
	Use EXTERNAL_LIST_LOOP_3() looping through CLASSES for circularity
	checking, leave the type checking to it.
	* eval.c (Fmultiple_value_prog1):
	ARGS is an external list, check for circularity and
	well-formedness.
	* keymap.c (Fsingle_key_description):
	If KEY is a cons, loop using EXTERNAL_LIST_LOOP_3(), giving us
	type and circularity checking.
tests/ChangeLog addition:
2017-12-02  Aidan Kehoe  <kehoea(a)parhasard.net>
	* automated/keymap-tests.el:
	Test circularity checkcing in #'single-key-description.
Affected #:  7 files
diff -r 86ddcb2cb737db4e9518b1db0b7e4332a3d1b4d1 -r
1f54a2879725779c7da8c8a3b22de821a595e049 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,18 @@
+2017-12-02  Aidan Kehoe  <kehoea(a)parhasard.net>
+
+	* bytecode.c (set_compiled_function_arglist):
+	Check that NEW_ is a true list, avoid having a circular list in
+	the compiled funcction down the line.
+	* debug.c (Fset_debug_classes_to_check):
+	Use EXTERNAL_LIST_LOOP_3() looping through CLASSES for circularity
+	checking, leave the type checking to it.
+	* eval.c (Fmultiple_value_prog1):
+	ARGS is an external list, check for circularity and
+	well-formedness.
+	* keymap.c (Fsingle_key_description):
+	If KEY is a cons, loop using EXTERNAL_LIST_LOOP_3(), giving us
+	type and circularity checking.
+
 2017-11-30  Aidan Kehoe  <kehoea(a)parhasard.net>
 
 	* keymap.c (describe_command):
diff -r 86ddcb2cb737db4e9518b1db0b7e4332a3d1b4d1 -r
1f54a2879725779c7da8c8a3b22de821a595e049 src/bytecode.c
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -2681,7 +2681,7 @@
 static void
 set_compiled_function_arglist (Lisp_Compiled_Function *f, Lisp_Object new_)
 {
-  CHECK_LIST (new_);
+  CHECK_TRUE_LIST (new_);
   f->arglist = new_;
 
   /* Recalculate the optimized version of the function, since this depends
diff -r 86ddcb2cb737db4e9518b1db0b7e4332a3d1b4d1 -r
1f54a2879725779c7da8c8a3b22de821a595e049 src/debug.c
--- a/src/debug.c
+++ b/src/debug.c
@@ -135,16 +135,12 @@
 */
        (classes))
 {
-  Lisp_Object rest;
-
-  CHECK_LIST (classes);
-
   /* Make sure all objects in the list are valid.  If anyone is not
      valid, reject the entire list without doing anything. */
-  LIST_LOOP (rest, classes)
+  EXTERNAL_LIST_LOOP_3 (elt, classes, rest)
     {
-      if (NILP (xemacs_debug_loop (X_VALIDATE, XCAR (rest), Qnil)))
-	sferror ("Invalid object in class list", Qunbound);
+      if (NILP (xemacs_debug_loop (X_VALIDATE, elt, Qnil)))
+        sferror ("Invalid object in class list", elt);
     }
 
   LIST_LOOP (rest, classes)
diff -r 86ddcb2cb737db4e9518b1db0b7e4332a3d1b4d1 -r
1f54a2879725779c7da8c8a3b22de821a595e049 src/eval.c
--- a/src/eval.c
+++ b/src/eval.c
@@ -5081,7 +5081,7 @@
   GCPRO1 (val);
 
   {
-    LIST_LOOP_2 (form, XCDR (args))
+    EXTERNAL_LIST_LOOP_2 (form, XCDR (args))
       Feval (form);
   }
 
diff -r 86ddcb2cb737db4e9518b1db0b7e4332a3d1b4d1 -r
1f54a2879725779c7da8c8a3b22de821a595e049 src/keymap.c
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -3593,10 +3593,8 @@
     {
       DECLARE_EISTRING (bufp);
 
-      Lisp_Object rest;
-      LIST_LOOP (rest, key)
+      EXTERNAL_LIST_LOOP_3 (keysym, key, rest)
 	{
-	  Lisp_Object keysym = XCAR (rest);
 	  if (EQ (keysym, Qcontrol))    eicat_ascii (bufp, "C-");
 	  else if (EQ (keysym, Qctrl))  eicat_ascii (bufp, "C-");
 	  else if (EQ (keysym, Qmeta))  eicat_ascii (bufp, "M-");
diff -r 86ddcb2cb737db4e9518b1db0b7e4332a3d1b4d1 -r
1f54a2879725779c7da8c8a3b22de821a595e049 tests/ChangeLog
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,8 @@
+2017-12-02  Aidan Kehoe  <kehoea(a)parhasard.net>
+
+	* automated/keymap-tests.el:
+	Test circularity checkcing in #'single-key-description.
+
 2017-11-23  Aidan Kehoe  <kehoea(a)parhasard.net>
 
 	* automated/format-tests.el (args-out-of-range):
diff -r 86ddcb2cb737db4e9518b1db0b7e4332a3d1b4d1 -r
1f54a2879725779c7da8c8a3b22de821a595e049 tests/automated/keymap-tests.el
--- a/tests/automated/keymap-tests.el
+++ b/tests/automated/keymap-tests.el
@@ -133,4 +133,10 @@
 						      pi))
   (Check-Error wrong-type-argument (command-remapping 'describe-function-at-point
 						      nil pi)))
+
+;; Not quite a keymap test, but this function is in keymap.c, so add a test
+;; here:
  
+(Check-Error circular-list (single-key-description '#1=(control shift . #1#)))
+
+;;; end of keymap-tests.el
Repository URL: 
https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from 
bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.