diff options
Diffstat (limited to 'src/bytecode.c')
| -rw-r--r-- | src/bytecode.c | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/src/bytecode.c b/src/bytecode.c index 55b193ffb2f..62ba2ca69d0 100644 --- a/src/bytecode.c +++ b/src/bytecode.c | |||
| @@ -132,6 +132,8 @@ DEFINE (Bunbind7, 057) \ | |||
| 132 | DEFINE (Bpophandler, 060) \ | 132 | DEFINE (Bpophandler, 060) \ |
| 133 | DEFINE (Bpushconditioncase, 061) \ | 133 | DEFINE (Bpushconditioncase, 061) \ |
| 134 | DEFINE (Bpushcatch, 062) \ | 134 | DEFINE (Bpushcatch, 062) \ |
| 135 | DEFINE (Bpushunwindprotect, 063) \ | ||
| 136 | DEFINE (Bendunwindprotect, 064) \ | ||
| 135 | \ | 137 | \ |
| 136 | DEFINE (Bnth, 070) \ | 138 | DEFINE (Bnth, 070) \ |
| 137 | DEFINE (Bsymbolp, 071) \ | 139 | DEFINE (Bsymbolp, 071) \ |
| @@ -770,6 +772,45 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, | |||
| 770 | NEXT; | 772 | NEXT; |
| 771 | } | 773 | } |
| 772 | 774 | ||
| 775 | CASE (Bpushunwindprotect): /* New in 27.1. */ | ||
| 776 | { | ||
| 777 | struct handler *c = push_handler (Qt, CATCHER_ALL); | ||
| 778 | c->bytecode_dest = FETCH2; | ||
| 779 | c->bytecode_top = top; | ||
| 780 | |||
| 781 | if (sys_setjmp (c->jmp)) | ||
| 782 | { | ||
| 783 | struct handler *c = handlerlist; | ||
| 784 | top = c->bytecode_top; | ||
| 785 | op = c->bytecode_dest; | ||
| 786 | handlerlist = c->next; | ||
| 787 | /* Push the exception value, plus a flag indicating | ||
| 788 | that re-throwing is necessary. This will be used | ||
| 789 | by Bendunwindprotect. */ | ||
| 790 | PUSH (c->val); | ||
| 791 | PUSH (Qt); | ||
| 792 | goto op_branch; | ||
| 793 | } | ||
| 794 | |||
| 795 | NEXT; | ||
| 796 | } | ||
| 797 | CASE (Bendunwindprotect): /* New in 27.1. */ | ||
| 798 | { | ||
| 799 | Lisp_Object flag = POP; | ||
| 800 | |||
| 801 | if (!NILP (flag)) | ||
| 802 | { | ||
| 803 | Lisp_Object err = POP; | ||
| 804 | |||
| 805 | if (EQ (XCAR (err), Qsignal)) | ||
| 806 | Fsignal (XCAR (XCDR (err)), XCDR (XCDR (err))); | ||
| 807 | else | ||
| 808 | Fthrow (XCAR (XCDR (err)), XCDR (XCDR (err))); | ||
| 809 | } | ||
| 810 | |||
| 811 | NEXT; | ||
| 812 | } | ||
| 813 | |||
| 773 | CASE (Bpushcatch): /* New in 24.4. */ | 814 | CASE (Bpushcatch): /* New in 24.4. */ |
| 774 | type = CATCHER; | 815 | type = CATCHER; |
| 775 | goto pushhandler; | 816 | goto pushhandler; |
| @@ -798,7 +839,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, | |||
| 798 | handlerlist = handlerlist->next; | 839 | handlerlist = handlerlist->next; |
| 799 | NEXT; | 840 | NEXT; |
| 800 | 841 | ||
| 801 | CASE (Bunwind_protect): /* FIXME: avoid closure for lexbind. */ | 842 | CASE (Bunwind_protect): /* Obsolete since 27.1. */ |
| 802 | { | 843 | { |
| 803 | Lisp_Object handler = POP; | 844 | Lisp_Object handler = POP; |
| 804 | /* Support for a function here is new in 24.4. */ | 845 | /* Support for a function here is new in 24.4. */ |