From 6339bd59120eaee13e4636f74bbf9a9d54efdce4 Mon Sep 17 00:00:00 2001 From: Andi Gutmans Date: Sat, 29 Jun 2002 07:35:41 +0000 Subject: [PATCH] - Fix bug 15037 - Bump version to alpha2-dev --- Zend/zend.h | 2 +- Zend/zend_operators.c | 28 ++++++++++++++++++---------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/Zend/zend.h b/Zend/zend.h index f1995d61e4..6b8be344ba 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -22,7 +22,7 @@ #ifndef ZEND_H #define ZEND_H -#define ZEND_VERSION "2.0.0-dev" +#define ZEND_VERSION "2.0.0-alpha2-dev" #define ZEND_ENGINE_2 diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index fca3b5618c..5fdd1c1eb6 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -1509,6 +1509,7 @@ ZEND_API int increment_function(zval *op1) ZEND_API int decrement_function(zval *op1) { long lval; + double dval; switch (op1->type) { case IS_LONG: @@ -1528,16 +1529,23 @@ ZEND_API int decrement_function(zval *op1) op1->value.lval = -1; op1->type = IS_LONG; break; - } else if (is_numeric_string(op1->value.str.val, op1->value.str.len, &lval, NULL, 0)==IS_LONG) { /* long */ - STR_FREE(op1->value.str.val); - if(lval == LONG_MIN) { - double d = (double)lval; - ZVAL_DOUBLE(op1, d-1); - } else { - op1->value.lval = lval-1; - op1->type = IS_LONG; - } - break; + } + switch(is_numeric_string(op1->value.str.val, op1->value.str.len, &lval, &dval, 0)) { + case IS_LONG: + STR_FREE(op1->value.str.val); + if(lval == LONG_MIN) { + double d = (double)lval; + ZVAL_DOUBLE(op1, d-1); + } else { + op1->value.lval = lval-1; + op1->type = IS_LONG; + } + break; + case IS_DOUBLE: + STR_FREE(op1->value.str.val); + op1->value.dval = dval - 1; + op1->type = IS_DOUBLE; + break; } break; default: -- 2.40.0