summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-04-12 14:55:37 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-04-12 15:12:45 +0200
commit3fab73e24ed0b6ce831319ff6cf5b7a968bac645 (patch)
treeb83962efb3f28dbe80bb4aa137d1fde1f724c847 /Zend/zend_compile.c
parentbbeec4c20f1b692084048051a8b96e066518f354 (diff)
downloadphp-git-3fab73e24ed0b6ce831319ff6cf5b7a968bac645.tar.gz
Avoid misc uninitialized variable warnings
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r--Zend/zend_compile.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 83bd649bb9..04a867a48a 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -4732,7 +4732,7 @@ void zend_compile_switch(zend_ast *ast) /* {{{ */
znode expr_node, case_node;
zend_op *opline;
- uint32_t *jmpnz_opnums, opnum_default_jmp, opnum_switch;
+ uint32_t *jmpnz_opnums, opnum_default_jmp, opnum_switch = (uint32_t)-1;
zend_uchar jumptable_type;
HashTable *jumptable = NULL;
@@ -4825,6 +4825,7 @@ void zend_compile_switch(zend_ast *ast) /* {{{ */
zend_update_jump_target_to_next(opnum_default_jmp);
if (jumptable) {
+ ZEND_ASSERT(opnum_switch != (uint32_t)-1);
opline = &CG(active_op_array)->opcodes[opnum_switch];
opline->extended_value = get_next_op_number();
}
@@ -4917,12 +4918,11 @@ void zend_compile_try(zend_ast *ast) /* {{{ */
zend_bool is_last_catch = (i + 1 == catches->children);
uint32_t *jmp_multicatch = safe_emalloc(sizeof(uint32_t), classes->children - 1, 0);
- uint32_t opnum_catch;
+ uint32_t opnum_catch = (uint32_t)-1;
CG(zend_lineno) = catch_ast->lineno;
for (j = 0; j < classes->children; j++) {
-
zend_ast *class_ast = classes->child[j];
zend_bool is_last_class = (j + 1 == classes->children);
@@ -4972,6 +4972,7 @@ void zend_compile_try(zend_ast *ast) /* {{{ */
jmp_opnums[i + 1] = zend_emit_jump(0);
}
+ ZEND_ASSERT(opnum_catch != (uint32_t)-1 && "Should have at least one class");
opline = &CG(active_op_array)->opcodes[opnum_catch];
if (!is_last_catch) {
opline->op2.opline_num = get_next_op_number();