summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-04-24 20:32:35 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-04-24 20:32:35 -0700
commitd9b04547bc08dfa2db6fa0574a85dc14e47a8d90 (patch)
treea5a05bfc52d59e7b8ee3f51334a20c17e964f0ae /share
parent74012ba82c2bcbbf4a3cde3da05e497719e41008 (diff)
downloadtxr-d9b04547bc08dfa2db6fa0574a85dc14e47a8d90.tar.gz
txr-d9b04547bc08dfa2db6fa0574a85dc14e47a8d90.tar.bz2
txr-d9b04547bc08dfa2db6fa0574a85dc14e47a8d90.zip
compiler: compile-file/load-time integration fix.
The issue is that when load-time forms are present in top-level forms, the execution of those forms destructively manipulates the data table. This is bad when we intend to write out the compiled forms into a file; we need to write them out in their freshly compiled state before these side effects took place. * share/txr/stdlib/compiler.tl (list-from-vm-desc): When serializing the compiled VM pieces to a list, make a freshly allocated shallow copy of the data vector. This could be optimized away if we know that the VM doesn't contain load-time effects.
Diffstat (limited to 'share')
-rw-r--r--share/txr/stdlib/compiler.tl2
1 files changed, 1 insertions, 1 deletions
diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl
index 9dbb1572..7defa0de 100644
--- a/share/txr/stdlib/compiler.tl
+++ b/share/txr/stdlib/compiler.tl
@@ -1477,7 +1477,7 @@
(list (sys:vm-desc-nlevels vd)
(sys:vm-desc-nregs vd)
(sys:vm-desc-bytecode vd)
- (sys:vm-desc-datavec vd)
+ (copy (sys:vm-desc-datavec vd))
(sys:vm-desc-funvec vd)))