mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-29 19:30:36 +02:00
Add a workaround for pre-3.0.10 incorrect inlinable exports
* module/language/tree-il/peval.scm (peval)
(inlinable-kwargs-bug-fixup): Before 3.0.10, the inlinable exports pass
was incorrectly serializing functions with keyword arguments. This was
fixed in 2c645571b3
, but that meant that
3.0.10 compiling against 3.0.9 binaries could raise an exception at
compile-time; whoops. Add a workaround so that 3.0.9 binaries still
work.
Fixes https://issues.guix.gnu.org/72936.
This commit is contained in:
parent
a970ed5bd5
commit
90e1205018
1 changed files with 18 additions and 2 deletions
|
@ -395,6 +395,21 @@ referenced multiple times."
|
|||
;; FIXME: add more cases?
|
||||
(else #f)))
|
||||
|
||||
(define (inlinable-kwargs-bug-fixup exp)
|
||||
;; Versions of Guile before 3.0.10 had a bug where they mis-serialized
|
||||
;; functions with keyword arguments; work around that. See
|
||||
;; https://issues.guix.gnu.org/72936.
|
||||
(post-order
|
||||
(match-lambda
|
||||
(($ <lambda-case> src req opt rest (aok? (kw name #f) ...) inits syms body
|
||||
alt)
|
||||
(let ((kw-syms (reverse (list-head (reverse syms) (length kw)))))
|
||||
(make-lambda-case src req opt rest
|
||||
(cons aok? (map list kw name kw-syms))
|
||||
inits syms body alt)))
|
||||
(exp exp))
|
||||
exp))
|
||||
|
||||
(define* (peval exp #:optional (cenv (current-module)) (env vlist-null)
|
||||
#:key
|
||||
(operator-size-limit 40)
|
||||
|
@ -1110,8 +1125,9 @@ top-level bindings from ENV and return the resulting expression."
|
|||
(lambda (module)
|
||||
(and=> (module-public-interface module)
|
||||
(lambda (iface)
|
||||
(and=> (module-inlinable-exports iface)
|
||||
(lambda (proc) (proc name))))))))
|
||||
(and=> (and=> (module-inlinable-exports iface)
|
||||
(lambda (proc) (proc name)))
|
||||
inlinable-kwargs-bug-fixup))))))
|
||||
=> (lambda (inlined)
|
||||
;; Similar logic to lexical-ref, but we can't enumerate
|
||||
;; uses, and don't know about aliases.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue