From 0d413ee324fb3eafb43f516250c19d27f552f81e Mon Sep 17 00:00:00 2001 From: ram <ram> Date: Thu, 6 Dec 1990 18:01:34 +0000 Subject: [PATCH] Improved syntax error checking for the :TEMPORARY spec to DEFINE-VOP. --- compiler/vmdef.lisp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/compiler/vmdef.lisp b/compiler/vmdef.lisp index 6554da2e0..514f31f80 100644 --- a/compiler/vmdef.lisp +++ b/compiler/vmdef.lisp @@ -1258,8 +1258,8 @@ ;;; Parse-Temporary -- Internal ;;; -;;; Parse a temporary specification, entering the Operand-Parse structures in -;;; the Parse structure. +;;; Parse a temporary specification, entering the Operand-Parse structures +;;; in the Parse structure. ;;; (defun parse-temporary (spec parse) (declare (list spec) @@ -1267,6 +1267,12 @@ (let ((len (length spec))) (unless (>= len 2) (error "Malformed temporary spec: ~S." spec)) + (unless (listp (second spec)) + (error "Malformed options list: ~S." (second spec))) + (unless (evenp (length (second spec))) + (error "Odd number of arguments in keyword options: ~S." spec)) + (unless (consp (cddr spec)) + (warn "Temporary spec allocates no temps:~% ~S" spec)) (dolist (name (cddr spec)) (unless (symbolp name) (error "Bad temporary name: ~S." name)) @@ -1274,8 +1280,6 @@ :temp-temp (gensym) :born (parse-time-spec :load) :dies (parse-time-spec :save)))) - (unless (evenp (length (second spec))) - (error "Odd number of argument in keyword options: ~S." spec)) (do ((opt (second spec) (cddr opt))) ((null opt)) (case (first opt) -- GitLab