aboutsummaryrefslogtreecommitdiffstats
path: root/src/bytecode.c
diff options
context:
space:
mode:
authorGerd Moellmann2000-01-26 14:47:42 +0000
committerGerd Moellmann2000-01-26 14:47:42 +0000
commitf5941bf8c0c13e150f67f26094287381c34c7217 (patch)
treef175098c0b98c98721a77d30fb490c69c4056f94 /src/bytecode.c
parentfc3cb4607cc17f0a465bb15dd492c58cccac080c (diff)
downloademacs-f5941bf8c0c13e150f67f26094287381c34c7217.tar.gz
emacs-f5941bf8c0c13e150f67f26094287381c34c7217.zip
(Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
an error may be signalled.
Diffstat (limited to 'src/bytecode.c')
-rw-r--r--src/bytecode.c52
1 files changed, 46 insertions, 6 deletions
diff --git a/src/bytecode.c b/src/bytecode.c
index 084dfef6fb5..52a0dba31d5 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -505,7 +505,11 @@ If the third argument is incorrect, Emacs may crash.")
505 else if (NILP (v1)) 505 else if (NILP (v1))
506 TOP = Qnil; 506 TOP = Qnil;
507 else 507 else
508 Fcar (wrong_type_argument (Qlistp, v1)); 508 {
509 BEFORE_POTENTIAL_GC ();
510 Fcar (wrong_type_argument (Qlistp, v1));
511 AFTER_POTENTIAL_GC ();
512 }
509 break; 513 break;
510 } 514 }
511 515
@@ -534,7 +538,11 @@ If the third argument is incorrect, Emacs may crash.")
534 else if (NILP (v1)) 538 else if (NILP (v1))
535 TOP = Qnil; 539 TOP = Qnil;
536 else 540 else
537 Fcdr (wrong_type_argument (Qlistp, v1)); 541 {
542 BEFORE_POTENTIAL_GC ();
543 Fcdr (wrong_type_argument (Qlistp, v1));
544 AFTER_POTENTIAL_GC ();
545 }
538 break; 546 break;
539 } 547 }
540 548
@@ -826,7 +834,9 @@ If the third argument is incorrect, Emacs may crash.")
826 Lisp_Object v1, v2; 834 Lisp_Object v1, v2;
827 v1 = POP; 835 v1 = POP;
828 v2 = TOP; 836 v2 = TOP;
837 BEFORE_POTENTIAL_GC ();
829 CHECK_NUMBER (v2, 0); 838 CHECK_NUMBER (v2, 0);
839 AFTER_POTENTIAL_GC ();
830 op = XINT (v2); 840 op = XINT (v2);
831 immediate_quit = 1; 841 immediate_quit = 1;
832 while (--op >= 0) 842 while (--op >= 0)
@@ -836,7 +846,9 @@ If the third argument is incorrect, Emacs may crash.")
836 else if (!NILP (v1)) 846 else if (!NILP (v1))
837 { 847 {
838 immediate_quit = 0; 848 immediate_quit = 0;
849 BEFORE_POTENTIAL_GC ();
839 v1 = wrong_type_argument (Qlistp, v1); 850 v1 = wrong_type_argument (Qlistp, v1);
851 AFTER_POTENTIAL_GC ();
840 immediate_quit = 1; 852 immediate_quit = 1;
841 op++; 853 op++;
842 } 854 }
@@ -847,7 +859,11 @@ If the third argument is incorrect, Emacs may crash.")
847 else if (NILP (v1)) 859 else if (NILP (v1))
848 TOP = Qnil; 860 TOP = Qnil;
849 else 861 else
850 Fcar (wrong_type_argument (Qlistp, v1)); 862 {
863 BEFORE_POTENTIAL_GC ();
864 Fcar (wrong_type_argument (Qlistp, v1));
865 AFTER_POTENTIAL_GC ();
866 }
851 break; 867 break;
852 } 868 }
853 869
@@ -1022,8 +1038,10 @@ If the third argument is incorrect, Emacs may crash.")
1022 { 1038 {
1023 Lisp_Object v1, v2; 1039 Lisp_Object v1, v2;
1024 v2 = POP; v1 = TOP; 1040 v2 = POP; v1 = TOP;
1041 BEFORE_POTENTIAL_GC ();
1025 CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (v1, 0); 1042 CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (v1, 0);
1026 CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (v2, 0); 1043 CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (v2, 0);
1044 AFTER_POTENTIAL_GC ();
1027#ifdef LISP_FLOAT_TYPE 1045#ifdef LISP_FLOAT_TYPE
1028 if (FLOATP (v1) || FLOATP (v2)) 1046 if (FLOATP (v1) || FLOATP (v2))
1029 { 1047 {
@@ -1270,7 +1288,9 @@ If the third argument is incorrect, Emacs may crash.")
1270 break; 1288 break;
1271 1289
1272 case Bchar_syntax: 1290 case Bchar_syntax:
1291 BEFORE_POTENTIAL_GC ();
1273 CHECK_NUMBER (TOP, 0); 1292 CHECK_NUMBER (TOP, 0);
1293 AFTER_POTENTIAL_GC ();
1274 XSETFASTINT (TOP, syntax_code_spec[(int) SYNTAX (XINT (TOP))]); 1294 XSETFASTINT (TOP, syntax_code_spec[(int) SYNTAX (XINT (TOP))]);
1275 break; 1295 break;
1276 1296
@@ -1381,7 +1401,9 @@ If the third argument is incorrect, Emacs may crash.")
1381 /* Exchange args and then do nth. */ 1401 /* Exchange args and then do nth. */
1382 v2 = POP; 1402 v2 = POP;
1383 v1 = TOP; 1403 v1 = TOP;
1404 BEFORE_POTENTIAL_GC ();
1384 CHECK_NUMBER (v2, 0); 1405 CHECK_NUMBER (v2, 0);
1406 AFTER_POTENTIAL_GC ();
1385 op = XINT (v2); 1407 op = XINT (v2);
1386 immediate_quit = 1; 1408 immediate_quit = 1;
1387 while (--op >= 0) 1409 while (--op >= 0)
@@ -1391,7 +1413,9 @@ If the third argument is incorrect, Emacs may crash.")
1391 else if (!NILP (v1)) 1413 else if (!NILP (v1))
1392 { 1414 {
1393 immediate_quit = 0; 1415 immediate_quit = 0;
1416 BEFORE_POTENTIAL_GC ();
1394 v1 = wrong_type_argument (Qlistp, v1); 1417 v1 = wrong_type_argument (Qlistp, v1);
1418 AFTER_POTENTIAL_GC ();
1395 immediate_quit = 1; 1419 immediate_quit = 1;
1396 op++; 1420 op++;
1397 } 1421 }
@@ -1402,7 +1426,11 @@ If the third argument is incorrect, Emacs may crash.")
1402 else if (NILP (v1)) 1426 else if (NILP (v1))
1403 TOP = Qnil; 1427 TOP = Qnil;
1404 else 1428 else
1405 Fcar (wrong_type_argument (Qlistp, v1)); 1429 {
1430 BEFORE_POTENTIAL_GC ();
1431 Fcar (wrong_type_argument (Qlistp, v1));
1432 AFTER_POTENTIAL_GC ();
1433 }
1406 } 1434 }
1407 else 1435 else
1408 { 1436 {
@@ -1485,10 +1513,14 @@ If the third argument is incorrect, Emacs may crash.")
1485 1513
1486#ifdef BYTE_CODE_SAFE 1514#ifdef BYTE_CODE_SAFE
1487 case Bset_mark: 1515 case Bset_mark:
1516 BEFORE_POTENTIAL_GC ();
1488 error ("set-mark is an obsolete bytecode"); 1517 error ("set-mark is an obsolete bytecode");
1518 AFTER_POTENTIAL_GC ();
1489 break; 1519 break;
1490 case Bscan_buffer: 1520 case Bscan_buffer:
1521 BEFORE_POTENTIAL_GC ();
1491 error ("scan-buffer is an obsolete bytecode"); 1522 error ("scan-buffer is an obsolete bytecode");
1523 AFTER_POTENTIAL_GC ();
1492 break; 1524 break;
1493#endif 1525#endif
1494 1526
@@ -1499,9 +1531,17 @@ If the third argument is incorrect, Emacs may crash.")
1499 default: 1531 default:
1500#ifdef BYTE_CODE_SAFE 1532#ifdef BYTE_CODE_SAFE
1501 if (op < Bconstant) 1533 if (op < Bconstant)
1502 error ("unknown bytecode %d (byte compiler bug)", op); 1534 {
1535 BEFORE_POTENTIAL_GC ();
1536 error ("unknown bytecode %d (byte compiler bug)", op);
1537 AFTER_POTENTIAL_GC ();
1538 }
1503 if ((op -= Bconstant) >= const_length) 1539 if ((op -= Bconstant) >= const_length)
1504 error ("no constant number %d (byte compiler bug)", op); 1540 {
1541 BEFORE_POTENTIAL_GC ();
1542 error ("no constant number %d (byte compiler bug)", op);
1543 AFTER_POTENTIAL_GC ();
1544 }
1505 PUSH (vectorp[op]); 1545 PUSH (vectorp[op]);
1506#else 1546#else
1507 PUSH (vectorp[op - Bconstant]); 1547 PUSH (vectorp[op - Bconstant]);