summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-08-28 07:19:34 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-08-28 07:19:34 -0700
commitac3df138f68a2fc3812101a94222e2d0b4aeb448 (patch)
treefa9a0300fd9ecc8e7b8c53ffd66367e60c404524
parentad8650f3a9af56f5db85aae74466e0bc08f617a1 (diff)
downloadtxr-ac3df138f68a2fc3812101a94222e2d0b4aeb448.tar.gz
txr-ac3df138f68a2fc3812101a94222e2d0b4aeb448.tar.bz2
txr-ac3df138f68a2fc3812101a94222e2d0b4aeb448.zip
trace: bug: redef of traced method resurrects old.
When a method which is traced is redefined, a warning message is correctly issued and the trace is removed. But the removal is done in the wrong order and ends up restoring the old function, clobbering the new definition. * struct.c (static_slot_ensure): Move the trace_check before the call to static_slot_ens_rec, so installation of the new method takes place after the trace is removed from the old one.
-rw-r--r--struct.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/struct.c b/struct.c
index 604ba041..693c20dc 100644
--- a/struct.c
+++ b/struct.c
@@ -1246,15 +1246,15 @@ val static_slot_ensure(val stype, val sym, val newval, val no_error_p)
uw_throwf(error_s, lit("~a: ~s isn't a valid slot name"),
self, sym, nao);
- no_error_p = default_null_arg(no_error_p);
- res = static_slot_ens_rec(stype, sym, newval, no_error_p, self, 0);
-
if (trace_loaded) {
struct struct_type *st = stype_handle(&stype, self);
val name = list(meth_s, st->name, sym, nao);
trace_check(name);
}
+ no_error_p = default_null_arg(no_error_p);
+ res = static_slot_ens_rec(stype, sym, newval, no_error_p, self, 0);
+
return res;
}