summaryrefslogtreecommitdiffstats
path: root/struct.c
diff options
context:
space:
mode:
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/struct.c b/struct.c
index 6178340b..0e8b1080 100644
--- a/struct.c
+++ b/struct.c
@@ -726,14 +726,30 @@ val reset_struct(val strct)
struct struct_inst *si = struct_handle(strct, self);
struct struct_type *st = si->type;
cnum i;
+ volatile val inited = nil;
+ int compat_190 = opt_compat && opt_compat <= 190;
check_init_lazy_struct(strct, si);
+ uw_simple_catch_begin;
+
for (i = 0; i < st->nslots; i++)
si->slot[i] = nil;
call_initfun_chain(st, strct);
+ if (!compat_190)
+ call_postinitfun_chain(st, strct);
+
+ inited = t;
+
+ uw_unwind {
+ if (!inited && !compat_190)
+ gc_call_finalizers(strct);
+ }
+
+ uw_catch_end;
+
return strct;
}