ALT Linux Bugzilla
– Attachment 784 Details for
Bug 6348
why divide by zero isn't error ?
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
патч для исправления поведения при делении на ноль.
php-4.3.10-alt-division-by-zero.patch (text/plain), 951 bytes, created by
algor
on 2005-03-29 12:51:36 MSD
(
hide
)
Description:
патч для исправления поведения при делении на ноль.
Filename:
MIME Type:
Creator:
algor
Created:
2005-03-29 12:51:36 MSD
Size:
951 bytes
patch
obsolete
>--- php-4.3.10.orig/ext/bcmath/bcmath.c 2003-06-12 16:23:10 +0400 >+++ php-4.3.10/ext/bcmath/bcmath.c 2005-03-29 10:31:02 +0400 >@@ -301,7 +301,7 @@ PHP_FUNCTION(bcdiv) > Z_TYPE_P(return_value) = IS_STRING; > break; > case -1: /* division by zero */ >- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Division by zero"); >+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Division by zero"); > break; > } > bc_free_num(&first); >--- php-4.3.10.orig/Zend/zend_operators.c 2004-11-29 12:15:28 +0300 >+++ php-4.3.10/Zend/zend_operators.c 2005-03-29 11:05:39 +0400 >@@ -749,7 +749,7 @@ ZEND_API int div_function(zval *result, > zendi_convert_scalar_to_number(op2, op2_copy, result); > > if ((op2->type == IS_LONG && op2->value.lval == 0) || (op2->type == IS_DOUBLE && op2->value.dval == 0.0)) { >- zend_error(E_WARNING, "Division by zero"); >+ zend_error(E_ERROR, "Division by zero"); > ZVAL_BOOL(result, 0); > return FAILURE; /* division by zero */ > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 6348
: 784