Skip to content

Commit 9e4603f

Browse files
committed
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.
1 parent 8d51af9 commit 9e4603f

File tree

4 files changed

+245
-179
lines changed

4 files changed

+245
-179
lines changed

Zend/zend_execute.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3921,6 +3921,7 @@ ZEND_API void zend_cleanup_unfinished_execution(zend_execute_data *execute_data,
39213921
cleanup_live_vars(execute_data, op_num, catch_op_num);
39223922
}
39233923

3924+
#if ZEND_VM_SPEC
39243925
static void zend_swap_operands(zend_op *op) /* {{{ */
39253926
{
39263927
znode_op tmp;
@@ -3934,6 +3935,7 @@ static void zend_swap_operands(zend_op *op) /* {{{ */
39343935
op->op2_type = tmp_type;
39353936
}
39363937
/* }}} */
3938+
#endif
39373939

39383940
static zend_never_inline zend_execute_data *zend_init_dynamic_call_string(zend_string *function, uint32_t num_args) /* {{{ */
39393941
{

Zend/zend_vm_def.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2064,7 +2064,9 @@ ZEND_VM_COLD_HELPER(zend_use_undef_in_read_context_helper, ANY, ANY)
20642064

20652065
ZEND_VM_COLD_CONSTCONST_HANDLER(93, ZEND_FETCH_DIM_FUNC_ARG, CONST|TMP|VAR|CV, CONST|TMPVAR|UNUSED|NEXT|CV)
20662066
{
2067+
#if !ZEND_VM_SPEC
20672068
USE_OPLINE
2069+
#endif
20682070

20692071
if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) {
20702072
if ((OP1_TYPE & (IS_CONST|IS_TMP_VAR))) {
@@ -2365,7 +2367,9 @@ ZEND_VM_C_LABEL(fetch_obj_is_finish):
23652367

23662368
ZEND_VM_COLD_CONST_HANDLER(94, ZEND_FETCH_OBJ_FUNC_ARG, CONST|TMP|VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, FETCH_REF|CACHE_SLOT)
23672369
{
2370+
#if !ZEND_VM_SPEC
23682371
USE_OPLINE
2372+
#endif
23692373

23702374
if (UNEXPECTED(ZEND_CALL_INFO(EX(call)) & ZEND_CALL_SEND_ARG_BY_REF)) {
23712375
/* Behave like FETCH_OBJ_W */
@@ -4240,7 +4244,7 @@ ZEND_VM_COLD_CONST_HANDLER(124, ZEND_VERIFY_RETURN_TYPE, CONST|TMP|VAR|UNUSED|CV
42404244
zend_verify_missing_return_type(EX(func), CACHE_ADDR(opline->op2.num));
42414245
} else {
42424246
/* prevents "undefined variable opline" errors */
4243-
#if !defined(ZEND_VM_SPEC) || (OP1_TYPE != IS_UNUSED)
4247+
#if !ZEND_VM_SPEC || (OP1_TYPE != IS_UNUSED)
42444248
zval *retval_ref, *retval_ptr;
42454249
zend_free_op free_op1;
42464250
zend_arg_info *ret_info = EX(func)->common.arg_info - 1;

0 commit comments

Comments
 (0)