1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00

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.
This commit is contained in:
Andy Wingo 2022-01-17 21:25:08 +01:00
parent d01ab7bf5c
commit 373f35b5f7

View file

@ -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.