# HG changeset patch # User Gerd Moellmann # Date 985611851 0 # Node ID 642a947337418b0a4978c80a27c40bb810db44f8 # Parent 8628eb0b28c73faacbb880cc5aa83f0ea0b27336 (byte-optimize-while) (byte-optimize-form-code-walker): Diagnose too few arguments for `if' and `while'. diff -r 8628eb0b28c7 -r 642a94733741 lisp/emacs-lisp/byte-opt.el --- a/lisp/emacs-lisp/byte-opt.el Mon Mar 26 12:28:54 2001 +0000 +++ b/lisp/emacs-lisp/byte-opt.el Mon Mar 26 13:04:11 2001 +0000 @@ -1,6 +1,6 @@ ;;; byte-opt.el --- the optimization passes of the emacs-lisp byte compiler. -;;; Copyright (c) 1991, 1994, 2000 Free Software Foundation, Inc. +;;; Copyright (c) 1991, 1994, 2000, 2001 Free Software Foundation, Inc. ;; Author: Jamie Zawinski ;; Hallvard Furuseth @@ -445,6 +445,8 @@ (byte-optimize-body (cdr (cdr form)) for-effect)))) ((eq fn 'if) + (when (< (length form) 3) + (byte-compile-warn "Too few arguments for `if'")) (cons fn (cons (byte-optimize-form (nth 1 form) nil) (cons @@ -1014,6 +1016,8 @@ (list 'progn clause nil))))) (defun byte-optimize-while (form) + (when (< (length form) 2) + (byte-compile-warn "Too few arguments for `while'")) (if (nth 1 form) form))