From 6e948c6336759b2a155e3d962685ad7bfbff2c2f Mon Sep 17 00:00:00 2001 From: Evan Hanson Date: Sun, 6 Mar 2016 17:37:13 +1300 Subject: [PATCH] Preserve destination name when inserting C_DEBUG_GLOBAL_ASSIGN events Using a gensym for the let binding inserted by C_DEBUG_GLOBAL_ASSIGN events causes a different "dest" to be used when walking the assigned value, which (for procedures) means that the value's accompanying C_DEBUG_ENTRY event will use that temporary name rather than the procedure's real, assigned one. --- compiler.scm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/compiler.scm b/compiler.scm index 301dcfe..207a67e 100644 --- a/compiler.scm +++ b/compiler.scm @@ -981,11 +981,10 @@ (mark-variable var '##compiler#always-bound-to-procedure) (mark-variable var '##compiler#always-bound)) (when emit-debug-info - (let ((tmp (gensym))) - (set! val - `(let ((,tmp ,val)) - (##core#debug-event "C_DEBUG_GLOBAL_ASSIGN" ',var) - ,tmp))))) + (set! val + `(let ((,var ,val)) + (##core#debug-event "C_DEBUG_GLOBAL_ASSIGN" ',var) + ,var)))) (cond ((##sys#macro? var) (warning (sprintf "assigned global variable `~S' is syntax ~A" -- 2.7.0