Skip to content

Commit 424ea1c

Browse files
committed
ct_eval should not emit notices
Does anything need to be done when an incompatible float is reached tho?
1 parent 1d794f5 commit 424ea1c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Zend/zend_compile.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8332,10 +8332,16 @@ static bool zend_try_ct_eval_array(zval *result, zend_ast *ast) /* {{{ */
83328332
case IS_STRING:
83338333
zend_symtable_update(Z_ARRVAL_P(result), Z_STR_P(key), value);
83348334
break;
8335-
case IS_DOUBLE:
8336-
zend_hash_index_update(Z_ARRVAL_P(result),
8337-
zend_dval_to_lval_safe(Z_DVAL_P(key)), value);
8335+
case IS_DOUBLE: {
8336+
zend_long lval = zend_dval_to_lval(Z_DVAL_P(key));
8337+
/* TODO Should bailout on incompatible float?
8338+
if (!zend_is_long_compatible(Z_DVAL_P(key), lval)) {
8339+
// Notice?
8340+
}
8341+
*/
8342+
zend_hash_index_update(Z_ARRVAL_P(result), lval, value);
83388343
break;
8344+
}
83398345
case IS_FALSE:
83408346
zend_hash_index_update(Z_ARRVAL_P(result), 0, value);
83418347
break;

0 commit comments

Comments
 (0)