From 373f35b5f7c4ad211f9ff2920d736d9ad2dcbd7e Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Mon, 17 Jan 2022 21:25:08 +0100 Subject: [PATCH] peval cross-module-inlining gracefully handles missing interface * module/language/tree-il/peval.scm (peval): The intention was for resolve-interface to return an interface only if it exists, but actually it throws if the interface isn't know. Fix to do what we intended to do. --- module/language/tree-il/peval.scm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/module/language/tree-il/peval.scm b/module/language/tree-il/peval.scm index d910088c9..e2d98f946 100644 --- a/module/language/tree-il/peval.scm +++ b/module/language/tree-il/peval.scm @@ -1,6 +1,6 @@ ;;; Tree-IL partial evaluator -;; Copyright (C) 2011-2014, 2017, 2019, 2020, 2021 Free Software Foundation, Inc. +;; Copyright (C) 2011-2014, 2017, 2019, 2020, 2021, 2022 Free Software Foundation, Inc. ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -1072,10 +1072,12 @@ top-level bindings from ENV and return the resulting expression." (cond ((and cross-module-inlining? public? - (and=> (resolve-interface module) + (and=> (resolve-module module #:ensure #f) (lambda (module) - (and=> (module-inlinable-exports module) - (lambda (proc) (proc name)))))) + (and=> (module-public-interface module) + (lambda (iface) + (and=> (module-inlinable-exports iface) + (lambda (proc) (proc name)))))))) => (lambda (inlined) ;; Similar logic to lexical-ref, but we can't enumerate ;; uses, and don't know about aliases.