diff options
| author | Kenichi Handa | 2011-05-19 09:37:36 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2011-05-19 09:37:36 +0900 |
| commit | 23373930daa192623bfda56960ccb04b2703fbe5 (patch) | |
| tree | 4350ad7774b3d4dc6f2ccf0e6343b505582e0112 /src/alloc.c | |
| parent | a28d4396018e48479916fd624e2371aa1f75e6e7 (diff) | |
| parent | 627abcddd1c45a07d58b9c0cbfd6bb62caf256a9 (diff) | |
| download | emacs-23373930daa192623bfda56960ccb04b2703fbe5.tar.gz emacs-23373930daa192623bfda56960ccb04b2703fbe5.zip | |
merge trunk
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/alloc.c b/src/alloc.c index 0bce83bfae7..71ab54bcab5 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -2174,6 +2174,11 @@ compact_small_strings (void) | |||
| 2174 | current_sblock = tb; | 2174 | current_sblock = tb; |
| 2175 | } | 2175 | } |
| 2176 | 2176 | ||
| 2177 | void | ||
| 2178 | string_overflow (void) | ||
| 2179 | { | ||
| 2180 | error ("Maximum string size exceeded"); | ||
| 2181 | } | ||
| 2177 | 2182 | ||
| 2178 | DEFUN ("make-string", Fmake_string, Smake_string, 2, 2, 0, | 2183 | DEFUN ("make-string", Fmake_string, Smake_string, 2, 2, 0, |
| 2179 | doc: /* Return a newly created string of length LENGTH, with INIT in each element. | 2184 | doc: /* Return a newly created string of length LENGTH, with INIT in each element. |
| @@ -2206,7 +2211,7 @@ INIT must be an integer that represents a character. */) | |||
| 2206 | EMACS_INT string_len = XINT (length); | 2211 | EMACS_INT string_len = XINT (length); |
| 2207 | 2212 | ||
| 2208 | if (string_len > MOST_POSITIVE_FIXNUM / len) | 2213 | if (string_len > MOST_POSITIVE_FIXNUM / len) |
| 2209 | error ("Maximum string size exceeded"); | 2214 | string_overflow (); |
| 2210 | nbytes = len * string_len; | 2215 | nbytes = len * string_len; |
| 2211 | val = make_uninit_multibyte_string (string_len, nbytes); | 2216 | val = make_uninit_multibyte_string (string_len, nbytes); |
| 2212 | p = SDATA (val); | 2217 | p = SDATA (val); |