diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-09-07 20:32:11 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-09-07 20:32:11 -0700 |
commit | e3aa3aac033df459debee3746feb437a506bc0f3 (patch) | |
tree | 5b34dd154dd4457e50a127acac854abccf4791a9 /struct.c | |
parent | b8ee64789e18cbfe5e1dc7e64e0c9160e9c265b7 (diff) | |
download | txr-e3aa3aac033df459debee3746feb437a506bc0f3.tar.gz txr-e3aa3aac033df459debee3746feb437a506bc0f3.tar.bz2 txr-e3aa3aac033df459debee3746feb437a506bc0f3.zip |
Fix poorly chosen :postinit order.
* struct.c (call_postinitfun_chain): call base
handlers before derived ones, except in backward
compatibility mode.
* txr.1: Updated documentation of :postinit,
and added compatibility note.
Diffstat (limited to 'struct.c')
-rw-r--r-- | struct.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -366,10 +366,14 @@ static void call_initfun_chain(struct struct_type *st, val strct) static void call_postinitfun_chain(struct struct_type *st, val strct) { if (st) { - if (st->postinitfun) + int derived_first = (opt_compat && opt_compat <= 148); + + if (derived_first && st->postinitfun) funcall1(st->postinitfun, strct); if (st->super) call_postinitfun_chain(st->super_handle, strct); + if (!derived_first && st->postinitfun) + funcall1(st->postinitfun, strct); } } |