diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-03-15 00:04:00 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-03-15 00:04:00 -0700 |
commit | 15206ed9236f4957cb62a0cfbd5397cf8f0cb76b (patch) | |
tree | c5b79dc24fd900342aaed46555ef28480014f502 /lisp/emacs-lisp/generic.el | |
parent | 4a6bea268fbac2fd64018374652f5b2c9b04b4fd (diff) | |
download | emacs-15206ed9236f4957cb62a0cfbd5397cf8f0cb76b.tar.gz emacs-15206ed9236f4957cb62a0cfbd5397cf8f0cb76b.tar.bz2 emacs-15206ed9236f4957cb62a0cfbd5397cf8f0cb76b.zip |
Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
dired.c's scmp function, had undefined behavior.
* lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
(NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
* buffer.h: ... to here, because these macros use current_buffer,
and the new implementation with inline functions needs to have
current_buffer in scope now, rather than later when the macros
are used.
(downcase, upcase1): New static inline functions.
(DOWNCASE, UPCASE1): Reimplement using these functions.
This avoids undefined behavior in expressions like
DOWNCASE (x) == DOWNCASE (y), which previously suffered
from race conditions in accessing the global variables
case_temp1 and case_temp2.
* casetab.c (case_temp1, case_temp2): Remove; no longer needed.
* lisp.h (case_temp1, case_temp2): Remove their decls.
* character.h (ASCII_CHAR_P): Move from here ...
* lisp.h: ... to here, so that the inline functions mentioned
above can use them.
Diffstat (limited to 'lisp/emacs-lisp/generic.el')
0 files changed, 0 insertions, 0 deletions