diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-07-06 06:25:35 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-07-06 06:25:35 -0700 |
commit | a6857c613efe6a0b54deb5daa0dc3234d5d86b57 (patch) | |
tree | d8089d89087b286bfff0b8dacf229d100cb248d4 /time.h | |
parent | 7a926eb8da998fba873900fadc4f2fa179e7319f (diff) | |
download | txr-a6857c613efe6a0b54deb5daa0dc3234d5d86b57.tar.gz txr-a6857c613efe6a0b54deb5daa0dc3234d5d86b57.tar.bz2 txr-a6857c613efe6a0b54deb5daa0dc3234d5d86b57.zip |
unwind: stop runaway recursion.
Before uw_rthrow calls uw_unwind_to_exit_point, it decrements the
reentry_count, so that function is not protected against
re-entry. We could protect some of its internal code agains
re-entry, like the use of a bad stderr stream, if we extend
the scope of that variable.
* unwind.c (reentry_count): New static variable, moved to file
scope from uw_rthrow function.
(uw_unwind_to_exit_point): Bump up the reentry count in two
places where we print diagnostics and terminate. If the
diagnostic code hits an exception, the uw_rthrow will see
the positive reentry count and abort.
Diffstat (limited to 'time.h')
0 files changed, 0 insertions, 0 deletions