Ensure argument to EXIT is an integer.

This commit is contained in:
mainzelm 2003-04-22 15:56:20 +00:00
parent 5c19731d59
commit c0b8928e7d
1 changed files with 8 additions and 5 deletions

View File

@ -1139,11 +1139,14 @@
proc))
(define (exit . maybe-status)
(call-exit-hooks-and-narrow
(lambda ()
(exit/errno (:optional maybe-status 0))
(display "The evil undead walk the earth." 2)
(if #t (error "(exit) returned.")))))
(let ((status (:optional maybe-status 0)))
(if (not (integer? status))
(error "non-integer argument to exit"))
(call-exit-hooks-and-narrow
(lambda ()
(exit/errno status)
(display "The evil undead walk the earth." 2)
(if #t (error "(exit) returned."))))))
;;; The classic T 2.0 primitive.