aboutsummaryrefslogtreecommitdiffstats
path: root/src/bytecode.c
diff options
context:
space:
mode:
authorGerd Moellmann1999-11-08 00:06:50 +0000
committerGerd Moellmann1999-11-08 00:06:50 +0000
commitfa9aabf6340269ce49f0e26b59a9c2676c5938e2 (patch)
tree7ff14d282cfb8c3a4528b31e84e0ab94d26dae5e /src/bytecode.c
parent033a5fa3094af5eca4b1fcfa0e1aa00e03e99a55 (diff)
downloademacs-fa9aabf6340269ce49f0e26b59a9c2676c5938e2.tar.gz
emacs-fa9aabf6340269ce49f0e26b59a9c2676c5938e2.zip
* bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
BEFORE_POTENTIAL_GC before DISCARD.
Diffstat (limited to 'src/bytecode.c')
-rw-r--r--src/bytecode.c73
1 files changed, 50 insertions, 23 deletions
diff --git a/src/bytecode.c b/src/bytecode.c
index 377d1a020b5..d2d74b0b59a 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -500,9 +500,12 @@ If the third argument is incorrect, Emacs may crash.")
500 { 500 {
501 Lisp_Object v1; 501 Lisp_Object v1;
502 v1 = TOP; 502 v1 = TOP;
503 if (CONSP (v1)) TOP = XCAR (v1); 503 if (CONSP (v1))
504 else if (NILP (v1)) TOP = Qnil; 504 TOP = XCAR (v1);
505 else Fcar (wrong_type_argument (Qlistp, v1)); 505 else if (NILP (v1))
506 TOP = Qnil;
507 else
508 Fcar (wrong_type_argument (Qlistp, v1));
506 break; 509 break;
507 } 510 }
508 511
@@ -526,9 +529,12 @@ If the third argument is incorrect, Emacs may crash.")
526 { 529 {
527 Lisp_Object v1; 530 Lisp_Object v1;
528 v1 = TOP; 531 v1 = TOP;
529 if (CONSP (v1)) TOP = XCDR (v1); 532 if (CONSP (v1))
530 else if (NILP (v1)) TOP = Qnil; 533 TOP = XCDR (v1);
531 else Fcdr (wrong_type_argument (Qlistp, v1)); 534 else if (NILP (v1))
535 TOP = Qnil;
536 else
537 Fcdr (wrong_type_argument (Qlistp, v1));
532 break; 538 break;
533 } 539 }
534 540
@@ -566,8 +572,12 @@ If the third argument is incorrect, Emacs may crash.")
566 op = FETCH2; 572 op = FETCH2;
567 goto varbind; 573 goto varbind;
568 574
569 case Bvarbind: case Bvarbind+1: case Bvarbind+2: case Bvarbind+3: 575 case Bvarbind:
570 case Bvarbind+4: case Bvarbind+5: 576 case Bvarbind+1:
577 case Bvarbind+2:
578 case Bvarbind+3:
579 case Bvarbind+4:
580 case Bvarbind+5:
571 op -= Bvarbind; 581 op -= Bvarbind;
572 varbind: 582 varbind:
573 specbind (vectorp[op], POP); 583 specbind (vectorp[op], POP);
@@ -581,11 +591,16 @@ If the third argument is incorrect, Emacs may crash.")
581 op = FETCH2; 591 op = FETCH2;
582 goto docall; 592 goto docall;
583 593
584 case Bcall: case Bcall+1: case Bcall+2: case Bcall+3: 594 case Bcall:
585 case Bcall+4: case Bcall+5: 595 case Bcall+1:
596 case Bcall+2:
597 case Bcall+3:
598 case Bcall+4:
599 case Bcall+5:
586 op -= Bcall; 600 op -= Bcall;
587 docall: 601 docall:
588 { 602 {
603 BEFORE_POTENTIAL_GC ();
589 DISCARD (op); 604 DISCARD (op);
590#ifdef BYTE_CODE_METER 605#ifdef BYTE_CODE_METER
591 if (byte_metering_on && SYMBOLP (TOP)) 606 if (byte_metering_on && SYMBOLP (TOP))
@@ -602,7 +617,6 @@ If the third argument is incorrect, Emacs may crash.")
602 } 617 }
603 } 618 }
604#endif 619#endif
605 BEFORE_POTENTIAL_GC ();
606 TOP = Ffuncall (op + 1, &TOP); 620 TOP = Ffuncall (op + 1, &TOP);
607 AFTER_POTENTIAL_GC (); 621 AFTER_POTENTIAL_GC ();
608 break; 622 break;
@@ -616,8 +630,12 @@ If the third argument is incorrect, Emacs may crash.")
616 op = FETCH2; 630 op = FETCH2;
617 goto dounbind; 631 goto dounbind;
618 632
619 case Bunbind: case Bunbind+1: case Bunbind+2: case Bunbind+3: 633 case Bunbind:
620 case Bunbind+4: case Bunbind+5: 634 case Bunbind+1:
635 case Bunbind+2:
636 case Bunbind+3:
637 case Bunbind+4:
638 case Bunbind+5:
621 op -= Bunbind; 639 op -= Bunbind;
622 dounbind: 640 dounbind:
623 BEFORE_POTENTIAL_GC (); 641 BEFORE_POTENTIAL_GC ();
@@ -737,7 +755,8 @@ If the third argument is incorrect, Emacs may crash.")
737 break; 755 break;
738 756
739 case Bsave_excursion: 757 case Bsave_excursion:
740 record_unwind_protect (save_excursion_restore, save_excursion_save ()); 758 record_unwind_protect (save_excursion_restore,
759 save_excursion_save ());
741 break; 760 break;
742 761
743 case Bsave_current_buffer: 762 case Bsave_current_buffer:
@@ -752,13 +771,13 @@ If the third argument is incorrect, Emacs may crash.")
752 break; 771 break;
753 772
754 case Bsave_restriction: 773 case Bsave_restriction:
755 record_unwind_protect (save_restriction_restore, save_restriction_save ()); 774 record_unwind_protect (save_restriction_restore,
775 save_restriction_save ());
756 break; 776 break;
757 777
758 case Bcatch: 778 case Bcatch:
759 { 779 {
760 Lisp_Object v1; 780 Lisp_Object v1;
761
762 v1 = POP; 781 v1 = POP;
763 BEFORE_POTENTIAL_GC (); 782 BEFORE_POTENTIAL_GC ();
764 TOP = internal_catch (TOP, Feval, v1); 783 TOP = internal_catch (TOP, Feval, v1);
@@ -823,9 +842,12 @@ If the third argument is incorrect, Emacs may crash.")
823 } 842 }
824 } 843 }
825 immediate_quit = 0; 844 immediate_quit = 0;
826 if (CONSP (v1)) TOP = XCAR (v1); 845 if (CONSP (v1))
827 else if (NILP (v1)) TOP = Qnil; 846 TOP = XCAR (v1);
828 else Fcar (wrong_type_argument (Qlistp, v1)); 847 else if (NILP (v1))
848 TOP = Qnil;
849 else
850 Fcar (wrong_type_argument (Qlistp, v1));
829 break; 851 break;
830 } 852 }
831 853
@@ -941,7 +963,9 @@ If the third argument is incorrect, Emacs may crash.")
941 { 963 {
942 Lisp_Object v1, v2; 964 Lisp_Object v1, v2;
943 v2 = POP; v1 = POP; 965 v2 = POP; v1 = POP;
966 BEFORE_POTENTIAL_GC ();
944 TOP = Fsubstring (TOP, v1, v2); 967 TOP = Fsubstring (TOP, v1, v2);
968 AFTER_POTENTIAL_GC ();
945 break; 969 break;
946 } 970 }
947 971
@@ -1121,8 +1145,8 @@ If the third argument is incorrect, Emacs may crash.")
1121 1145
1122 case BinsertN: 1146 case BinsertN:
1123 op = FETCH; 1147 op = FETCH;
1124 DISCARD (op - 1);
1125 BEFORE_POTENTIAL_GC (); 1148 BEFORE_POTENTIAL_GC ();
1149 DISCARD (op - 1);
1126 TOP = Finsert (op, &TOP); 1150 TOP = Finsert (op, &TOP);
1127 AFTER_POTENTIAL_GC (); 1151 AFTER_POTENTIAL_GC ();
1128 break; 1152 break;
@@ -1373,9 +1397,12 @@ If the third argument is incorrect, Emacs may crash.")
1373 } 1397 }
1374 } 1398 }
1375 immediate_quit = 0; 1399 immediate_quit = 0;
1376 if (CONSP (v1)) TOP = XCAR (v1); 1400 if (CONSP (v1))
1377 else if (NILP (v1)) TOP = Qnil; 1401 TOP = XCAR (v1);
1378 else Fcar (wrong_type_argument (Qlistp, v1)); 1402 else if (NILP (v1))
1403 TOP = Qnil;
1404 else
1405 Fcar (wrong_type_argument (Qlistp, v1));
1379 } 1406 }
1380 else 1407 else
1381 { 1408 {