diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2018-03-27 20:34:46 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2018-03-27 20:34:46 -0700 |
commit | 137ca989b8eb496e5e2237eaf200121e3529dd1f (patch) | |
tree | 2990d5faff617a52e395e79172e0798df0a3a573 | |
parent | 4adb942347bfdcdebdfd29625a41846cc0bb9cf8 (diff) | |
download | txr-137ca989b8eb496e5e2237eaf200121e3529dd1f.tar.gz txr-137ca989b8eb496e5e2237eaf200121e3529dd1f.tar.bz2 txr-137ca989b8eb496e5e2237eaf200121e3529dd1f.zip |
compiler: bugfix: register double free.
* share/txr/stdlib/compiler.tl (compiler comp-progn): Since
oreg-discard is conditionally allocated, it must be
only be freed if it had been allocated.
-rw-r--r-- | share/txr/stdlib/compiler.tl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl index fe9bfce8..8f64adca 100644 --- a/share/txr/stdlib/compiler.tl +++ b/share/txr/stdlib/compiler.tl @@ -753,7 +753,8 @@ (set fvars (uni fvars frag.fvars)) (set ffuns (uni ffuns frag.ffuns)) (pend frag.code))))))) - me.(free-treg oreg-discard) + (when (nequal oreg oreg-discard) + me.(free-treg oreg-discard)) (new (frag (if lastfrag lastfrag.oreg ^(t 0)) code fvars ffuns)))) (defmeth compiler comp-and-or (me oreg env form) |