summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2022-01-17 21:25:08 +0100
committerAndy Wingo <wingo@pobox.com>2022-01-17 21:25:08 +0100
commit373f35b5f7c4ad211f9ff2920d736d9ad2dcbd7e (patch)
tree372e6a692ed91483f82efcccdb1cb0030f2238be
parentd01ab7bf5cb97264b48bec96469360f1901d1a35 (diff)
downloadguile-373f35b5f7c4ad211f9ff2920d736d9ad2dcbd7e.tar.gz
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.
-rw-r--r--module/language/tree-il/peval.scm10
1 files 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.