You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2013/04/20 18:23:58 UTC

svn commit: r1470183 - in /httpd/httpd/trunk: CHANGES server/core.c

Author: sf
Date: Sat Apr 20 16:23:57 2013
New Revision: 1470183

URL: http://svn.apache.org/r1470183
Log:
Add workaround for gcc bug on sparc/64bit

PR: 52900

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/server/core.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1470183&r1=1470182&r2=1470183&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Sat Apr 20 16:23:57 2013
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) core: Add workaround for gcc bug on sparc/64bit. PR 52900.
+     [Stefan Fritsch]
+
   *) htpasswd: Add -v option to verify a password. [Stefan Fritsch]
 
   *) htpasswd, htdbm: Fix password generation. PR 54735. [Stefan Fritsch]

Modified: httpd/httpd/trunk/server/core.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/core.c?rev=1470183&r1=1470182&r2=1470183&view=diff
==============================================================================
--- httpd/httpd/trunk/server/core.c (original)
+++ httpd/httpd/trunk/server/core.c Sat Apr 20 16:23:57 2013
@@ -4929,13 +4929,18 @@ AP_DECLARE(void) ap_random_insecure_byte
 AP_DECLARE(apr_uint32_t) ap_random_pick(apr_uint32_t min, apr_uint32_t max)
 {
     apr_uint32_t number;
+#if (!__GNUC__ || __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) || \
+     !__sparc__ || APR_SIZEOF_VOIDP != 8)
+    /* This triggers a gcc bug on sparc/64bit with gcc < 4.8, PR 52900 */
     if (max < 16384) {
         apr_uint16_t num16;
         ap_random_insecure_bytes(&num16, sizeof(num16));
         RAND_RANGE(num16, min, max, APR_UINT16_MAX);
         number = num16;
     }
-    else {
+    else
+#endif
+    {
         ap_random_insecure_bytes(&number, sizeof(number));
         RAND_RANGE(number, min, max, APR_UINT32_MAX);
     }