summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-11-15 19:35:19 -0800
committerKaz Kylheku <kaz@kylheku.com>2023-11-15 19:35:19 -0800
commit7d6caf9959e5bf92c6714ca19fb2f628d3c72bfb (patch)
tree42456efc9567acf19a6da6015831671be79124df /tests
parentab7b3f9c872d103ffe21fa65f5b420dc94414f75 (diff)
downloadtxr-7d6caf9959e5bf92c6714ca19fb2f628d3c72bfb.tar.gz
txr-7d6caf9959e5bf92c6714ca19fb2f628d3c72bfb.tar.bz2
txr-7d6caf9959e5bf92c6714ca19fb2f628d3c72bfb.zip
oop: segfault in special methods cache.
* struct.c (invalidate_special_slots): New static function. (invalidate_special_slot_nonexistence): Move static function up in file, to be next to invalidate_special_slots. (make_struct_type, static_slot_ens_rec): Call the new invalidate_special_slots function in addition to calling static_slot_home_fixup whenever the stslots array is resized. The spslot array contains pointers to the elements of stslots, which become invalid when that is resized. * tests/012/oop-seq.tl: Repro test case added.
Diffstat (limited to 'tests')
-rw-r--r--tests/012/oop-seq.tl14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/012/oop-seq.tl b/tests/012/oop-seq.tl
index 919f34cc..e91564fc 100644
--- a/tests/012/oop-seq.tl
+++ b/tests/012/oop-seq.tl
@@ -54,3 +54,17 @@
(test (list-seq (new counter-fast init 0 step 1 limit 0))
nil)
+
+;; The following reproduced a segfault when the change was made to allow del to
+;; work with structs that have lambda and lambda-set.
+
+(defstruct blah ()
+ (:method lambda-set (me . args)))
+
+(defparm o (new blah))
+
+(set [o 1..20] 42)
+
+(defmeth blah lambda (me . args))
+
+(set [o 1..20] 42)