diff options
| author | Paul Eggert | 2011-03-15 00:04:00 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-03-15 00:04:00 -0700 |
| commit | 15206ed9236f4957cb62a0cfbd5397cf8f0cb76b (patch) | |
| tree | c5b79dc24fd900342aaed46555ef28480014f502 /src/ChangeLog | |
| parent | 4a6bea268fbac2fd64018374652f5b2c9b04b4fd (diff) | |
| download | emacs-15206ed9236f4957cb62a0cfbd5397cf8f0cb76b.tar.gz 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 'src/ChangeLog')
| -rw-r--r-- | src/ChangeLog | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 7468af4c725..7e873e3d85d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,26 @@ | |||
| 1 | 2011-03-15 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-03-15 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254). | ||
| 4 | An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in | ||
| 5 | dired.c's scmp function, had undefined behavior. | ||
| 6 | * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP): | ||
| 7 | (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ... | ||
| 8 | * buffer.h: ... to here, because these macros use current_buffer, | ||
| 9 | and the new implementation with inline functions needs to have | ||
| 10 | current_buffer in scope now, rather than later when the macros | ||
| 11 | are used. | ||
| 12 | (downcase, upcase1): New static inline functions. | ||
| 13 | (DOWNCASE, UPCASE1): Reimplement using these functions. | ||
| 14 | This avoids undefined behavior in expressions like | ||
| 15 | DOWNCASE (x) == DOWNCASE (y), which previously suffered | ||
| 16 | from race conditions in accessing the global variables | ||
| 17 | case_temp1 and case_temp2. | ||
| 18 | * casetab.c (case_temp1, case_temp2): Remove; no longer needed. | ||
| 19 | * lisp.h (case_temp1, case_temp2): Remove their decls. | ||
| 20 | * character.h (ASCII_CHAR_P): Move from here ... | ||
| 21 | * lisp.h: ... to here, so that the inline functions mentioned | ||
| 22 | above can use them. | ||
| 23 | |||
| 3 | * dired.c (directory_files_internal_unwind): Now static. | 24 | * dired.c (directory_files_internal_unwind): Now static. |
| 4 | 25 | ||
| 5 | * fileio.c (file_name_as_directory, directory_file_name): | 26 | * fileio.c (file_name_as_directory, directory_file_name): |