summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-08-28 09:50:44 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-08-28 09:50:44 -0700
commitee0abfbd740dc1f2b05989232046e94c6ce11b05 (patch)
tree86e1cb10c42e14fd968d5f7a2fb853a520f3c876 /eval.c
parentd4091b09902b5f57eef994fe414966ae4b6b2097 (diff)
downloadtxr-ee0abfbd740dc1f2b05989232046e94c6ce11b05.tar.gz
txr-ee0abfbd740dc1f2b05989232046e94c6ce11b05.tar.bz2
txr-ee0abfbd740dc1f2b05989232046e94c6ce11b05.zip
Fix runaway recursion in lazy struct initialization.
Staci-blowing test case: (defstruct foo nil bar) (mlet ((f (lnew foo bar (not f.bar)))) (prinl f.bar)) * struct.c (lazy_struct_init): Do not flip the lazy flag to zero here. The problem is that it's being done after the funcall(so->slot[0]), and so the struct is still marked for lazy initialization while that function is running. We could detect the circularity (as done in the force function) but that would create inflexibilities in lazy struct initialization. (check_init_lazy_struct): Flip the lazy flag to zero in this function before calling lazy_struct_init. * txr.1: Document behavior of struct being freely accessible during lazy initialization.
Diffstat (limited to 'eval.c')
0 files changed, 0 insertions, 0 deletions