Skip to content

Commit 00e814d

Browse files
committed
Review zend_is_true() usage in zend_compile.c
1 parent 3af0c31 commit 00e814d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Zend/zend_compile.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9726,6 +9726,7 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
97269726
}
97279727

97289728
child0_is_true = zend_is_true(zend_ast_get_zval(ast->child[0]));
9729+
/* TODO Check if need to handle potential TypeError if child[0] is an object which cannot be converted to bool */
97299730
if (child0_is_true == (ast->kind == ZEND_AST_OR)) {
97309731
ZVAL_BOOL(&result, ast->kind == ZEND_AST_OR);
97319732
break;
@@ -9736,6 +9737,7 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
97369737
}
97379738

97389739
child1_is_true = zend_is_true(zend_ast_get_zval(ast->child[1]));
9740+
/* TODO Check if need to handle potential TypeError if child[1] is an object which cannot be converted to bool */
97399741
if (ast->kind == ZEND_AST_OR) {
97409742
ZVAL_BOOL(&result, child0_is_true || child1_is_true);
97419743
} else {
@@ -9802,6 +9804,7 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
98029804
}
98039805

98049806
child = &ast->child[2 - zend_is_true(zend_ast_get_zval(ast->child[0]))];
9807+
/* TODO Check if need to handle potential TypeError if child[0] is an object which cannot be converted to bool */
98059808
if (*child == NULL) {
98069809
child--;
98079810
}

0 commit comments

Comments
 (0)