# HG changeset patch # User Karl Heuer # Date 769832528 0 # Node ID 31d444fcae2476101014dbf2da31e5b4c63c6a00 # Parent b3be53811505052b0488e3ad8d342908e676a016 (Fprimitive_undo): GCPRO next and list. Check argument type before calling XINT. diff -r b3be53811505 -r 31d444fcae24 src/undo.c --- a/src/undo.c Tue May 24 21:16:23 1994 +0000 +++ b/src/undo.c Wed May 25 02:22:08 1994 +0000 @@ -335,8 +335,10 @@ (n, list) Lisp_Object n, list; { + struct gcpro gcpro1, gcpro2; + Lisp_Object next; int count = specpdl_ptr - specpdl; - register int arg = XINT (n); + register int arg; #if 0 /* This is a good feature, but would make undo-start unable to do what is expected. */ Lisp_Object tem; @@ -348,6 +350,11 @@ list = Fcdr (list); #endif + CHECK_NUMBER (n, 0); + arg = XINT (n); + next = Qnil; + GCPRO2 (next, list); + /* Don't let read-only properties interfere with undo. */ if (NILP (current_buffer->read_only)) specbind (Qinhibit_read_only, Qt); @@ -356,7 +363,6 @@ { while (1) { - Lisp_Object next; next = Fcar (list); list = Fcdr (list); /* Exit inner loop at undo boundary. */ @@ -455,6 +461,7 @@ arg--; } + UNGCPRO; return unbind_to (count, list); }