Skip to content

Commit c0587a8

Browse files
committed
UB
1 parent 4d5c2d3 commit c0587a8

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

Zend/Optimizer/dfa_pass.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ static uint32_t zend_dfa_optimize_calls(zend_op_array *op_array, zend_ssa *ssa)
482482
/* Const exprs can evaluate to non-const zvals (e.g. objects), and are not idempotent */
483483
continue;
484484
}
485-
const_args |= (1 << i);
485+
const_args |= (UINT32_C(1) << i);
486486
}
487487
}
488488

Zend/zend_compile.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4162,6 +4162,8 @@ static void zend_compile_call_partial(znode *result, zend_ast_fcc *fcc_ast, uint
41624162
if (!Z_ISUNDEF_P(named_positions)) {
41634163
opline->op2.constant = zend_add_literal(named_positions);
41644164
opline->op2_type = IS_CONST;
4165+
} else {
4166+
opline->op2.num = 0;
41654167
}
41664168
}
41674169

Zend/zend_partial.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static zend_always_inline bool zp_is_non_static_closure(const zend_function *fun
6969
/* Whether argument at offset 'offset' is const. Such arguments can be burned into the generated op_array */
7070
static inline bool zp_is_const_arg(uint32_t const_args, uint32_t offset) {
7171
if (offset < sizeof(const_args) * CHAR_BIT) {
72-
return const_args & (1 << offset);
72+
return const_args & (UINT32_C(1) << offset);
7373
}
7474
return false;
7575
}

0 commit comments

Comments
 (0)