diff options
Diffstat (limited to 'src/eval.c')
| -rw-r--r-- | src/eval.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/src/eval.c b/src/eval.c index 26aea3df5df..718e58c693f 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -38,16 +38,20 @@ struct backtrace | |||
| 38 | struct backtrace *next; | 38 | struct backtrace *next; |
| 39 | Lisp_Object *function; | 39 | Lisp_Object *function; |
| 40 | Lisp_Object *args; /* Points to vector of args. */ | 40 | Lisp_Object *args; /* Points to vector of args. */ |
| 41 | size_t nargs; /* Length of vector. | 41 | #define NARGS_BITS (BITS_PER_INT - 2) |
| 42 | If nargs is (size_t) UNEVALLED, args points | 42 | /* Let's not use size_t because we want to allow negative values (for |
| 43 | to slot holding list of unevalled args. */ | 43 | UNEVALLED). Also let's steal 2 bits so we save a word (or more for |
| 44 | char evalargs; | 44 | alignment). In any case I doubt Emacs would survive a function call with |
| 45 | more than 500M arguments. */ | ||
| 46 | int nargs : NARGS_BITS; /* Length of vector. | ||
| 47 | If nargs is UNEVALLED, args points | ||
| 48 | to slot holding list of unevalled args. */ | ||
| 49 | char evalargs : 1; | ||
| 45 | /* Nonzero means call value of debugger when done with this operation. */ | 50 | /* Nonzero means call value of debugger when done with this operation. */ |
| 46 | char debug_on_exit; | 51 | char debug_on_exit : 1; |
| 47 | }; | 52 | }; |
| 48 | 53 | ||
| 49 | struct backtrace *backtrace_list; | 54 | struct backtrace *backtrace_list; |
| 50 | |||
| 51 | struct catchtag *catchlist; | 55 | struct catchtag *catchlist; |
| 52 | 56 | ||
| 53 | #ifdef DEBUG_GCPRO | 57 | #ifdef DEBUG_GCPRO |
| @@ -553,7 +557,7 @@ interactive_p (int exclude_subrs_p) | |||
| 553 | looking at several frames for special forms. Skip past them. */ | 557 | looking at several frames for special forms. Skip past them. */ |
| 554 | while (btp | 558 | while (btp |
| 555 | && (EQ (*btp->function, Qbytecode) | 559 | && (EQ (*btp->function, Qbytecode) |
| 556 | || btp->nargs == (size_t) UNEVALLED)) | 560 | || btp->nargs == UNEVALLED)) |
| 557 | btp = btp->next; | 561 | btp = btp->next; |
| 558 | 562 | ||
| 559 | /* `btp' now points at the frame of the innermost function that isn't | 563 | /* `btp' now points at the frame of the innermost function that isn't |
| @@ -3335,7 +3339,7 @@ Output stream used is value of `standard-output'. */) | |||
| 3335 | while (backlist) | 3339 | while (backlist) |
| 3336 | { | 3340 | { |
| 3337 | write_string (backlist->debug_on_exit ? "* " : " ", 2); | 3341 | write_string (backlist->debug_on_exit ? "* " : " ", 2); |
| 3338 | if (backlist->nargs == (size_t) UNEVALLED) | 3342 | if (backlist->nargs == UNEVALLED) |
| 3339 | { | 3343 | { |
| 3340 | Fprin1 (Fcons (*backlist->function, *backlist->args), Qnil); | 3344 | Fprin1 (Fcons (*backlist->function, *backlist->args), Qnil); |
| 3341 | write_string ("\n", -1); | 3345 | write_string ("\n", -1); |
| @@ -3345,8 +3349,8 @@ Output stream used is value of `standard-output'. */) | |||
| 3345 | tem = *backlist->function; | 3349 | tem = *backlist->function; |
| 3346 | Fprin1 (tem, Qnil); /* This can QUIT. */ | 3350 | Fprin1 (tem, Qnil); /* This can QUIT. */ |
| 3347 | write_string ("(", -1); | 3351 | write_string ("(", -1); |
| 3348 | if (backlist->nargs == (size_t) MANY) | 3352 | if (backlist->nargs == MANY) |
| 3349 | { | 3353 | { /* FIXME: Can this happen? */ |
| 3350 | int i; | 3354 | int i; |
| 3351 | for (tail = *backlist->args, i = 0; | 3355 | for (tail = *backlist->args, i = 0; |
| 3352 | !NILP (tail); | 3356 | !NILP (tail); |
| @@ -3399,11 +3403,11 @@ If NFRAMES is more than the number of frames, the value is nil. */) | |||
| 3399 | 3403 | ||
| 3400 | if (!backlist) | 3404 | if (!backlist) |
| 3401 | return Qnil; | 3405 | return Qnil; |
| 3402 | if (backlist->nargs == (size_t) UNEVALLED) | 3406 | if (backlist->nargs == UNEVALLED) |
| 3403 | return Fcons (Qnil, Fcons (*backlist->function, *backlist->args)); | 3407 | return Fcons (Qnil, Fcons (*backlist->function, *backlist->args)); |
| 3404 | else | 3408 | else |
| 3405 | { | 3409 | { |
| 3406 | if (backlist->nargs == (size_t) MANY) | 3410 | if (backlist->nargs == MANY) /* FIXME: Can this happen? */ |
| 3407 | tem = *backlist->args; | 3411 | tem = *backlist->args; |
| 3408 | else | 3412 | else |
| 3409 | tem = Flist (backlist->nargs, backlist->args); | 3413 | tem = Flist (backlist->nargs, backlist->args); |
| @@ -3423,8 +3427,8 @@ mark_backtrace (void) | |||
| 3423 | { | 3427 | { |
| 3424 | mark_object (*backlist->function); | 3428 | mark_object (*backlist->function); |
| 3425 | 3429 | ||
| 3426 | if (backlist->nargs == (size_t) UNEVALLED | 3430 | if (backlist->nargs == UNEVALLED |
| 3427 | || backlist->nargs == (size_t) MANY) | 3431 | || backlist->nargs == MANY) /* FIXME: Can this happen? */ |
| 3428 | i = 1; | 3432 | i = 1; |
| 3429 | else | 3433 | else |
| 3430 | i = backlist->nargs; | 3434 | i = backlist->nargs; |