diff options
| author | Jim Blandy | 1993-03-31 07:19:25 +0000 |
|---|---|---|
| committer | Jim Blandy | 1993-03-31 07:19:25 +0000 |
| commit | 734fef9492c91bf15fef9c1a9cff9ac2ad320570 (patch) | |
| tree | f930dc6c8091cd628ba44ebcc2f50d5921202f3a /src | |
| parent | e5176baef508e7f697d650feb27d2e96bff76337 (diff) | |
| download | emacs-734fef9492c91bf15fef9c1a9cff9ac2ad320570.tar.gz emacs-734fef9492c91bf15fef9c1a9cff9ac2ad320570.zip | |
* keyboard.c (parse_modifiers, apply_modifiers): Make sure we're
not trying to create modifier masks using integers which are
unrepresentable as lisp values.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index d80cf2d83e8..91e4ee1f477 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -2485,6 +2485,8 @@ parse_modifiers (symbol) | |||
| 2485 | Qnil); | 2485 | Qnil); |
| 2486 | Lisp_Object mask; | 2486 | Lisp_Object mask; |
| 2487 | 2487 | ||
| 2488 | if (modifiers & ~((1<<VALBITS) - 1)) | ||
| 2489 | abort (); | ||
| 2488 | XFASTINT (mask) = modifiers; | 2490 | XFASTINT (mask) = modifiers; |
| 2489 | elements = Fcons (unmodified, Fcons (mask, Qnil)); | 2491 | elements = Fcons (unmodified, Fcons (mask, Qnil)); |
| 2490 | 2492 | ||
| @@ -2521,6 +2523,8 @@ apply_modifiers (modifiers, base) | |||
| 2521 | 2523 | ||
| 2522 | /* The click modifier never figures into cache indices. */ | 2524 | /* The click modifier never figures into cache indices. */ |
| 2523 | cache = Fget (base, Qmodifier_cache); | 2525 | cache = Fget (base, Qmodifier_cache); |
| 2526 | if (index & ~((1<<VALBITS) - 1)) | ||
| 2527 | abort (); | ||
| 2524 | XFASTINT (index) = (modifiers & ~click_modifier); | 2528 | XFASTINT (index) = (modifiers & ~click_modifier); |
| 2525 | entry = Fassq (index, cache); | 2529 | entry = Fassq (index, cache); |
| 2526 | 2530 | ||
| @@ -2538,6 +2542,8 @@ apply_modifiers (modifiers, base) | |||
| 2538 | Fput (base, Qmodifier_cache, Fcons (entry, cache)); | 2542 | Fput (base, Qmodifier_cache, Fcons (entry, cache)); |
| 2539 | 2543 | ||
| 2540 | /* We have the parsing info now for free, so add it to the caches. */ | 2544 | /* We have the parsing info now for free, so add it to the caches. */ |
| 2545 | if (modifiers & ~((1<<VALBITS) - 1)) | ||
| 2546 | abort (); | ||
| 2541 | XFASTINT (index) = modifiers; | 2547 | XFASTINT (index) = modifiers; |
| 2542 | Fput (new_symbol, Qevent_symbol_element_mask, | 2548 | Fput (new_symbol, Qevent_symbol_element_mask, |
| 2543 | Fcons (base, Fcons (index, Qnil))); | 2549 | Fcons (base, Fcons (index, Qnil))); |