diff options
Diffstat (limited to 'Zend/zend_operators.c')
| -rw-r--r-- | Zend/zend_operators.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 575a68d0d5..6b7d5d16ac 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -1732,7 +1732,8 @@ ZEND_API int ZEND_FASTCALL shift_left_function(zval *result, zval *op1, zval *op zval_ptr_dtor(result); } - ZVAL_LONG(result, op1_lval << op2_lval); + /* Perform shift on unsigned numbers to get well-defined wrap behavior. */ + ZVAL_LONG(result, (zend_long) ((zend_ulong) op1_lval << op2_lval)); return SUCCESS; } /* }}} */ @@ -2966,7 +2967,7 @@ ZEND_API zend_uchar ZEND_FASTCALL _is_numeric_string_ex(const char *str, size_t int digits = 0, dp_or_e = 0; double local_dval = 0.0; zend_uchar type; - zend_long tmp_lval = 0; + zend_ulong tmp_lval = 0; int neg = 0; if (!length) { @@ -3074,7 +3075,7 @@ process_double: if (neg) { tmp_lval = -tmp_lval; } - *lval = tmp_lval; + *lval = (zend_long) tmp_lval; } return IS_LONG; |
