@@ -151,7 +151,7 @@ typedef unsigned long int uint32_t;
151151****************************************/
152152#define MEMC_VAL_GET_USER_FLAGS (flags ) ((flags & MEMC_MASK_USER) >> 16)
153153#define MEMC_VAL_SET_USER_FLAGS (flags , udf_flags ) ((flags) |= ((udf_flags << 16) & MEMC_MASK_USER))
154- #define MEMC_VAL_USER_FLAGS_MAX (MEMC_MASK_USER >> 16)
154+ #define MEMC_VAL_USER_FLAGS_MAX ((1 << 16) - 1 )
155155
156156/****************************************
157157 "get" operation flags
@@ -1256,8 +1256,8 @@ static void php_memc_setMulti_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool by_ke
12561256 i_obj -> rescode = MEMCACHED_SUCCESS ;
12571257
12581258 /*
1259- * php_memcached uses 8 bits internally to store type, compression and serialization info.
1260- * We use 8 upper bits to store user defined flags.
1259+ * php_memcached uses 16 bits internally to store type, compression and serialization info.
1260+ * We use 16 upper bits to store user defined flags.
12611261 */
12621262 if (udf_flags > 0 ) {
12631263 if ((uint32_t ) udf_flags > MEMC_VAL_USER_FLAGS_MAX ) {
@@ -1465,8 +1465,8 @@ static void php_memc_store_impl(INTERNAL_FUNCTION_PARAMETERS, int op, zend_bool
14651465 }
14661466
14671467 /*
1468- * php_memcached uses 8 bits internally to store type, compression and serialization info.
1469- * We use 8 upper bits to store user defined flags.
1468+ * php_memcached uses 16 bits internally to store type, compression and serialization info.
1469+ * We use 16 upper bits to store user defined flags.
14701470 */
14711471 if (udf_flags > 0 ) {
14721472 if ((uint32_t ) udf_flags > MEMC_VAL_USER_FLAGS_MAX ) {
@@ -1608,8 +1608,8 @@ static void php_memc_cas_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool by_key)
16081608 }
16091609
16101610 /*
1611- * php_memcached uses 8 bits internally to store type, compression and serialization info.
1612- * We use 8 upper bits to store user defined flags.
1611+ * php_memcached uses 16 bits internally to store type, compression and serialization info.
1612+ * We use 16 upper bits to store user defined flags.
16131613 */
16141614 if (udf_flags > 0 ) {
16151615 if ((uint32_t ) udf_flags > MEMC_VAL_USER_FLAGS_MAX ) {
0 commit comments