Index: branches/1.2/xcache.c
===================================================================
--- branches/1.2/xcache.c	(revision 428)
+++ branches/1.2/xcache.c	(revision 432)
@@ -2002,4 +2002,5 @@
 				stored_var = stored_xce->data.var;
 				if (Z_TYPE_P(stored_var->value) == IS_LONG) {
+					zval *zv;
 					stored_xce->ctime = XG(request_time);
 					stored_xce->ttl   = xce.ttl;
@@ -2010,5 +2011,7 @@
 					value += (inc == 1 ? count : - count);
 					RETVAL_LONG(value);
-					Z_LVAL_P(stored_var->value) = value;
+
+					zv = (zval *) xce.cache->shm->handlers->to_readwrite(xce.cache->shm, (char *) stored_var->value);
+					Z_LVAL_P(zv) = value;
 					break; /* leave lock */
 				}
