aboutsummaryrefslogtreecommitdiffstats
path: root/src/fns.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fns.c')
-rw-r--r--src/fns.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/fns.c b/src/fns.c
index fdaffe947ac..e5538d6acbc 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -602,7 +602,12 @@ concat (ptrdiff_t nargs, Lisp_Object *args,
602 602
603 prev = Qnil; 603 prev = Qnil;
604 if (STRINGP (val)) 604 if (STRINGP (val))
605 SAFE_ALLOCA (textprops, struct textprop_rec *, sizeof (struct textprop_rec) * nargs); 605 {
606 if (min (PTRDIFF_MAX, SIZE_MAX) / sizeof *textprops < nargs)
607 memory_full (SIZE_MAX);
608 SAFE_ALLOCA (textprops, struct textprop_rec *,
609 sizeof *textprops * nargs);
610 }
606 611
607 for (argnum = 0; argnum < nargs; argnum++) 612 for (argnum = 0; argnum < nargs; argnum++)
608 { 613 {
@@ -3395,11 +3400,13 @@ check_hash_table (Lisp_Object obj)
3395 3400
3396 3401
3397/* Value is the next integer I >= N, N >= 0 which is "almost" a prime 3402/* Value is the next integer I >= N, N >= 0 which is "almost" a prime
3398 number. */ 3403 number. A number is "almost" a prime number if it is not divisible
3404 by any integer in the range 2 .. (NEXT_ALMOST_PRIME_LIMIT - 1). */
3399 3405
3400EMACS_INT 3406EMACS_INT
3401next_almost_prime (EMACS_INT n) 3407next_almost_prime (EMACS_INT n)
3402{ 3408{
3409 verify (NEXT_ALMOST_PRIME_LIMIT == 11);
3403 for (n |= 1; ; n += 2) 3410 for (n |= 1; ; n += 2)
3404 if (n % 3 != 0 && n % 5 != 0 && n % 7 != 0) 3411 if (n % 3 != 0 && n % 5 != 0 && n % 7 != 0)
3405 return n; 3412 return n;