mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-04-21 01:00:38 -07:00
Detect recursive inline functions
This commit is contained in:
parent
6512337535
commit
480d1dedfd
2 changed files with 8 additions and 2 deletions
|
|
@ -70,8 +70,11 @@
|
|||
(consp can-inline)
|
||||
(eq (first can-inline) 'function)
|
||||
(<= (cmp-env-optimization 'space) 1))
|
||||
(cmpnote "Inlining ~a" fname)
|
||||
(c1expr `(funcall ,can-inline ,@args)))
|
||||
(when (member fname *inlined-functions* :test #'eq)
|
||||
(cmperr "Recursive function ~A declared inline." fname))
|
||||
(let ((*inlined-functions* (cons fname *inlined-functions*)))
|
||||
(cmpnote "Inlining ~a" fname)
|
||||
(c1expr `(funcall ,can-inline ,@args))))
|
||||
(t (c1call-global fname args))))
|
||||
|
||||
(defun c1call-local (fname args)
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@
|
|||
;;; temporaries for intermediate results of the evaluation of inlined
|
||||
;;; function calls.
|
||||
|
||||
(defvar *inlined-functions* '()
|
||||
"List of functions being inlined right now. Used to detect recursive inlines.")
|
||||
|
||||
;;; --cmputil.lsp--
|
||||
;;;
|
||||
;;; Variables and constants for error handling
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue