summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-12-08 19:41:59 -0800
committerKaz Kylheku <kaz@kylheku.com>2017-12-08 19:41:59 -0800
commit8834a98cff2d8f80458957fccab5424f4b90cde5 (patch)
treef81ca46992f24e487536e4e5dd3dc82ada680a57
parent67bea8d7d93447767181af3ef047cb55b79f9ea0 (diff)
downloadtxr-8834a98cff2d8f80458957fccab5424f4b90cde5.tar.gz
txr-8834a98cff2d8f80458957fccab5424f4b90cde5.tar.bz2
txr-8834a98cff2d8f80458957fccab5424f4b90cde5.zip
trace: bugfix: spurious "previously traced" warning
When a method is traced with (trace (meth class slot)), a spurious warning occurs. This is because the function is recorded in the trace hash first and then the hook is installed, and the hook is installed using the static-slot-ensure function which performs the trace warning check. * share/txr/stdlib/trace.tl (sys:trace): Swap the order: install the hook first, and then put the the previous function into the trace hash. Doing this in parallel with pset would also work.
-rw-r--r--share/txr/stdlib/trace.tl4
1 files changed, 2 insertions, 2 deletions
diff --git a/share/txr/stdlib/trace.tl b/share/txr/stdlib/trace.tl
index 6cc97914..d5ecd103 100644
--- a/share/txr/stdlib/trace.tl
+++ b/share/txr/stdlib/trace.tl
@@ -51,8 +51,8 @@
val))
(if abandoned
(sys:trace-leave lex-n :abandoned)))))))
- (set [sys:*trace-hash* n] prev)
- (set (symbol-function n) hook)))))))
+ (set (symbol-function n) hook
+ [sys:*trace-hash* n] prev)))))))
(defun sys:untrace (names)
(flet ((disable (name-orig name)