From f860ae451a2e052c72006a23ac4e74007403cfd7 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 18 Dec 2017 11:43:12 +0300 Subject: [PATCH] fixed "unused function" compilation warning --- Zend/zend_vm_execute.h | 4 ++++ Zend/zend_vm_gen.php | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 8990bcd31d..b729a31906 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -323,7 +323,9 @@ static int zend_handlers_count; static const void * const * zend_opcode_handler_funcs; static zend_op hybrid_halt_op; #endif +#if (ZEND_VM_KIND != ZEND_VM_KIND_HYBRID) static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op); +#endif #if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) static const void *zend_vm_get_opcode_handler_func(zend_uchar opcode, const zend_op* op); @@ -67695,10 +67697,12 @@ static const void *zend_vm_get_opcode_handler_ex(uint32_t spec, const zend_op* o return zend_opcode_handlers[(spec & SPEC_START_MASK) + offset]; } +#if ZEND_VM_KIND != ZEND_VM_KIND_HYBRID static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op) { return zend_vm_get_opcode_handler_ex(zend_spec_handlers[opcode], op); } +#endif #if ZEND_VM_KIND == ZEND_VM_KIND_HYBRID static const void *zend_vm_get_opcode_handler_func(zend_uchar opcode, const zend_op* op) diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php index 67a4aa0048..4f4ad4c7b2 100644 --- a/Zend/zend_vm_gen.php +++ b/Zend/zend_vm_gen.php @@ -1638,7 +1638,9 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name) out($f,"static zend_op hybrid_halt_op;\n"); out($f,"#endif\n"); } - out($f,"static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op);\n\n"); + out($f,"#if (ZEND_VM_KIND != ZEND_VM_KIND_HYBRID)\n"); + out($f,"static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op);\n"); + out($f,"#endif\n\n"); if ($kind == ZEND_VM_KIND_HYBRID) { out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n"); out($f,"static const void *zend_vm_get_opcode_handler_func(zend_uchar opcode, const zend_op* op);\n"); @@ -2501,6 +2503,7 @@ function gen_vm($def, $skel) { out($f, "\treturn zend_opcode_handlers[(spec & SPEC_START_MASK) + offset];\n"); } out($f, "}\n\n"); + out($f, "#if ZEND_VM_KIND != ZEND_VM_KIND_HYBRID\n"); out($f, "static const void *zend_vm_get_opcode_handler(zend_uchar opcode, const zend_op* op)\n"); out($f, "{\n"); if (!ZEND_VM_SPEC) { @@ -2508,7 +2511,8 @@ function gen_vm($def, $skel) { } else { out($f, "\treturn zend_vm_get_opcode_handler_ex(zend_spec_handlers[opcode], op);\n"); } - out($f, "}\n\n"); + out($f, "}\n"); + out($f, "#endif\n\n"); if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) { // Generate zend_vm_get_opcode_handler_func() function -- 2.50.1