Try to fix macos build

By avoiding unused variable opline warnings. Also clean up the
replacement of ZEND_VM_SPEC -- we were sometimes treating it as
an always-defined constant with a value (what it actually is) and
sometimes as a conditionally defined constant (which it isn't, but
which still worked thanks to the specializer). Switch to only
treating it as a constant with a value.
This commit is contained in:
Nikita Popov 2019-07-24 09:44:55 +02:00
parent 8d51af9bc2
commit 9e4603f772
4 changed files with 245 additions and 179 deletions

View File

@ -3921,6 +3921,7 @@ ZEND_API void zend_cleanup_unfinished_execution(zend_execute_data *execute_data,
cleanup_live_vars(execute_data, op_num, catch_op_num);
}
#if ZEND_VM_SPEC
static void zend_swap_operands(zend_op *op) /* {{{ */
{
znode_op tmp;
@ -3934,6 +3935,7 @@ static void zend_swap_operands(zend_op *op) /* {{{ */
op->op2_type = tmp_type;
}
/* }}} */
#endif
static zend_never_inline zend_execute_data *zend_init_dynamic_call_string(zend_string *function, uint32_t num_args) /* {{{ */
{

View File

@ -2064,7 +2064,9 @@ ZEND_VM_COLD_HELPER(zend_use_undef_in_read_context_helper, ANY, ANY)
ZEND_VM_COLD_CONSTCONST_HANDLER(93, ZEND_FETCH_DIM_FUNC_ARG, CONST|TMP|VAR|CV, CONST|TMPVAR|UNUSED|NEXT|CV)
{
#if !ZEND_VM_SPEC
USE_OPLINE
#endif
if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) {
if ((OP1_TYPE & (IS_CONST|IS_TMP_VAR))) {
@ -2365,7 +2367,9 @@ ZEND_VM_C_LABEL(fetch_obj_is_finish):
ZEND_VM_COLD_CONST_HANDLER(94, ZEND_FETCH_OBJ_FUNC_ARG, CONST|TMP|VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, FETCH_REF|CACHE_SLOT)
{
#if !ZEND_VM_SPEC
USE_OPLINE
#endif
if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) {
/* Behave like FETCH_OBJ_W */
@ -4240,7 +4244,7 @@ ZEND_VM_COLD_CONST_HANDLER(124, ZEND_VERIFY_RETURN_TYPE, CONST|TMP|VAR|UNUSED|CV
zend_verify_missing_return_type(EX(func), CACHE_ADDR(opline->op2.num));
} else {
/* prevents "undefined variable opline" errors */
#if !defined(ZEND_VM_SPEC) || (OP1_TYPE != IS_UNUSED)
#if !ZEND_VM_SPEC || (OP1_TYPE != IS_UNUSED)
zval *retval_ref, *retval_ptr;
zend_free_op free_op1;
zend_arg_info *ret_info = EX(func)->common.arg_info - 1;

File diff suppressed because it is too large Load Diff

View File

@ -812,10 +812,8 @@ function gen_code($f, $spec, $kind, $export, $code, $op1, $op2, $name, $extra_sp
"/FREE_OP2_VAR_PTR\(\)/" => $op2_free_op_var_ptr[$op2],
"/FREE_UNFETCHED_OP1\(\)/" => $op1_free_unfetched[$op1],
"/FREE_UNFETCHED_OP2\(\)/" => $op2_free_unfetched[$op2],
"/^#(\s*)ifdef\s+ZEND_VM_SPEC\s*\n/m" => ($op1!="ANY"||$op2!="ANY")?"#\\1if 1\n":"#\\1if 0\n",
"/^#(\s*)ifndef\s+ZEND_VM_SPEC\s*\n/m" => ($op1!="ANY"||$op2!="ANY")?"#\\1if 0\n":"#\\1if 1\n",
"/\!defined\(ZEND_VM_SPEC\)/m" => ($op1!="ANY"||$op2!="ANY")?"0":"1",
"/defined\(ZEND_VM_SPEC\)/m" => ($op1!="ANY"||$op2!="ANY")?"1":"0",
"/\!ZEND_VM_SPEC/m" => ($op1!="ANY"||$op2!="ANY")?"0":"1",
"/ZEND_VM_SPEC/m" => ($op1!="ANY"||$op2!="ANY")?"1":"0",
"/ZEND_VM_C_LABEL\(\s*([A-Za-z_]*)\s*\)/m" => "\\1".(($spec && $kind != ZEND_VM_KIND_CALL)?("_SPEC".$prefix[$op1].$prefix[$op2].extra_spec_name($extra_spec)):""),
"/ZEND_VM_C_GOTO\(\s*([A-Za-z_]*)\s*\)/m" => "goto \\1".(($spec && $kind != ZEND_VM_KIND_CALL)?("_SPEC".$prefix[$op1].$prefix[$op2].extra_spec_name($extra_spec)):""),
"/^#(\s*)if\s+1\s*\\|\\|.*[^\\\\]$/m" => "#\\1if 1",