php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #61352
Patch 61352.1.patch revision 2012-03-13 17:54 UTC by ab@php.net
Patch 61352.0.patch revision 2012-03-12 11:11 UTC by ab@php.net

Patch 61352.0.patch for APC Bug #61352

Patch version 2012-03-12 11:11 UTC

Return to Bug #61352 | Download this patch
Patch Revisions:

Developer: ab@php.net

--- apc_compile.c.61352pre	2012-03-12 11:44:29.748750419 +0100
+++ apc_compile.c	2012-03-12 11:55:00.160777272 +0100
@@ -279,6 +279,7 @@
 static char *apc_string_pmemcpy(char *str, size_t len, apc_pool* pool TSRMLS_DC)
 {	
 #ifdef ZEND_ENGINE_2_4
+#ifndef ZTS
     if (pool->type != APC_UNPOOL) {
         char * ret = (char*)apc_new_interned_string((const char*)str, len TSRMLS_CC);
         if (ret) {
@@ -286,6 +287,7 @@
         }
     }
 #endif
+#endif
     return apc_pmemcpy(str, len, pool TSRMLS_CC);
 }
 
@@ -887,17 +889,18 @@
             CHECK((newp = (Bucket*) apc_pmemcpy(curr, sizeof(Bucket), pool TSRMLS_CC)));
         } else if (IS_INTERNED(curr->arKey)) {
             CHECK((newp = (Bucket*) apc_pmemcpy(curr, sizeof(Bucket), pool TSRMLS_CC)));
+#ifndef ZTS
         } else if (pool->type != APC_UNPOOL) {
             char *arKey;
 
+            CHECK((newp = (Bucket*) apc_pmemcpy(curr, sizeof(Bucket), pool TSRMLS_CC)));
             arKey = apc_new_interned_string(curr->arKey, curr->nKeyLength TSRMLS_CC);
             if (!arKey) {
-                CHECK((newp = (Bucket*) apc_pmemcpy(curr, (sizeof(Bucket) + curr->nKeyLength), pool TSRMLS_CC)));
-                newp->arKey = ((char*)newp) + sizeof(Bucket);
+                CHECK((newp->arKey = (char*) apc_pmemcpy(curr->arKey, curr->nKeyLength, pool TSRMLS_CC)));
             } else {
-                CHECK((newp = (Bucket*) apc_pmemcpy(curr, sizeof(Bucket), pool TSRMLS_CC)));
                 newp->arKey = arKey;
             }
+#endif
         } else {
             CHECK((newp = (Bucket*) apc_pmemcpy(curr, sizeof(Bucket), pool TSRMLS_CC)));
             CHECK((newp->arKey = (char*) apc_pmemcpy(curr->arKey, curr->nKeyLength, pool TSRMLS_CC)));
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 04:01:38 2024 UTC