From 87d120937f0dcbef1ca892f7ef467f79bb51ee27 Mon Sep 17 00:00:00 2001 From: Bike Date: Mon, 22 Apr 2019 16:54:10 -0400 Subject: [PATCH] Make AST interpreter give up on uninterpretable closures --- src/lisp/kernel/cleavir/ast-interpreter.lisp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/lisp/kernel/cleavir/ast-interpreter.lisp b/src/lisp/kernel/cleavir/ast-interpreter.lisp index d13840d285..3e587c2159 100644 --- a/src/lisp/kernel/cleavir/ast-interpreter.lisp +++ b/src/lisp/kernel/cleavir/ast-interpreter.lisp @@ -168,6 +168,20 @@ (let ((body (cleavir-ast:body-ast ast)) (dynenv-out (cleavir-ast:dynamic-environment-out-ast ast)) (ll (cleavir-ast:lambda-list ast))) + ;; KLUDGE: If the closure has ASTs we can't interpret, we have + ;; to give up now, and there's no way to only compile this + ;; possibly-a-closure. We have to check proactively. + (cleavir-ast:map-ast-depth-first-preorder + (lambda (ast) + (when (typep ast '(or #+cst cc-ast:bind-va-list-ast + cc-ast:defcallback-ast + cc-ast:debug-break-ast + cc-ast:debug-message-ast + cc-ast:multiple-value-foreign-call-ast + cc-ast:foreign-call-ast + cc-ast:foreign-call-pointer-ast)) + (error 'interpret-ast:cannot-interpret :ast ast))) + body) (multiple-value-bind (required optional rest va-rest-p keyp key aok-p) (parse-lambda-list ll) (lambda (core:&va-rest arguments)