From d9b04547bc08dfa2db6fa0574a85dc14e47a8d90 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 24 Apr 2018 20:32:35 -0700 Subject: 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. --- share/txr/stdlib/compiler.tl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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))) -- cgit v1.2.3