diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-04-10 11:34:23 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-04-10 11:34:23 -0700 |
commit | 3cffd5639fc0d1484a543c0bc137b8e00205a9e9 (patch) | |
tree | d230f5108913beb6ed060fa7d202a7d6d2bbfd68 /cadr.h | |
parent | 73a458a786c3cedde19b233132344a5279fc5d16 (diff) | |
download | txr-3cffd5639fc0d1484a543c0bc137b8e00205a9e9.tar.gz txr-3cffd5639fc0d1484a543c0bc137b8e00205a9e9.tar.bz2 txr-3cffd5639fc0d1484a543c0bc137b8e00205a9e9.zip |
compiler: bug: symbol not in ffuns in call forms.
This bug causes forms like (call (fun 'foo) ...) not to
register foo as a free reference in the function space,
leading to inappropriate lambda lifting optimizations. The
compiler thinks that a lambda is safe to move because that
lambda doesn't reference any surrounding lexical functions,
which is incorrect.
A failing test case for this is
(compile-file "tests/012/man-or-boy.tl")
at *opt-level* 3 or higher. A bogus error occurs similar
to "function #:g0144 is not defined", due to that function
being referenced from a lifted lambda, and not being in
its scope.
* share/txr/stdlib/compiler.tl (compiler (comp-fun-form,
comp-apply-call)): Pass the function symbol as an extra
argument to comp-fun-form so that it's added to ffuns.
(compiler comp-call-impl): Take new optional argument: a
symbol to be added to the ffuns slot of the returned fragment,
indicating that a function symbol is referenced.
Diffstat (limited to 'cadr.h')
0 files changed, 0 insertions, 0 deletions