summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-04-30 18:32:42 +0400
committerDmitry Stogov <dmitry@zend.com>2014-04-30 18:32:42 +0400
commit17d027ed47c1f07b397a611431d28ad0e0107146 (patch)
treeda6cadcd3ca0cad02dd4ff39f027575070873cbd /Zend/zend_compile.c
parent6a911e833f6b6dcac669a60808e96dc2c4f391d3 (diff)
downloadphp-git-17d027ed47c1f07b397a611431d28ad0e0107146.tar.gz
Split IS_BOOL into IS_FALSE and IS_TRUE
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r--Zend/zend_compile.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 8df612e18b..02dca941ba 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -3494,14 +3494,12 @@ static char * zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{
ZVAL_DUP(&zv, precv->op2.zv);
zval_update_constant_ex(&zv, 1, fptr->common.scope TSRMLS_CC);
- if (Z_TYPE(zv) == IS_BOOL) {
- if (Z_LVAL(zv)) {
- memcpy(offset, "true", 4);
- offset += 4;
- } else {
- memcpy(offset, "false", 5);
- offset += 5;
- }
+ if (Z_TYPE(zv) == IS_FALSE) {
+ memcpy(offset, "false", 5);
+ offset += 5;
+ } else if (Z_TYPE(zv) == IS_TRUE) {
+ memcpy(offset, "true", 4);
+ offset += 4;
} else if (Z_TYPE(zv) == IS_NULL) {
memcpy(offset, "NULL", 4);
offset += 4;
@@ -5973,9 +5971,14 @@ void zend_do_add_static_array_element(znode *result, znode *offset, znode *expr
zend_symtable_update(Z_ARRVAL(result->u.constant), STR_EMPTY_ALLOC(), &element);
break;
case IS_LONG:
- case IS_BOOL:
zend_hash_index_update(Z_ARRVAL(result->u.constant), Z_LVAL(offset->u.constant), &element);
break;
+ case IS_FALSE:
+ zend_hash_index_update(Z_ARRVAL(result->u.constant), 0, &element);
+ break;
+ case IS_TRUE:
+ zend_hash_index_update(Z_ARRVAL(result->u.constant), 1, &element);
+ break;
case IS_DOUBLE:
zend_hash_index_update(Z_ARRVAL(result->u.constant), zend_dval_to_lval(Z_DVAL(offset->u.constant)), &element);
break;