diff options
| author | Paul Eggert | 2012-08-02 13:59:49 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-08-02 13:59:49 -0700 |
| commit | 79ea6c20c483991e1be356be10aa27f92329d47e (patch) | |
| tree | d7530801a119025dc508978447a89b2446266910 /src | |
| parent | a01bbb8412afe10c936e54d893054e720bd30332 (diff) | |
| download | emacs-79ea6c20c483991e1be356be10aa27f92329d47e.tar.gz emacs-79ea6c20c483991e1be356be10aa27f92329d47e.zip | |
Fix macroexp crash on Windows with debugging.
* lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
checking subscripts; problem introduced with the recent
"ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
(ARRAY_MARK_FLAG): Now a macro as well as a constant,
since it's used in non-static inline functions now.
Fixes: debbugs:12118
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/lisp.h | 6 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index c590e9fb32f..45b24436519 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,12 @@ | |||
| 1 | 2012-08-02 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2012-08-02 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | Fix macroexp crash on Windows with debugging (Bug#12118). | ||
| 4 | * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when | ||
| 5 | checking subscripts; problem introduced with the recent | ||
| 6 | "ASET (a, i, v)" rather than "AREF (a, i) = v" patch. | ||
| 7 | (ARRAY_MARK_FLAG): Now a macro as well as a constant, | ||
| 8 | since it's used in non-static inline functions now. | ||
| 9 | |||
| 3 | * xfaces.c (face_at_buffer_position, face_for_overlay_string): | 10 | * xfaces.c (face_at_buffer_position, face_for_overlay_string): |
| 4 | Don't assume buffer size fits in 'int'. Remove unused local. | 11 | Don't assume buffer size fits in 'int'. Remove unused local. |
| 5 | 12 | ||
diff --git a/src/lisp.h b/src/lisp.h index 4b54af9fe43..3d00f4dde78 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -331,7 +331,9 @@ enum CHECK_LISP_OBJECT_TYPE { CHECK_LISP_OBJECT_TYPE = 0 }; | |||
| 331 | 331 | ||
| 332 | /* In the size word of a vector, this bit means the vector has been marked. */ | 332 | /* In the size word of a vector, this bit means the vector has been marked. */ |
| 333 | 333 | ||
| 334 | static ptrdiff_t const ARRAY_MARK_FLAG = PTRDIFF_MIN; | 334 | static ptrdiff_t const ARRAY_MARK_FLAG |
| 335 | #define ARRAY_MARK_FLAG PTRDIFF_MIN | ||
| 336 | = ARRAY_MARK_FLAG; | ||
| 335 | 337 | ||
| 336 | /* In the size word of a struct Lisp_Vector, this bit means it's really | 338 | /* In the size word of a struct Lisp_Vector, this bit means it's really |
| 337 | some other vector-like object. */ | 339 | some other vector-like object. */ |
| @@ -606,7 +608,7 @@ clip_to_bounds (ptrdiff_t lower, EMACS_INT num, ptrdiff_t upper) | |||
| 606 | /* The IDX==IDX tries to detect when the macro argument is side-effecting. */ | 608 | /* The IDX==IDX tries to detect when the macro argument is side-effecting. */ |
| 607 | #define ASET(ARRAY, IDX, VAL) \ | 609 | #define ASET(ARRAY, IDX, VAL) \ |
| 608 | (eassert ((IDX) == (IDX)), \ | 610 | (eassert ((IDX) == (IDX)), \ |
| 609 | eassert ((IDX) >= 0 && (IDX) < ASIZE (ARRAY)), \ | 611 | eassert ((IDX) >= 0 && (IDX) < (ASIZE (ARRAY) & ~ARRAY_MARK_FLAG)), \ |
| 610 | XVECTOR (ARRAY)->contents[IDX] = (VAL)) | 612 | XVECTOR (ARRAY)->contents[IDX] = (VAL)) |
| 611 | 613 | ||
| 612 | /* Convenience macros for dealing with Lisp strings. */ | 614 | /* Convenience macros for dealing with Lisp strings. */ |