diff options
Diffstat (limited to 'Zend/zend_operators.c')
-rw-r--r-- | Zend/zend_operators.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 98210953a0..61bdbc806c 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -1493,6 +1493,12 @@ ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) / op1_lval = Z_LVAL_P(op1); } + /* prevent wrapping quirkiness on some processors where << 64 + x == << x */ + if (Z_LVAL_P(op2) >= SIZEOF_LONG * 8) { + ZVAL_LONG(result, 0); + return SUCCESS; + } + if (Z_LVAL_P(op2) < 0) { zend_error(E_WARNING, "Bit shift by negative number"); ZVAL_FALSE(result); |