diff options
author | Chet Ramey <chet.ramey@case.edu> | 2020-09-09 15:25:32 -0400 |
---|---|---|
committer | Chet Ramey <chet.ramey@case.edu> | 2020-09-09 15:25:32 -0400 |
commit | 3eb0018e75b74bb886df7fba4b1712529ce7258f (patch) | |
tree | 13b53713ef8f483a82295324e314da48b59c9346 /unwind_prot.c | |
parent | 712f80b0a49c3a0227d0b52bff5e0b763747697e (diff) | |
download | bash-5.1-beta.tar.gz |
bash-5.1 beta releasebash-5.1-beta
Diffstat (limited to 'unwind_prot.c')
-rw-r--r-- | unwind_prot.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/unwind_prot.c b/unwind_prot.c index 664e3a9b..5703777f 100644 --- a/unwind_prot.c +++ b/unwind_prot.c @@ -108,21 +108,13 @@ uwp_init () } /* Run a function without interrupts. This relies on the fact that the - FUNCTION cannot change the value of interrupt_immediately. (I.e., does - not call QUIT (). */ + FUNCTION cannot call QUIT (). */ static void without_interrupts (function, arg1, arg2) VFunction *function; char *arg1, *arg2; { - int old_interrupt_immediately; - - old_interrupt_immediately = interrupt_immediately; - interrupt_immediately = 0; - (*function)(arg1, arg2); - - interrupt_immediately = old_interrupt_immediately; } /* Start the beginning of a region. */ @@ -349,6 +341,8 @@ unwind_protect_mem_internal (var, psize) size = *(int *) psize; allocated = size + offsetof (UNWIND_ELT, sv.v.desired_setting[0]); + if (allocated < sizeof (UNWIND_ELT)) + allocated = sizeof (UNWIND_ELT); elt = (UNWIND_ELT *)xmalloc (allocated); elt->head.next = unwind_protect_list; elt->head.cleanup = (Function *) restore_variable; |