From 88ec761548b66f58acc1a86cdd0fc164ca925476 Mon Sep 17 00:00:00 2001 From: SVN Migration Date: Sun, 15 Oct 2006 21:09:28 +0000 Subject: This commit was manufactured by cvs2svn to create branch 'PECL_OPENSSL'. --- Zend/ChangeLog | 22097 ------------------------- Zend/FlexLexer.h | 186 - Zend/LICENSE | 56 - Zend/Makefile.am | 54 - Zend/Makefile.frag | 1 - Zend/OBJECTS2_HOWTO | 195 - Zend/README.ZEND_MM | 13 - Zend/README.ZEND_VM | 108 - Zend/RFCs/001.txt | 136 - Zend/RFCs/002.txt | 169 - Zend/RFCs/003.txt | 72 - Zend/ZEND_CHANGES | 1166 -- Zend/Zend.dsp | 602 - Zend/Zend.m4 | 406 - Zend/ZendCore.dep | 258 - Zend/ZendTS.dsp | 736 - Zend/acconfig.h | 121 - Zend/acinclude.m4 | 107 - Zend/bench.php | 419 - Zend/build.mk | 43 - Zend/buildconf | 33 - Zend/configure.in | 51 - Zend/flex.skl | 1648 -- Zend/header | 19 - Zend/tests/001.phpt | 54 - Zend/tests/002.phpt | 108 - Zend/tests/003.phpt | 81 - Zend/tests/004.phpt | 25 - Zend/tests/005.phpt | 27 - Zend/tests/006.phpt | 31 - Zend/tests/007.phpt | 63 - Zend/tests/008.phpt | 53 - Zend/tests/009.phpt | 46 - Zend/tests/010.phpt | 59 - Zend/tests/011.phpt | 89 - Zend/tests/012.phpt | 34 - Zend/tests/013.phpt | 34 - Zend/tests/014.inc | 3 - Zend/tests/014.phpt | 52 - Zend/tests/015.phpt | 35 - Zend/tests/016.phpt | 12 - Zend/tests/abstract-static.phpt | 13 - Zend/tests/array_type_hint_001.phpt | 15 - Zend/tests/bug19859.phpt | 22 - Zend/tests/bug20240.phpt | 43 - Zend/tests/bug20242.phpt | 26 - Zend/tests/bug21478.phpt | 37 - Zend/tests/bug21888.phpt | 36 - Zend/tests/bug22725.phpt | 31 - Zend/tests/bug22836.phpt | 34 - Zend/tests/bug23104.phpt | 12 - Zend/tests/bug24436.phpt | 24 - Zend/tests/bug24635.phpt | 30 - Zend/tests/bug24699.phpt | 13 - Zend/tests/bug24773.phpt | 9 - Zend/tests/bug24884.phpt | 28 - Zend/tests/bug26010.phpt | 19 - Zend/tests/bug26077.phpt | 9 - Zend/tests/bug26166.phpt | 74 - Zend/tests/bug26229.phpt | 29 - Zend/tests/bug26281.phpt | 13 - Zend/tests/bug26696.phpt | 22 - Zend/tests/bug26697.phpt | 24 - Zend/tests/bug26698.phpt | 73 - Zend/tests/bug26801.phpt | 22 - Zend/tests/bug26802.phpt | 37 - Zend/tests/bug27268.phpt | 28 - Zend/tests/bug27304.phpt | 23 - Zend/tests/bug27598.phpt | 12 - Zend/tests/bug27669.phpt | 18 - Zend/tests/bug27731.phpt | 10 - Zend/tests/bug27798.phpt | 72 - Zend/tests/bug28072.phpt | 46 - Zend/tests/bug28377.phpt | 23 - Zend/tests/bug28442.phpt | 65 - Zend/tests/bug28444.phpt | 81 - Zend/tests/bug29015.phpt | 11 - Zend/tests/bug29104.phpt | 27 - Zend/tests/bug29210.phpt | 104 - Zend/tests/bug29368.phpt | 34 - Zend/tests/bug29505.phpt | 31 - Zend/tests/bug29674.phpt | 41 - Zend/tests/bug29689.phpt | 62 - Zend/tests/bug29883.phpt | 13 - Zend/tests/bug29890.phpt | 23 - Zend/tests/bug29896.phpt | 28 - Zend/tests/bug29944.phpt | 16 - Zend/tests/bug30080.phpt | 18 - Zend/tests/bug30140.phpt | 30 - Zend/tests/bug30161.phpt | 34 - Zend/tests/bug30162.phpt | 52 - Zend/tests/bug30332.phpt | 40 - Zend/tests/bug30346.phpt | 24 - Zend/tests/bug30394.phpt | 30 - Zend/tests/bug30407.phpt | 18 - Zend/tests/bug30451.phpt | 36 - Zend/tests/bug30519.phpt | 10 - Zend/tests/bug30702.phpt | 39 - Zend/tests/bug30707.phpt | 29 - Zend/tests/bug30725.phpt | 32 - Zend/tests/bug30791.phpt | 35 - Zend/tests/bug30820.phpt | 27 - Zend/tests/bug30828.phpt | 61 - Zend/tests/bug30889.phpt | 31 - Zend/tests/bug30922.phpt | 13 - Zend/tests/bug30998.phpt | 21 - Zend/tests/bug31098.phpt | 53 - Zend/tests/bug31102.phpt | 48 - Zend/tests/bug31177-2.phpt | 18 - Zend/tests/bug31177.phpt | 44 - Zend/tests/bug31341.phpt | 29 - Zend/tests/bug31525.phpt | 22 - Zend/tests/bug31683.phpt | 97 - Zend/tests/bug31720.phpt | 16 - Zend/tests/bug31828.phpt | 25 - Zend/tests/bug32080.phpt | 18 - Zend/tests/bug32226.phpt | 36 - Zend/tests/bug32252.phpt | 47 - Zend/tests/bug32290.phpt | 126 - Zend/tests/bug32296.phpt | 60 - Zend/tests/bug32322.phpt | 80 - Zend/tests/bug32427.phpt | 19 - Zend/tests/bug32428.phpt | 13 - Zend/tests/bug32429.phpt | 28 - Zend/tests/bug32596.phpt | 27 - Zend/tests/bug32660.phpt | 39 - Zend/tests/bug32674.phpt | 62 - Zend/tests/bug32799.phpt | 21 - Zend/tests/bug32833.phpt | 10 - Zend/tests/bug32852.phpt | 38 - Zend/tests/bug32993.phpt | 29 - Zend/tests/bug33116.phpt | 22 - Zend/tests/bug33171.phpt | 27 - Zend/tests/bug33243.phpt | 25 - Zend/tests/bug33257.phpt | 25 - Zend/tests/bug33277.phpt | 28 - Zend/tests/bug33318.phpt | 8 - Zend/tests/bug33512.phpt | 66 - Zend/tests/bug33558.phpt | 21 - Zend/tests/bug33710.phpt | 32 - Zend/tests/bug33732.phpt | 45 - Zend/tests/bug33771.phpt | 40 - Zend/tests/bug33802.phpt | 22 - Zend/tests/bug33996.phpt | 29 - Zend/tests/bug33999.phpt | 30 - Zend/tests/bug34045.phpt | 28 - Zend/tests/bug34062.phpt | 24 - Zend/tests/bug34064.phpt | 35 - Zend/tests/bug34065.phpt | 15 - Zend/tests/bug34137.phpt | 10 - Zend/tests/bug34199.phpt | 18 - Zend/tests/bug34260.phpt | 36 - Zend/tests/bug34310.phpt | 34 - Zend/tests/bug34358.phpt | 15 - Zend/tests/bug34467.phpt | 27 - Zend/tests/bug34518.phpt | 38 - Zend/tests/bug34617.phpt | 18 - Zend/tests/bug34678.phpt | 25 - Zend/tests/bug34712.phpt | 28 - Zend/tests/bug34767.phpt | 33 - Zend/tests/bug34786.phpt | 22 - Zend/tests/bug34873.phpt | 27 - Zend/tests/bug34879.phpt | 11 - Zend/tests/bug34893.phpt | 33 - Zend/tests/bug35017.phpt | 21 - Zend/tests/bug35239.phpt | 41 - Zend/tests/bug35393.phpt | 30 - Zend/tests/bug35411.phpt | 19 - Zend/tests/bug35437.phpt | 27 - Zend/tests/bug35470.phpt | 11 - Zend/tests/bug35509.phpt | 31 - Zend/tests/bug35655.phpt | 25 - Zend/tests/bug36006.phpt | 30 - Zend/tests/bug36037.phpt | 14 - Zend/tests/bug36071.phpt | 13 - Zend/tests/bug36268.phpt | 14 - Zend/tests/bug36303.phpt | 12 - Zend/tests/bug36513.phpt | 22 - Zend/tests/bug36568.phpt | 15 - Zend/tests/bug36759.phpt | 27 - Zend/tests/bug37046.phpt | 23 - Zend/tests/bug37138.phpt | 21 - Zend/tests/bug37144.phpt | 16 - Zend/tests/bug37212.phpt | 55 - Zend/tests/bug37632.phpt | 135 - Zend/tests/bug37667.phpt | 53 - Zend/tests/bug37707.phpt | 16 - Zend/tests/bug37811.phpt | 28 - Zend/tests/bug38047.phpt | 50 - Zend/tests/bug38146.phpt | 19 - Zend/tests/bug38211.phpt | 10 - Zend/tests/bug38220.phpt | 92 - Zend/tests/bug38234.phpt | 18 - Zend/tests/bug38287.phpt | 45 - Zend/tests/bug38461.phpt | 25 - Zend/tests/bug38623.phpt | 16 - Zend/tests/bug38624.phpt | 34 - Zend/tests/bug38772.phpt | 42 - Zend/tests/bug38779.phpt | 29 - Zend/tests/bug38779_1.phpt | 45 - Zend/tests/bug38808.phpt | 17 - Zend/tests/bug38942.phpt | 17 - Zend/tests/bug39003.phpt | 24 - Zend/tests/bug39017.phpt | 11 - Zend/tests/bug39036.phpt | 19 - Zend/tests/bug_debug_backtrace.phpt | 28 - Zend/tests/catch.phpt | 23 - Zend/tests/catch_002.phpt | 33 - Zend/tests/catch_003.phpt | 38 - Zend/tests/catch_004.phpt | 43 - Zend/tests/dtor_scope.phpt | 34 - Zend/tests/error_reporting01.phpt | 26 - Zend/tests/error_reporting02.phpt | 27 - Zend/tests/error_reporting03.phpt | 35 - Zend/tests/error_reporting04.phpt | 23 - Zend/tests/error_reporting05.phpt | 34 - Zend/tests/error_reporting06.phpt | 30 - Zend/tests/error_reporting07.phpt | 30 - Zend/tests/error_reporting08.phpt | 32 - Zend/tests/error_reporting09.phpt | 31 - Zend/tests/error_reporting10.phpt | 35 - Zend/tests/foreach_undefined.phpt | 14 - Zend/tests/halt01.phpt | 12 - Zend/tests/halt02.phpt | 13 - Zend/tests/halt03.phpt | 10 - Zend/tests/instanceof.phpt | 18 - Zend/tests/int_overflow_32bit.phpt | 29 - Zend/tests/int_overflow_64bit.phpt | 29 - Zend/tests/int_underflow_32bit.phpt | 29 - Zend/tests/int_underflow_64bit.phpt | 29 - Zend/tests/is_a.phpt | 51 - Zend/tests/method_exists.phpt | 11 - Zend/tests/object-null.phpt | 21 - Zend/tests/object_handlers.phpt | 171 - Zend/tests/objects_001.phpt | 60 - Zend/tests/objects_002.phpt | 24 - Zend/tests/objects_003.phpt | 24 - Zend/tests/objects_004.phpt | 24 - Zend/tests/objects_005.phpt | 24 - Zend/tests/objects_006.phpt | 24 - Zend/tests/objects_007.phpt | 24 - Zend/tests/objects_008.phpt | 24 - Zend/tests/objects_009.phpt | 24 - Zend/tests/objects_010.phpt | 19 - Zend/tests/objects_011.phpt | 19 - Zend/tests/objects_012.phpt | 15 - Zend/tests/objects_013.phpt | 15 - Zend/tests/objects_014.phpt | 15 - Zend/tests/objects_015.phpt | 26 - Zend/tests/offset_array.phpt | 47 - Zend/tests/offset_bool.phpt | 37 - Zend/tests/offset_long.phpt | 37 - Zend/tests/offset_null.phpt | 37 - Zend/tests/offset_object.phpt | 11 - Zend/tests/offset_string.phpt | 45 - Zend/tests/strict_001.phpt | 19 - Zend/tests/strict_002.phpt | 27 - Zend/tests/unset.inc | 3 - Zend/tests/unset_cv01.phpt | 13 - Zend/tests/unset_cv02.phpt | 13 - Zend/tests/unset_cv03.phpt | 13 - Zend/tests/unset_cv04.phpt | 16 - Zend/tests/unset_cv05.phpt | 28 - Zend/tests/unset_cv06.phpt | 26 - Zend/tests/unset_cv07.phpt | 18 - Zend/tests/unset_cv08.phpt | 16 - Zend/tests/unset_cv09.phpt | 14 - Zend/tests/unset_cv10.phpt | 18 - Zend/tests/unset_cv11.phpt | 21 - Zend/tests/unset_cv12.phpt | 11 - Zend/tests/zend2.php.txt | 275 - Zend/tests/zend_operators.phpt | 12 - Zend/tests/zend_strtod.phpt | 19 - Zend/zend.c | 1191 -- Zend/zend.h | 661 - Zend/zend.ico | Bin 1382 -> 0 bytes Zend/zend_API.c | 2930 ---- Zend/zend_API.h | 639 - Zend/zend_alloc.c | 1909 --- Zend/zend_alloc.h | 209 - Zend/zend_arg_defs.c | 52 - Zend/zend_builtin_functions.c | 2158 --- Zend/zend_builtin_functions.h | 39 - Zend/zend_compile.c | 4192 ----- Zend/zend_compile.h | 710 - Zend/zend_config.nw.h | 89 - Zend/zend_config.w32.h | 98 - Zend/zend_constants.c | 344 - Zend/zend_constants.h | 78 - Zend/zend_default_classes.c | 42 - Zend/zend_dynamic_array.c | 72 - Zend/zend_dynamic_array.h | 47 - Zend/zend_errors.h | 50 - Zend/zend_exceptions.c | 725 - Zend/zend_exceptions.h | 64 - Zend/zend_execute.c | 1435 -- Zend/zend_execute.h | 230 - Zend/zend_execute_API.c | 1573 -- Zend/zend_extensions.c | 295 - Zend/zend_extensions.h | 132 - Zend/zend_fast_cache.h | 141 - Zend/zend_globals.h | 293 - Zend/zend_globals_macros.h | 106 - Zend/zend_hash.c | 1418 -- Zend/zend_hash.h | 370 - Zend/zend_highlight.c | 256 - Zend/zend_highlight.h | 61 - Zend/zend_indent.c | 156 - Zend/zend_indent.h | 37 - Zend/zend_ini.c | 596 - Zend/zend_ini.h | 216 - Zend/zend_ini_parser.y | 316 - Zend/zend_ini_scanner.h | 42 - Zend/zend_ini_scanner.l | 253 - Zend/zend_interfaces.c | 566 - Zend/zend_interfaces.h | 74 - Zend/zend_istdiostream.h | 44 - Zend/zend_iterators.c | 107 - Zend/zend_iterators.h | 93 - Zend/zend_language_parser.y | 932 -- Zend/zend_language_scanner.h | 67 - Zend/zend_language_scanner.l | 1921 --- Zend/zend_list.c | 374 - Zend/zend_list.h | 120 - Zend/zend_llist.c | 317 - Zend/zend_llist.h | 86 - Zend/zend_mm.c | 475 - Zend/zend_mm.h | 85 - Zend/zend_modules.h | 142 - Zend/zend_multibyte.c | 1135 -- Zend/zend_multibyte.h | 79 - Zend/zend_multiply.h | 47 - Zend/zend_object_handlers.c | 1153 -- Zend/zend_object_handlers.h | 169 - Zend/zend_objects.c | 210 - Zend/zend_objects.h | 46 - Zend/zend_objects_API.c | 390 - Zend/zend_objects_API.h | 94 - Zend/zend_opcode.c | 505 - Zend/zend_operators.c | 2025 --- Zend/zend_operators.h | 357 - Zend/zend_ptr_stack.c | 115 - Zend/zend_ptr_stack.h | 119 - Zend/zend_qsort.c | 127 - Zend/zend_qsort.h | 36 - Zend/zend_sprintf.c | 49 - Zend/zend_stack.c | 173 - Zend/zend_stack.h | 58 - Zend/zend_static_allocator.c | 84 - Zend/zend_static_allocator.h | 55 - Zend/zend_stream.c | 142 - Zend/zend_stream.h | 64 - Zend/zend_strtod.c | 1797 -- Zend/zend_strtod.h | 31 - Zend/zend_ts_hash.c | 365 - Zend/zend_ts_hash.h | 134 - Zend/zend_types.h | 47 - Zend/zend_variables.c | 191 - Zend/zend_variables.h | 96 - Zend/zend_vm.h | 29 - Zend/zend_vm_def.h | 3826 ----- Zend/zend_vm_execute.h | 30309 ---------------------------------- Zend/zend_vm_execute.skl | 77 - Zend/zend_vm_gen.php | 1302 -- Zend/zend_vm_opcodes.h | 149 - 365 files changed, 111948 deletions(-) delete mode 100644 Zend/ChangeLog delete mode 100644 Zend/FlexLexer.h delete mode 100644 Zend/LICENSE delete mode 100644 Zend/Makefile.am delete mode 100755 Zend/Makefile.frag delete mode 100644 Zend/OBJECTS2_HOWTO delete mode 100644 Zend/README.ZEND_MM delete mode 100644 Zend/README.ZEND_VM delete mode 100644 Zend/RFCs/001.txt delete mode 100644 Zend/RFCs/002.txt delete mode 100644 Zend/RFCs/003.txt delete mode 100644 Zend/ZEND_CHANGES delete mode 100644 Zend/Zend.dsp delete mode 100644 Zend/Zend.m4 delete mode 100644 Zend/ZendCore.dep delete mode 100644 Zend/ZendTS.dsp delete mode 100644 Zend/acconfig.h delete mode 100644 Zend/acinclude.m4 delete mode 100644 Zend/bench.php delete mode 100644 Zend/build.mk delete mode 100755 Zend/buildconf delete mode 100644 Zend/configure.in delete mode 100644 Zend/flex.skl delete mode 100644 Zend/header delete mode 100644 Zend/tests/001.phpt delete mode 100644 Zend/tests/002.phpt delete mode 100644 Zend/tests/003.phpt delete mode 100644 Zend/tests/004.phpt delete mode 100644 Zend/tests/005.phpt delete mode 100644 Zend/tests/006.phpt delete mode 100644 Zend/tests/007.phpt delete mode 100644 Zend/tests/008.phpt delete mode 100644 Zend/tests/009.phpt delete mode 100644 Zend/tests/010.phpt delete mode 100644 Zend/tests/011.phpt delete mode 100644 Zend/tests/012.phpt delete mode 100644 Zend/tests/013.phpt delete mode 100644 Zend/tests/014.inc delete mode 100644 Zend/tests/014.phpt delete mode 100644 Zend/tests/015.phpt delete mode 100644 Zend/tests/016.phpt delete mode 100644 Zend/tests/abstract-static.phpt delete mode 100755 Zend/tests/array_type_hint_001.phpt delete mode 100644 Zend/tests/bug19859.phpt delete mode 100755 Zend/tests/bug20240.phpt delete mode 100755 Zend/tests/bug20242.phpt delete mode 100755 Zend/tests/bug21478.phpt delete mode 100755 Zend/tests/bug21888.phpt delete mode 100755 Zend/tests/bug22725.phpt delete mode 100644 Zend/tests/bug22836.phpt delete mode 100644 Zend/tests/bug23104.phpt delete mode 100755 Zend/tests/bug24436.phpt delete mode 100644 Zend/tests/bug24635.phpt delete mode 100644 Zend/tests/bug24699.phpt delete mode 100644 Zend/tests/bug24773.phpt delete mode 100755 Zend/tests/bug24884.phpt delete mode 100644 Zend/tests/bug26010.phpt delete mode 100755 Zend/tests/bug26077.phpt delete mode 100755 Zend/tests/bug26166.phpt delete mode 100755 Zend/tests/bug26229.phpt delete mode 100755 Zend/tests/bug26281.phpt delete mode 100755 Zend/tests/bug26696.phpt delete mode 100755 Zend/tests/bug26697.phpt delete mode 100755 Zend/tests/bug26698.phpt delete mode 100755 Zend/tests/bug26801.phpt delete mode 100755 Zend/tests/bug26802.phpt delete mode 100755 Zend/tests/bug27268.phpt delete mode 100755 Zend/tests/bug27304.phpt delete mode 100755 Zend/tests/bug27598.phpt delete mode 100755 Zend/tests/bug27669.phpt delete mode 100644 Zend/tests/bug27731.phpt delete mode 100755 Zend/tests/bug27798.phpt delete mode 100755 Zend/tests/bug28072.phpt delete mode 100755 Zend/tests/bug28377.phpt delete mode 100755 Zend/tests/bug28442.phpt delete mode 100755 Zend/tests/bug28444.phpt delete mode 100644 Zend/tests/bug29015.phpt delete mode 100644 Zend/tests/bug29104.phpt delete mode 100644 Zend/tests/bug29210.phpt delete mode 100755 Zend/tests/bug29368.phpt delete mode 100755 Zend/tests/bug29505.phpt delete mode 100755 Zend/tests/bug29674.phpt delete mode 100644 Zend/tests/bug29689.phpt delete mode 100644 Zend/tests/bug29883.phpt delete mode 100644 Zend/tests/bug29890.phpt delete mode 100755 Zend/tests/bug29896.phpt delete mode 100644 Zend/tests/bug29944.phpt delete mode 100755 Zend/tests/bug30080.phpt delete mode 100755 Zend/tests/bug30140.phpt delete mode 100755 Zend/tests/bug30161.phpt delete mode 100755 Zend/tests/bug30162.phpt delete mode 100644 Zend/tests/bug30332.phpt delete mode 100755 Zend/tests/bug30346.phpt delete mode 100755 Zend/tests/bug30394.phpt delete mode 100644 Zend/tests/bug30407.phpt delete mode 100644 Zend/tests/bug30451.phpt delete mode 100755 Zend/tests/bug30519.phpt delete mode 100644 Zend/tests/bug30702.phpt delete mode 100755 Zend/tests/bug30707.phpt delete mode 100755 Zend/tests/bug30725.phpt delete mode 100755 Zend/tests/bug30791.phpt delete mode 100755 Zend/tests/bug30820.phpt delete mode 100755 Zend/tests/bug30828.phpt delete mode 100644 Zend/tests/bug30889.phpt delete mode 100644 Zend/tests/bug30922.phpt delete mode 100755 Zend/tests/bug30998.phpt delete mode 100644 Zend/tests/bug31098.phpt delete mode 100755 Zend/tests/bug31102.phpt delete mode 100755 Zend/tests/bug31177-2.phpt delete mode 100755 Zend/tests/bug31177.phpt delete mode 100755 Zend/tests/bug31341.phpt delete mode 100755 Zend/tests/bug31525.phpt delete mode 100644 Zend/tests/bug31683.phpt delete mode 100644 Zend/tests/bug31720.phpt delete mode 100644 Zend/tests/bug31828.phpt delete mode 100644 Zend/tests/bug32080.phpt delete mode 100755 Zend/tests/bug32226.phpt delete mode 100755 Zend/tests/bug32252.phpt delete mode 100755 Zend/tests/bug32290.phpt delete mode 100755 Zend/tests/bug32296.phpt delete mode 100755 Zend/tests/bug32322.phpt delete mode 100644 Zend/tests/bug32427.phpt delete mode 100755 Zend/tests/bug32428.phpt delete mode 100644 Zend/tests/bug32429.phpt delete mode 100755 Zend/tests/bug32596.phpt delete mode 100755 Zend/tests/bug32660.phpt delete mode 100644 Zend/tests/bug32674.phpt delete mode 100755 Zend/tests/bug32799.phpt delete mode 100644 Zend/tests/bug32833.phpt delete mode 100644 Zend/tests/bug32852.phpt delete mode 100755 Zend/tests/bug32993.phpt delete mode 100755 Zend/tests/bug33116.phpt delete mode 100755 Zend/tests/bug33171.phpt delete mode 100755 Zend/tests/bug33243.phpt delete mode 100755 Zend/tests/bug33257.phpt delete mode 100644 Zend/tests/bug33277.phpt delete mode 100755 Zend/tests/bug33318.phpt delete mode 100755 Zend/tests/bug33512.phpt delete mode 100755 Zend/tests/bug33558.phpt delete mode 100755 Zend/tests/bug33710.phpt delete mode 100755 Zend/tests/bug33732.phpt delete mode 100644 Zend/tests/bug33771.phpt delete mode 100755 Zend/tests/bug33802.phpt delete mode 100755 Zend/tests/bug33996.phpt delete mode 100755 Zend/tests/bug33999.phpt delete mode 100755 Zend/tests/bug34045.phpt delete mode 100755 Zend/tests/bug34062.phpt delete mode 100755 Zend/tests/bug34064.phpt delete mode 100755 Zend/tests/bug34065.phpt delete mode 100755 Zend/tests/bug34137.phpt delete mode 100755 Zend/tests/bug34199.phpt delete mode 100755 Zend/tests/bug34260.phpt delete mode 100644 Zend/tests/bug34310.phpt delete mode 100755 Zend/tests/bug34358.phpt delete mode 100755 Zend/tests/bug34467.phpt delete mode 100755 Zend/tests/bug34518.phpt delete mode 100755 Zend/tests/bug34617.phpt delete mode 100755 Zend/tests/bug34678.phpt delete mode 100755 Zend/tests/bug34712.phpt delete mode 100755 Zend/tests/bug34767.phpt delete mode 100755 Zend/tests/bug34786.phpt delete mode 100644 Zend/tests/bug34873.phpt delete mode 100755 Zend/tests/bug34879.phpt delete mode 100755 Zend/tests/bug34893.phpt delete mode 100755 Zend/tests/bug35017.phpt delete mode 100755 Zend/tests/bug35239.phpt delete mode 100755 Zend/tests/bug35393.phpt delete mode 100755 Zend/tests/bug35411.phpt delete mode 100755 Zend/tests/bug35437.phpt delete mode 100755 Zend/tests/bug35470.phpt delete mode 100755 Zend/tests/bug35509.phpt delete mode 100755 Zend/tests/bug35655.phpt delete mode 100755 Zend/tests/bug36006.phpt delete mode 100755 Zend/tests/bug36037.phpt delete mode 100755 Zend/tests/bug36071.phpt delete mode 100755 Zend/tests/bug36268.phpt delete mode 100755 Zend/tests/bug36303.phpt delete mode 100755 Zend/tests/bug36513.phpt delete mode 100755 Zend/tests/bug36568.phpt delete mode 100755 Zend/tests/bug36759.phpt delete mode 100755 Zend/tests/bug37046.phpt delete mode 100755 Zend/tests/bug37138.phpt delete mode 100755 Zend/tests/bug37144.phpt delete mode 100755 Zend/tests/bug37212.phpt delete mode 100755 Zend/tests/bug37632.phpt delete mode 100755 Zend/tests/bug37667.phpt delete mode 100755 Zend/tests/bug37707.phpt delete mode 100755 Zend/tests/bug37811.phpt delete mode 100755 Zend/tests/bug38047.phpt delete mode 100755 Zend/tests/bug38146.phpt delete mode 100755 Zend/tests/bug38211.phpt delete mode 100755 Zend/tests/bug38220.phpt delete mode 100755 Zend/tests/bug38234.phpt delete mode 100755 Zend/tests/bug38287.phpt delete mode 100644 Zend/tests/bug38461.phpt delete mode 100755 Zend/tests/bug38623.phpt delete mode 100644 Zend/tests/bug38624.phpt delete mode 100755 Zend/tests/bug38772.phpt delete mode 100644 Zend/tests/bug38779.phpt delete mode 100644 Zend/tests/bug38779_1.phpt delete mode 100755 Zend/tests/bug38808.phpt delete mode 100755 Zend/tests/bug38942.phpt delete mode 100644 Zend/tests/bug39003.phpt delete mode 100755 Zend/tests/bug39017.phpt delete mode 100644 Zend/tests/bug39036.phpt delete mode 100755 Zend/tests/bug_debug_backtrace.phpt delete mode 100755 Zend/tests/catch.phpt delete mode 100755 Zend/tests/catch_002.phpt delete mode 100755 Zend/tests/catch_003.phpt delete mode 100755 Zend/tests/catch_004.phpt delete mode 100755 Zend/tests/dtor_scope.phpt delete mode 100644 Zend/tests/error_reporting01.phpt delete mode 100644 Zend/tests/error_reporting02.phpt delete mode 100644 Zend/tests/error_reporting03.phpt delete mode 100644 Zend/tests/error_reporting04.phpt delete mode 100644 Zend/tests/error_reporting05.phpt delete mode 100644 Zend/tests/error_reporting06.phpt delete mode 100644 Zend/tests/error_reporting07.phpt delete mode 100644 Zend/tests/error_reporting08.phpt delete mode 100644 Zend/tests/error_reporting09.phpt delete mode 100644 Zend/tests/error_reporting10.phpt delete mode 100644 Zend/tests/foreach_undefined.phpt delete mode 100644 Zend/tests/halt01.phpt delete mode 100644 Zend/tests/halt02.phpt delete mode 100644 Zend/tests/halt03.phpt delete mode 100755 Zend/tests/instanceof.phpt delete mode 100644 Zend/tests/int_overflow_32bit.phpt delete mode 100644 Zend/tests/int_overflow_64bit.phpt delete mode 100644 Zend/tests/int_underflow_32bit.phpt delete mode 100644 Zend/tests/int_underflow_64bit.phpt delete mode 100755 Zend/tests/is_a.phpt delete mode 100644 Zend/tests/method_exists.phpt delete mode 100644 Zend/tests/object-null.phpt delete mode 100755 Zend/tests/object_handlers.phpt delete mode 100644 Zend/tests/objects_001.phpt delete mode 100644 Zend/tests/objects_002.phpt delete mode 100644 Zend/tests/objects_003.phpt delete mode 100644 Zend/tests/objects_004.phpt delete mode 100644 Zend/tests/objects_005.phpt delete mode 100644 Zend/tests/objects_006.phpt delete mode 100644 Zend/tests/objects_007.phpt delete mode 100644 Zend/tests/objects_008.phpt delete mode 100644 Zend/tests/objects_009.phpt delete mode 100644 Zend/tests/objects_010.phpt delete mode 100644 Zend/tests/objects_011.phpt delete mode 100644 Zend/tests/objects_012.phpt delete mode 100644 Zend/tests/objects_013.phpt delete mode 100644 Zend/tests/objects_014.phpt delete mode 100755 Zend/tests/objects_015.phpt delete mode 100644 Zend/tests/offset_array.phpt delete mode 100644 Zend/tests/offset_bool.phpt delete mode 100644 Zend/tests/offset_long.phpt delete mode 100644 Zend/tests/offset_null.phpt delete mode 100644 Zend/tests/offset_object.phpt delete mode 100644 Zend/tests/offset_string.phpt delete mode 100644 Zend/tests/strict_001.phpt delete mode 100644 Zend/tests/strict_002.phpt delete mode 100644 Zend/tests/unset.inc delete mode 100644 Zend/tests/unset_cv01.phpt delete mode 100644 Zend/tests/unset_cv02.phpt delete mode 100644 Zend/tests/unset_cv03.phpt delete mode 100644 Zend/tests/unset_cv04.phpt delete mode 100644 Zend/tests/unset_cv05.phpt delete mode 100644 Zend/tests/unset_cv06.phpt delete mode 100644 Zend/tests/unset_cv07.phpt delete mode 100644 Zend/tests/unset_cv08.phpt delete mode 100644 Zend/tests/unset_cv09.phpt delete mode 100644 Zend/tests/unset_cv10.phpt delete mode 100644 Zend/tests/unset_cv11.phpt delete mode 100755 Zend/tests/unset_cv12.phpt delete mode 100644 Zend/tests/zend2.php.txt delete mode 100644 Zend/tests/zend_operators.phpt delete mode 100644 Zend/tests/zend_strtod.phpt delete mode 100644 Zend/zend.c delete mode 100644 Zend/zend.h delete mode 100644 Zend/zend.ico delete mode 100644 Zend/zend_API.c delete mode 100644 Zend/zend_API.h delete mode 100644 Zend/zend_alloc.c delete mode 100644 Zend/zend_alloc.h delete mode 100644 Zend/zend_arg_defs.c delete mode 100644 Zend/zend_builtin_functions.c delete mode 100644 Zend/zend_builtin_functions.h delete mode 100644 Zend/zend_compile.c delete mode 100644 Zend/zend_compile.h delete mode 100644 Zend/zend_config.nw.h delete mode 100644 Zend/zend_config.w32.h delete mode 100644 Zend/zend_constants.c delete mode 100644 Zend/zend_constants.h delete mode 100644 Zend/zend_default_classes.c delete mode 100644 Zend/zend_dynamic_array.c delete mode 100644 Zend/zend_dynamic_array.h delete mode 100644 Zend/zend_errors.h delete mode 100644 Zend/zend_exceptions.c delete mode 100644 Zend/zend_exceptions.h delete mode 100644 Zend/zend_execute.c delete mode 100644 Zend/zend_execute.h delete mode 100644 Zend/zend_execute_API.c delete mode 100644 Zend/zend_extensions.c delete mode 100644 Zend/zend_extensions.h delete mode 100644 Zend/zend_fast_cache.h delete mode 100644 Zend/zend_globals.h delete mode 100644 Zend/zend_globals_macros.h delete mode 100644 Zend/zend_hash.c delete mode 100644 Zend/zend_hash.h delete mode 100644 Zend/zend_highlight.c delete mode 100644 Zend/zend_highlight.h delete mode 100644 Zend/zend_indent.c delete mode 100644 Zend/zend_indent.h delete mode 100644 Zend/zend_ini.c delete mode 100644 Zend/zend_ini.h delete mode 100644 Zend/zend_ini_parser.y delete mode 100644 Zend/zend_ini_scanner.h delete mode 100644 Zend/zend_ini_scanner.l delete mode 100755 Zend/zend_interfaces.c delete mode 100755 Zend/zend_interfaces.h delete mode 100644 Zend/zend_istdiostream.h delete mode 100755 Zend/zend_iterators.c delete mode 100755 Zend/zend_iterators.h delete mode 100644 Zend/zend_language_parser.y delete mode 100644 Zend/zend_language_scanner.h delete mode 100644 Zend/zend_language_scanner.l delete mode 100644 Zend/zend_list.c delete mode 100644 Zend/zend_list.h delete mode 100644 Zend/zend_llist.c delete mode 100644 Zend/zend_llist.h delete mode 100644 Zend/zend_mm.c delete mode 100644 Zend/zend_mm.h delete mode 100644 Zend/zend_modules.h delete mode 100644 Zend/zend_multibyte.c delete mode 100644 Zend/zend_multibyte.h delete mode 100644 Zend/zend_multiply.h delete mode 100644 Zend/zend_object_handlers.c delete mode 100644 Zend/zend_object_handlers.h delete mode 100644 Zend/zend_objects.c delete mode 100644 Zend/zend_objects.h delete mode 100644 Zend/zend_objects_API.c delete mode 100644 Zend/zend_objects_API.h delete mode 100644 Zend/zend_opcode.c delete mode 100644 Zend/zend_operators.c delete mode 100644 Zend/zend_operators.h delete mode 100644 Zend/zend_ptr_stack.c delete mode 100644 Zend/zend_ptr_stack.h delete mode 100644 Zend/zend_qsort.c delete mode 100644 Zend/zend_qsort.h delete mode 100644 Zend/zend_sprintf.c delete mode 100644 Zend/zend_stack.c delete mode 100644 Zend/zend_stack.h delete mode 100644 Zend/zend_static_allocator.c delete mode 100644 Zend/zend_static_allocator.h delete mode 100644 Zend/zend_stream.c delete mode 100644 Zend/zend_stream.h delete mode 100644 Zend/zend_strtod.c delete mode 100644 Zend/zend_strtod.h delete mode 100644 Zend/zend_ts_hash.c delete mode 100644 Zend/zend_ts_hash.h delete mode 100644 Zend/zend_types.h delete mode 100644 Zend/zend_variables.c delete mode 100644 Zend/zend_variables.h delete mode 100644 Zend/zend_vm.h delete mode 100644 Zend/zend_vm_def.h delete mode 100644 Zend/zend_vm_execute.h delete mode 100644 Zend/zend_vm_execute.skl delete mode 100644 Zend/zend_vm_gen.php delete mode 100644 Zend/zend_vm_opcodes.h (limited to 'Zend') diff --git a/Zend/ChangeLog b/Zend/ChangeLog deleted file mode 100644 index ef4e71c87a..0000000000 --- a/Zend/ChangeLog +++ /dev/null @@ -1,22097 +0,0 @@ -2005-08-05 Dmitry Stogov - - * zend_execute.c - tests/array_type_hint_001.phpt - tests/bug33996.phpt: - Fixed bug #33996 (No information given for fatal error on passing invalid - value to typed argument) - - * zend_operators.c - tests/bug33999.phpt: - Fixed bug #33999 (object remains object when cast to int) - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed memory leak in foreach() on undefined variable - (Zend/tests/foreach_undefined.php) - -2005-08-04 Antony Dovgal - - * tests/foreach_undefined.phpt: - add test for the last Dmitry's fix - -2005-08-04 Dmitry Stogov - - * zend_compile.c: - Fixed possible memory corryption during compilation of - - * (PHP_5_0) - zend_objects.c: - Fixed clone bug in ze1_compatibility mode - - * zend_objects.c: - Fixed clone bug in ze1_compatibilty mode - -2005-08-03 Jani Taskinen - - * LICENSE: - - Bumber up year - - * acconfig.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.nw.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_default_classes.c - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_exceptions.c - zend_exceptions.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_interfaces.c - zend_interfaces.h - zend_istdiostream.h - zend_iterators.c - zend_iterators.h - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_mm.c - zend_mm.h - zend_modules.h - zend_multibyte.c - zend_multibyte.h - zend_multiply.h - zend_object_handlers.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_reflection_api.c - zend_reflection_api.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_stream.c - zend_stream.h - zend_strtod.h - zend_ts_hash.c - zend_ts_hash.h - zend_types.h - zend_variables.c - zend_variables.h - zend_vm.h: - Bump up the year - - * README.ZEND_VM: - Nuked DOS EOLs - -2005-08-02 Dmitry Stogov - - * zend_execute_API.c - zend_execute_API.c: - Fixed bug #33942 (the patch to #33156 crash cygwin except cli) - -2005-08-02 Jani Taskinen - - * zend_exceptions.c: - - Fixed bug #33967 (misuse of Exception constructor doesn\'t display - errorfile) - -2005-08-02 Dmitry Stogov - - * bench.php: - Removed warnings - -2005-07-29 Ilia Alshanetsky - - * zend_vm_def.h - zend_vm_execute.h: - Fixed warning message generated when isset() or empty() are given invalid - offset type. - -2005-07-29 Anantha Kesari H Y - - * acconfig.h - acconfig.h: - In NetWare few of the programs like apache2 and ldap use winsock inclusinf - sys/socket.h is not desirable. - --Kamesh - -2005-07-29 Jani Taskinen - - * zend_vm_execute.h: - update generated file - -2005-07-28 Andi Gutmans - - * zend_vm_def.h: - - Tiny fixlet - -2005-07-28 Marcus Boerger - - * zend_API.c - zend_API.h: - - Add convenience function zend_is_callable_ex() and base zend_is_callable - and zend_make_callable on it. This functions allows to check if a php - variable is a callable function and returns its function pointer as well - as object if possible. - -2005-07-26 Jani Taskinen - - * zend_execute_API.c: - bug #33865 - -2005-07-25 Marcus Boerger - - * zend_API.c: - - Fix #33853 - -2005-07-22 Dmitry Stogov - - * zend.c - zend.c - tests/bug33802.phpt - tests/bug33802.phpt - tests/bug33802.phpt: - Fixed bug #33802 (throw Exception in error handler causes crash) - -2005-07-21 Marcus Boerger - - * zend_execute_API.c: - - Fix error generation logic (found by johannes) - -2005-07-21 Dmitry Stogov - - * zend_vm_def.h: - Fixed bug with returning from internal function by reference - -2005-07-19 Marcus Boerger - - * zend_interfaces.c: - - Dont't warn in case an exception is pending - in this case it'd - superflous - -2005-07-19 Dmitry Stogov - - * zend_compile.c - zend_compile.c - zend_execute.c - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed bug #33710 (ArrayAccess objects doen't initialize $this) - -2005-07-18 Rasmus Lerdorf - - * zend_language_scanner.l: - Valgrind is unhappy that this is not initialized - -2005-07-18 Dmitry Stogov - - * zend_API.c - zend_API.h: - Fixed bug in new module statrup mechanism - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug33558.phpt: - Fixed bug #33558 (warning with nested calls to functions returning by - reference) - - * tests/bug33558.phpt - tests/bug33558.phpt: - - Fixed bug #33558 (warning with nested calls to functions returning by - reference) - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - Removed some compilation warnings. - -2005-07-18 Jani Taskinen - - * tests/bug33710.phpt: - typo - -2005-07-17 Marcus Boerger - - * tests/bug33710.phpt: - - Add new test - -2005-07-17 Ilia Alshanetsky - - * zend_compile.c: - Added missing init. - -2005-07-14 Andi Gutmans - - * zend.h: - - Back to -dev - - * (php_5_1_0b3) - zend.h: - - Beta 3 - -2005-07-12 Andi Gutmans - - * zend.h: - - Back to -dev - - * (php_5_1_0b3) - zend.h: - - Beta 3 - -2005-07-12 Dmitry Stogov - - * (php_5_1_0b3) - zend_execute_API.c - zend_execute_API.c: - Fixed bug #33156 (cygwin version of setitimer doesn't accept ITIMER_PROF). - (Nuno) - -2005-07-11 Ilia Alshanetsky - - * zend_vm_def.h - zend_vm_execute.h: - Make references misuse emit E_NOTICE rather E_STRICT to be compatible with - PHP 4.4.0 - -2005-07-08 Jani Taskinen - - * tests/unset_cv05.phpt - tests/unset_cv06.phpt: - fix test when session.save_handler is "user" - -2005-07-07 Dmitry Stogov - - * zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_object_handlers.c - zend_objects.c - zend_reflection_api.c: - Fixed bug #33512 (Add missing support for isset()/unset() overloading to - complement the property get/set methods) - -2005-07-07 Anantha Kesari H Y - - * zend_stream.c - zend_stream.c: - zend_stream_getc uses fread internally. NetWare LibC fread reads 4(Which I - believe EOT) for EOF(^D) character. This happens when fread is asked to - read one and only character as is the case with cl interactive mode. - -- Kamesh - -2005-07-07 Dmitry Stogov - - * zend_execute_API.c - zend_hash.c - zend_hash.h - tests/bug28072.phpt: - Fixed bug #28072 (static array with some constant keys will be incorrectly - ordered). - -2005-07-04 Dmitry Stogov - - * zend_compile.h - zend_execute.c - zend_language_parser.y - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed SIGSEGV on 'global ${"{$blah}_ID"};' - - * zend_API.h - zend_execute_API.c: - Fixed bug #31158 (array_splice on $GLOBALS crashes) - -2005-07-03 Dmitry Stogov - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed memory leak - -2005-06-30 Dmitry Stogov - - * zend_API.c - zend_API.h: - Restored old behavior of zend_statup_module() - -2005-06-29 Stanislav Malyshev - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h: - fix conditions for freeing - - * zend_API.c - zend_API.c: - add comment - - * (PHP_5_0) - zend_execute.c: - fix conditions - -2005-06-28 Antony Dovgal - - * zend_execute.c: - fix leak: when dup was ful zend_std_object_get_class_name() - returns SUCCESS aka 0 - -2005-06-28 Stanislav Malyshev - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h: - fix previous patch - - * zend_vm_execute.h: - update - - * zend_execute.c - zend_vm_def.h: - fixes for non-php objects - - * (PHP_5_0) - zend_execute.c: - fixes fo rnon-php objects (John Coggeshall) - -2005-06-27 Jani Taskinen - - * zend.c: - - Fixed bug #31358 (Older GCC versions do not provide portable va_copy()). - -2005-06-27 Stanislav Malyshev - - * zend_API.c - zend_API.c - zend_API.h - zend_API.h - zend_builtin_functions.c - zend_builtin_functions.c - zend_exceptions.c - zend_exceptions.c: - fix various "Class entry requested for an object without PHP class" - messages - when working with non-PHP objects. - -2005-06-27 Dmitry Stogov - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed SIGSEGV on assigment string offset by reference - - * zend_builtin_functions.c - zend_builtin_functions.c: - Fixed wrong include/requre occurrences in debug backtrace. - -2005-06-24 Dmitry Stogov - - * zend_execute.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - Export zend_do_fcall() helper from executor - - * zend_compile.c - zend_compile.c: - Partial fix for bug #26584 (Class member - array key overflow) - It doesn't fix integer overflow problem, but allows null, boolean and - double keys in array constants in the same way as in runtime. - - * tests/bug30519.phpt - tests/bug30519.phpt: - - Fixed bug #30519 (Interface not existing says Class not found) - - * zend_compile.c - zend_compile.c - zend_compile.h - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_execute_API.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug30519.phpt: - Fixed bug #30519 (Interface not existing says Class not found) - -2005-06-23 Dmitry Stogov - - * zend_builtin_functions.c - zend_builtin_functions.c - tests/bug28377.phpt: - Fixed bug #28377 (debug_backtrace is intermittently passing args) - - * tests/bug28377.phpt - tests/bug28377.phpt: - - file bug28377.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug32660.phpt: - Fixed bug #32660 (Assignment by reference causes crash when field access is - overloaded (__get)) - - * tests/bug32660.phpt - tests/bug32660.phpt: - - Fixed bug #32660 (Assignment by reference causes crash when field access - is overloaded (__get)) - - * zend_builtin_functions.c - zend_builtin_functions.c - tests/bug30828.phpt: - Fixed bug #30828 (debug_backtrace() reports incorrect class in overridden - methods) - - * tests/bug30828.phpt - tests/bug30828.phpt: - - file bug30828.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - tests/bug27268.phpt: - Test for bug #27268. It is fixed in HEAD but not in PHP_5_0. - - * zend_execute.c - tests/bug27268.phpt - tests/bug27268.phpt: - Fixed bug #27268 (Bad references accentuated by clone). - -2005-06-23 Andi Gutmans - - * zend.h: - - Back to -dev - - * (php_5_1_0b2) - zend.h: - - Beta 2 - -2005-06-22 Dmitry Stogov - - * (php_5_1_0b2) - zend_builtin_functions.c - zend_builtin_functions.c - zend_execute_API.c - zend_execute_API.c - tests/bug29896.phpt: - Fixed bug #29896 (Backtrace argument list out of sync) - - * tests/bug29896.phpt - tests/bug29896.phpt: - - file bug29896.phpt was initially added on branch PHP_5_0. - -2005-06-22 Stanislav Malyshev - - * (php_5_1_0b2) - zend_vm.h - zend_vm_execute.h - zend_vm_gen.php: - export zend_vm_set_opcode_handler - -2005-06-22 Antony Dovgal - - * (php_5_1_0b2) - zend_ini.c: - - allow to use "yes" and "true" with ini_set() and in commandline (through - -d flag) - - fix #15854 that was caused by wrong consideration that - zend_ini_boolean_displayer_cb() - always recieves converted to "0"/"1" values. - -2005-06-22 Dmitry Stogov - - * (php_5_1_0b2) - zend_compile.c - zend_compile.c - zend_compile.h - zend_compile.h - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug33257.phpt: - Fixed bug #33257 (array_splice() inconsistent when passed function instead - of variable) - - * tests/bug33257.phpt - tests/bug33257.phpt: - - file bug33257.phpt was initially added on branch PHP_5_0. - -2005-06-22 Jani Taskinen - - * (php_5_1_0b2) - tests/unset_cv05.phpt - tests/unset_cv06.phpt: - fix tests - -2005-06-21 Dmitry Stogov - - * tests/unset_cv07.phpt: - Fixed test file - -2005-06-21 Andi Gutmans - - * zend.h: - - Back to -dev. Guys (n' Girls), give at least 1 hour before you start - - complaining about not going back to -dev. I like checking the tarball - - before I change it back. - - * (php_5_1_0b2) - zend.h: - - Take #3 :) - -2005-06-21 Ilia Alshanetsky - - * (php_5_1_0b2) - zend_reflection_api.c: - Fixed memory leak. - - -2005-06-21 Dmitry Stogov - - * (PHP_5_0) - zend_compile.c: - Remove unnecessary ZEND_FETCH_CLASS together with - ZEND_DECLARE_INHERITED_CLASS - in case of early binding - - * (php_5_1_0b2) - zend_compile.c: - Remove unnecessary ZEND_FETCH_CLASS together with - ZEND_DECLARE_INHERITED_CLASS in case of early binding - -2005-06-20 Andi Gutmans - - * zend.h: - - Back to -dev - - * (php_5_1_0b2) - zend.h: - - Beta 2 - -2005-06-20 Dmitry Stogov - - * (php_5_1_0b2) - zend_object_handlers.c - zend_object_handlers.c: - Fixed possible crash on $x = $obj->$non_string - -2005-06-20 Marcus Boerger - - * (php_5_1_0b2) - zend_reflection_api.c: - - Fix bug #33389 by fixing copying - - * zend_reflection_api.c: - - Show true/flase - -2005-06-19 Derick Rethans - - * tests/bug32226.phpt: - - Fixed layout of test description. - -2005-06-17 Jani Taskinen - - * tests/bug29368.phpt - tests/bug30856.phpt - tests/bug30961.phpt - tests/bug31720.phpt - tests/bug32226.phpt - tests/bug33277.phpt: - No short-tags! - -2005-06-17 Dmitry Stogov - - * zend_compile.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Removed EX(fbc_constructor) (it is no longer needed) - -2005-06-17 Antony Dovgal - - * (PHP_5_0) - zend_API.c - zend_list.c: - MFH: improve error messages in internal classes - - * zend_API.c - zend_list.c: - improve error messages when error raised from an internal class (do not - hide class name) - -2005-06-17 Dmitry Stogov - - * zend_object_handlers.c - zend_object_handlers.c: - Fixed bug #33277 (private method accessed by child class) - -2005-06-17 Antony Dovgal - - * zend_hash.c: - fix bug #33382 (array_reverse() fails after *sort()) - no need to MFH - the bug existed only in HEAD - -2005-06-17 Dmitry Stogov - - * zend_API.c - zend_API.h - zend_extensions.h - zend_modules.h: - Improved PHP extension loading mechanism with support for module - dependencies and conflicts. - -2005-06-16 Marcus Boerger - - * zend_reflection_api.c: - - Internal functions/methods can now return by reference - - * zend_execute.c: - - Fix TSRM build - -2005-06-16 Dmitry Stogov - - * bench.php: - typo - - * zend.h - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_extensions.h - zend_modules.h - zend_object_handlers.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Allowed return by refrence from internal functions - -2005-06-16 Stanislav Malyshev - - * zend_execute.c - zend_execute.h: - rename to zend_ - -2005-06-16 Dmitry Stogov - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug33318.phpt: - Fixed bug #33318 (throw 1; results in Invalid opcode 108/1/8) - -2005-06-16 Zeev Suraski - - * zend_language_scanner.l: - Fixlet - -2005-06-16 Dmitry Stogov - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Compilation warnings - - * zend_compile.c - zend_compile.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - ZEND_UNSET_DIM_OBJ is splitted to ZEND_UNSET_DIM and ZEND_UNSET_OBJ. - -2005-06-16 Stanislav Malyshev - - * zend_execute.c - zend_execute.h: - export zval getters - -2005-06-16 Dmitry Stogov - - * zend_execute.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - USER_OPCODE API is improvet. - Implemented ability to dispatch from user handler to internal handler of - another opcode. - -2005-06-15 Dmitry Stogov - - * zend.c - zend.h: - Fixed OS X compatibility - -2005-06-15 Jani Taskinen - - * tests/bug32428.phpt: - typofix - -2005-06-14 Ilia Alshanetsky - - * bench.php: - more accurate timing function. - -2005-06-14 Dmitry Stogov - - * zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - Removed old executor - -2005-06-14 Jani Taskinen - - * Zend.m4: - reordered + added msg to configure output for PHP_ZEND_VM - - * Zend.m4: - typofix - - * Zend.m4 - acinclude.m4: - fix standalone build - -2005-06-13 Dmitry Stogov - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - Specializer optimization - - * zend.c - zend.h - zend_execute.c: - Fixed bug #33212 ([GCC 4]: 'zend_error_noreturn' aliased to external symbol - 'zend_error'). - The fix is not tested on Solaris and DARWIN! - - * zend_reflection_api.c - tests/bug33312.phpt: - Fixed bug #33312 (ReflectionParameter methods do not work correctly) - -2005-06-11 Andi Gutmans - - * zend.h: - - Back to -dev - - * (php_5_1_0b2) - zend.h: - - b2 (will post it to internals@) - -2005-06-10 Andi Gutmans - - * zend.h: - - Back to -dev - - * (php_5_1_0b1) - zend.h: - - Go with 5.1.0b1 - -2005-06-10 Dmitry Stogov - - * (php_5_1_0b1) - tests/bug30162.phpt: - Added test for bug #30162 (it is already fixed but test file was forgotten) - - * (php_5_1_0b1) - tests/bug31177.phpt: - Added test file for bug #31177 (not fixed yet) - - * tests/bug31177.phpt - tests/bug31177.phpt: - - file bug31177.phpt was initially added on branch PHP_5_0. - - * (php_5_1_0b1) - tests/bug29689.phpt: - typos - - * (php_5_1_0b1) - zend_reflection_api.c - zend_reflection_api.c: - Fixed support for ZEND_ACC_SHADOW in ReflectionProperty constructor - - * (php_5_1_0b1) - zend_execute.c - zend_execute.h - zend_extensions.h - zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - Fix so that extensions like xdebug, can overload opcodes in all execution - modes including goto/switch - - * (php_5_1_0b1) - zend_compile.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Merge three opcodes (ZEND_NEW, ZEND_JMP_NO_CTOR, ZEND_INIT_CTOR) into one - (ZEND_NEW). There was no real reason for this anymore and API should be - changed before 5.1 - -2005-06-09 Stanislav Malyshev - - * zend_compile.c - zend_compile.h - zend_object_handlers.c - zend_reflection_api.c - tests/bug29689.phpt: - MF50: fix #29689 and more private property problems - - * tests/bug33277.phpt: - add test for this TBF bug - - * zend_compile.c: - disallow abstrace private methods - - * (PHP_5_0) - zend_compile.c: - Disallow abstract privae methods - - * (PHP_5_0) - zend_compile.c - zend_compile.h - zend_object_handlers.c - zend_reflection_api.c - tests/bug29689.phpt: - fix #29689 and more private property problems - -2005-06-09 Dmitry Stogov - - * zend.c - zend.c - zend_execute_API.c - zend_execute_API.c: - Fixed double call to php_stream_close() on compiler errors - -2005-06-09 Stanislav Malyshev - - * tests/bug33277.phpt - tests/bug33277.phpt: - - file bug33277.phpt was initially added on branch PHP_5_0. - -2005-06-09 Dmitry Stogov - - * zend.c - zend.c: - Fixed bug #25922 (In error handler, modifying 5th arg (errcontext) may - result in seg fault) - - * zend_language_scanner.l - zend_language_scanner.l: - Fixed bug (Crash on Windows and ZTS) that was introduced with fix for bug - #26456 - -2005-06-08 Dmitry Stogov - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed exception handling in getIterator() callback (bugs #26229 & #30725) - - * zend_compile.c - zend_compile.c: - Fixed valgrind errors - - * zend_reflection_api.c: - Fixed ReflectionClass::setStaticPropertyValue() - -2005-06-08 Jani Taskinen - - * zend_config.w32.h: - Hopefully fixes win32 builds - -2005-06-08 Dmitry Stogov - - * zend_compile.c: - Fixed lookups for previos opcodes - - * zend_execute_API.c - zend_execute_API.c - tests/bug30140.phpt: - Fixed bug #30140 (Problem with array in static properties) - - * tests/bug30140.phpt - tests/bug30140.phpt: - - file bug30140.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - tests/bug32322.phpt: - Added test for bug #32322 (Return values by reference broken( using - self::),example singleton instance) - - * tests/bug32322.phpt - tests/bug32322.phpt: - - Added test for bug #32322 (Return values by reference broken( using - self::),example singleton instance) - - * zend_object_handlers.c - zend_object_handlers.c - tests/bug30820.phpt: - Fixed bug #30820 (static member conflict with $this->member silently - ignored) - - * tests/bug30820.phpt - tests/bug30820.phpt: - - file bug30820.phpt was initially added on branch PHP_5_0. - - * zend_compile.c - zend_compile.c - zend_language_parser.y - zend_language_parser.y - tests/bug30961.phpt: - Fixed bug #30961 (Wrong linenumber in ReflectionClass getStartLine()) - - * tests/bug30961.phpt - tests/bug30961.phpt: - - file bug30961.phpt was initially added on branch PHP_5_0. - -2005-06-07 Dmitry Stogov - - * zend_compile.c - zend_compile.c - zend_compile.h - zend_compile.h - zend_language_scanner.l - zend_language_scanner.l: - Fixed bug #26456 (Wrong results from Reflection-API getDocComment() when - called via STDIN) - -2005-06-07 Jani Taskinen - - * Zend.m4: - -Moved --disable-zend-memory-manager where it belongs - - * acinclude.m4: - - Show "none" when nothing is found - -2005-06-07 Ilia Alshanetsky - - * zend_objects.c: - Fixed ZTS build. - -2005-06-07 Derick Rethans - - * (PHP_5_0) - zend_alloc.h: - - MFH: Added the --disable-zend-memory-manager switch to disable the Zend - memory manager. - - * zend_alloc.h: - - Added the --disable-zend-memory-manager switch to disable the Zend memory - manager. - -2005-06-07 Dmitry Stogov - - * zend_builtin_functions.c - zend_builtin_functions.c: - Fixed memory leak in debug_print_backtrace() - - * zend_execute.c - zend_execute.c: - fixed memory leak in bug #28972 ([] operator overflow treatment is - incorrect), not the bug itself. - -2005-06-07 Derick Rethans - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - - MF44: Problems with user defined error handler and references - -2005-06-07 Dmitry Stogov - - * zend_objects.c - zend_objects.c - tests/bug33243.phpt: - Fixed bug #33243 (ze1_compatibility_mode does not work as expected) - - * tests/bug33243.phpt - tests/bug33243.phpt: - - file bug33243.phpt was initially added on branch PHP_5_0. - -2005-06-07 Dmitry Stogov - - * zend_compile.c - zend_compile.c - zend_compile.h - zend_compile.h - zend_language_scanner.l - zend_language_scanner.l: - Fixed bug #26456 (Wrong results from Reflection-API getDocComment() when - called via STDIN) - -2005-06-07 Jani Taskinen - - * Zend.m4: - -Moved --disable-zend-memory-manager where it belongs - - * acinclude.m4: - - Show "none" when nothing is found - -2005-06-07 Ilia Alshanetsky - - * zend_objects.c: - Fixed ZTS build. - -2005-06-07 Derick Rethans - - * (PHP_5_0) - zend_alloc.h: - - MFH: Added the --disable-zend-memory-manager switch to disable the Zend - memory manager. - - * zend_alloc.h: - - Added the --disable-zend-memory-manager switch to disable the Zend memory - manager. - -2005-06-07 Dmitry Stogov - - * zend_builtin_functions.c - zend_builtin_functions.c: - Fixed memory leak in debug_print_backtrace() - - * zend_execute.c - zend_execute.c: - fixed memory leak in bug #28972 ([] operator overflow treatment is - incorrect), not the bug itself. - -2005-06-07 Derick Rethans - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - - MF44: Problems with user defined error handler and references - -2005-06-07 Dmitry Stogov - - * zend_objects.c - zend_objects.c - tests/bug33243.phpt: - Fixed bug #33243 (ze1_compatibility_mode does not work as expected) - - * tests/bug33243.phpt - tests/bug33243.phpt: - - file bug33243.phpt was initially added on branch PHP_5_0. - -2005-06-06 Derick Rethans - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - - Regenerate VM files and add warning about regeneration - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h: - - MH44: Problems with user defined error handler and wrong usage of - references - -2005-06-06 Dmitry Stogov - - * zend_compile.c - tests/bug32428.phpt: - Fixed bug #32428 (The @ warning error supression operator is broken) - - * zend_objects_API.c - zend_objects_API.c - tests/bug32799.phpt: - Fixed bug #32799 (crash: calling the corresponding global var during the - destruct) - - * tests/bug32799.phpt - tests/bug32799.phpt: - - file bug32799.phpt was initially added on branch PHP_5_0. - - * tests/bug32596.phpt: - Added test for bug #32596 (Segfault/Memory Leak by getClass (etc) in - __destruct) - - * tests/bug32596.phpt - tests/bug32596.phpt: - - file bug32596.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute_API.c: - Fixed bug #32596 (Segfault/Memory Leak by getClass (etc) in __destruct) - - * (PHP_5_0) - tests/bug32993.phpt: - Added test for bug #32993 (implemented Iterator function current() don't - throw - exception) - - * tests/bug32993.phpt - tests/bug32993.phpt: - - Fixed bug #32993 (implemented Iterator function current() don't throw - exception) - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed bug #32993 (implemented Iterator function current() don't throw - exception) - - * zend_object_handlers.c - zend_object_handlers.c - tests/bug33171.phpt: - Fixed bug #33171 (foreach enumerates private fields declared in base - classes) - - * tests/bug33171.phpt - tests/bug33171.phpt: - - file bug33171.phpt was initially added on branch PHP_5_0. - -2005-06-06 Wez Furlong - - * zend_language_scanner.l: - Avoid double-freeing streams. - This can happen because all streams are registered as resources; - the engine also tracks them in the open_files global. - - Avoid the potential for double-freeing by simply making streams exposed to - the - engine have no closer for the engine to call; they will already be in the - resource list, and thus will be shut down properly at request end. - -2005-06-04 Zeev Suraski - - * zend_compile.h - zend_language_parser.y - zend_language_scanner.l - zend_stream.c - zend_stream.h - tests/halt01.phpt - tests/halt02.phpt - tests/halt03.phpt: - Thought I committed it ages ago... Anyway, without further delays, the - final - __halt_compiler() patch - -2005-06-03 Dmitry Stogov - - * tests/bug30394.phpt: - Added test for 5.0 specific bug #30394 (Assignment operators yield wrong - result with __get/__set) - - * (PHP_5_0) - zend.c - zend_execute_API.c - tests/bug30394.phpt - tests/bug30394.phpt: - Fixed bug #30394 (Assignment operators yield wrong result with __get/__set) - - * zend_compile.c - zend_compile.c - tests/bug30080.phpt: - Fixed bug #30080 (Passing array or non array of objects) - - * tests/bug30080.phpt - tests/bug30080.phpt: - - file bug30080.phpt was initially added on branch PHP_5_0. - - * zend_compile.c - zend_compile.c - zend_execute.c - tests/bug27598.phpt: - Fixed bug #27598 (list() array key assignment causes HUGE memory leak) - - * tests/bug27598.phpt - tests/bug27598.phpt: - - file bug27598.phpt was initially added on branch PHP_5_0. - - * zend_execute.c - zend_object_handlers.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/object_handlers.phpt: - Fixed memory allocation bugs related to magic object handlers (__get(), - __set(), - ...) - - * tests/object_handlers.phpt - tests/object_handlers.phpt: - - file object_handlers.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_object_handlers.c: - Fixed memory allocation bugs related to magic object handlers (__get(), - __set(), ...) - -2005-06-01 Dmitry Stogov - - * zend_object_handlers.c - zend_object_handlers.c - tests/bug30791.phpt: - Fixed bug #30791 (magic methods (__sleep/__wakeup/__toString) call __call - if object is overloaded) - - * tests/bug30791.phpt - tests/bug30791.phpt: - - file bug30791.phpt was initially added on branch PHP_5_0. - -2005-05-31 Magnus Määttä - - * tests/bug27304.phpt: - Fix test - -2005-05-31 Dmitry Stogov - - * zend_operators.c: - Reverted wrong fix for bug #30572. - Seems the bug was already fixed in other way. - But reverted patch produced a lot of valgrind errors, because IS_TMP_VAR - operands don't initialize refcount. - -2005-05-31 Marcus Boerger - - * zend_compile.c: - - Only allow changing return ref agnostic when a script method overrides an - internal method (found by dmitry) - -2005-05-29 Jani Taskinen - - * Zend.m4: - - Unify the "configure --help" texts - -2005-05-29 Hartmut Holzgraefe - - * acinclude.m4: - forgot to re-add 1.875 as a valid bison version after testing - - * acinclude.m4: - bison may be installed under a different executable name, e.g. - - YACC="bison-1.75" configure ... - - removing the check for "bison -y" allows for this - the check was redundant anyway as the following one filters - for "GNU Bison" in the --version output - - * Zend.m4 - acinclude.m4: - avoid code duplication in bison version test - -2005-05-28 Marcus Boerger - - * zend_compile.c - zend_compile.h: - - Make zend_do_inheritance ZEND_API - -2005-05-27 Dmitry Stogov - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug22836.phpt - tests/bug22836.phpt: - Fixed bug #22836 (returning reference to uninitialized variable) - -2005-05-26 Dmitry Stogov - - * (PHP_5_0) - zend_execute_API.c - tests/bug33116.phpt: - Fixed bug #33116 (crash when assigning class name to global variable in - __autoload) - - * tests/bug33116.phpt - tests/bug33116.phpt: - - Fixed bug #33116 (crash when assigning class name to global variable in - __autoload). - - * zend_execute_API.c: - Fixed bug #33116 (crash when assigning class name to global variable in - __autoload). - - * zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_reflection_api.c - tests/array_type_hint_001.phpt: - Added array type hinting. (This patch requires full re-make) - -2005-05-26 Marcus Boerger - - * (PHP_5_0) - tests/bug27304.phpt - tests/bug32981.phpt: - - Add new tests - - * tests/bug27304.phpt - tests/bug27304.phpt - tests/bug32981.phpt - tests/bug32981.phpt: - - - Add new tests - -2005-05-22 Ilia Alshanetsky - - * (PHP_5_0) - zend_highlight.c: - MFH: Fixed bug #29338 (unencoded spaces get ignored after certain tags). - - * zend_highlight.c: - Fixed bug #29338 (unencoded spaces get ignored after certain tags). - -2005-05-22 Stanislav Malyshev - - * zend.c - zend.c: - fix leak - -2005-05-19 Dmitry Stogov - - * (PHP_5_0) - zend_object_handlers.c: - Backported fix for bug #30451 - - * tests/bug31828.phpt - tests/bug31828.phpt - tests/bug32080.phpt - tests/bug32080.phpt: - Strict warnings - -2005-05-18 Stanislav Malyshev - - * zend.c - zend.c: - fix for #29890 - part 2 - - * (PHP_5_0) - tests/bug29890.phpt: - test - - * tests/bug29890.phpt - tests/bug29890.phpt: - - test - - * zend_execute_API.c - zend_execute_API.c: - fix #29890 - crash when function call fails - - * zend_object_handlers.c: - revert - seems to be fixed elsewhere - - * zend_object_handlers.c: - fix #30451 static properties don't work properly - - * tests/bug29689.phpt - tests/bug30451.phpt: - tests - - * tests/bug29689.phpt - tests/bug29689.phpt - tests/bug30451.phpt - tests/bug30451.phpt: - - file bug29689.phpt was initially added on branch PHP_5_0. - -2005-05-17 Magnus Määttä - - * tests/bug31828.phpt - tests/bug32080.phpt: - Fix tests. - -2005-05-13 Antony Dovgal - - * (PHP_5_0) - zend.c: - MFH: fix bug #29975 (memory leaks when set_error_handler() is used inside - error handler) - - * zend.c: - fix bug #29975 (memory leaks when set_error_handler() is used inside error - handler) - -2005-05-12 Marcus Boerger - - * zend_reflection_api.c: - - Make ReflectionObject::hasProperty() recognize dynamically added props - -2005-05-06 Jani Taskinen - - * zend_object_handlers.h: - typofix :) - -2005-05-05 Dmitry Stogov - - * zend_compile.c - zend_compile.c - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug31525.phpt: - Fixed bug #31525 (object reference being dropped. $this getting lost) - - * tests/bug31525.phpt - tests/bug31525.phpt: - - file bug31525.phpt was initially added on branch PHP_5_0. - -2005-05-04 Stanislav Malyshev - - * zend.c: - fix bug #32924: prepend does not add file to included files - - * (PHP_5_0) - zend_execute.c: - clarify some magic - -2005-05-04 Dmitry Stogov - - * zend_execute.c: - Fixed bug #30641 (Compile error: error: symbol "zend_error" is used but not - defined) - - * tests/bug30707.phpt - tests/bug30707.phpt: - - file bug30707.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug30707.phpt: - Fixed bug #30707 (Segmentation fault on exception in method) - - * (PHP_5_0) - zend_execute.c: - ws - - * tests/bug30162.phpt - tests/bug30162.phpt: - - file bug30162.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug30161.phpt: - Fixed bug #30162 (Catching exception in constructor couses lose of $this) - -2005-05-03 Dmitry Stogov - - * tests/unset_cv07.phpt: - Fixed notice message - -2005-05-03 Marcus Boerger - - * (PHP_5_0) - tests/bug32252.phpt: - - Add test - -2005-05-03 Dmitry Stogov - - * zend_object_handlers.c: - Fixed destruction of zval after returning from __call() - - * zend_builtin_functions.c - zend_builtin_functions.c - tests/bug32296.phpt: - Fixed bug #32296 (get_class_methods output has changed between 5.0.2 and - 5.0.3) - Now get_class_methods() shows accessible private and protected methods if - it is called from class scope. - - * tests/bug32296.phpt - tests/bug32296.phpt: - - file bug32296.phpt was initially added on branch PHP_5_0. - -2005-05-02 Marcus Boerger - - * zend_builtin_functions.c - zend_object_handlers.c - zend_object_handlers.h: - - Extend API to support real existance test without the need to add any new - functions or change any behavior - - * zend_execute_API.c: - - Part 2 of #30126: Enhancement for error message for abstract classes - - * zend_execute_API.c: - - Part 1 of #30126: Enhancement for error message for abstract classes - -2005-04-29 Jani Taskinen - - * zend_object_handlers.c: - compile fix - - * tests/bug30332.phpt - tests/bug32852.phpt: - Make sure E_STRICT is set always - -2005-04-29 Dmitry Stogov - - * zend_API.c - zend_API.c - tests/bug30332.phpt: - Fixed bug #30332 (zend.ze1_compatibility_mode isnt fully compatable with - array_push()) - - * tests/bug30332.phpt - tests/bug30332.phpt: - - file bug30332.phpt was initially added on branch PHP_5_0. - - * zend_execute.c - zend_execute.c - tests/bug31828.phpt - tests/bug32080.phpt - tests/bug32852.phpt: - Fixed bug #32852 (Crash with singleton and __destruct when - zend.ze1_compatibility_mode = On) - Fixed bug #31828 (Crash with zend.ze1_compatibility_mode=On) - Fixed bug #32080 (segfault when assigning object to itself with - zend.ze1_compatibility_mode=On) - - * tests/bug31828.phpt - tests/bug31828.phpt - tests/bug32080.phpt - tests/bug32080.phpt - tests/bug32852.phpt - tests/bug32852.phpt: - - file bug31828.phpt was initially added on branch PHP_5_0. - -2005-04-29 Jani Taskinen - - * tests/bug22836.phpt - tests/bug27641.phpt: - - Unify error_reporting setting + make sure E_STRICT is set when wanted - -2005-04-28 Dmitry Stogov - - * zend_object_handlers.c - zend_object_handlers.c - tests/bug29015.phpt: - Fixed bug #29015 (Incorrect behavior of member vars(non string - ones)-numeric mem vars und others) - - * tests/bug29015.phpt - tests/bug29015.phpt: - - file bug29015.phpt was initially added on branch PHP_5_0. - -2005-04-27 Dmitry Stogov - - * zend_API.c - zend_API.h - zend_object_handlers.c - zend_object_handlers.h - tests/bug29210.phpt: - Fixed bug #29210 (Function: is_callable - no support for private and - protected classes) - - * (PHP_5_0) - zend_API.c - zend_API.h - zend_object_handlers.c - zend_object_handlers.h - tests/bug29210.phpt - tests/bug29210.phpt: - Fixed bug #29210 (Function: is_callable - no support for private and - protected classes). - - * zend_compile.c - zend_compile.c - tests/bug29104.phpt - tests/bug29104.phpt - tests/bug29104.phpt: - Fixed bug #29104 (Function declaration in method doesn't work) - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug32833.phpt: - Fixed bug #32833 (Invalid opcode) - - * tests/bug32674.phpt - tests/bug32674.phpt: - - file bug32674.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug32674.phpt: - Fixed bug #32674 (exception in iterator causes crash) - -2005-04-26 Dmitry Stogov - - * tests/bug30889.phpt - tests/bug30889.phpt: - - file bug30889.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug30889.phpt: - Fixed bug #30889 (Conflict between __get/__set and ++ operator) - - * tests/bug32429.phpt: - fix - - * zend_API.c - zend_API.c - tests/bug30702.phpt: - Fixed bug #30702 (cannot initialize class variable from class constant) - - * tests/bug30702.phpt - tests/bug30702.phpt: - - file bug30702.phpt was initially added on branch PHP_5_0. - - * zend_compile.c - tests/bug32427.phpt: - Fixed bug #32427 (Interfaces are not allowed 'static' access modifier). - - * zend_builtin_functions.c - tests/bug32429.phpt: - Fixed bug #32429 (method_exists() always return TRUE if __call method - exists) - -2005-04-25 Andrei Zmievski - - * zend_object_handlers.c: - Reverting. Let's not introduce major BC breakage like this without a - good reason. - -2005-04-25 Dmitry Stogov - - * tests/bug29944.phpt - tests/bug29944.phpt: - - Fixed bug #29944 (Function defined in switch, crashes). - - * zend_compile.c - zend_compile.c - tests/bug29944.phpt: - Fixed bug #29944 (Function defined in switch, crashes). - -2005-04-25 Jani Taskinen - - * zend_hash.c: - ws - -2005-04-25 Dmitry Stogov - - * zend_hash.c: - Fixed call to estrndup() with invalid length - - * (PHP_5_0) - zend_hash.c: - Fixed call to estrndup() with invalid lengt - -2005-04-25 Sebastian Bergmann - - * zend_reflection_api.c: - Correct grammar. - -2005-04-24 Marcus Boerger - - * zend_compile.c: - - Need to copy doc comments correct for properties - -2005-04-23 Marcus Boerger - - * tests/bug29674.phpt - tests/bug30161.phpt - tests/bug30346.phpt: - - Add new tests - -2005-04-21 Jani Taskinen - - * tests/unset_cv05.phpt: - Fix test when register_long_arrays is off in your php.ini - -2005-04-19 Marcus Boerger - - * zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_reflection_api.c: - - Add ReflectionProperty::getDocComment() - -2005-04-19 Jani Taskinen - - * zend_compile.c - zend_exceptions.c: - No c++ comments in C code - -2005-04-18 Dmitry Stogov - - * zend_builtin_functions.c - zend_builtin_functions.c - zend_execute.c: - Fixed memory leak in debug_backtrace() - -2005-04-17 Marcus Boerger - - * zend_builtin_functions.c: - - Fix special cases of property_exists() - - * zend_object_handlers.c: - - Fix logic - -2005-04-16 Sara Golemon - - * tests/method_exists.phpt: - method_exists() regression test - - * zend_builtin_functions.c: - Fix method_exists(), pce is fetched, but ce is used - -2005-04-15 Marcus Boerger - - * zend_builtin_functions.c: - - Fix even though we already know that the function will be renamed - -2005-04-15 Andrei Zmievski - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fix certain operations to stop relying on presence of read_property and - write_property handlers. They may be NULL'ed out by certain objects - pretending to be pure arrays, for example. Do checks first. - -2005-04-12 Stanislav Malyshev - - * zend_ini.c: - fix memory corruption if one on the on_modify handlers errors out - - * (PHP_5_0) - zend_ini.c: - fi memory corruption if one on the on_modify handlers errors out - -2005-04-08 Marcus Boerger - - * zend_operators.c: - - Fix memory corruption found by rob - - * tests/bug22836.phpt: - - Ensure we see all errors. No need for () in return - - * zend_builtin_functions.c: - - Add property_exits() - - * zend_object_handlers.c: - - No E_ERROR when we just check (where did my 0->1 change go on first - commit?) - - * zend_object_handlers.c: - - No E_ERROR when we just check, here visibility simply means there is none - - * zend_object_handlers.c - zend_object_handlers.h: - - Simplify getting property info and make it an api function - -2005-04-07 Jani Taskinen - - * zend_alloc.c - zend_alloc.h: - - Nuke the code duplication - - * zend_alloc.h: - Fix build when USE_ZEND_ALLOC is 0 - -2005-04-07 Zeev Suraski - - * (PHP_5_0) - zend_alloc.c - zend_alloc.h: - MFH (Fix strdup() bug when USE_ZEND_ALLOC was disabled) - - * zend_alloc.c - zend_alloc.h: - Fix strdup() bug when USE_ZEND_ALLOC is disabled - -2005-04-05 Marcus Boerger - - * zend_interfaces.c: - - Just return FAILURE & allow NULL without emmidiate error - -2005-04-04 Stanislav Malyshev - - * zend_builtin_functions.c: - MF50: fix backtraces - non-Zend classes have names too - - * (PHP_5_0) - zend_builtin_functions.c: - fix backtraces - non-Zend classes have names too - -2005-04-03 Jani Taskinen - - * (PHP_5_0) - zend_execute_API.c: - MFH: - Fixed bug #28839 (SIGSEGV in interactive mode (php -a)). - MFH: (kameshj at fastmail dot fm) - -2005-03-31 Derick Rethans - - * (PHP_5_0) - zend_API.c: - - MFH: internal_function->fn_flags is not initialized at this point - -2005-03-26 Jani Taskinen - - * zend_execute_API.c: - - Fixed bug #28839 (SIGSEGV in interactive mode (php -a)) - (kameshj at fastmail dot fm) - -2005-03-24 Marcus Boerger - - * zend_vm_execute.h: - - Second part of removing temp solution - - * zend_vm_def.h: - - Remove potential bad solution for now - -2005-03-23 Andrei Zmievski - - * zend_execute.c: - Consolidate: call _get_zval_ptr_var() for IS_VAR case in - _get_zval_ptr(). - -2005-03-21 Andi Gutmans - - * (PHP_5_0) - zend_execute.c: - - Fix memset() bug (Joe Orton) - -2005-03-21 Andrei Zmievski - - * zend_API.c: - internal_function->fn_flags is not initialized at this point - -2005-03-20 Marcus Boerger - - * tests/bug31102.phpt: - - Added missing description (thanks jani) - - * tests/bug31102.phpt: - - Add new test - -2005-03-19 Marcus Boerger - - * zend_object_handlers.c: - - More fixes to gracefully act on exception thrown in overload methods - - * zend_object_handlers.c: - - Fix #31185 - - * zend_execute_API.c: - - Fix all incarnations of bug #30266 - -2005-03-19 Andi Gutmans - - * zend_interfaces.c - zend_interfaces.h: - - Fix typos - -2005-03-16 Wez Furlong - - * (PHP_5_0) - zend_API.c: - MFH: don't call rshutdown twice for dl()'d modules. - - * zend_API.c: - don't call rshutdown twice for dl()'d modules. - Spotted by Andrei. - -2005-03-15 Wez Furlong - - * zend.c - zend_API.c - zend_modules.h: - fix shutdown so that dl()'d modules are unloaded after all the dtors have - been called. - -2005-03-14 Zeev Suraski - - * zend_ini.c: - Clarify logic - -2005-03-14 Stanislav Malyshev - - * zend_builtin_functions.c - zend_builtin_functions.c: - ws - -2005-03-13 Stanislav Malyshev - - * zend_stream.c - zend_stream.c: - Do not convert ZEND_HANDLE_FP to ZEND_HANDLE_STREAM but allow using - reader/closer - on it - -2005-03-13 Marcus Boerger - - * zend_interfaces.c: - - More exact signatures (even though complete correct not possible atm) - -2005-03-13 Stanislav Malyshev - - * zend_builtin_functions.c - zend_builtin_functions.c: - Fix get_extension_funcs() - extension names are now lowercased, so should - be function arguments. - -2005-03-13 Marcus Boerger - - * zend_execute_API.c: - - Actually this is a much better error decription - - * zend_execute_API.c - tests/bug32290.phpt - tests/bug32290.phpt: - - Bugfix #32290 - -2005-03-12 Marcus Boerger - - * zend_vm_def.h - zend_vm_execute.h: - - If an exception is pending we don't bail out but show the unhandled - exception - -2005-03-11 Anantha Kesari H Y - - * (PHP_5_0) - acconfig.h: - NetWare LibC's sys/types.h does not include sys/select.h implicitly as it - is the case with Linux LibC - -2005-03-11 Marcus Boerger - - * tests/bug32252.phpt: - - Add new test - - * tests/bug27145.phpt - tests/bug27145.phpt: - - Irrelevant - - * zend_object_handlers.c: - - Don't touch refcount/is_ref - -2005-03-10 Marcus Boerger - - * tests/bug28442.phpt - tests/bug28442.phpt: - - - Bugfix #28442 - - * zend_compile.c: - - Bugfix #28442 - -2005-03-10 Anantha Kesari H Y - - * (PHP_5_0) - acconfig.h: - Autoconf based build can be used for NetWare - - * (PHP_5_0) - zend.h: - NetWare can make use of ./configure generated zend_config.h - - * (PHP_5_0) - Zend.m4: - This patch is needed for cross compilation to go through - -2005-03-10 Marcus Boerger - - * zend_vm_execute.h: - - #31562 2nd part - - * zend_vm_def.h: - - Fix #31562 - -2005-03-07 Marcus Boerger - - * zend.h - zend_compile.c - zend_interfaces.c - zend_interfaces.h: - - New Interface Serializeable - - Change signature of unserialize() callback to ease inheritance and - support code reuse of handlers - - * tests/bug32226.phpt - tests/bug32226.phpt: - - - Add updated description - - * zend_builtin_functions.c - tests/bug32226.phpt: - - Fix #32226 - -2005-03-07 Zeev Suraski - - * zend_language_scanner.l - zend_language_scanner.l: - Revert // patch - -2005-03-06 Marcus Boerger - - * zend_reflection_api.c: - - Fix by Tim - -2005-03-06 Jani Taskinen - - * zend_compile.c - zend_compile.c: - Fixed compile warning (bug #32046) - - * zend_mm.c: - Fix compile warning (bug #32047) - -2005-03-01 Marcus Boerger - - * zend_interfaces.c: - - Support statuc methods/functions - -2005-03-01 Jani Taskinen - - * (PHP_5_0) - zend_language_scanner.l: - MFH: - Fixed bug #31672 ( not considered closing tag if - MFH: preceded by one-line comment) - - * zend_language_scanner.l: - Fix the fix for one line comments with tags - -2005-02-28 Marcus Boerger - - * zend_builtin_functions.c: - - Add support for methods dynamically added through object handlers - -2005-02-27 Marcus Boerger - - * zend_object_handlers.c: - - If silence if wanted we do not error out - - * zend_reflection_api.c: - - Add two new methods - - Fix signature, no need to cast it - - * zend_API.h: - - These must be initailized - - * zend_builtin_functions.c: - - Update method_exists to new handlers and allow first parameter as string - -2005-02-27 Jani Taskinen - - * Zend.m4: - - Cache the version check results - -2005-02-24 Andi Gutmans - - * zend_language_scanner.l: - - Make one line comments work the same with as with - - other tags. This will break scripts that have whitespace at the end - - of the closing tag but this is barely used as it is - - and I doubt ppl used whitespace. (patch by Jani) - - * zend_objects_API.h: - - This part of the patch was right - -2005-02-24 Dmitry Stogov - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - Fixed bug in ZEND_POST_INC/ZEND_POST_DEC handlers. - These opcodes assume IS_TMP_VAR as result. - -2005-02-24 Andi Gutmans - - * zend_modules.h: - - Need zend_Compile.h for struct _zend_arg_info definiton (thanks to Joe - Orton) - - * zend_objects.c - zend_objects.h - zend_objects_API.h: - - Revert following patch until we decide what is the right way to handle - - this: - - Fix signatures they are all meant to be able to deal with any type in - any - object storage (though we are still missing several parts) - -2005-02-23 Derick Rethans - - * (PHP_5_0) - zend_reflection_api.c: - - MFH: fixed bug #32076 (ReflectionMethod :: isDestructor() always return - true). - - * zend_reflection_api.c: - - Fixed bug #32076 (ReflectionMethod :: isDestructor() always return true) - (Patch by Antony Dogval) - -2005-02-23 Stanislav Malyshev - - * zend.h - zend_compile.c: - Custom object serializer infrastructure - -2005-02-23 Jani Taskinen - - * Zend.m4: - Hack the planet - -2005-02-23 Marcus Boerger - - * zend_interfaces.c: - - Allow to convert Traversable into Aggregate - -2005-02-22 Marcus Boerger - - * zend_objects_API.c: - - We cannot provide this fallback becuase it requires zend_object ptr's. - -2005-02-22 Jani Taskinen - - * Zend.m4: - Fix cross-compile - - * acconfig.h: - Fix build (it was #ifNdef NETWARE..) - -2005-02-22 Marcus Boerger - - * zend_objects.c - zend_objects.h - zend_objects_API.h: - - Fix signatures they are all meant to be able to deal with any type in any - object storage (though we are still missing several parts) - - * zend_objects_API.c: - - Force calling of dtors unless otherwise specified (fixes several - __destruct bugs) - -2005-02-22 Anantha Kesari H Y - - * zend.h: - NetWare can include autoconf generated config headers - - * acconfig.h: - NetWare can make use of the configure script generated header file. - -2005-02-21 Moriyoshi Koizumi - - * Makefile.am: - - Add missing entry. - -2005-02-20 Dmitry Stogov - - * zend_compile.c: - Fixed possible memory corruption - -2005-02-19 Rui Hirokawa - - * (PHP_5_0) - zend_language_scanner.l: - MFH: fixed #31987 zend-multibyte in ZTS. - - * zend_language_scanner.l: - fixed #31987 zend-multibyte in ZTS. - -2005-02-17 Marcus Boerger - - * zend_API.c: - - A little optimization to prevent problems when trying to reimplement an - interface inherited from an interfaces that was just implemented...... - - * zend_API.c: - - No C++ ruleZ here - - * zend_API.c: - - Actually we must do this in two steps: 1st resize the table and set all - interfaces, 2nd implement the interfaces - - * zend_API.c: - - Incrementation is done elsewhere - - * zend_API.c: - - Fix windows build (funny MS compiler) - -2005-02-17 Jani Taskinen - - * (PHP_5_0) - Zend.m4 - zend_strtod.c: - MFH: - Compile fix for systems without int32_t typedef - - * Zend.m4 - zend_strtod.c: - - Compile fix for systems without int32_t typedef - -2005-02-13 Marcus Boerger - - * zend_execute_API.c - zend_reflection_api.c: - - Be more gracious in reflection API - - * zend_language_scanner.l: - - Fix doc comment handling - -2005-02-12 Marcus Boerger - - * zend_execute_API.c: - - Bugfix #30682 (autoconversion from false/true to 0/1 missing in case of - static property default value) - -2005-02-11 Marcus Boerger - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Cleanup foreach handling - -2005-02-10 Jani Taskinen - - * zend_strtod.c - zend_strtod.c: - - Fixed bug #31920 (zend_strtod.c error: conflicting types for 'int8_t') - -2005-02-10 Dmitry Stogov - - * zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug30407.phpt: - Fixed bug #30407 (Strange behaviour of default arguments) - -2005-02-07 Dmitry Stogov - - * zend_compile.c: - Fixed bug introduced with foreach() optimization patch - - * zend_compile.c: - Fixed FE_RESET/FE_FETCH bug. - Now FE_RESET instruction takes jump-address from itself, not from the - following FE_FETCH instruction. - - * zend_compile.c - zend_compile.h - zend_language_parser.y - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - foreash($a as $key => $val) optimization - Removed temorary array creation on each iteration. - -2005-02-07 Marcus Boerger - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Remove part of the cleanup which causes a problem with unnormal code - like tests/lang/040.phpt - -2005-02-06 Zeev Suraski - - * (PHP_5_0) - zend_ini_scanner.l: - Correct fix for #28803 - - * zend_ini_scanner.l: - Correct fix for #28804 - -2005-02-05 Marcus Boerger - - * zend_compile.c - zend_compile.h - zend_language_parser.y - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h: - - Cleanup foreach statement - -2005-02-04 Hartmut Holzgraefe - - * zend_API.c - zend_API.h: - added some missing zend_[declare|update]_property_...() convenience - functions for bool, double and binary safe string data - -2005-02-03 Jani Taskinen - - * (PHP_5_0) - zend_ini_scanner.l: - MFH: Fixed bug #28804 (ini-file section parsing pattern is buggy). - - * zend_ini_scanner.l: - - Fixed bug #28804 (ini-file section parsing pattern is buggy). - - * zend_ini_scanner.l - zend_ini_scanner.l: - ws fix - -2005-02-02 Stanislav Malyshev - - * zend_execute_API.c: - Fix #31720 Invalid object callbacks not caught in array_walk() (patch - from Antony Dovgal) - - * tests/bug31720.phpt: - test for Bug #31720 - - * tests/bug31720.phpt - tests/bug31720.phpt: - - file bug31720.phpt was initially added on branch PHP_5_0. - - * (PHP_5_0) - zend_execute_API.c: - Fix #31720 Invalid object callbacks not caught in array_walk() (patch - from Antony Dovgal) - -2005-02-02 Dmitry Stogov - - * zend.h - zend.h - zend_object_handlers.c - zend_object_handlers.c - tests/bug31683.phpt: - Fixed bugs #29767 and #31683 (__get and __set methods must not modify - property name). - - * tests/bug31683.phpt - tests/bug31683.phpt: - - file bug31683.phpt was initially added on branch PHP_5_0. - -2005-02-01 Stanislav Malyshev - - * zend_builtin_functions.c - zend_builtin_functions.c: - Fix debug_trace with eval (patch from Antony Dovgal) - - * tests/bug_debug_backtrace.phpt: - test for eval debug_backtrace bug - - * tests/bug_debug_backtrace.phpt - tests/bug_debug_backtrace.phpt: - - file bug_debug_backtrace.phpt was initially added on branch PHP_5_0. - -2005-01-31 Marcus Boerger - - * zend_reflection_api.c: - - Add ReclectionClass:hasProperty(), ReflectionClass::hasConstant() - to complete api (johannes@php.net) - -2005-01-28 Marcus Boerger - - * zend_execute_API.c: - - Fix severity (found by johannes) - -2005-01-25 Jani Taskinen - - * zend.h: - New versions of glibc support a RTLD_DEEPBIND flag to dlopen. The - effect of this flag when loading a "foo.so" with undefined symbols is - that the search that symbol starts at foo.so and its dependencies - *before* the loading process' global symbol table. - - This is an effective workaround for symbol namespace collisions between - various modules and the libraries on which they depend (where fixing the - respective modules or libraries is not possible e.g. due to API - constraints). - - (By: Joe Orton) - -2005-01-25 Marcus Boerger - - * (PHP_5_0) - zend_execute.c - zend_interfaces.c - tests/bug26229.phpt: - - MFH #26229 (getIterator() segfaults when it returns arrays or scalars) - - * zend_interfaces.c - zend_vm_def.h - zend_vm_execute.h - tests/bug26229.phpt: - - Bugfix #26229 (getIterator() segfaults when it returns arrays or scalars) - - * Makefile.frag: - - Fix dependency - - * zend_vm_def.h - zend_vm_execute.h: - - Use correct freeing (thx Dmitry) - -2005-01-24 Marcus Boerger - - * zend_vm_def.h - zend_vm_execute.h - tests/bug30725.phpt: - - Second and last part of #30725 fix - - * zend_interfaces.c: - - Allow getIterator() to fail - - * tests/bug30725.phpt: - - - Add new test - -2005-01-22 Jani Taskinen - - * (PHP_5_0) - Zend.m4 - configure.in - zend_strtod.c: - MFH: Compile fix for systems without uint32_t typedef - - * Zend.m4 - configure.in - zend_strtod.c: - - Compile fix for systems without uint32_t typedef - -2005-01-22 Marcus Boerger - - * zend_API.c - zend_API.h - zend_reflection_api.c: - - Fix #31651 (ReflectionClass::getDefaultProperties segfaults with arrays.) - -2005-01-22 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h: - - Two new API calls for Derick (retreive CV name and value) by Dmitry - -2005-01-20 Jani Taskinen - - * zend.h - zend_constants.c: - - Revert the weird change of ZEND_STRS() macro and use the correct - ZEND_STRL() macro. - -2005-01-19 Jani Taskinen - - * zend_object_handlers.c: - - Fixed bug #29183 (Undefined symbol zend_check_private with Solaris CC) - -2005-01-19 Marcus Boerger - - * zend_ini_parser.y: - - Fix memleak - -2005-01-18 Dmitry Stogov - - * zend_compile.c: - Fixed patch for bug #31478 (SegFault/Memory Leak with empty()) - - * zend_execute.c: - Fixed bug #28444 (Cannot access undefined property for object with - overloaded property access). - - * (PHP_5_0) - zend_execute.c: - Fixed bug #28444 (Cannot access undefined property for object with - overloaded property access). (Dmitry) - -2005-01-18 Ilia Alshanetsky - - * (PHP_5_0) - zend_operators.h: - MFH: Fixed bug #30726 (-.1 like numbers are not being handled correctly). - - * zend_operators.h: - Fixed bug #30726 (-.1 like numbers are not being handled correctly). - -2005-01-17 Jani Taskinen - - * (PHP_5_0) - zend_language_scanner.l: - MFH: - Fixed bug #31444 (Memory leak in zend_language_scanner.c) - - * zend_language_scanner.l: - - Fixed bug #31444 (Memory leak in zend_language_scanner.c) - -2005-01-15 Andi Gutmans - - * (PHP_5_0) - zend_API.c: - - Fix WS - - * (PHP_5_0) - zend_API.c: - - Change to using DL_UNLOAD macro. - - * zend_API.c: - - Unload on MAC OS X (shouldn't be a reason not to) - -2005-01-14 Dmitry Stogov - - * zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug31098.phpt: - Restore behavior of $str["str"]. (Now $str["str"] is equivalent to $str[0] - again) - - * (PHP_5_0) - tests/bug31098.phpt: - Path -> pattern - - * (PHP_5_0) - zend_execute.c - tests/bug31098.phpt: - Revert to old behavior of $str["str"]. ($str["str"] is equivalent of - $str[0]) - -2005-01-13 Dmitry Stogov - - * zend_execute.c - zend_execute.c: - Additional fix for fix of bug #29883 - -2005-01-12 Dmitry Stogov - - * zend_execute.c - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_opcodes.h - tests/bug31098.phpt - tests/bug31098.phpt: - Fixed bug #31098 (isset false positive) - -2005-01-11 Moriyoshi Koizumi - - * (PHP_5_0) - zend_execute.c - tests/bug31098.phpt: - - MFH: fix for bug #31098. - - * tests/bug31098.phpt - tests/bug31436.phpt: - - - Test renaming - - * zend_vm_execute.h - tests/bug31436.phpt: - - Fix bug #31436 (isset() incorrectly returns true in dereference of a - wrong type) - - * zend_compile.c: - - Fix bug #31478 (segfault with empty()) - -2005-01-10 Rasmus Lerdorf - - * zend.h - zend_API.c: - Fix OSX DL_UNLOAD macro and actually use it to make shared extensions - work on OSX. - -2005-01-10 Jani Taskinen - - * header - zend_arg_defs.c - zend_strtod.c - zend_vm_def.h - zend_vm_execute.h - zend_vm_gen.php - zend_vm_opcodes.h: - - Added missing header sections. - - * acinclude.m4 - configure.in: - - Added AC_ZEND_C_BIGENDIAN macro (as requested by Andi) - -2005-01-09 Jani Taskinen - - * (PHP_5_0) - zend.h: - MFH: - Fix outside-source-tree builds. Always include generated header - files - with #include to make sure the correct file is - used. - - * zend.h: - - Fix outside-source-tree builds. Always include generated header files - with #include to make sure the correct file is used. - - * zend.c: - MFB: - Rationalize code a bit - -2005-01-03 Stanislav Malyshev - - * (PHP_5_0) - zend_language_scanner.l: - MFH: - Fix the following nasty bug: - - if compile bails out from the middle of compiling, current_buffer is not - restored - - if current_buffer is not null, yy_switch_to_buffer will do: *yy_c_buf_p - = yy_hold_char; on - the next request - - which would lead to memory corruption on next request - - * zend_language_scanner.l: - Fix the following nasty bug: - - if compile bails out from the middle of compiling, current_buffer is not - restored - - if current_buffer is not null, yy_switch_to_buffer will do: *yy_c_buf_p - = yy_hold_char; on - the next request - - which would lead to memory corruption on next request - -2005-01-02 Ilia Alshanetsky - - * (PHP_5_0) - zend_highlight.c: - MFH: Fixed bug #31371 (highlight_file() trims new line after heredoc). - - * zend_highlight.c: - Fixed bug #31371 (highlight_file() trims new line after heredoc). - -2004-12-30 Jani Taskinen - - * (PHP_5_0) - zend_compile.c - zend_highlight.c - zend_indent.c - zend_ini_scanner.l - zend_language_scanner.l: - MFH: - Fixed bug #28930 (PHP sources pick wrong header files generated by - bison). - - * zend_compile.c - zend_highlight.c - zend_indent.c - zend_ini_scanner.l - zend_language_scanner.l: - - Fixed bug #28930 (PHP sources pick wrong header files generated by bison) - - * Zend.m4 - acinclude.m4: - MFB_4_3: Quote macro names in AC_DEFUN() - -2004-12-27 Zeev Suraski - - * zend_builtin_functions.c: - MFB - - * (PHP_5_0) - zend_builtin_functions.c: - Fix desc - -2004-12-27 Marcus Boerger - - * (PHP_5_0) - zend_reflection_api.c: - - MFH: Need to unmangle the class name here - - * zend_reflection_api.c: - - Need to unmangle the class name here - -2004-12-27 Zeev Suraski - - * (PHP_5_0) - zend_exceptions.c: - Add descriptions - -2004-12-27 Dmitry Stogov - - * zend_execute.c - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - tests/bug22836.phpt - tests/bug22836.phpt - tests/unset_cv01.phpt - tests/unset_cv02.phpt - tests/unset_cv03.phpt - tests/unset_cv04.phpt - tests/unset_cv06.phpt - tests/unset_cv08.phpt - tests/unset_cv09.phpt - tests/unset_cv10.phpt: - "Undefined variable: %s" noticies were fixed to use one space - -2004-12-27 Marcus Boerger - - * zend_reflection_api.c: - - More proto/error message fixes - - * zend_reflection_api.c: - - Small fixlet (by Tony) - -2004-12-24 Dmitry Stogov - - * zend_vm_def.h - zend_vm_execute.h: - New sarbage collector's bug was fixed (the behavior should be the same as - in PHP_5_0) - - * zend_execute.c - tests/unset_cv01.phpt - tests/unset_cv02.phpt - tests/unset_cv03.phpt - tests/unset_cv04.phpt - tests/unset_cv06.phpt - tests/unset_cv08.phpt - tests/unset_cv09.phpt - tests/unset_cv10.phpt: - "Undefined variable: %s" noticies were fixed to be compatible with PHP_5_0 - -2004-12-21 Jani Taskinen - - * (PHP_5_0) - zend_strtod.c: - MFH: - Use correct header files (in c99 compliant way). uint32_t is - preferred. - - * zend_strtod.c: - - Use correct header files (in c99 compliant way). uint32_t is preferred. - -2004-12-20 Jani Taskinen - - * zend_strtod.c: - Better fix for endian compile problems. - -2004-12-17 Andi Gutmans - - * zend_object_handlers.c: - - Fixed Bug #30562 Segmentation fault with __call() - -2004-12-17 Derick Rethans - - * zend_strtod.c - zend_strtod.c: - - MF43: Fixed strtod for Irix and some other strange platform - -2004-12-16 Derick Rethans - - * zend_strtod.c - zend_strtod.c: - - MF43: Make it compile on HPUX on Itanium 2 - - * zend_strtod.c - zend_strtod.c: - - MF43: Fixed bug #31107 (strtod on solaris9/intel) - -2004-12-16 Jani Taskinen - - * (PHP_5_0) - ChangeLog: - - MFH: Fix typo (avaliable -> available). (bug #28725) - - * ChangeLog: - - Fix typo (avaliable -> available). (bug #28725) - -2004-12-16 Derick Rethans - - * zend_strtod.c: - - MF43: Fixed bug #31110 and #31111 (Zend/zend_strtod.c problems) - - * (PHP_5_0) - zend_strtod.c: - - Fixed bug #31110 and #31111 (Zend/zend_strtod.c problems) - -2004-12-15 Andi Gutmans - - * (PHP_5_0) - zend.h: - - 5.0.4-dev - - * (PHP_5_0) - zend.h: - - Redo 5.0.3 - - * (PHP_5_0) - zend.h: - - Back to -dev - - * (PHP_5_0) - zend.h: - - Roll PHP 5.0.3 - -2004-12-14 Derick Rethans - - * zend_strtod.c - zend_strtod.c: - - MFH: Fixed compile error related to bug #28605. - -2004-12-13 Derick Rethans - - * zend_operators.c: - - Added "G" modifier to ini setting number format. - -2004-12-10 Andi Gutmans - - * (PHP_5_0) - zend.h: - - Back to -dev - - * (PHP_5_0) - zend.h: - - 5.0.3RC2 - -2004-12-07 Dmitry Stogov - - * zend_exceptions.c - zend_exceptions.c: - Fixed bug #30904 (segfault when recording soapclient into session). - -2004-12-06 Stanislav Malyshev - - * tests/bug30998.phpt: - add test - - * zend.c - zend.c: - port fix for #30998: Crash when user error handler returns false on amd64 - -2004-12-06 Dmitry Stogov - - * zend_compile.c - zend_compile.c - tests/bug30922.phpt: - Fixed bug #30922 (reflective functions crash PHP when interfaces extend - themselves) - - * tests/bug30922.phpt - tests/bug30922.phpt: - - file bug30922.phpt was initially added on branch PHP_5_0. - -2004-12-06 Stanislav Malyshev - - * (PHP_5_0) - zend_builtin_functions.c: - if fetch called not from PHP function, ptr can be NULL - -2004-12-01 Ilia Alshanetsky - - * zend_strtod.c: - MFB: Removed extra space that causes problems for some compilers. - - * (PHP_5_0) - zend_strtod.c: - Removed extra space that causes problems for some compilers. - -2004-12-01 Derick Rethans - - * (PHP_5_0) - zend_strtod.c: - - revert unwanted change - - * zend_strtod.c - zend_strtod.c: - - Fixed MacOSX compilation (Patch by Christian) - - * (PHP_5_0) - zend.h: - - And in Zend/ too. - -2004-12-01 Dmitry Stogov - - * (PHP_5_0) - zend_execute.c - zend_vm_def.h - zend_vm_execute.h - tests/bug29883.phpt - tests/bug29883.phpt - tests/bug29883.phpt: - Fixed bug #29883 (isset gives invalid values on strings). - -2004-11-30 Andi Gutmans - - * (PHP_5_0) - zend.h: - - Go with 5.0.3RC1 - -2004-11-29 Derick Rethans - - * (PHP_5_0) - zend_operators.c: - - MF43: Revert Joe's work around a bug in GCC patch as it breaks too many - things. - - * zend_operators.c: - - MFH: Revert Joe's work around a bug in GCC patch as it breaks too many - things. - -2004-11-25 Zeev Suraski - - * (PHP_5_0) - zend_execute.c - zend_execute_API.c - zend_extensions.h - zend_object_handlers.c - zend_object_handlers.h: - Reverting get_method() signature change - -2004-11-24 Marcus Boerger - - * zend_reflection_api.c: - - Fix Bug #30856 (ReflectionClass::getStaticProperties segfaults) - - * tests/bug30856.phpt: - - - Add new test - -2004-11-17 Stanislav Malyshev - - * (PHP_5_0) - zend_execute_API.c: - fix #30543 - - * zend_execute_API.c: - fix crash - -2004-11-16 Derick Rethans - - * zend_strtod.c - zend_strtod.c: - - Make this compile for the Mac again - -2004-11-15 Derick Rethans - - * (PHP_5_0) - zend_strtod.c: - - MFH: Fixed bug #30779 (Compile of Zend/zend_strtod.c fails on Sparc) - - * zend_strtod.c: - - Fixed bug #30779 (Compile of Zend/zend_strtod.c fails on Sparc) - -2004-11-14 Marcus Boerger - - * (PHP_5_0) - zend_reflection_api.c: - MFH #30783 Apache crash when using ReflectionFunction::getStaticVariables() - MFH proto fixes - - * zend_reflection_api.c: - - Bugix #30783: Apache crash when using - ReflectionFunction::getStaticVariables() - -2004-11-09 Andrei Zmievski - - * zend_ini_parser.y: - Revert inadvertent commit. - - * zend_ini_parser.y: - .dylib extension are Mach-O shared libraries that meant for linking - against. Loadable modules (aka bundles) can have any extension, so we - should probably stick with .so - - http://fink.sourceforge.net/doc/porting/shared.php?phpLang=en#lib-and-mod - -2004-11-05 Derick Rethans - - * (PHP_5_0) - zend_execute_API.c: - - Fix for bug #30367, #30490 and possibly #30011. - -2004-11-04 Edin Kadribasic - - * Zend.dsp - ZendTS.dsp: - Added zend_strtod.* to the build - - * zend_strtod.c - zend_strtod.h: - Make zend_strtod compile on windows - -2004-11-04 Moriyoshi Koizumi - - * (PHP_5_0) - Makefile.am: - - MFH: Add entry for zend_strtod.c in belief that this is still active. - - * Makefile.am: - - Add entry for zend_strtod.c in belief that this is still active. - -2004-11-03 Moriyoshi Koizumi - - * Zend.m4: - - Don't show grep outputs - -2004-11-03 Derick Rethans - - * (PHP_5_0) - zend_execute_API.c - zend_globals.h - zend_ini.c - zend_language_scanner.l - zend_operators.c - zend_operators.h - zend_strtod.c - zend_strtod.h: - - MFH: Fixed bug #30630: Added a BSD based strtod function that is - locale-independent. - - * zend_execute_API.c - zend_globals.h - zend_ini.c - zend_language_scanner.l - zend_operators.c - zend_operators.h - zend_strtod.c - zend_strtod.h: - - Fixed bug #30630: Added a BSD based strtod function that is - locale-independent. - -2004-11-03 Moriyoshi Koizumi - - * Zend.m4 - zend.h - zend_execute.c: - - Checks for Darwin'ish systems that uses Mach-O, which apparently doesn't - support weak symbol aliasing at this time. - -2004-11-03 Marcus Boerger - - * zend_reflection_api.c: - - Trying to invoke function not methot here - - * zend_reflection_api.c: - - Fix invokeargs() with static methods - -2004-11-03 Dmitry Stogov - - * zend_vm_def.h - zend_vm_execute.h: - Fixed "isset() and the new VM" bug. - -2004-11-02 Sebastian Bergmann - - * (PHP_5_0) - zend_API.c: - MFH: Patch by Joe Orton . - - * zend_API.c: - Patch by Joe Orton . - -2004-10-31 Marcus Boerger - - * zend_reflection_api.c: - - Add ReflectionFunction::invokeArgs(array) - - Add ReflectionMethod::invokeArgs(obj, array) - -2004-10-31 Sebastian Bergmann - - * zend_reflection_api.c: - Invokation -> Invocation - -2004-10-30 Marcus Boerger - - * zend.h: - Bump version (as discussed with Andi) - - * (PHP_5_0) - zend_execute.c: - - Fix (readd function name which got lost during earlier comit) - - * zend_reflection_api.c: - - Be consistent and use names as keys (found by johannes) - - * zend_extensions.h - zend_modules.h: - - Bump API version - - * (PHP_5_0) - zend_extensions.h - zend_modules.h: - Bump api after latest changes - - * (PHP_5_0) - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - MFH change zend_object_handlers->get_method() - - * zend_execute_API.c - zend_object_handlers.c - zend_object_handlers.h - zend_vm_def.h - zend_vm_execute.h: - - Change zend_object_handlers->get_method() to allow aggregation for - internal classes - - * Makefile.frag: - - New architecture needs one more dependency - - * zend_exceptions.c - zend_reflection_api.c: - - Fix protos - -2004-10-29 Andi Gutmans - - * zend_operators.c: - - For Ilia: - - MFH: Fixed bug #30572 (crash when comparing SimpleXML attribute to a - boolean). - - Hope this works well. I will MFH tomorrow if no one complains. - -2004-10-28 Dmitry Stogov - - * README.ZEND_VM - zend_vm_gen.php: - --without-lines changed to --with-lines - -2004-10-28 Andi Gutmans - - * zend_vm_execute.skl - zend_vm_gen.php: - - Fix typo - -2004-10-27 Andi Gutmans - - * zend_vm_opcodes.h: - - Oops missed this one - - * zend_operators.c: - - Revert Fixed bug #30228 (crash when comparing SimpleXML attribute to a - boolean). - - Need to discuss where the real problem is. - - * README.ZEND_VM: - - Tiny fixes - - * README.ZEND_VM - zend_compile.h - zend_vm_execute.h - zend_vm_gen.php: - - Improve comments, docs, code... - -2004-10-26 Andi Gutmans - - * zend_builtin_functions.c: - - Patch from Andrey Hristov: - I have cooked a small patch which allows is_subclass_of() the accept - not only an object as first parameter but a string as well. When string - is passed the function checks whether the class specified is subclass of - the second parameter - class a{} - class b{} extends a{} - is_subclass_of("a", "a") //false - is_subclass_of("b", "a") //true - currently only objects are allowed as first parameter - -2004-10-26 Ilia Alshanetsky - - * (PHP_5_0) - zend_operators.c: - MFH: Fixed bug #30572 (crash when comparing SimpleXML attribute to a - boolean). - - * zend_operators.c: - Fixed bug #30228 (crash when comparing SimpleXML attribute to a boolean). - -2004-10-23 Andi Gutmans - - * zend_vm_execute.h: - - Add missing file - -2004-10-22 Andi Gutmans - - * zend_vm_handlers.h - zend_vm_spec.h: - - Nuke another two files - - * Makefile.frag - zend_execute.c - zend_vm.h - zend_vm_def.h - zend_vm_execute.skl - zend_vm_gen.php: - - Commit new VM - - Old one is tagged as PRE_NEW_VM_GEN_PATCH - - Still doing work so more commits to come. Don't complain (yet) :) - - * (PRE_NEW_VM_GEN_PATCH) - zend_execute.c: - - Fix crash (MFB PHP5_0) - -2004-10-21 Andi Gutmans - - * (PHP_5_0) - zend_execute.c: - - Fix bug #30395 (Apache Child Segmentation fault in specific PHP-Code) - -2004-10-20 Andi Gutmans - - * zend_operators.c: - - If object handles are equal then save the comparison of properties in - - the == operator. - -2004-10-18 Anantha Kesari H Y - - * zend_modules.h: - including zend_compile.h for NetWare as NetWare uses MetroWerks Code - warrior compiler which does not allow declarations of following kind - before defining the types. - extern struct _zend_arg_info first_arg_force_ref[2]; - -2004-10-16 Andi Gutmans - - * zend_compile.c: - - One more test (WS) - - * zend_compile.c: - - WS fix to test commit - -2004-10-16 Anantha Kesari H Y - - * zend_compile.c - zend_compile.c: - Fix for 30457 - -2004-10-14 Marcus Boerger - - * zend_builtin_functions.c: - - Allow to omit object/classname in get_parent_class() which makes it - compatible with the signature and behavior of get_class() - -2004-10-13 Andi Gutmans - - * zend_compile.c: - - Don't allow access modifiers in interfaces. Explicitly stating public - - should also be disallowed but we don't have a way to detect it today. - -2004-10-12 Marcus Boerger - - * zend_builtin_functions.c: - Bug #30381 Strange results with get_class_vars() - - * (PHP_5_0) - zend_builtin_functions.c: - MFH Fix visibility of get_class_vars() and get_class_methods() - - * zend_builtin_functions.c: - - Fix visibility in get_class_vars() and get_class_methods() - - * zend_builtin_functions.c: - - Fix set_exception_handler - -2004-10-10 Sebastian Bergmann - - * .cvsignore - tests/.cvsignore: - Add *.gcda and *.gcno (from gcc -fprofile-{use|generate}) to .cvsignore. - -2004-10-08 Marcus Boerger - - * zend_compile.c - zend_compile.h - zend_vm_handlers.h: - - Revert automatic pass arg_info - -2004-10-08 Andi Gutmans - - * zend_compile.c: - - Fix BC break with default in switch() having to be at the end. - -2004-10-08 Anantha Kesari H Y - - * acconfig.h - zend_config.nw.h: - explicitly including sys/select.h as NetWare LibC sys/types.h does not - include sys/select.h implicitly as other LibC - -2004-10-06 Marcus Boerger - - * zend_reflection_api.c: - - Fix Bug #30344 - -2004-10-05 Marcus Boerger - - * zend_compile.c - zend_compile.h - zend_vm_handlers.h: - - Add arginfo ZEND_ARG_SEND_AUTOMATIC which lets the compiler automatically - determine whether pass by ref is possible or pass by value is needed. - -2004-10-05 Dmitry Stogov - - * tests/unset_cv06.phpt - tests/unset_cv07.phpt - tests/unset_cv07.phpt: - Test files are fixed. - - * zend_execute.c - zend_vm_handlers.h - tests/unset_cv11.phpt: - Fixed unset() bug that was introduced with CV optimization patch - - * zend_execute_API.c - zend_vm_handlers.h - tests/unset.inc - tests/unset_cv01.phpt - tests/unset_cv02.phpt - tests/unset_cv03.phpt - tests/unset_cv04.phpt - tests/unset_cv05.phpt - tests/unset_cv06.phpt - tests/unset_cv07.phpt - tests/unset_cv08.phpt - tests/unset_cv09.phpt - tests/unset_cv10.phpt: - Added test cases for CV optimization patch - -2004-10-04 Andi Gutmans - - * zend_API.h - zend_execute_API.c: - - Rename delete_global_variable() to zend_delete_global_variable() - - * Zend.m4 - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_opcode.c - zend_vm.h - zend_vm_handlers.h - zend_vm_spec.h: - - Commit the variable fetch optimization. - - Extensions which delete global variables need to use new special - function - - delete_global_variable() (I'm about to rename it) to remove them. - - Will post to internals@ or via commit messages if there's anything else. - -2004-10-04 Marcus Boerger - - * zend_builtin_functions.c: - - Bugfix #27798 - - * tests/bug27798.phpt: - - - Add new test - -2004-10-02 Marcus Boerger - - * (PHP_5_0) - tests/bug28444.phpt - tests/bug29368.phpt: - - Add new tests - - * tests/bug28444.phpt - tests/bug29368.phpt: - - - Add new test - -2004-10-01 Marcus Boerger - - * Makefile.frag: - - Add makefile fragment which simplifies working on the executer - -2004-09-30 Andi Gutmans - - * zend_operators.c: - - Small improvement to DVAL_TO_ZVAL macro - -2004-09-29 Marcus Boerger - - * zend_API.c: - - MFB (synch correctly not only for one problem) - - * zend_API.c: - - Refix the fix - -2004-09-29 Andi Gutmans - - * bench.php - tests/bench.php: - - Move bench.php to Zend/ - -2004-09-28 Marcus Boerger - - * zend_API.c - zend_API.h - zend_object_handlers.c - zend_objects.c: - Simplify/Optmize magic method calls (__get/__set/__call/__clone/__destruct) - -2004-09-28 Andi Gutmans - - * zend_execute_API.c: - - Return the warning until we check if we can change the type of str.len - -2004-09-28 Marcus Boerger - - * zend_reflection_api.c - zend_reflection_api.h: - - publish reflection_class_factory() as zend_reflection_class_factory() - -2004-09-27 Marcus Boerger - - * (PHP_5_0) - zend_reflection_api.c: - MFH fix several property handling issues - - * zend_reflection_api.c: - - Make internally used properties read-only and fix default properties - - * zend_exceptions.c: - - Fix memeleak - - * zend_reflection_api.c: - - Declare properties - -2004-09-27 Andi Gutmans - - * README.ZEND_VM: - - Document zend_vm_use_old_executor() for Derick. - -2004-09-27 Marcus Boerger - - * zend_reflection_api.c: - Fix Reflection_Class to ReflectionClass in docu/messages - - * zend_execute_API.c: - - Fix warning - - * zend_compile.c - zend_stream.c: - - Fix warning - - * zend_builtin_functions.c - zend_reflection_api.c: - - Fix warnings - - * zend_interfaces.c: - Fix warnign - -2004-09-27 Andi Gutmans - - * zend_variables.c - zend_variables.h: - - Use zval_ctor_func() for wrapper and update the prototype to void - - * zend_variables.c - zend_variables.h: - - Make zval_copy_ctor() return void like dtor(). No one ever checks the - - return value which is SUCCESS always. - -2004-09-26 Marcus Boerger - - * zend.h - zend_variables.h: - - Fix build - -2004-09-26 Andi Gutmans - - * zend.h - zend_variables.c - zend_variables.h: - - Apply Thies and Sterling's patch which doesn't call ctor/dtor functions - - for types which don't require it (BOOL/NULL/LONG/DOUBLE) - - Breaks serialization!!! - -2004-09-24 Anantha Kesari H Y - - * zend_API.c: - selectively avoiding module cleanup code for apache 1 build and removing a - duplicate code - -2004-09-24 Dmitry Stogov - - * zend_vm_spec.h: - Fixed specializer bug. - -2004-09-23 Andi Gutmans - - * (PHP_5_0) - zend.h: - - PHP 5.0.3-dev - - * zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_opcode.c - zend_vm.h: - - Commit new VM architecture. This one allows people (aka Derick) to - - ask the engine to use function handler mode. Will update the README - - about that. - - * (PHP_5_0) - zend.h: - - Roll 5.0.2 - -2004-09-23 Ilia Alshanetsky - - * tests/bug20240.phpt: - Fixed test. - -2004-09-23 Marcus Boerger - - * zend_reflection_api.c: - Bugfix # 30209 - -2004-09-23 Andi Gutmans - - * tests/bench.php: - - Commit synthetic benchmark - -2004-09-23 Anantha Kesari H Y - - * zend_execute.c - zend_execute_API.c - zend_globals.h: - Reverted the NetWare Specific Stack limit related patches as asked by Andi - -2004-09-22 Anantha Kesari H Y - - * zend_execute_API.c - zend_globals.h: - NetWare specific stack limit checks - - * zend_API.c: - Aligned the ifdef NETWARE blocks to first column. - - * zend_execute.c: - Stack limit will be checked while executing the script - - * zend_config.nw.h: - To avoid redefinition (of free, alloca etc.) compilation errors in Zend. - - * zend_API.c: - When Apache is unloaded, it calls dlclose on all the PHP extensions - that are loaded in memory. In the case of Apache 1.3, this call is - blocking indefinitely. As a work around, this call is bypassed for Apache - 1.3 build on NetWare only. This means that none of the loaded PHP - extensions are unloaded. They will have to be manually unloaded before - re-loading the Apache 1.3 again. - - * zend.h: - defined ZEND_PATHS_SEPERATOR to semicolon for NetWare - - * acconfig.h: - enabled macros to call the proper LibC functions - -2004-09-22 Dmitry Stogov - - * zend_vm_handlers.h - zend_vm_spec.h: - Specializer was updated with executor's fixes. - - * zend_execute.c - zend_execute.c: - Fixed bug #29566 (foreach/string handling strangeness (crash)). - - * zend_execute.c: - Fixed bug in fix for bug #29707 - -2004-09-21 Andi Gutmans - - * zend_execute.c - zend_execute.h: - - Fix for bug #29707 - -2004-09-19 Marcus Boerger - - * zend_reflection_api.c: - Bugfix #30146 (ReflectionProperty->getValue() requires instance for static - property) - - * zend_reflection_api.c: - Bugfix #30148 (ReflectionMethod->isConstructor() fails for inherited - classes) - -2004-09-17 Stanislav Malyshev - - * zend_execute_API.c - zend_objects_API.c - zend_objects_API.h: - fix crash when dtor is fialing on shutdown - -2004-09-16 Andi Gutmans - - * (PHP_5_0) - zend.h: - - Go with PHP 5.0.2RC1 - - * tests/bug27669.phpt: - - Add test for bug #27669 - -2004-09-16 Sebastian Bergmann - - * zend_language_parser.y: - ZTS fix. - -2004-09-16 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Fix bug #27669 (Dmitry). - Fixes: - - -2004-09-15 Ilia Alshanetsky - - * zend_operators.h: - MFH: Fixed a bug causing ".123" * "90" and alike to return a 0. - - * (PHP_5_0) - zend_operators.h: - Fixed a bug causing ".123" * "90" and alike to return a 0. - -2004-09-15 Derick Rethans - - * zend_config.w32.h: - - Windows support strcoll too. - -2004-09-13 Stanislav Malyshev - - * zend_execute.c: - Antony Dovgal's error message improvement - #27290 - -2004-09-11 Derick Rethans - - * zend_operators.c - zend_operators.h: - - MFB: Added the sorting flag SORT_LOCALE_STRING to the sort() functions - which - makes them sort based on the current locale. (Derick) - - * (PHP_5_0) - zend_operators.c - zend_operators.h: - - Added the sorting flag SORT_LOCALE_STRING to the sort() functions which - makes - them sort based on the current locale. (Derick) - -2004-09-11 Andi Gutmans - - * zend_operators.c: - - Resolve undefined behavior (joe at redhat) - -2004-09-10 Andi Gutmans - - * zend_compile.c: - - This one fixes rather strange problem - ZE allows multiple declarations - of the same class constant. - - It could be a minor BC break, but I'm sure it's a bug. (Antony Dovgal - aka tony2001) - -2004-09-09 Andi Gutmans - - * zend_extensions.h: - - Revert API bump - - * README.ZEND_VM: - - Commit VM explanation. - - * zend.c: - - Recommit - - * zend_API.c - zend_API.h - zend_compile.c: - - Recommit: - - Check signature of magic methods - - Register __get/__set/__call for internal classes - - * zend_extensions.h: - - Recommit: - - Bump the API number to work around this major breakage. - - * ChangeLog - zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_exceptions.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.h - zend_opcode.c: - - Roll back VM commit - -2004-09-09 Marcus Boerger - - * zend.c: - - Drop namespace relict - - * (PHP_5_0) - zend_API.c - zend_API.h - zend_compile.c: - MFH signature check/method registration - - * zend_API.c - zend_API.h - zend_compile.c: - - Check signature of magic methods - - Register __get/__set/__call for internal classes - -2004-09-09 Derick Rethans - - * zend_extensions.h: - - Bump the API number to work around this major breakage. - -2004-09-09 Dmitry Stogov - - * zend_vm.h: - We will use CALL dispatch method for compilers other then GCC. It is more - safe. - -2004-09-09 Andi Gutmans - - * zend_API.c: - - Fix the fix. - -2004-09-06 Marcus Boerger - - * zend_objects.c: - - Fix handling of exceptions in dtors - -2004-09-05 Zeev Suraski - - * zend.c - zend.h - zend_ini_parser.y: - Fix reverse dependency - -2004-09-04 Andi Gutmans - - * zend_API.c: - - Don't destroy object when calling overloaded cast method in - - zend_parse_parameters() - -2004-09-02 Sebastian Bergmann - - * zend_compile.c: - Fugbix typo. - -2004-08-30 Marcus Boerger - - * (PHP_5_0) - ZEND_CHANGES: - MFH: Add some information about array overloading - - * ZEND_CHANGES: - Add some information about array overloading - -2004-08-30 Stanislav Malyshev - - * zend_execute.c: - fix crash #29893 - -2004-08-29 Marcus Boerger - - * zend_execute.c: - String offset starts with 0, fix isset($str[$len]) - - * (PHP_5_0) - zend_compile.c: - MFH: Bugfix #29882 isset crashes on arrays - - * zend_compile.c: - Bugfix #29882 isset crashes on arrays - -2004-08-27 Andi Gutmans - - * zend_alloc.c: - - Fix leak report for 0 byte allocations (Dmitry) - -2004-08-26 Marcus Boerger - - * (PHP_5_0) - zend_compile.c: - MFH: Enforce semantics: Classes cannot extend Interfaces - - * zend_compile.c: - Enforce semantics: Classes cannot extend Interfaces - - * tests/bug29828.phpt: - Fix test: Classes cannot extend Interfaces - - * zend_compile.c: - Drop doubled check - - * zend_compile.c: - - Bugfix #29828 Interfaces no longer work - - * tests/bug29828.phpt: - - Add new test - -2004-08-25 Andi Gutmans - - * zend_builtin_functions.c: - - Add interface_exists() and differentiate between classes and interfaces - (Andrey Hristov) - -2004-08-24 Marcus Boerger - - * zend_API.c: - - Add missing brackets - -2004-08-23 Marcus Boerger - - * zend_compile.c: - - Drop unused variable - - * zend_execute_API.c - zend_globals.h: - - Boost up __autoload() calls by caching the lookup - -2004-08-23 Andi Gutmans - - * zend_compile.c: - - Improve performance of switch() - -2004-08-23 Zeev Suraski - - * (PHP_5_0) - zend_reflection_api.c: - Fix names - -2004-08-21 Sara Golemon - - * zend_compile.c: - Bugfix#29777 Some compilers don't like // style comments - -2004-08-20 Sara Golemon - - * zend_ini_parser.y: - Fix compile - -2004-08-19 Andi Gutmans - - * zend_execute.c: - - Cleanup - - * zend.c - zend_execute_API.c - zend_globals.h: - - Second wave of garbage removal. - - * zend_compile.h - zend_execute.c: - - Stop using garbage. Please let me know if you find any bugs resulting - - of this patch (very likely). (Dmitry, Andi) - -2004-08-19 Marcus Boerger - - * zend_reflection_api.c: - - Implement #29728: Reflection API Feature: Default parameter value. - . ReflectionParameter::isDefaultValueAvailable() - . ReflectionParameter::getDefaultValue() - - * zend_reflection_api.c: - - Nedd to work on copy - -2004-08-18 Marcus Boerger - - * zend_reflection_api.c: - - Show default value of optional parameters of user defined functions. - -2004-08-18 Andrei Zmievski - - * zend_ini_parser.y: - Forgot to turn off debugging. - - * zend_ini_parser.y - zend_ini_scanner.l: - Re-add my patch for .ini variable access. - -2004-08-16 Marcus Boerger - - * (PHP_5_0) - zend_reflection_api.c: - MFH: Fix bug #29447: Reflection API issues - - * zend_reflection_api.c: - - Fix bug #29447: Reflection API issues - -2004-08-15 Marcus Boerger - - * zend_compile.c: - Remove unnecessary check - -2004-08-14 Marcus Boerger - - * zend_compile.c: - Add missing check - -2004-08-12 Andi Gutmans - - * (PHP_5_0) - zend.h: - - Back to 5.0.2-dev - - * (PHP_5_0) - zend.h: - - Roll 5.0.1 - - * (PHP_5_0) - zend.h: - - Back to -dev - - * (PHP_5_0) - zend.h: - - 5.0.1RC2 - - * zend_compile.c - zend_compile.h - zend_execute.c: - - Don't use magic numbers - - * zend_compile.c - zend_execute.c: - - Significantly improve performance of foreach($arr as $data). (Marcus) - -2004-08-11 Ilia Alshanetsky - - * zend_highlight.c: - MFH: Fixed bug #29607 (highlighting code with HEREDOC produces invalid - output). - - * (PHP_5_0) - zend_highlight.c: - Fixed bug #29607 (highlighting code with HEREDOC produces invalid output). - -2004-08-11 Marcus Boerger - - * zend_execute.c: - More meaningfull error message - -2004-08-11 Derick Rethans - - * (PHP_5_0) - zend_alloc.h: - - MFH: Patch to allow the Zend memory allocators to be disabled. - - * zend_alloc.h: - - Added missing defines. - -2004-08-10 Ilia Alshanetsky - - * (PHP_5_0) - zend_highlight.c: - MFH: Fixed bug #29606 (php_strip_whitespace() prints to stdout rather then - returning the value). - - * zend_highlight.c: - Fixed bug #29606 (php_strip_whitespace() prints to stdout rather then - returning the value). - -2004-08-10 Andi Gutmans - - * (PHP_5_0) - zend.h: - - Back to -dev - - * (PHP_5_0) - zend.h: - - 5.0.1RC1 - -2004-08-10 Marcus Boerger - - * zend_execute.c: - - Fix warnings - -2004-08-07 Andi Gutmans - - * zend_alloc.h: - - Commit Derick's patch for allowing Zend to use regular libc memory - - allocation functions. Mainly useful in conjunction with tools such as - - valgrind which enables us to find bugs we might not find with the - - current memory managers boundary protection. - -2004-08-05 Ilia Alshanetsky - - * zend_builtin_functions.c: - Eliminate unneeded variable. - -2004-08-04 Marcus Boerger - - * zend_reflection_api.c - tests/bug29523.phpt: - - Fix bug #29523 (ReflectionParameter::isOptional() is incorrect) - -2004-08-03 Marcus Boerger - - * ZEND_CHANGES: - Update - - * (PHP_5_0) - zend_builtin_functions.c - tests/bug29505.phpt: - - MFH Bug #29505 get_class_vars() severely broken when used with arrays - - * tests/bug29505.phpt: - - Add new test - - * zend_builtin_functions.c: - - Fixed Bug #29505 get_class_vars() severely broken when used with arrays - -2004-08-02 Marcus Boerger - - * zend_reflection_api.c: - - Add methods to check parameter count - - * (PHP_5_0) - zend_compile.c: - MFH Change to use memcmp instead of strcmp - - * zend_compile.c: - - Change to use memcmp instead of strcmp - -2004-08-02 Andi Gutmans - - * zend_compile.c: - - Fix typo - -2004-08-02 Marcus Boerger - - * zend_language_parser.y - zend_language_scanner.l: - - Remove all for now - - * zend_compile.c - zend_compile.h - zend_execute_API.c: - MFB: Enforce protocol on magic methods/functions - -2004-08-02 Ilia Alshanetsky - - * (PHP_5_0) - zend_execute.c: - MFH: A gentler (performance wise) allocation of buffer for temp variables. - - * zend_execute.c: - A gentler (performance wise) allocation of buffer for temp variables. - -2004-08-01 Marcus Boerger - - * (PHP_5_0) - zend_compile.c - zend_compile.h - zend_execute_API.c: - - Enforce protocol on magic methods/functions - -2004-07-30 Andi Gutmans - - * zend_execute.c - zend_execute_API.c - zend_ptr_stack.c - zend_ptr_stack.h: - - More ptr_stack optimizations and cleanups - - * zend_alloc.c - zend_alloc.h - zend_execute.c - zend_fast_cache.h - zend_ptr_stack.h: - - Improve performance by inlining zend_ptr_stack_n_push(). var_args can - usually not be inlined by compilers. - -2004-07-29 Marcus Boerger - - * zend_hash.c: - - Increase performance of *sort() and some internal sort operations. - -2004-07-29 Sara Golemon - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - Revert goto opcode - - * zend_execute.c: - &tmp and label are the same thing, don't free it till we're done with it. - - * zend_compile.c - zend_execute.c: - Plug some memory leaks and promote unknown label to E_ERROR. - If someone tries to jump to a non-existant label execution really - shouldn't try to carry on. - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - Add goto operator by popular request. - -2004-07-28 Wez Furlong - - * zend_ini.c: - Fix: ini entries for dl()'d modules now work under ZTS - Side-effect: avoid possible crashes when multiple threads load/unload - modules and mess with the global hash table. - -2004-07-28 Andi Gutmans - - * zend.h - zend.h: - - Fix MAC OSX to always use native DSO loading - -2004-07-27 Marcus Boerger - - * zend_exceptions.c: - - Be specific about visibility - -2004-07-27 Wez Furlong - - * zend_builtin_functions.c: - Fix two possible crashes. Latter is unlikely unless you are doing scary - things, but former looks nasty. - -2004-07-26 Stanislav Malyshev - - * zend_interfaces.c: - quick fix for #29382 - -2004-07-25 Marcus Boerger - - * zend_reflection_api.c: - - Show visibility errors (try to fix #29354) - - * (PHP_5_0) - zend_execute.c - zend_objects_API.c - zend_objects_API.h: - - MFH: Fix bug #29368 : The destructor is called when an exception is - thrown from the constructor - - * zend_execute.c - zend_objects_API.c - zend_objects_API.h: - - Fix bug #29368 : The destructor is called when an exception is thrown - from the constructor - - * zend.c - zend.h - zend_execute.h - zend_execute_API.c: - - Execute destructors earlier (Florian Schaper, fschaper at intux org) - - * zend_reflection_api.c: - - Add ReflectionParameter::isOptional() to test whether a parameter is - optional and also show this information in export. - - * zend_exceptions.c: - - Add optional parameters $filename and $lineno to ErrorException - constructor to allow overwriting automatically retrieved information. - -2004-07-23 Marcus Boerger - - * zend_execute.c: - Fix 0 Byte leak after alloca to emalloc change - -2004-07-22 Zeev Suraski - - * zend_object_handlers.c: - Fix bug in handling of protected properties - -2004-07-21 Edin Kadribasic - - * zend_builtin_functions.c: - Fixed build - -2004-07-21 Marcus Boerger - - * (PHP_5_0) - zend_builtin_functions.c: - MFH: Fixded #29291: get_class_vars() return names with NULLs - - * zend_builtin_functions.c: - - Fixded #29291: get_class_vars() return names with NULLs - -2004-07-20 Moriyoshi Koizumi - - * zend_alloc.c - zend_alloc.h: - - Add safe_pemalloc() - -2004-07-20 Marcus Boerger - - * zend_reflection_api.c: - - Fixed bug 28895 again (long live the dead) - -2004-07-20 Zeev Suraski - - * zend_exceptions.c: - Fix prototypes - - * zend_exceptions.c: - Add descriptions - -2004-07-20 Stanislav Malyshev - - * zend_compile.c: - add todo - - * (PHP_5_0) - zend_ini.h - zend_ini_parser.y: - export ini parser - -2004-07-19 Sebastian Bergmann - - * zend_reflection_api.c: - Fix prototypes: Reflection_* -> Reflection*. - - * zend_reflection_api.c: - Make ReflectionClass::getMethod() and ReflectionClass::getProperty() raise - an ReflectionException instead of returning NULL on failure. - - * zend_reflection_api.c: - Do not use contracted forms. - -2004-07-19 Stanislav Malyshev - - * zend_ini.h - zend_ini_parser.y: - export INI parser - - * zend_object_handlers.c: - __set and __get will be called not only when variable doesn't exist but - also when it's - invisible - -2004-07-19 Andi Gutmans - - * zend_extensions.h - zend_modules.h: - - Bump API number due to empty_string change - - * zend.c - zend.h - zend_API.h - zend_alloc.h - zend_execute.c - zend_object_handlers.c - zend_operators.c - zend_variables.c: - - Nuke empty_string. It is a reminanent from the time where RETURN_FALSE() - used to return "" and not bool(false). It's not worth keeping it because - STR_FREE() and zval_dtor() always have to check for it and it slows down - the general case. In addition, it seems that empty_string has been - abused - quite a lot, and was used not only for setting zval's but generally in - PHP code instead of "", which wasn't the intention. Last but not least, - nuking empty_string should improve stability as I doubt every place - correctly checked if they are not mistakenly erealloc()'ing it or - calling efree() on it. - NOTE: Some code is probably broken. Each extension maintainer should - check and see that my changes are OK. Also, I haven't had time to touch - PECL yet. Will try and do it tomorrow. - -2004-07-18 Wez Furlong - - * zend_execute_API.c: - No point allocating 0 bytes - -2004-07-16 Marcus Boerger - - * zend_language_parser.y - zend_language_scanner.l: - - Speed up by making null/false/true reserved word which allows to drop - an opcode (FETCH_CONSTANT) for every usage. - - * zend_execute.c: - Bugfix #28464 catch() does not catch exceptions by interfaces - -2004-07-16 Ilia Alshanetsky - - * zend_operators.h: - MFB: Fixed bug #28800 (strings beginning with "inf" improperly converted). - - * (PHP_5_0) - zend_operators.h: - Fixed bug #28800 (strings beginning with "inf" improperly converted). - -2004-07-15 Andi Gutmans - - * zend_alloc.c - zend_alloc.h: - - Improve performance of zend_alloc by stopping the size from being a bit - - field. - -2004-07-15 Marcus Boerger - - * zend_exceptions.c - zend_exceptions.h: - - Add new class ErrorException to encapsulate errors in exceptions - - * zend_dynamic_array.h: - - Fix prototype - -2004-07-14 Stanislav Malyshev - - * zend_object_handlers.c: - be consistent with write_dimension - - * zend_object_handlers.c: - fix #28957 - -2004-07-13 Andi Gutmans - - * zend.h: - - 5.0.1-dev - -2004-07-13 Marcus Boerger - - * zend_constants.c: - Bugfix #29116 Zend constant warning uses memory after free (jdolecek at - NetBSD dot org) - -2004-07-13 Andi Gutmans - - * (php_5_0_0) - zend.h: - - Roll PHP 5.0.0 - -2004-07-12 Ilia Alshanetsky - - * (php_5_0_0RC4) - zend_execute.c: - Fixed bug #29086 & #28064 (PHP crashes on extremly long scripts). - -2004-07-12 Andi Gutmans - - * (php_5_0_0RC4) - zend.c: - - Convert zend_class_entry -> zend_class_entry * - -2004-07-10 Jon Parise - - * zend.c: - DragonFly BSD is derived from FreeBSD and requires the same floating point - precision fix. - -2004-07-10 Andi Gutmans - - * zend_alloc.c - zend_hash.c - zend_variables.c: - - Better stability during premature shutdown of request startup - -2004-07-05 Andi Gutmans - - * zend_mm.h: - - Disable zend_mm for 5.0.0 - -2004-07-03 Andi Gutmans - - * zend_alloc.c: - - Should fix mem leak with ZEND_MM. I made this change a while ago and - - rolled it back but I don't remember why. Please test! - -2004-07-01 Ilia Alshanetsky - - * zend_constants.c: - Do not use alloca() where it can be easily abused by the users. - - -2004-06-25 Wez Furlong - - * zend_stream.c - zend_stream.h: - export zend stream functions for zend extensions under windows - -2004-06-24 Sara Golemon - - * zend_execute.c: - Ease off on severity of new error (Using Resources as array offsets) - -2004-06-23 Sara Golemon - - * zend_execute.c: - BugFix #28879 Inconsistent behavior between explicit and implicit array - creation. - - Changes: - - Throw E_WARNING "Illegal offset type" when explicitly creating - array elements with objects, arrays, or resorces as indexes. - This matches implicit creation w/ obj/arr indices. - - Throw E_WARNING "Resource ID#%ld used as offset, casting to integer (%ld)" - when implicitly creating array with resource as index. (BC) - -2004-06-19 Sebastian Bergmann - - * zend_reflection_api.c: - Reflection_* -> Reflection*. Patch by Timm Friebe. - -2004-06-18 Sara Golemon - - * zend_execute.c: - Another typo in converting array index doubles to long. - -2004-06-18 George Schlossnagle - - * zend_builtin_functions.c: - fix for 28213. - - class_name and call_type should be reinitialized on every loop iter. - -2004-06-17 Sara Golemon - - * zend_builtin_functions.c: - String length in parse_parameters should be int - -2004-06-15 Marcus Boerger - - * zend_reflection_api.c: - - -2004-06-14 Marcus Boerger - - * zend_language_scanner.l: - Need {} here - -2004-06-10 Marcus Boerger - - * zend_language_scanner.l: - - Require a single white-space char after /** to start a doc comment that - way we prevent /*** from becoming a doc comment (as requested Derick). - - * zend_API.h: - Add missing declaration - - * zend_reflection_api.c: - Small code layout change - - * zend_language_scanner.l: - Do not require NEWLINE at start of doccomment - - * zend_reflection_api.c: - Bugfix #28699: Reflection api bugs - -2004-06-09 Marcus Boerger - - * zend_reflection_api.c: - Fix Bug #28694 ReflectionExtension::getFunctions() crashes PHP - -2004-06-07 Andi Gutmans - - * zend.h: - - Go back to -dev (Shouldn't need another RC) - - * (php_5_0_0RC3) - zend.h: - - Roll RC3 - -2004-06-06 Stefan Esser - - * zend_compile.h - zend_opcode.c: - Fixed Zend Function Destructor to use correct TSRM handle. - -2004-06-05 Marcus Boerger - - * zend_API.c: - Fix #28641: Instance of Interface - -2004-06-03 Andi Gutmans - - * (php_5_0_0RC3RC2) - zend.h: - - Prepare for RC3RC2 - -2004-06-02 Andi Gutmans - - * zend_mm.h: - - Don't use ZEND_MM in Windows - -2004-06-02 Stanislav Malyshev - - * zend_execute.c: - fix incdec - make value's refcount non-zero when passing to - write_property - otherwise __set caller cleanup could kill it. - -2004-06-01 Andi Gutmans - - * zend.c: - - If user error handler returns "false" then we relay to the built in error - handler - -2004-05-31 Marcus Boerger - - * zend_reflection_api.c: - Refcount must not be set separatley again. - - * zend_reflection_api.c - zend_reflection_api.c: - Add missing initialization - - * zend_compile.c: - - -2004-05-28 Andrei Zmievski - - * zend.c: - Allow user-defined error handlers to indicate whether default error - handler should be re-invoked, by returning true or false. - -2004-05-28 Marcus Boerger - - * zend_execute.c: - Prevent possible problems with illegal properties - -2004-05-28 Derick Rethans - - * zend_builtin_functions.c: - - Make the default mask for user defined error handlers include ALL errors, - including E_STRICT. - -2004-05-27 Andi Gutmans - - * zend.h: - - Back to RC3-dev until we roll final - - * (php_5_0_0RC3RC1) - zend_execute.c: - - Fix problem with exceptions returning from include(). (Dmitry) - - * (php_5_0_0RC3RC1) - zend.h: - - RC3RC1 - -2004-05-26 Wez Furlong - - * zend_object_handlers.c: - Fix leak on systems where alloca isn't really alloca. - -2004-05-26 Andrei Zmievski - - * zend_constants.c: - Avoid unnecessary and silly copying of constant name when registering. - -2004-05-26 Andi Gutmans - - * zend_alloc.c: - - Fix memory manager problem - -2004-05-26 Sebastian Bergmann - - * ZEND_CHANGES: - Update Reflection API class names. Whitespace fixes. - -2004-05-25 Andi Gutmans - - * zend_objects_API.h: - - Nuke unused decleration - - * zend_alloc.c - zend_alloc.h: - - More fixes - - * zend_alloc.c - zend_alloc.h: - - Make fix compile. - - * zend_alloc.c - zend_alloc.h: - - Fix memory leak in mem cache in conjunction with Zend MM. How come no one - - noticed this? :) - -2004-05-23 Andi Gutmans - - * zend_objects_API.c: - - Fix problem with object being destroyed more than once - - * zend_builtin_functions.c: - - Fix the following script (it crashed): - - -2004-05-20 Wez Furlong - - * zend_exceptions.c - zend_exceptions.h: - Revert; obviously I missed the function at the bottom of the file... - - * zend_exceptions.c - zend_exceptions.h: - Export this, so extensions may throw their own exception objects that - they have already instantiated. - -2004-05-18 Marcus Boerger - - * zend_API.c: - - Need to operate on module pointer in hash table - -2004-05-18 Wez Furlong - - * zend_execute_API.c: - Fix bug #28438: win32 build fails in non-zts mode - -2004-05-18 Stanislav Malyshev - - * zend_API.c: - Z_TYPE_P is for zvals - -2004-05-18 Wez Furlong - - * zend_API.c: - Register according to the type specified by the module. - (Helps to fix dl() bug) - -2004-05-18 Sara Golemon - - * zend_execute.c: - Bugfix#28404 When type is double we need to access dval, not lval - -2004-05-17 Andrei Zmievski - - * zend_ini_parser.y - zend_ini_scanner.l: - Revert the .ini vars patch. Will have to try again next Christmas - apparently. - - * zend_ini_parser.y: - Fix the apparent bug (; at the end of parse rule block). - -2004-05-17 Wez Furlong - - * zend_objects_API.c - zend_objects_API.h: - As discussed with Andi, add this helper API for setting the object pointer - from - within the constructor. - - Please read the comment for notes about how to use it; in general, you - don't - need it, so don't use it. - -2004-05-14 Andrei Zmievski - - * zend_ini_parser.y - zend_ini_scanner.l: - Adding ability to refer to existing .ini variables from within .ini - files. Example: - - open_basedir = ${open_basedir} ":/new/dir" - -2004-05-12 Marcus Boerger - - * zend_API.c: - - Centralize register and hash operations for startup/register_module - in new zend_register_module_ex(). - - * zend_API.c: - - Revert to 1.249 - -2004-05-11 Andi Gutmans - - * zend_compile.c: - - Don't allow passing NULL to type hinted parameter. - -2004-05-10 Zeev Suraski - - * zend_operators.c: - - Fix comparison of objects - - Clarify convert_object_to_type() - -2004-05-10 Stefan Esser - - * zend_alloc.c: - Checking MEMORY_LIMIT before doing emalloc/erealloc solves several ugly - problems. - -2004-05-04 Wez Furlong - - * zend_iterators.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - Add count_elements handler for overloaded objects. - -2004-05-02 Andi Gutmans - - * zend_operators.c: - - Fix comparison of two objects in non-compatibility mode. - -2004-05-01 Marcus Boerger - - * zend_API.c: - Don't load modules twice - -2004-04-29 Stanislav Malyshev - - * zend_execute.c: - Fix bug #27876 - -2004-04-28 Marcus Boerger - - * zend_exceptions.h: - Fix c++ builds - -2004-04-27 Marcus Boerger - - * zend_builtin_functions.c: - - Optional parameter to class_exists() that can be used to bypass - __autoload() which can be helpfull in __autoload() itself. - - * zend_interfaces.c: - - Fix warnings - - * zend_interfaces.c - zend_interfaces.h - zend_iterators.h: - - no unneccessary retval initialization - - new c-level iterator handler invalidate_current that is optionally - used to clear internal caching like in implementation of Iterator - -2004-04-27 Andi Gutmans - - * zend_reflection_api.c: - - Fix prototypes - -2004-04-26 Marcus Boerger - - * zend_reflection_api.c: - Fix prototype - -2004-04-25 Marcus Boerger - - * zend_builtin_functions.c: - Skip correct amount of stack entries - - * zend_interfaces.c: - Capture potential problem by error message - - * zend_reflection_api.c: - Show number of classes - -2004-04-25 Andi Gutmans - - * zend.h: - - RC3-dev - - * (php_5_0_0RC2) - zend.h: - - RC2 - -2004-04-23 Andi Gutmans - - * zend_compile.c: - - Fixed bug #27923. foreach() without a key should not check if the key - - is a reference (Adam) - -2004-04-21 Andi Gutmans - - * zend.h: - - RC2-dev - - * (php_5_0_0RC2RC2) - zend.h: - - Prepare for RC2RC2 (if everything is OK especially Zeev's interface - - patch I'll roll RC2 tomorrow). - -2004-04-21 Zeev Suraski - - * (php_5_0_0RC2RC2) - zend_compile.c: - Restore fatal error in case a method that's supposed to implement an - interface/abstract method, breaks its prototype - -2004-04-20 Andi Gutmans - - * zend_language_parser.y: - - Fix bug #27283 - Exceptions where the last catch() statement was - sometimes - - skipped. - -2004-04-19 Marcus Boerger - - * zend_reflection_api.c: - show ini entries and classes for extensions. - -2004-04-17 Marcus Boerger - - * zend.c: - Retval may not be set when zend_execute() is overloaded - -2004-04-15 Marcus Boerger - - * zend_execute.c: - Handle failure in get_current_data - -2004-04-14 Andi Gutmans - - * zend_extensions.h: - - Add comment - - * zend.h: - - RC2-dev - - * (php_5_0_0RC2RC1) - zend.h: - - RC2RC1 - -2004-04-13 Marcus Boerger - - * zend_exceptions.c: - Classnames shall start with an uppercase character - -2004-04-13 Zeev Suraski - - * zend_builtin_functions.c: - Fix debug_backtrace to show arguments again - We need to merge code from debug_backtrace & debug_print_backtrace at - some point! - -2004-04-13 Andi Gutmans - - * zend_extensions.h: - - Fix API no of Engine 2. The first number is the engine version and the - - rest is the API_NO. This way engine2_api_no is always greater than - - engine1_api_no. - - * zend.c - zend_exceptions.c - zend_exceptions.h: - - Add hook for exception handler (Derick) - -2004-04-12 Marcus Boerger - - * zend_API.h: - Fix order of macro parameter (synch with other macros) - -2004-04-12 Andi Gutmans - - * OBJECTS2_HOWTO - zend_extensions.h - zend_ini.c - zend_ini.h - zend_modules.h: - - modifyable -> modifiable - -2004-04-09 Andi Gutmans - - * zend_object_handlers.c: - - Fix bug #26441 (When __set() returned a value it corrupted it) - -2004-04-08 Marcus Boerger - - * zend_reflection_api.c: - Bugfix #27519 Reflection_Function constructor crashes with non-existant - function's name - -2004-04-07 Andi Gutmans - - * zend_builtin_functions.c: - - Hopefully fix the debug_backtrace() code. - - * zend_builtin_functions.c: - - Fix crash bug in zend_debug_backtrace(). No idea how come this survived - - for so long.... - -2004-04-04 Ilia Alshanetsky - - * zend_objects_API.c: - Removed unused variable. - -2004-04-03 Andi Gutmans - - * zend_builtin_functions.c: - Patch by Timm Friebe: - It changes - set_exception_handler() to accept the pseudo-type "callable" (instead of - a string referring to a global function). - - - Examples: - set_exception_handler('function_name'); - set_exception_handler(array('class_name', 'static_method')); - set_exception_handler(array($instance, 'instance_method')); - - - This also makes set_exception_handler() more consistent with all the - other callback functionality, e.g. set_error_handler(). - - * zend_operators.c: - - Nuke more old junk - - * zend.h - zend_operators.c - zend_operators.h: - - Nuke code which hasn't been in use for ages. - -2004-04-01 Ilia Alshanetsky - - * zend_builtin_functions.c: - MFB: Revert patch for bug #27782. - - * zend_execute.c - tests/bug27731.phpt: - Fixed reversed condition for error reporting. - -2004-03-31 Dmitry Stogov - - * zend_execute.c: - Fixed BUG in zend_post_incdec_property - -2004-03-31 Andi Gutmans - - * zend_reflection_api.c: - - Fix typo - -2004-03-30 Marcus Boerger - - * tests/bug26695.phpt: - Fix test - -2004-03-30 Ilia Alshanetsky - - * zend_builtin_functions.c: - Fixed bug #27782 (Wrong behaviour of next(), prev() and each()). - -2004-03-30 Marcus Boerger - - * zend_reflection_api.c: - TSRM fix - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_globals.h - zend_reflection_api.c: - - Fix Reflection class names - - Add ability to get the extension an internal class was defined in - -2004-03-29 Marcus Boerger - - * acconfig.h: - NAN==NAN doest work (Ard) - - * zend_builtin_functions.c: - Allow mixed case search for extensions - -2004-03-29 Sebastian Bergmann - - * zend_execute.c: - -clonning+cloning - -2004-03-29 Dmitry Stogov - - * zend_execute.c: - Implicit clonning strict warning was added for ze1_compatibility_mode - -2004-03-29 Ilia Alshanetsky - - * zend_execute.c - tests/bug27731.phpt: - Fixed bug #27731 (error_reporting() inside @ block fails to set - error_reporting level). - -2004-03-28 Marcus Boerger - - * zend_API.c: - Use lowercasing here - - * zend.c: - Initialize the complete struct - -2004-03-28 Stanislav Malyshev - - * zend_language_parser.y: - check writability on =& too - - * zend_execute.c: - - call set handler if assigning to object having this handler - - cleanup: use macros to access object internal vars - - * zend_interfaces.c: - preserve ZEND_API in definition - - * zend_interfaces.h: - declare as extern - -2004-03-28 Marcus Boerger - - * zend_reflection_api.c: - Fix memleak found by Timm - -2004-03-28 Stanislav Malyshev - - * zend_operators.c: - centralize object-to-scalar conversion, make it work with get handler - - * zend.c: - try get handler on printable conversion - - * zend_object_handlers.h: - some more clear comments - - * zend_operators.c: - Use macros for object parts access - -2004-03-28 Dmitry Stogov - - * zend_execute_API.c: - fix of fix related to __autoload. (ext/standard/tests/network/bug20134.phpt - passes again) - -2004-03-27 Marcus Boerger - - * zend.c: - Even though it is uncommented it should be right - -2004-03-26 Marcus Boerger - - * zend_API.c - zend_compile.c: - Force destructors to have empty signatures - -2004-03-26 Andi Gutmans - - * zend_execute.c: - - Fix build (thanks to Timm) - -2004-03-25 Derick Rethans - - * zend_language_scanner.l: - - Remove old and deprecated scanner token. - -2004-03-25 Andi Gutmans - - * zend_compile.c: - - If __construct() is defined then it will always take precedence over - - old style constructors. - -2004-03-25 Stanislav Malyshev - - * zend_execute.c: - no need to use result for RECV's - as in PHP4 - - * zend_execute.c: - Use get/set handlers for increment.decrement ops on objects - -2004-03-25 Andi Gutmans - - * zend_execute_API.c: - /* The compiler is not-reentrant. Make sure we __autoload() only during - run-time - * (doesn't impact fuctionality of __autoload() - */ - -2004-03-25 Dmitry Stogov - - * zend_execute_API.c: - Using ALLOC_HASHTABLE/FREE_HASHTABLE instead of emalloc/free. - -2004-03-24 Dmitry Stogov - - * zend.c - zend_execute_API.c - zend_globals.h: - New autoload protection schema was implemented (Using HashTable instead of - boolean flag) - -2004-03-24 Derick Rethans - - * zend_operators.c: - - Revert bogus commit - - * zend_operators.c: - - Fixed NEWS - -2004-03-24 Dmitry Stogov - - * tests/bug27641.phpt: - Fixed bug #27641 (Object cloning in ze1_compatibility_mode was - reimplemented) - - * zend_execute.c - zend_variables.c: - Object cloning in ze1 compatibility mode (zend.ze1_compatibility_mode) was - reimplemented (Dmitry, Andi) - -2004-03-22 Andi Gutmans - - * zend_compile.c: - - Fix bug - - * zend_execute.c: - - Remove whitespace - -2004-03-21 Andi Gutmans - - * zend_execute.c: - - Improve consistency - -2004-03-21 Stanislav Malyshev - - * zend_objects_API.c - zend_objects_API.h: - return zval *, to make it useful for read_property - - * zend_objects_API.c: - update to new API - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - API change for read_property: - instead of bool silent it now gets fetch type - This can be used for creating proxy objects for write contexts - -2004-03-21 Andi Gutmans - - * zend_execute.c: - - Nuke unused code - -2004-03-18 Andi Gutmans - - * zend.h: - - Back to RC2-dev - -2004-03-18 Zeev Suraski - - * (php_5_0_0RC1) - zend.h: - Prepare to roll RC1 - - * (php_5_0_0RC1) - zend_execute.c: - Fix possible data corruption with __set() - -2004-03-18 Stanislav Malyshev - - * zend_execute.c: - Improve error message - on E_STRICT, method is actually called, - so the error shouldn't say it cannot be called. - -2004-03-18 Andi Gutmans - - * (php_5_0_0RC1) - zend_compile.c: - - Change redefinition of constructor from E_COMPILE_ERROR to E_STRICT. - - * (php_5_0_0RC1) - ZEND_CHANGES: - - Update Changes - -2004-03-17 Sascha Schumann - - * zend_multiply.h: - Readd x86 implementation - -2004-03-17 Andi Gutmans - - * (php_5_0_0RC1RC2) - zend_multiply.h: - - Improved patch for support multiplication on 64bit machines - - * (php_5_0_0RC1RC2) - zend_execute.c: - - Fix tiny bug (one of the reasons we can't support __toString() for - - regular objects). - - * (php_5_0_0RC1RC2) - zend.c: - - Stop make_printable_zval() from calling __toString() - - * zend_execute.c: - - Fixed problem with __toString(). Due to the engine's architecture it is - - currently not possible to call __toString() anywhere besides print & - eval. - - Follow up will be on internals@ - -2004-03-17 Stanislav Malyshev - - * (php_5_0_0RC1RC2) - zend_compile.c: - fix typo - -2004-03-17 Andi Gutmans - - * zend_multiply.h - zend_operators.c: - - Apply Ard's patch to support multiplication & overflow on both 32bit - and 64bit machines - -2004-03-16 Derick Rethans - - * zend.c - zend.h - zend_API.h - zend_modules.h: - - Replaced the exec_finished hook by the zend_post_deactive hook for - extensions. The new hook will be run after the symbol table and - destructors - are run. (Derick) - - * zend_modules.h: - - Bump API number so that it actually differs from PHP 4. This is needed - because we don't want PHP 4 and PHP 5 extensions to be in the same - directory - when doing "make install" for shared, or phpize'd extensions. - -2004-03-16 Marcus Boerger - - * zend_execute_API.c: - Fix SEGV in certain conditions while calling static methods - -2004-03-16 Zeev Suraski - - * zend_compile.c - zend_compile.h: - Add ability to disable JIT for a particular auto global - -2004-03-16 Marcus Boerger - - * zend_execute_API.c: - TSRM fix - -2004-03-16 Sascha Schumann - - * zend.h: - Enable ptr format check for GCC 3.1 and higher - -2004-03-16 Ilia Alshanetsky - - * zend.h: - Do not allow 3.0.4 for __attribute__. - - * zend.h: - Fixed bug #27600 (GCC 3.0.4 does not like __attribute__ directive) - -2004-03-16 Andi Gutmans - - * zend_compile.c: - - Fix problem when using old-style constructors it wasn't being inherited - correctly. - -2004-03-16 Derick Rethans - - * zend_execute_API.c: - - Spaces to tabs - -2004-03-16 Andi Gutmans - - * zend_execute_API.c: - - If the called method is static then don't define $this - - * zend_execute.c - zend_execute_API.c: - - Error out if get_method() isn't defined. - - Use calling scope of internal function callee when calling a method - using static syntax (array("A", "func")); - -2004-03-16 Marcus Boerger - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - Improve error message - -2004-03-15 Andi Gutmans - - * zend_operators.c: - - Restore E_NOTICE for longs and doubles. - -2004-03-15 Jani Taskinen - - * zend.h: - - Fixed bug #24582 (extensions can not be loaded dynamically in - Solaris/iPlanet) - -2004-03-15 Andi Gutmans - - * zend_operators.c: - - Nuke E_NOTICE. This caused a notice when doing if ($obj == NULL) - -2004-03-14 Marcus Boerger - - * zend_builtin_functions.c: - Make object parameter optional - -2004-03-14 Ilia Alshanetsky - - * zend.c: - Fixed bug #27590 (crash during shutdown when freeing persistent resources - in ZTS mode). - -2004-03-14 Andi Gutmans - - * zend_execute_API.c: - - Fix windows build - - * zend_execute_API.c: - - Fix for bug #27504 - - * zend_builtin_functions.c: - - Fixing bug #27123 - - * zend_operators.c: - - Improve compatibility mode and compare objects according to property - - comparison (sucky but this is how PHP 4 behaved). - - * zend.c: - - Fix flow of logic - - * zend_operators.c: - - Support old style of converting objects to long/double/bool. - - This is only enabled in compatibility mode, else it calls cast_object() - - and if that is not available we return 1 (true) so that the following - - code would work: - if ($obj) { - } - -2004-03-14 Marcus Boerger - - * zend_operators.c: - Fix: Add return type void - -2004-03-14 Andi Gutmans - - * zend.c - zend_object_handlers.c - zend_object_handlers.h - zend_operators.c: - - Support Cast operator in convert_to_* so that we support internal - - extensions such as SimpleXML. This is for Sterling. - - * zend_operators.c: - - Fix memory leak in the following code (Dmitry): - - - * zend_operators.c: - - Initial commit which allows comparing overloaded objects with native - - types (only for internal classes and not for user-land classes). - -2004-03-11 Andi Gutmans - - * zend_objects_API.c: - - Real fix for bug #27535 (Dmitry) - - * zend_objects_API.c: - - Attempt to fix bug #27535 - -2004-03-09 Marcus Boerger - - * ZEND_CHANGES: - Rename hasMore() to valid() as discussed. (Part VI) - - * zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_interfaces.c - zend_language_parser.y - zend_reflection_api.c: - Clearify the different method/class flags (as discussed with Andi). - - * zend.h: - No longer needed - -2004-03-09 Andi Gutmans - - * zend_constants.c: - - Fix crash: - - - * zend_compile.c - zend_compile.h - zend_execute.c: - - Nuke unused code. - -2004-03-08 Marcus Boerger - - * zend_execute.c - zend_interfaces.c - zend_iterators.h: - Rename hasMore() to valid() as discussed. (Part II) - - * zend_interfaces.c: - Rename hasMore() to valid() as discussed. (Part I) - - * zend_execute_API.c: - Check count. - - * zend_reflection_api.c: - Add another missing conversion - -2004-03-05 Andi Gutmans - - * zend_compile.c: - - Fix some small problems I introduce in last patch. - - * zend_compile.c: - - Finally fix the following: - $xml_mem = - simplexml_load_string('1'); - /* The following works fine */ - foreach ($xml_mem->part as $part) { - foreach($part->chapter->page as $page) { - print $page; - } - } - /* The following segfaults */ - foreach ($xml_mem->part as $part) { - foreach($part->chapter as $chapter) { // Difference here from previous - example - print $chapter; - } - } - -2004-03-04 Moriyoshi Koizumi - - * zend_language_scanner.l: - - Fix memleak when scanner is called from within tokenizer extension. - -2004-03-04 Stanislav Malyshev - - * zend_execute.h: - fix the fix - - * zend_execute.h: - oops, fix cut&paste gone bad - - * zend_execute.h: - Fix object true value: if we are in compat mode and it's Zend object - - use PHP4 rules. Otherwise, object is always true. - -2004-03-04 Derick Rethans - - * zend_constants.h - zend_operators.h: - - Fixed a 64bit issue (for zend_builtin_functions.c, module_number is an - int). - - Change the MAX_LENGTH_OF_LONG constant to 20, as LONG_MAX is 20 - characters. - (Patches by Ard Biesheuven) - - * tests/zend_operators.phpt: - - Added instance_of test (patch by Ard Biesheuvel) - -2004-03-04 Stanislav Malyshev - - * zend_compile.c: - Disallow redefining ctors and cleanup - - * zend_mm.c: - Handle out of memory/bad size situation gracefully, without getting into - loop - -2004-03-03 Andi Gutmans - - * zend_objects_API.c: - - Fix crash: - x as $x); - } - } - new foo(); - echo 'OK'; - ?> - -2004-03-02 Marcus Boerger - - * zend_API.c - zend_API.h: - Fix zend_parse_method_parameters_ex() and make it consistant with - zend_parse_method_parameters(). - -2004-03-02 Andi Gutmans - - * zend_compile.c: - - Fix leaks (although there might be still a problem here). - - * zend_execute.c: - - Fix leak (Dmitry) - - * zend_compile.c: - - Fix crash in: - attributes as $name => $attr) { - } - } - } - - $f= new Foo(); - $f->export(); - ?> - - * zend_objects.c: - - Improve fix for protecting destructor's from exceptions. - - I was killing the current exception completely which was wrong. - -2004-03-01 Andi Gutmans - - * zend_objects.c: - - Fix crash in destructors(). You can't throw an exception in destructors - as there is no guaranteed time when the destructor will be called. - - * zend_reflection_api.c: - - Fix leak - - * zend_reflection_api.c: - - Fix crash in reflection API (pierre) - - * zend.c - zend_exceptions.c - zend_execute_API.c: - - Fix crash in exception handling (zend_exception_error(...) and - zend_eval_string_ex() were buggy (Dmitry, Andi) - -2004-03-01 Derick Rethans - - * zend_compile.h: - - Typo fix (by Jan) - - * zend_builtin_functions.c: - - Fixed bug #27443 (defined() returns wrong type). - -2004-02-29 Andi Gutmans - - * zend_reflection_api.c: - - Apply fixes by Timm. - - * zend_compile.c: - - Change prototype isA check not to check the constructor. - - Only give an E_STRICT for non-isA compliant code as opposed to - E_COMPILE_ERROR. - -2004-02-29 Stanislav Malyshev - - * zend_compile.h: - add ZEND_API there too for opcode handlers - -2004-02-29 Derick Rethans - - * zend_execute.c: - - Initialize memory to \0 so that we can reliable detect whether a specific - opcode element is in use. - -2004-02-29 Stanislav Malyshev - - * zend_execute.c: - export opcode table - -2004-02-27 Marcus Boerger - - * zend_API.c - zend_compile.h: - Add some comments - - * zend_API.c - zend_compile.c - zend_execute.c: - Fixes for abstract classes/methods - -2004-02-26 Marcus Boerger - - * zend_language_parser.y - zend_language_scanner.l: - Fix __METHOD__ (noticed by Davey Sahfik) - - * zend_reflection_api.c: - Fix problem with Reflection_Property (patch from Timm slightly modified). - -2004-02-25 Marcus Boerger - - * zend_objects_API.c: - As Andi found out the dtor may increase the refcount. - -2004-02-25 Jani Taskinen - - * zend_builtin_functions.c: - ws + cs - -2004-02-25 Zeev Suraski - - * zend_compile.c - zend_execute.c: - Fix leak in foreach ($o->mthd()->arr) - - * zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c: - - Improve ARG_INFO() macros to support supplying required_num_args - - Initial fix for foreach($o->mthd()->arr) crash (now leaks) - -2004-02-25 Derick Rethans - - * zend_highlight.c: - - Use instead of in highlight_string(). (Patch by - mg@iceni.pl) - -2004-02-25 Jani Taskinen - - * zend_exceptions.c: - Improve error messages - -2004-02-25 Zeev Suraski - - * zend.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_variables.c: - - Rename compatiblity mode to zend.ze2_compatibility_mode (it doesn't - only affect auto-clone). - - Perform implementation checks even with simple inheritance (off when - compatibility mode is enabled). - - Restore default arguments in interfaces and handle it correctly. - - Move registration of internal classes later in the startup sequence - in order to have INI options available. - -2004-02-25 Derick Rethans - - * zend_exceptions.c: - - Fixed bug #27391 (typo in Fatal Error message). - -2004-02-25 Zeev Suraski - - * zend_API.c - zend_compile.c - zend_compile.h - zend_opcode.c: - - Abstract methods cannot have defaults for arguments - - Make function foo($a, $b=null) satisfy both foo($a) and foo($a, $b) - prototypes - -2004-02-25 Sebastian Bergmann - - * zend_reflection_api.c: - Proto fixes. - -2004-02-25 Marcus Boerger - - * zend_objects_API.c: - Fix object destruction/free in shutdown - - set destructor_called even when no dtor is given - - use free_storage even when no dtor hat to be called - - * zend_objects_API.c: - Checking once for dtor is enough - -2004-02-24 Marcus Boerger - - * zend_API.c: - Fix class flags when handling abstract methods - -2004-02-23 Andi Gutmans - - * zend_language_parser.y: - - Improve precendence: - - foo = "Blah"; - - if (!$obj instanceof StdClass) { - print "No"; - } else { - print "Yes"; - } - - * zend_language_parser.y: - - Decrease precedence of instanceof so that the following is true: - php -r 'var_export((object)1 instanceof stdClass);'; - Patch by Jan Lehnardt - -2004-02-22 Derick Rethans - - * zend_operators.c: - - Fixed bug #27354 (Modulus operator crashes PHP). - -2004-02-22 Marcus Boerger - - * ZEND_CHANGES: - Add some more obviously needed information - -2004-02-20 Hartmut Holzgraefe - - * zend.h - zend_API.h - zend_iterators.h - zend_operators.h - zend_variables.h: - more EXTERN_C wrapping of ZEND_API prototypes - -2004-02-20 Jani Taskinen - - * zend_opcode.c: - ws fix - -2004-02-18 Hartmut Holzgraefe - - * zend.h - zend_builtin_functions.h - zend_extensions.h - zend_indent.h - zend_interfaces.h - zend_object_handlers.h - zend_objects.h - zend_objects_API.h - zend_ptr_stack.h - zend_stack.h - zend_stream.h: - wrap ZEND_API prototypes into BEGIN_EXTERN_C/END_EXTERN_C - for C++ extension support - -2004-02-18 Zeev Suraski - - * zend.c: - Forward-port fixlet from PHP 4 (thanks to Michael Sisolak) - -2004-02-17 Jani Taskinen - - * zend_list.c: - MFB: - Fix bug #26753 (zend_fetch_list_dtor_id() does not check NULL - strings) - -2004-02-16 Derick Rethans - - * ZEND_CHANGES: - - Clearify clone behavior, fixed clone example (Patch by Jan Lehnardt) - -2004-02-16 Marcus Boerger - - * zend_compile.c: - Bugfix #27227 Mixed case class names causes Fatal Error in Constructor call - -2004-02-14 Marcus Boerger - - * zend_iterators.c: - dtor's may not be called from free_storage handlers - -2004-02-12 Andi Gutmans - - * (php_5_0_0b4) - zend_execute.c: - - Remove old code - -2004-02-12 Hartmut Holzgraefe - - * (php_5_0_0b4) - ZEND_CHANGES: - making sure that the provided examples actualy work (or at least do not - generate no parse errors) unless they are really expected to fail - -2004-02-12 Andi Gutmans - - * (php_5_0_0b4) - zend_object_handlers.c: - - This was too strict. - -2004-02-12 Zeev Suraski - - * (php_5_0_0b4) - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_interfaces.c - zend_object_handlers.c: - - Check return-by-reference bit when implementing interface prototypes - - Add infrastructure for built-in functions to hint whether they - return by reference or not. It is NOT currently used for anything, - except for interface prototypes (you can use it to request that the - function that implements your prototype returns by reference or - doesn't return by reference). - For downwards compatibility - by default, interface prototypes are - agnostic as to whether the function that implements them returns - by reference or not. Use ZEND_BEGIN_ARG_INFO_EX() with - ZEND_RETURN_VALUE/ZEND_RETURN_REFERENCE to change that. - - Fix ArrayAccess::getOffset() to conduct additional checks. - If your getOffset() should work with multidimensional arrays - it - must return by reference. - -2004-02-12 Andi Gutmans - - * (php_5_0_0b4) - zend_object_handlers.h: - - Add comments to read/write property/dimension for extension authors - -2004-02-12 Zeev Suraski - - * zend_default_classes.h: - zend_default_classes.h -> zend_exceptions.h - -2004-02-12 Andi Gutmans - - * (php_5_0_0b4) - Makefile.am: - - Add zend_exceptions.c - -2004-02-12 Zeev Suraski - - * (php_5_0_0b4) - ZendTS.dsp - zend.c - zend_default_classes.c - zend_exceptions.c - zend_exceptions.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_reflection_api.c: - Centralize exceptions code in zend_exceptions.[ch]. - Remove zend_default_classes.h (use zend_exceptions.h instead) - - NOTE: This currently breaks the build, fixes to php-src and pecl coming - soon - -2004-02-12 Andi Gutmans - - * zend_execute.c: - - Use zend_throw_exception_object() in throw_handler to make sure it - - does all the checks - -2004-02-12 Zeev Suraski - - * zend_default_classes.c - zend_default_classes.h - zend_exceptions.c - zend_exceptions.h - zend_execute.h - zend_execute_API.c: - Exceptions updates: - - - Enforce exceptions to be derived from class Exception. This allows - users to perform catch-all. It's not yet complete, so don't get - comfortable with it just yet :) Updates are coming soon. - - Implement zend_throw_exception() using zend_throw_exception_ex() - -2004-02-12 Andi Gutmans - - * zend_execute.h - zend_execute_API.c: - - Add API function to throw exception by using an object - -2004-02-11 Marcus Boerger - - * zend.c: - Must be initialized in ZTS mode - - * ZEND_CHANGES - ZEND_CHANGES: - Update - - * zend_compile.c - zend_language_parser.y: - Fix: [extends [, ]* ] - -2004-02-11 Zeev Suraski - - * zend_execute.c: - Fix leaks in assignments to overloaded objects - - * zend_execute.c: - Fix leak with overloaded objects, when they're used just "for the hell - of it" :) - - * zend_execute.c: - Fixed a bug the caused overloaded array indices to be converted to strings - - * zend_execute.c: - Turn off bogus warnings with overloaded dimensions and += (and friends) - - * zend_execute.c: - Improve the implementation of unset() on array dimensions to be more - consistent with that of regular variables and string offsets - - * zend_execute_API.c: - Fix bug #25038 - - * zend_reflection_api.c: - Fix crash (patch by Rob Richards) - - * zend.c - zend_execute_API.c: - Fix exceptions thrown without a stack frame - Always enable set_exception_handler() - - * zend_list.h: - Change FETCH_RESOURCE to return false on error instead of null, for - consistency with other error situations - - * zend_compile.c: - Fix bug #26802 (the right aspects of it found by Marcus, anyway :) - - * tests/bug26802.phpt: - Fix and clarify the test case - - * zend_execute_API.c: - Complete the fix for handling of exceptions happening during the - argument passing phase of function calls (fixes bug #26866) - - * zend_execute_API.c: - whitespace - -2004-02-10 Zeev Suraski - - * tests/bug26698.phpt: - Ignore the memleak in this test - - * zend_execute.c: - Fix bug #26698 (exceptions handled properly during argument passing to - functions) - - * zend_default_classes.c: - Fix bug #27186 - - * zend_execute_API.c: - Fix bug #26869 - - * zend_execute.c: - Fix refcounting of ++/+= overloading (fix leak in __get()/__set() - based classes) - -2004-02-10 Andi Gutmans - - * zend_compile.c: - - Nuke more unused code - -2004-02-10 Zeev Suraski - - * zend_execute.c: - Fix handling in assignment using multidimensional array syntax to string - offset ($s = "FUBAR"; $s[0][0] = 1;) - -2004-02-10 Andi Gutmans - - * ZEND_CHANGES: - - We will go with PHP 4 behavior. With the new object model assigning by - reference has lost a lot of its importance. - - * zend_compile.c: - - Remove junk - -2004-02-10 Zeev Suraski - - * zend_execute.c: - Fix exception handling in opcodes spanned across multiple oplines (fixes - the crash in __set()) - - * zend_execute.c: - - Fix pre/post increment for overloaded objects - - Fix binary-assign-op for overloaded objects - - NOTE: This requires the implementation of the 'get' callback! - -2004-02-10 Moriyoshi Koizumi - - * tests/bug22836.phpt: - - Correcting test. - -2004-02-08 Zeev Suraski - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Fix write-mode of overloaded objects when using array dimensions - -2004-02-08 Andi Gutmans - - * zend_objects_API.c: - - Check if free_storage exists - -2004-02-05 Sebastian Bergmann - - * ZEND_CHANGES: - Committing for Jan. - -2004-02-05 Ilia Alshanetsky - - * zend_compile.c - tests/bug27145.phpt: - Fixed bug #27145 (Unmangle private/protected property names before printing - then inside error messages). - -2004-02-04 Zeev Suraski - - * zend_execute_API.c: - Fix exceptions happening inside internal functions called through - zend_user_function() - - * zend_execute_API.c: - Remove double initialization - -2004-02-04 Marcus Boerger - - * zend_objects.h: - Add new prototype - - * zend_reflection_api.c: - Fix reflection - - * zend_iterators.c: - Fix warnings - -2004-02-04 Zeev Suraski - - * zend_compile.c: - Fixlet - - * zend_compile.c: - Fix handling of $this in some cases - - * zend_compile.c: - Handle additional cases - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_language_parser.y: - Reinstate early-binding for classes. - - Note that this is available for downwards compatibility only - and it - doesn't - work if you use new features (namely, interfaces). Generally, people - should - declare their classes before using them, but we just didn't want hell to - break - loose (c) - - * zend_opcode.c: - Optimize - - * zend_compile.c: - - Improve $this assignment detection and generalize some code in - zend_compile.c - - * zend_compile.c: - -Error out when trying to re-assign $this - - * zend_objects_API.c - zend_objects_API.h: - The valid bit was necessary after all - restored - - * zend_objects_API.c: - Fixlets - - * zend_compile.c - zend_objects.c: - - Small fixes - - * zend_execute.c: - - Improve wording - - * zend_execute_API.c - zend_iterators.c - zend_objects.c - zend_objects_API.c - zend_objects_API.h - zend_reflection_api.c: - Change destructor implementation (details will follow on internals@) - -2004-02-03 Marcus Boerger - - * tests/bug24884.phpt: - Update tests - - * zend_objects.c: - Nuke unused variable - - * zend_compile.c: - Fix Warning - -2004-02-03 Sebastian Bergmann - - * ZEND_CHANGES: - clone/__clone() related changes. - -2004-02-03 Zeev Suraski - - * zend_compile.c: - Remove unused variable - - * zend_objects_API.c - zend_objects_API.h: - Remove more garbage - valid bit was not really necessary - - * zend_execute_API.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c - zend_objects_API.h: - - Clean garbage (delete was nuked a long time ago) - -2004-02-03 Ilia Alshanetsky - - * zend_execute.c: - More unneeded code removed. - -2004-02-03 Zeev Suraski - - * zend_execute.c - zend_language_scanner.l: - Abort on parse error in an include file (patch by Ilia) - - * zend_compile.c: - Remove redundant code - - * zend_execute.c: - Fix try/catch block logic - - * zend_compile.c - zend_objects.c: - Perform a bitwise copy of the object even when __clone() is defined. - __clone() is back to not requiring any arguments, as $that is no longer - needed ($this already contains a copy of the original object, by the time - we __clone() is executed). - Calling the parent clone is done using parent::__clone() - - * zend_compile.c - zend_compile.h - zend_default_classes.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - Rewrote exception support. Fixes a few limitations and bugs in the old - implementation, and allows exceptions to 'fire' much earlier than before. - - Instructions on how to use the new mechanism will follow on internals@ - shortly... - - Note - this (most probably) breaks the current implementation of - set_exception_handler() - -2004-02-02 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_language_parser.y - zend_language_scanner.l - zend_objects.c: - Redesign the clone() feature to fix some fundamental flaws in the previous - implementation. - - Using clone directly is now done using - $replica = clone $src; - - Clone methods must now be declared as follows: - function __clone($that) - { - } - - Clone methods in derived classes can call the __clone method of their - parent - classes using parent::__clone($that) - -2004-01-31 Marcus Boerger - - * zend_reflection_api.c: - Throw an exception in case a reflection object cannot be found and do not - override the exception from constructors in static method calls. - -2004-01-30 Ilia Alshanetsky - - * zend_execute.c: - Apply the same parse error handling to (include|require)_once as the one - for - their non-once counterparts. - -2004-01-28 Zeev Suraski - - * zend_compile.c: - Tweak checks to detect some additional cases. - Reorder checks to make more sense. - - * zend_compile.c: - - Error message fix - - Prevent inheritance of the same constant from two interfaces - - * zend_compile.c: - Fixlets - - * zend_compile.c - zend_compile.h: - Prevent classes from implementing interfaces that have the same function - - * zend_execute.c: - Whitespace - - * zend_compile.c: - Code relayout - - * zend_execute_API.c: - Forward-port fix for timeouts under Windows - -2004-01-26 Marcus Boerger - - * zend_interfaces.c - zend_interfaces.h: - - Export struct zend_user_iterator - - Ad 'it' to function prefix to prevent naming clashes - - Export zend_user_it_free_current - -2004-01-25 Ilia Alshanetsky - - * zend_execute.c: - Fixed bug #26814 (On parse error include included file, terminate - execution script). - -2004-01-25 Marcus Boerger - - * zend_execute.c - zend_iterators.c - zend_iterators.h: - Respect proeprty visibility in foreach - - * tests/bug26696.phpt: - Update test - -2004-01-24 Marcus Boerger - - * zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c: - Switch from ZEND_ACC_DYNAMIC to ZEND_ACC_ALLOW_STATIC and disallow calling - internal non-static methods statically. - -2004-01-24 Sebastian Bergmann - - * zend_execute.c - zend_execute_API.c: - Change message as proposed by Jon. - -2004-01-23 Marcus Boerger - - * zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c: - Simplify detection of methods that must be called dynamic (with object) - - * zend_execute.c - zend_execute_API.c: - Disallow calling __clone/__construct/__destruct static - Send an E_STRICT when calling a non static method static - - * zend_API.c - zend_compile.c - zend_compile.h: - Disallow static declaration of clone - -2004-01-23 Jani Taskinen - - * zend_constants.h - zend_ini.h: - Silence some compile warnings - -2004-01-22 Marcus Boerger - - * zend_default_classes.c: - Fix internal access to exception properties - -2004-01-19 Andi Gutmans - - * zend_execute.c - zend_execute.h: - - Hopefully fix bug #26696. - - Please let me know if hell-breaks loose - -2004-01-19 Marcus Boerger - - * zend_API.c - zend_API.h: - Add zend_get_module_started() to quickly check whether a module is present - and its MINIT function has been called. - -2004-01-18 Marcus Boerger - - * zend_execute.h - zend_execute_API.c: - Improove debug capabilities - - * zend_reflection_api.c: - Fix some casing issues - -2004-01-17 Marcus Boerger - - * zend_interfaces.c: - - - * zend_interfaces.c: - Fix inheritance rule for interface Traversable - -2004-01-17 Jani Taskinen - - * tests/bug26802.phpt: - - Renamed all *php4* files to *php5*, changed all php4/PHP4 to php5/PHP5 - -2004-01-17 Ilia Alshanetsky - - * zend_object_handlers.c - zend_object_handlers.h: - Expose zend_std_call_user_call(), needed for implementation of things like - __call handlers. - -2004-01-17 Jani Taskinen - - * zend_compile.c - zend_language_scanner.h - zend_language_scanner.l: - Nuke compile warning by using the LANG_SCNG macro instead - -2004-01-16 Jani Taskinen - - * zend_reflection_api.c: - - Fixed bug #26640 (__autoload() not invoked by Reflection classes) - - -2004-01-15 Zeev Suraski - - * zend.c: - Nice patch Christian, but it wasn't at all enabled? :) - - Fix bug #26883 - -2004-01-14 Zeev Suraski - - * zend_compile.c: - Don't allow interfaces to implement anything - -2004-01-14 Andi Gutmans - - * zend_operators.h: - - Remove bogus macros - -2004-01-13 Wez Furlong - - * zend_ini_parser.y: - Don't treat strings containing : as potential constant names in - the .ini parser. - This fixes Bug #26893 - -2004-01-12 Andi Gutmans - - * zend_compile.c: - - Return the PHP 4 behavior of not allowing class declerations within - - class declerations. This happened when declaring a class within a - - method. - class A { - function foo() { - class B { - } - } - } - -2004-01-12 Marcus Boerger - - * zend_API.h: - Add missing macro - -2004-01-11 Wez Furlong - - * zend_compile.c - zend_language_scanner.h - zend_language_scanner.l: - TSRMLS fix - -2004-01-11 Andi Gutmans - - * zend_language_parser.y: - - Re-allow conditional class declerations. Needless to say that I also - - think it's not great coding.. Use polymorphism instead :) - - * zend_compile.c - zend_language_scanner.h - zend_language_scanner.l: - - This should fix the problem of conditional function decleration on the - - same line of code not to work. You should re-evaluate your coding style - - if you really code this way :) - -2004-01-10 Zeev Suraski - - * zend_operators.c: - Remove conflict - - * zend_builtin_functions.c - zend_execute_API.c - zend_globals.h - zend_operators.c: - Added error mask to set_error_handler() - Patch by Christian Schneider - -2004-01-09 Wez Furlong - - * acconfig.h: - support for building asm in the unix buildsys. - Also, when ZEND_ACCONFIG_H_NO_C_PROTOS is defined, - omit the C prototypes from the configuration header - so that it can be included into asm files. - -2004-01-09 Marcus Boerger - - * RFCs/002.txt: - this one is declined - -2004-01-09 Wez Furlong - - * zend_object_handlers.h: - must be extern to avoid problems with some compilers - -2004-01-09 Stanislav Malyshev - - * tests/bug26077.phpt: - fix expect - - * zend_compile.c: - Bug #25816 - disallow arrays in class constants - - * tests/bug26077.phpt: - add test - - * zend_compile.c - zend_execute.c: - Fix Bug #26077 - memory leak when new() result is not assigned - and no constructor defined - -2004-01-08 Jani Taskinen - - * acconfig.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.nw.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_default_classes.c - zend_default_classes.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_ini_scanner.h - zend_interfaces.c - zend_interfaces.h - zend_istdiostream.h - zend_iterators.c - zend_iterators.h - zend_language_scanner.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_mm.c - zend_mm.h - zend_modules.h - zend_multibyte.c - zend_multibyte.h - zend_multiply.h - zend_object_handlers.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_reflection_api.c - zend_reflection_api.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_stream.c - zend_stream.h - zend_ts_hash.c - zend_ts_hash.h - zend_types.h - zend_variables.c - zend_variables.h: - - Happy new year and PHP 5 for rest of the files too.. - -2004-01-08 Andi Gutmans - - * zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.l: - - - A belated happy holidays (by two years) - -2004-01-07 Marcus Boerger - - * zend_execute.c: - Reimplement part of Bug #24608 that was reverted too - - * zend_execute.c: - Revert patch that allowed to call sttaic methods via $method() - -2004-01-06 Ilia Alshanetsky - - * zend_mm.c: - Check if realloc() succeeds or not. (Noticed by Andrey) - -2004-01-06 Marcus Boerger - - * tests/bug26802.phpt: - Update - -2004-01-05 Marcus Boerger - - * zend_execute.c - tests/bug26802.phpt: - Fixed bug #26802 - - * tests/bug26802.phpt: - Fix test - - * tests/bug26801.phpt - tests/bug26802.phpt: - Add new test - - * tests/bug26696.phpt: - Update test - -2004-01-05 Stanislav Malyshev - - * zend_API.c: - Fix bug #26543 - check parent:: and self:: in class names - - * zend_execute.c - zend_object_handlers.c: - Bug #24608 - fix interaction between __accessors and get_property_ptr - -2004-01-03 Derick Rethans - - * zend.c - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_reflection_api.c: - - Fixed var_export() to show public, protected and private modifiers - properly. - - Exported (un)mangle_property_name. - -2004-01-02 Andrei Zmievski - - * zend_default_classes.c: - Do not show exception message if it's empty. - - -2003-12-31 Andrei Zmievski - - * zend_default_classes.c: - Make default message look better. - -2003-12-30 Andi Gutmans - - * ZEND_CHANGES: - - Fix typos - -2003-12-30 Marcus Boerger - - * ZEND_CHANGES: - Update - -2003-12-30 Ilia Alshanetsky - - * tests/bug26696.phpt: - Added test case for bug #26696. - -2003-12-29 Marcus Boerger - - * zend_execute.c: - Fix (string) conversion - - * zend.c: - Add missing notice - - * zend_execute_API.c: - Fix __autoload() with derived classes - -2003-12-28 Marcus Boerger - - * zend_API.c: - WS - - * zend_API.h - zend_compile.c: - Fix order of class_entry member initialization (needed for example for DOM) - -2003-12-27 Marcus Boerger - - * zend_language_parser.y: - Fixed bug #26065 (Crash when nesting classes) - - * tests/bug26698.phpt: - Add new test - - * zend_objects.c: - Simplify - - * zend_object_handlers.c: - Fix __tostring() and concatenation - -2003-12-25 Marcus Boerger - - * zend_execute.c - zend_execute.c: - Fix warning - -2003-12-25 Ilia Alshanetsky - - * zend_highlight.c: - Fixed Bug #26703 (Certain characters inside strings incorrectly treated as - keywords). Original patch by vrana@php.net. - -2003-12-23 Marcus Boerger - - * zend.c - zend_execute_API.c - zend_globals.h - tests/bug26697.phpt: - Fixed bug #26697 (calling class_exists on a nonexistent class in __autoload - results in segfault). - -2003-12-22 Marcus Boerger - - * tests/bug26229.phpt - tests/bug26695.phpt: - Add more tests - - * tests/bug24884.phpt - tests/bug26166.phpt: - Fix tests now that class names are shown in correct casing - - * zend_compile.c: - Preserve class name casing. - - * zend_reflection_api.c: - Fixed bug #26695 (Reflection API does not recognize mixed-case class hints) - - * zend_object_handlers.c: - Fixed bug #26675 (Segfault on ArrayAccess use) - Update NEWS - -2003-12-22 Wez Furlong - - * zend_API.c - zend_API.h - zend_object_handlers.c - zend_object_handlers.h: - export these symbols for use by SPL as a shared extension - -2003-12-19 Andi Gutmans - - * (php_5_0_0b3RC2) - zend_language_parser.y: - - Nuke another rule (thanks to Jan for noticing this) - -2003-12-19 Dmitry Stogov - - * (php_5_0_0b3RC2) - zend.c: - Bug #25547 (error_handler and array index with function call) was fixed - tests/lang/bug25547.phpt - -2003-12-19 Andi Gutmans - - * zend_language_parser.y: - - Nuke unused code - -2003-12-19 Dmitry Stogov - - * (php_5_0_0b3RC2) - zend_execute.c: - Error reporting on unset string offset was added (Bug #24773 - Zend/tests/bug24773.phpt) - - * zend_execute.c: - Assign_op operators (+=) were fixed for elements of overloaded objects - -2003-12-18 Andi Gutmans - - * zend_execute.c: - - Nuke C++ comment - - * zend_execute.c: - - Revert patch 1.566 - -2003-12-18 Marcus Boerger - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Fixed bug #24837 Incorrect behaviour of PPP using foreach. - -2003-12-17 Zeev Suraski - - * (php_5_0_0b3RC1) - zend_execute.c: - This part of the if was necessary after all. - Refix bug #22510 - -2003-12-17 Dmitry Stogov - - * (php_5_0_0b3RC1) - zend_execute_API.c: - -** empty log message *** - - * (php_5_0_0b3RC1) - zend_compile.c: - Dynamic function call from object's property was fixed - (See "tests/lang/bug24926.phpt" and "tests/lang/bug25652.phpt") - - * zend_execute_API.c: - Access to globals/autoglobals from class __destructor was fixed. - (see "tests/lang/bug24908.phpt" and - "tests/classes/destructor_and_globals.phpt") - -2003-12-16 Sebastian Bergmann - - * zend_compile.h - zend_object_handlers.h - zend_stream.h: - Sync: Export externally used functions. - -2003-12-16 Stanislav Malyshev - - * zend_compile.c: - export class initialization function - - * zend_object_handlers.c: - export externally used functions - - * zend_stream.c: - export function - -2003-12-15 Marcus Boerger - - * zend.c - zend_object_handlers.c - zend_object_handlers.h: - Reenable __tostring() magic for print,echo,concatenation,function naming... - but not for other internal things. - -2003-12-15 Jani Taskinen - - * zend_execute.c: - ws + cs (no c++ comments in c code) - -2003-12-15 Dmitry Stogov - - * zend_execute.c: - Bug #24773 was fixed (Zend/tests/bug24773.phpt) - Assign_op operators (+=) were fixed for elements of overloaded objects - Memory leaks during accessing ptoperies/elements of overloaded objects - were fixed - - * zend_execute_API.c - zend_reflection_api.c: - Memory corruptions were fixed in zend_str_tolower_copy() - -2003-12-14 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h: - Fix behavior of return-by-reference functions. Remove erroneous warnings, - add E_STRICT warnings in case you return something by reference that - you're - not supposed to (anything that's not a variable, or a return-value of a - function that returned by reference). - - * zend.h - zend_execute.c - zend_execute.h: - Some cleanup - -2003-12-13 Moriyoshi Koizumi - - * zend_operators.c: - Fixes for POSIX compliancy. - -2003-12-12 Marcus Boerger - - * zend.c: - Free is needed in non ZTS too - - * zend.c: - Fix memleaks in ZTS mode - - * zend.c: - Fix memleaks - -2003-12-12 Ilia Alshanetsky - - * zend_constants.c: - Do not copy extra byte. - -2003-12-11 Ilia Alshanetsky - - * zend.h: - Fixed extra byte allocation for TRUE/FALSE/ZEND_THREAD_SAFE/NULL constants. - -2003-12-11 Marcus Boerger - - * zend_execute_API.c: - Bugfix: #26591 [NEW]: "__autoload threw an exception" during an uncaught - Exception - -2003-12-11 Andi Gutmans - - * zend_execute.c: - - Refix bug #24773 - -2003-12-11 Marcus Boerger - - * zend_object_handlers.c: - Handle getter failure and allow to bypass thrown exceptions. - - * zend_execute.c: - read_dimension() handler might return 0, handle this. - -2003-12-10 Marcus Boerger - - * zend_execute_API.c: - Do not double copy the string - -2003-12-09 Jani Taskinen - - * zend_operators.c - zend_operators.h: - - Brought ext/bcmath to the new millennium - -2003-12-09 Andi Gutmans - - * zend_constants.c: - - Fix overallocation (thanks to Ilia) - -2003-12-08 Derick Rethans - - * zend_builtin_functions.c: - - Make it compile again - -2003-12-07 Stanislav Malyshev - - * zend_builtin_functions.c: - Apply Andrey Hristov's patch adding get_declared_interfaces() - -2003-12-06 Marcus Boerger - - * zend_compile.c: - This test is against interfaces not abstract classes. - - * zend_default_classes.c: - Show the exception message again after __toString() magic has been dropped. - -2003-12-05 Andi Gutmans - - * zend_compile.c - zend_execute.c: - - Remove two unneeded convert_to_string() (found by Marcus) - - Change illegal use of string offset to E_ERROR - -2003-12-05 Ilia Alshanetsky - - * zend_default_classes.c: - Fixed crash demonstrated with ext/dom/tests/dom003.phpt test case. - -2003-12-04 Moriyoshi Koizumi - - * zend_execute.c: - Revert crap. - - * zend_execute.c: - Raise error in case dereference is performed on a scalar value. - -2003-12-03 Ilia Alshanetsky - - * tests/bug24773.phpt: - Test case for bug #24773. - -2003-12-03 Moriyoshi Koizumi - - * zend_execute.c: - This kind of error should be caught. (suggested by Andi, thanks) - - * zend_execute.c: - Fix bug #24773 (unset()ing string offsets crashes PHP) - -2003-12-03 Derick Rethans - - * zend_execute.c: - - Remove newline from error message - -2003-12-02 Marcus Boerger - - * zend_object_handlers.c: - Remove automatic call to __toString() since it is supposed to cause too - much trouble. See discussion on the mailing list. - -2003-12-02 Andi Gutmans - - * zend_API.c - zend_operators.c: - - Revert the revert of these patches. This overloading can only be used - - by C extensions such as SimpleXML and *NOT* PHP code. Reasons given - - on the mailing list and problem with reentrancy inside the opcodes. - - * zend_compile.c: - - Fix for bug #26182 - - * zend_errors.h: - - Don't include E_STRICT in E_ALL. - -2003-12-02 Marcus Boerger - - * zend_API.h: - Free the zval container only if it should be freed and was not copied. - -2003-12-01 Andi Gutmans - - * zend_execute.c: - - Change to E_STRICT so as not to break existing scripts. - - Thanks Edin - - * zend_builtin_functions.c: - - Nuke property_exists(). We need to fix isset() and this is already - - supported in reflection API. In any case, it's best not to add new - - functions in the general namespace except for keeping engine consistency - (which would have been true in this case) - - * zend_API.c: - - Revert auto-conversion in parameter API - - * zend_operators.c: - - Don't automatically call __toString() in convert_to_string_ex(). - - use __toString() in your code. - - Keep the auto-case in make_printable_zval. - -2003-11-30 Marcus Boerger - - * zend_default_classes.c: - Check return value of exception::__tostring() - - * tests/bug20240.phpt: - Fix test - -2003-11-29 Marcus Boerger - - * zend_compile.c - zend_iterators.c: - Fix memleak - -2003-11-29 Ilia Alshanetsky - - * zend_highlight.c - zend_language_scanner.l: - Fixed bug #26463 (Incorrect handling of semicolons after heredoc) - -2003-11-29 Marcus Boerger - - * zend_API.h: - This takes the address of a zval ptr - - * zend_API.h: - Add macros to return values of other zvals. - This is needed because one cannot use REPLACE_ZVAL_VALUE with - return_value. - -2003-11-29 Ilia Alshanetsky - - * zend_execute.c: - Restore original patch for bug #26281. - - -2003-11-29 Marcus Boerger - - * zend_compile.c: - Revert accidential commit until decision - - * zend_compile.c - zend_default_classes.c: - Make exception code more robust: - - Fix error in calculation of trace-string length - - Allow to overload __strostring() and make it work for uncaught - exceptions - - Show exception thrown while displaying exceptions - -2003-11-28 Ilia Alshanetsky - - * zend_API.c: - Add removed lcname, it is still needed. - -2003-11-27 Marcus Boerger - - * zend_API.c: - Convert objects to string if string is required by newer parameter parsing - since we do this for older parameter parsing does so too. - - * zend_object_handlers.c: - The macro REPLACE_ZVAL_VALUE cannot be used since we only have zval * - writeobj. to allow it the api needs to be changed to zval **writeobj. - - * zend_builtin_functions.c: - Add a support function to check for property existance which is different - from checking a property from being empty/set. - Update test #26182. - -2003-11-24 Marcus Boerger - - * zend_execute.c - zend_interfaces.c - zend_interfaces.h - zend_object_handlers.c - zend_operators.c - zend_operators.h: - Add new interface ArrayAccess to use objects as Arrays - -2003-11-24 Andi Gutmans - - * zend_constants.c: - - Fix newly introduced bug which stopped class constants from working. - - Thanks to Jan Lehnardt for reporting it. - -2003-11-24 Sebastian Bergmann - - * RFCs/004.txt: - No longer needed. - -2003-11-24 Andi Gutmans - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_reflection_api.c: - - Fix __autoload() to preserve class case. - - Heads up, this patch might break stuff so please let me know if you - - bump into any problems. - -2003-11-23 Andi Gutmans - - * zend_reflection_api.c: - - Allocation optimizations by Timm Friebe - -2003-11-21 Ilia Alshanetsky - - * zend_execute.c: - Cleaner patch for bug #26281. - -2003-11-19 Ilia Alshanetsky - - * zend_execute.c - tests/bug26281.phpt: - Possible fix for bug #26281 & test case. - -2003-11-18 Marcus Boerger - - * zend_API.h: - Add method alias macro - -2003-11-18 Andi Gutmans - - * zend.c - zend_builtin_functions.c - zend_constants.c - zend_errors.h - zend_language_parser.y: - - Add E_STRICT, to be used to warn purists (like Jani :) - -2003-11-18 Marcus Boerger - - * zend_compile.c: - Backpatch the correct opcode for list(), property overloading needs more - opcodes (Bugfix #26257). - - * zend_interfaces.c: - Use correct order - - * zend_interfaces.c: - Use correct macro/function - -2003-11-17 Marcus Boerger - - * zend_interfaces.c: - Correct destruction - -2003-11-13 Moriyoshi Koizumi - - * zend_operators.c: - Bugfix #26156 (REPLACE_ZVAL_VALUE works on uninit stack-based zvals) - -2003-11-13 Marcus Boerger - - * ZEND_CHANGES - zend_interfaces.c: - IteratorAggregate::getIterator() cannot return anythingy else than objects - -2003-11-13 Andi Gutmans - - * zend_compile.c: - - Make sure internal clasess are malloced - -2003-11-10 Marcus Boerger - - * zend_iterators.c: - Don't use zend_class_entry indirection - - * zend_builtin_functions.c: - Bugfix #26010 (Bug on get_object_vars() function) - - * zend_object_handlers.c: - Correct default handlers - - * zend_iterators.c: - Need to update iterators handler table too. - - * zend_execute.c - zend_object_handlers.c: - Fix those warnings - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - Split isset/isempty for object property and object dimension hooking. - - * zend_interfaces.c: - Little iterator improvement: ability to store index in iterator - -2003-11-08 Marcus Boerger - - * zend_reflection_api.c: - Add method reflection_class::implementsInterface() - Allow string & reflection_class in isSubclassOf() - - * zend_reflection_api.c: - Fix reflection_class::isSubclassOf() - - * zend.c - zend_object_handlers.c - zend_operators.c - tests/bug26166.phpt: - Handle exceptions in casting more gracefully. - This fixes bug #26166 - -2003-11-07 Marcus Boerger - - * zend_execute_API.c: - Make __autoload() faster - - * zend_execute.c - zend_iterators.h: - Update Iterators: Call next at the correct point in time. - - * zend_compile.c: - Add missing initialization. - - * zend_interfaces.h: - Make these class entries available for inheriting classes - -2003-11-06 Ilia Alshanetsky - - * zend_operators.c: - Fixed bug #26148 (Print the notice before modifying variable on type - mismatch). - - - Patch by: morten-bugs dot php dot net at afdelingp dot dk - -2003-11-04 Marcus Boerger - - * zend_execute.c - zend_interfaces.c: - Prevent some SEGV's when Exceptions are thorown inside iterators. - - * zend_builtin_functions.c: - Removedouble efree call - -2003-11-04 Moriyoshi Koizumi - - * zend_object_handlers.c: - __tostring() handler should be binary-safe - - * tests/bug26010.phpt: - Fix one more test - -2003-11-04 Stanislav Malyshev - - * Makefile.am: - add zend_iterators.c zend_interfaces.c to make - -2003-10-31 Moriyoshi Koizumi - - * tests/bug26010.phpt: - Add test case for bug #26010 - -2003-10-30 Stanislav Malyshev - - * zend_compile.c: - make CATCH opcode use "class" T like other opcodes do - via IS_CONST - -2003-10-30 Andi Gutmans - - * (php_5_0_0b2) - ZEND_CHANGES: - - Beta 2 - -2003-10-29 Moriyoshi Koizumi - - * zend_operators.h: - Use pretty macro instead. - -2003-10-28 Andi Gutmans - - * zend_language_parser.y: - - Head up! I'm reverting the patch which allows for expressions in constant - - declerations. Allowing the access of other constants in this code is - - flawed. We are reverting back to PHP 4's static scalars. - - Don't worry if you get the following msg when compiling: - - "zend_language_parser.y contains 3 useless nonterminals and 22 useless - rules" - - I didn't nuke the code in case we have some brilliant ideas after beta 2 - -2003-10-28 Marcus Boerger - - * zend_interfaces.c: - Give some freedon to c iterators but not in userspace. - -2003-10-28 Shane Caraveo - - * zend_compile.c: - fix crash in do_implement_interface when compiling - pear/PHPUnit/Framework/TestCase.php line 63 - while only interface_gets_implemented is the issue in this instance, both - these vars were unitialized, causing potential other issues - -2003-10-25 Marcus Boerger - - * zend_API.c - zend_API.h: - Add zend_make_callable() which allows to make zval's callable zval's. - At the moment this function only converts strings of the form - class::method - to an array(class,method). - - * zend_default_classes.c - zend_reflection_api.c: - This forces a better error message for non working clone calls. - - * zend_default_classes.c: - And use things to throw an exception here - - * zend_default_classes.c: - You shall not clone Exception instances - - * zend_reflection_api.c: - You shall not clone reflection_xx instances - - * ZEND_CHANGES - ZEND_CHANGES: - Update - -2003-10-25 Sebastian Bergmann - - * ZEND_CHANGES: - Fugbix typo. - - * ZEND_CHANGES: - s/Throwable/Printable: Exception has become an internal class since I - initially documented interfaces. - -2003-10-24 Andi Gutmans - - * ZEND_CHANGES: - - Fix typo - -2003-10-24 Marcus Boerger - - * zend_API.c - zend_execute_API.c: - Revert accidental commit - - * ZEND_CHANGES - zend_API.c - zend_execute_API.c: - Zend/ZEND_CHANGES - -2003-10-23 Sebastian Bergmann - - * Zend.dsp - ZendTS.dsp: - Add zend_interfaces.{c|h}. - -2003-10-22 Ilia Alshanetsky - - * zend.c: - Fixed bug #25922 (Crash in error handler when 5th argument is modified). - -2003-10-22 Marcus Boerger - - * zend_default_classes.c - zend_interfaces.c - zend_interfaces.h: - Impement userspace iterator interfaces and tests. See tests for details - on the names. - - * zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c: - Expand Interface C API. - In short: zend_class_entry->interface_gets_implemented() allows to modify - the class entry of a class when an interface gets implemented. - - * zend_default_classes.c: - The string conversion method should be named __toString() - -2003-10-21 Marcus Boerger - - * ZEND_CHANGES: - Make this clear - -2003-10-20 Andi Gutmans - - * ZEND_CHANGES: - - Add comment from Timm - -2003-10-20 Marcus Boerger - - * ZEND_CHANGES - ZEND_CHANGES: - Update - -2003-10-19 Andi Gutmans - - * zend_language_parser.y: - - Nuke const in function parameters. I just can't remember why this exists - - and it seems no one else remembers either. It has no semantic meaning. - -2003-10-18 Marcus Boerger - - * zend.h - zend_API.h - zend_compile.c - zend_iterators.h: - Fix class/iterator relationship & handling - - * zend_iterators.c: - Fallback to old behavior until we have a default iterator that respects - visibility we do the array trick. - - * zend_iterators.h: - Change order: Optional rewind() to end of structure - -2003-10-17 Marcus Boerger - - * ZendTS.dsp: - WS - - * zend_reflection_api.c: - Show if a class/object is iterateable - - * ZendTS.dsp - zend.h - zend_API.h - zend_default_classes.c - zend_execute.c - zend_iterators.c - zend_iterators.h: - Added c-api for iterators - - * zend_reflection_api.c: - Fix showing final/abstract for classes - -2003-10-17 Ilia Alshanetsky - - * zend_ini_parser.y: - Fixed formatting issue. - - * zend_alloc.c: - Fixed if() condition. - -2003-10-15 Marcus Boerger - - * zend_API.c - zend_API.h: - Add oo support function zend_class_implements() - - * zend_default_classes.c: - Fix cast function - -2003-10-14 Andi Gutmans - - * zend_mm.c: - - Argh, the suffering copy&paste can cause - - * zend_alloc.c: - - Fix compile problem. - - * zend_mm.c: - - Fix the fix by making sure the new block is in the right free list. - -2003-10-14 Stanislav Malyshev - - * zend_execute_API.c: - The freed one is a hashtable - may matter if Hashtables are allocated - differently - -2003-10-14 Andi Gutmans - - * zend_mm.c: - - Support merging free block which was created by reallocing to smaller - - size. This should fix some performance issues. This code is still not - - thoroughly tested. - -2003-10-09 Zeev Suraski - - * zend_compile.c - zend_execute.c - zend_language_parser.y: - Allow foo::$bar() - -2003-10-07 Rasmus Lerdorf - - * Zend.m4: - MFB bison configure test fix - -2003-10-07 Zeev Suraski - - * zend_execute.c: - Fix bug #17997 (Warning when switch & reference are combined) - - * zend_ini_parser.y: - Fix the fix :) - Not thoroughly tested, but appears to work fine - -2003-10-07 Marcus Boerger - - * zend_ini_parser.y: - Bugfix #25770 Segfault with PHP and bison 1.875 - -2003-10-05 Zeev Suraski - - * zend_object_handlers.c: - Remove unused callback - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - Remove redundant callback, simplify API - -2003-10-05 Shane Caraveo - - * (BEFORE_HANDLERS_RESHUFFLE) - zend_API.h: - this little piggy broke lots of things...eg. _function_check_flag in - reflection api. - -2003-10-03 Moriyoshi Koizumi - - * zend_API.c: - Fixed bug #24766 (strange result array from unpack()) - - * zend.h: - Bug #25738 (alloca() related problems on the Darwin platform) - - * zend_API.h: - Ensure lval to have a *boolean* value. - -2003-10-03 Jani Taskinen - - * Zend.m4: - Aligned configure help texts. - -2003-09-30 Moriyoshi Koizumi - - * zend_compile.c: - Remove redundant '\n' - -2003-09-26 Hartmut Holzgraefe - - * zend_alloc.c: - signed/unsigned compiler warning fixes - -2003-09-25 Georg Richter - - * zend_alloc.c: - fixed compiler warning - removed dead code - - * zend_hash.h: - changed ulong to long to avoid compiler warnings (comparison between signed - and unsigned) - -2003-09-22 Ilia Alshanetsky - - * zend.c - zend_language_scanner.l: - Added missing format. - -2003-09-20 Marcus Boerger - - * zend_reflection_api.c: - Add public array Reflection_Class::getDefaultProperties() - -2003-09-18 Marcus Boerger - - * zend_builtin_functions.c: - Nuke vars no longer needed - - * zend_builtin_functions.c - zend_reflection_api.c: - Go with studlyCaps - - * zend_reflection_api.c: - Change tostring() into __toString() to match method name used in casting. - - * zend.c - zend_operators.c: - Fallback to default behaviour for unsupported object type conversions - - * zend_object_handlers.c - zend_object_handlers.h - zend_operators.c: - - Allow partial type conversion support for objects. - - Add support for object to string conversion from userspace by method - __toString() and add a test. - - * zend_API.c: - Add missing check - -2003-09-17 Marcus Boerger - - * zend_compile.c - zend_execute.c: - Show name of missing function as typed - - * zend_default_classes.c: - Use studlyCaps in exception class - - * zend_compile.c: - Go with studlyCaps in error messages/backtrace/reflection output - -2003-09-16 Marcus Boerger - - * zend_reflection_api.c: - - Make it clear whether it is an interface or a class - - Fix static properties - -2003-09-15 Marcus Boerger - - * zend_execute.c: - Revert - need to look for a better solution - - * zend_execute.c: - Bugfix #25547 - -2003-09-15 Zeev Suraski - - * zend_operators.c: - Simplify / fix - -2003-09-14 Marcus Boerger - - * zend.c: - Bugfix #25335 - -2003-09-14 Zeev Suraski - - * zend_operators.c: - Commit 64-bit fixes to the standard operators - by Ard Biesheuvel (abies@php.net) - -2003-09-14 Marcus Boerger - - * zend.h: - Bugfix #25528 (by Ard Biesheuvel) - -2003-09-13 Marcus Boerger - - * zend_alloc.c: - Fix warnings - -2003-09-11 Stanislav Malyshev - - * tests/dtor_scope.phpt: - add test - - * zend_execute_API.c: - ws - - * zend_execute_API.c: - Use scope from method, not from object - -2003-09-11 Marcus Boerger - - * zend_default_classes.c: - Use type instead of constant - -2003-09-08 Marcus Boerger - - * zend_compile.c: - Fix property inheritance where a derived class inherits a public property - and owns it as an implicit public property already (noticed by Brad). - - * zend.c: - Fix registering/derigistering of stdClass in ZTS and NON ZTS mode - -2003-09-07 Marcus Boerger - - * zend_execute.c: - Fix foreach() called with non array - -2003-09-07 Stanislav Malyshev - - * Zend.m4: - check for mach-o/dyld.h - needed for non-PHP ZE build - -2003-09-06 Marcus Boerger - - * zend_default_classes.c: - Disallow to changing the backtrace - - * zend_reflection_api.c: - Add missing newline if no static methods are available - - * zend_reflection_api.c: - - Internal functions shall be static - - Fix more nesting - - * zend_reflection_api.c: - Fix logic - - * zend_reflection_api.c: - - Fix CS: {{{ / }}} - - Fix static reflection_*::export() - - Add class reflection_object which allows to show dynamic properties - - * zend_reflection_api.c: - Use %s where it makes more sense - -2003-09-05 Marcus Boerger - - * zend_reflection_api.c: - Simplify reflection_property::__constructor() and fix property factory - - * zend_reflection_api.c: - - Don't use resorved words as variable names. - - Improve several exception messages. - - Fix Reflection_Property::_construct() / getDeclaringClass() - - * zend_reflection_api.c: - Fix reflection_api::__construct() (noticed by Andrey) - - * zend_default_classes.c: - Provide string casting for exceptions by calling toString() - -2003-09-04 Marcus Boerger - - * zend_API.c - zend_execute.c - zend_object_handlers.c: - Tests show updating consts must happen once at runtime (revert - optimization). - Add tests for static properties. - - * zend_reflection_api.c: - Add reflection_class::getstaticproerties() - -2003-09-03 Marcus Boerger - - * zend_compile.c: - Partly revert and reintroduce hash table entries for the ctor. - - * zend_compile.c: - Nuke unused variable, too - - * zend_compile.c: - - Inheritance applies to __clone() too. - - No need to add additional functions for the constructor. - The handler uses the pointer as intended and doesn't look the the name. - - * zend_compile.c: - Cannot turn a static property into a non static one and vice versa - - * zend_API.c - zend_API.h - zend_compile.c - zend_default_classes.c: - Fix handling of static properties initialized to arrays - - * zend_compile.c: - Add missing error messages when violating static property inheritance - rules. - - * zend_API.c - zend_compile.c - zend_execute.c - zend_object_handlers.c: - Fix static properties. - - * zend_compile.c: - Allow redeclareing a protected property as public. - -2003-09-03 Zeev Suraski - - * zend_compile.c: - Revert bogus patch - One must *never* use E_CORE_* error levels! - -2003-09-03 Marcus Boerger - - * zend_reflection_api.c: - Clearly distinguish between Const, Static and Other members. - -2003-09-02 Marcus Boerger - - * zend_compile.c: - Fix error messages - - * zend_API.c: - Allow redeclaring of protected properties as public (for internal classes). - - * zend_reflection_api.c: - Use appropriate function for property name unmangling. - - * zend_reflection_api.c: - Make these static as noticed by Andrey - - * zend_execute.c - zend_object_handlers.c - zend_objects.c: - Synch/Unify error messages related to function/method calls - - * zend_compile.c: - Fix error level - - * zend_API.c - zend_compile.c: - Currently we cannot support static ctor/dtor - - * zend_reflection_api.c: - These are implicit properties as denoted by the flag. Dynamic properties - only - exist in one single object and currently reflection api is not capable of - showing those. - -2003-08-31 Marcus Boerger - - * zend_reflection_api.c: - Don't repeat first const count(consts) time - - * zend_reflection_api.c: - Beautify output - - * zend_reflection_api.c: - Add reflection_parameters, patch by Timm Friebe - - * zend_default_classes.c: - Excluded chars < 32 when displaying string parameters that would obliterate - output. - -2003-08-31 Zeev Suraski - - * zend_arg_defs.c - zend_builtin_functions.c - zend_modules.h: - Attempt at fixing the linkage problem in Win32 - -2003-08-31 Marcus Boerger - - * zend_execute.c: - Synch error message with other one to fix tests - - * zend_reflection_api.c: - Check whether we may access tat union - - * zend.c: - Revisited: Replace the non portable code by spprintf - - * zend_reflection_api.c: - Using zend_spprintf should be faster here - - * zend.c - zend.h - zend_default_classes.c: - Make vspprintf available as zend utility function. Use it in exception - output. - -2003-08-30 Marcus Boerger - - * zend_default_classes.c: - Actually fetch the parameter - - * zend_default_classes.c - zend_default_classes.h - zend_execute.c - zend_reflection_api.c: - - Calling abstract methods should be a error for consistency reason. - - So in reflection_api we use the reflection_exception again. - -2003-08-30 Andi Gutmans - - * zend_default_classes.c: - - PLEASE stop commiting ^M's - -2003-08-30 Marcus Boerger - - * zend_default_classes.c: - Even though it is ignored this should be correct - - * zend_default_classes.c: - Add frame numer and finally display stack trace in the message. - - * zend_default_classes.c: - Add exception::traceAsString() and exception::toString() - - * zend_reflection_api.c: - fci.function_table & fci.function_name are not needed since we use - zend_fcall_info_cache - - * zend_reflection_api.c: - Be precise - - * zend_reflection_api.c: - Actually using fcc would be a good idea - - * zend_default_classes.c - zend_default_classes.h - zend_execute.c: - - The compiler can't detect all abstract function calls so we need to - check. - - * zend_default_classes.c: - Make those final (see comment) - -2003-08-29 Marcus Boerger - - * zend_API.c - zend_API.h: - - Add zend_merge_properties() which is designed to serve *_fetch_object(). - - Explain drawbacks of object_and_properties_init and - zend_merge_properties. - - * zend_reflection_api.c: - - Use zend_fcall_info_cache in invoke() to improve speed. - -2003-08-29 Zeev Suraski - - * zend_compile.c: - Fix a problem in implicit public properties and inheritance - -2003-08-29 Sascha Schumann - - * zend_hash.c: - improve a number of zend_debug format strings - -2003-08-29 Marcus Boerger - - * zend_builtin_functions.c - zend_builtin_functions.h - zend_default_classes.c: - Need to tell zend_fetch_debug_backtrace() whether to skip top function or - not. - -2003-08-28 Marcus Boerger - - * zend_default_classes.c: - Add public read access to protected - - * zend_default_classes.c - zend_default_classes.h: - Add zend_throw_exception_ex() which allows to format exception messages. - - * zend.c: - Classe tables work this way - - * zend_builtin_functions.c - zend_builtin_functions.h - zend_default_classes.c: - - Split debug_backtrace() into lowlevel c function and php function wrapper - - Add trace property to default method based on new - zend_fetch_debug_backtrace - -2003-08-28 Sascha Schumann - - * zend.h: - older gccs don't understand attribute((format)) on function pointers - - * zend.h: - ZEND_GCC_VERSION should always be defined to a number so we can use - simple comparisons all the time. - - * zend.h - zend_alloc.c - zend_builtin_functions.c - zend_compile.c - zend_execute.c: - Add format attribute to a number of functions - - Kill a few warnings - - * zend.h - zend_alloc.h: - cleanup & centralize ZEND_GCC_VERSION and ZEND_ATTRIBUTE_MALLOC so that - they can be used by downstream applications - - * zend_alloc.h: - Enable attribute((malloc)) for GCC 2.96 - - * zend_alloc.h: - GCC 2 does not know about malloc yet. - - * zend_alloc.h: - provide attribute((malloc)) where appropiate - -2003-08-27 Marcus Boerger - - * zend_reflection_api.c: - Nuke unused variable - - * zend_reflection_api.c: - Fix reflection_class::newInstance() - -2003-08-25 Jani Taskinen - - * zend.h: - - Fixed bug #25240 (spaces before pre-processor directives) - -2003-08-24 Marcus Boerger - - * zend_API.c: - Add missing check - - * zend_API.c: - Fix memory source of string duplication for non internal properties - - * zend_API.c - zend_API.h - zend_compile.c - zend_default_classes.c - zend_execute_API.c - zend_variables.c - zend_variables.h: - - Provide appropriate way to destroy internal zval's. - - Allow internal zval's of type string and disallow complex types. - - Define the default string for extensions at class level instead of ctor. - - * zend_API.h - zend_compile.h - zend_reflection_api.c: - Don't identify alias'ed functions - -2003-08-24 Zeev Suraski - - * zend_API.c: - Use ""'s if you want empty strings. We want to crash on errors. - - * zend_compile.c: - Use pemalloc() - -2003-08-24 Marcus Boerger - - * zend_API.c: - Allow NULL, too - -2003-08-24 Zeev Suraski - - * zend_API.c: - Get rid of more ^M's - Marcus, please check your CVS client! - - * zend_default_classes.c: - Get rid of more ^M's - - * zend_compile.c: - line endings fix - - * zend_execute.c: - Never, ever, overwrite the refcount element of a connected zval! - -2003-08-24 Marcus Boerger - - * zend_reflection_api.c: - Add dedicated reflection_exception - - * zend_default_classes.c - zend_default_classes.h: - Allow to throw instances of classes derived from exception - - * zend.c - zend_default_classes.c - zend_default_classes.h - zend_execute.h - zend_execute_API.c: - - Provide a unified way to display uncaught exceptions, which shows - file/line/message info if possible. - - Add zend_eval_string_ex() to be able to handle exceptions in eval'd - code. - - Use above function to fix memleaks in CLI. - - * zend_reflection_api.c: - Make invoke() work - - * zend_reflection_api.c: - zend_parse_parameters 'O' works the way we need here - - * zend_reflection_api.c: - Not needed - - * zend_default_classes.c: - Make use method macros - - * zend_API.h: - One of PPP is needed, too - - * zend_reflection_api.c: - - Add Reflection_Function::isAlias - - Use ZEND_ME/ZEND_METHOD - - Fix static entries - - * zend_API.h - zend_compile.h: - - Add fn_flag ZEND_ACC_ALIAS - - Unify way of function_entry generation by new macro ZEND_FENTRY - - * zend_API.c: - Fix fn_flags handling - - * zend_API.c - zend_API.h - zend_default_classes.c: - Add property read code and use that in default exception class - -2003-08-23 Marcus Boerger - - * zend_default_classes.c - zend_default_classes.h - zend_reflection_api.c: - Allow zend_throw_exception() to also set the exception code - - * zend_default_classes.c: - Exception has 4 protected default properties (message,code,file,line). - They are all initialized at c-level constructor correctly. - - * zend_API.c - zend_API.h - zend_compile.c - zend_compile.h: - Internal classes can now have default properties. - - * zend_reflection_api.c: - Show ctor/dtor information and those don't return anything - - * zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c: - - Flag ctor/dtor methods - - Use this to prevent memleaks when an exception gets thrown in ctors. - - * zend_default_classes.c: - Make exception code more robust - -2003-08-22 Ilia Alshanetsky - - * zend_builtin_functions.c - zend_constants.h: - Replace *magic number* with a much nicer define. - - * zend_builtin_functions.c: - Set 2147483647 as the module number of user defined constants - Fixed a few bugs and cleaned up get_defined_constants(). - -2003-08-21 Marcus Boerger - - * zend_default_classes.c - zend_default_classes.h - zend_reflection_api.c: - Add function 'zend_throw_exception(char *message, int duplicate - TSRMLS_DC);' - to provide an easy way to throw exceptions for extension developers. - - * zend_API.c: - If ce not given than any object would do - - * zend_API.c: - Paramspec 'O' / zend_parse_method_params(): only if given check the class - type - -2003-08-20 Zeev Suraski - - * zend_alloc.c: - adhere to silence - -2003-08-20 Marcus Boerger - - * zend_alloc.c: - Fix counting number of leaks - -2003-08-19 Wez Furlong - - * zend_execute.c: - fix build - -2003-08-18 Wez Furlong - - * zend_ini.h: - linkage for C++ - -2003-08-18 Zeev Suraski - - * ZendTS.dsp - zend_execute.c - zend_execute_locks.h: - Prevent access to internal engine functionality - - * zend.h - zend_alloc.c - zend_compile.h - zend_execute.c: - - Improve tracking - - Fix several overloading issues - - * zend_API.c - zend_alloc.h - zend_hash.c - zend_hash.h - zend_ts_hash.c - zend_ts_hash.c - zend_ts_hash.h - zend_ts_hash.h: - Improve tracking - - * zend_compile.c: - ws - -2003-08-17 Marcus Boerger - - * zend_API.h - zend_builtin_functions.c - zend_execute.c - zend_object_handlers.c - zend_operators.c - zend_reflection_api.c: - Fix warnings - -2003-08-17 Sascha Schumann - - * zend.h: - One bit fields need to be unsigned, otherwise there is no storage for - the sign bit - - "A signed bit field has a length of 1 bit." - - * zend_API.h: - explicitly cast size_t to zend_uint to avoid warnings on 64 bit platforms. - -2003-08-17 Marcus Boerger - - * zend_execute.c: - Remove unnecessary if - - * zend_execute.c: - Put the code where it belongs - fixes a warning and confusion - - * zend_compile.c - zend_execute.c: - Implement a TBD: JMP to the end of foreach - - * zend_compile.c: - WS - - * zend_API.c: - - Show class names in error messages when dealing with methods - - Mark class as abstract if it gets an abstract method - -2003-08-16 Marcus Boerger - - * zend_API.c - zend_API.h - zend_reflection_api.c: - Simplify abstract method declaration - - * zend_object_handlers.h: - WS - -2003-08-15 Sascha Schumann - - * zend_execute.c - zend_object_handlers.c: - Restrict scope of inline functions to compile unit - - Submitted by: Jason Greene - -2003-08-13 Marcus Boerger - - * zend_objects_API.c: - Add missing entry - - * zend_API.c: - - Show classes in case of methods - - Using sprintf here was a bad idea - -2003-08-12 Zeev Suraski - - * zend_hash.c: - Remove bogus patch - the number of elements is unrelated - -2003-08-12 Zeev Suraski - - * zend_hash.c: - Remove bogus patch - the number of elements is unrelated - -2003-08-12 Zeev Suraski - - * zend_hash.c: - Remove bogus patch - the number of elements is unrelated - -2003-08-12 Zeev Suraski - - * zend_hash.c: - Remove bogus patch - the number of elements is unrelated - -2003-08-12 Zeev Suraski - - * zend_hash.c: - Remove bogus patch - the number of elements is unrelated - -2003-08-11 Marcus Boerger - - * zend_hash.c - zend_hash.h: - Bugfix 21918 - -2003-08-11 Masaki Fujimoto - - * Zend.m4 - flex.skl - zend_compile.c - zend_globals.h - zend_highlight.c - zend_language_scanner.h - zend_language_scanner.l - zend_multibyte.c - zend_multibyte.h: - - added script encoding support to Zend Engine 2. - this enables ZE2 to gracefully parse scripts written in UTF-8 (with - BOM), - UTF-16, UTF-32, Shift_JIS, ISO-2022-JP etc... (when configured with - '--enable-zend-multibyte' and '--enable-mbstring') - -2003-08-10 Marcus Boerger - - * zend_compile.c: - Bugfix #24637 __destruct not called - -2003-08-09 Moriyoshi Koizumi - - * zend_compile.c: - Fix segfault when a referenced parameter is specified with typehint. - Result of the node will never be used because verify_instanceof handler - has - been eliminated. - -2003-08-09 Marcus Boerger - - * zend_objects.c: - Precise destructor errors - -2003-08-07 Moriyoshi Koizumi - - * tests/bug21478.phpt: - Add missing right parensis - -2003-08-07 Zeev Suraski - - * zend_execute_API.c: - Clarify use of original_function_state_ptr - -2003-08-07 Marcus Boerger - - * zend_execute_API.c: - - Fix warnings - - Fix code - -2003-08-06 Zeev Suraski - - * zend_execute_API.c: - clarify :) - -2003-08-05 Jani Taskinen - - * zend_execute_API.c: - Fix the build - -2003-08-05 Zeev Suraski - - * zend_API.h - zend_execute_API.c - zend_reflection_api.c: - Try to put an end to the endless number of call_user_function variants. - zend_call_function() now takes a structure that should contain all of the - necessary information. If further information is necessary in the future, - then we'll be able to add it without having to introduce a new function. - - As for caching - the 2nd, optional argument is a struct that can hold all - of the information that's necessary to invoke the function, including its - handler, scope and object it operates on (if any). Note that you may only - use a cache if the arguments you provide to zend_call_function() are - identical to the ones of the last call, except for the argument and return - value information. - - - The recently introduced fast_call_user_function() was removed - - I fixed most of the places that used fast_call_user_function() to use - caching - but there are still some that need to be fixed (XML and reflection) - -2003-08-05 Stanislav Malyshev - - * tests/bug24699.phpt: - fix syntax - - * zend_execute_API.c: - remove stack clean - it makes trouble - -2003-08-04 Marcus Boerger - - * zend_execute.c: - Fix ZTS - - * zend_execute_API.c: - Nuke unused variables - - * zend_reflection_api.c: - Add function/method parameter reflection - -2003-08-04 Ilia Alshanetsky - - * zend_execute_API.c - tests/bug23104.phpt: - Fixed bug #23104 (hash position of static arrays not being reset) - -2003-08-04 Stanislav Malyshev - - * zend_execute_API.c: - oops. forgot function - - * zend_execute_API.c: - fix crash #24842 - - * zend_compile.c: - fix leaks: bug #24831 - - * zend_execute.c: - use get_obj_zval_ptr - - * tests/bug24884.phpt: - add test - - * zend_execute.c: - Fix #24884 - clone $this - -2003-08-04 Zeev Suraski - - * zend_compile.c: - Simplify code using XOR - - * zend.h: - Add logical XOR, proves to be quite useful lately - - * zend_opcode.c: - This check shouldn't be necessary - -2003-08-03 Marcus Boerger - - * zend_opcode.c: - Fix crash - - * zend_compile.c: - Fix test and add missing initialization - -2003-08-03 Zeev Suraski - - * zend_API.c: - Ensure functions have a valid access level - - * zend_API.c: - Default to public - -2003-08-03 Marcus Boerger - - * zend_API.c: - Not needed, will be copied from ptr->flags later - - * zend_builtin_functions.c: - Add missing arg info - -2003-08-03 Moriyoshi Koizumi - - * tests/bug24635.phpt - tests/bug24699.phpt: - Style & WS fixes - -2003-08-03 Zeev Suraski - - * (BEFORE_ARG_INFO) - zend_API.c: - No need for this initialization - this function initializes all of the - elements of zend_internal_function - - * (BEFORE_ARG_INFO) - zend_execute.c: - Clean up. extended_value can only contain either ZEND_UNSET_DIM or - ZEND_UNSET_OBJ. - - * (BEFORE_ARG_INFO) - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c: - Generalize fetch_class - -2003-08-02 Marcus Boerger - - * zend_API.c: - Initialize all struct members: Necessary for reflection - - * zend_reflection_api.c: - Show interfaces - -2003-08-02 Wez Furlong - - * zend_API.c: - fix usage of instanceof here too - -2003-08-02 Marcus Boerger - - * zend_execute.c: - Fix warning - -2003-08-01 Wez Furlong - - * zend_API.c: - better fix... - - * zend_API.c: - Fix "O" format for zend_parse_parameters - -2003-07-31 Zeev Suraski - - * zend_API.c: - Use instanceof_function() - - * zend_compile.c - zend_execute.c: - Finish the array overloading patch - - * zend_execute.c: - Cleanup - -2003-07-31 Andi Gutmans - - * zend_hash.c: - - Fix logic. It was the wrong way around. - -2003-07-30 Andi Gutmans - - * zend_execute.c - zend_hash.c: - - Fix problem with hash when updating same bucket with data of different - sizes one after another. - - Fix number of arguments to read_dimension. - -2003-07-30 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_execute.c: - Get rid of an opcode - - * zend_compile.c - zend_execute.c: - Support overloading of $foo["bar"] += "baz" - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Improve array overloading - support unset($foo["bar"]) - - * zend_compile.h: - Remove garbage - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_compile.h - zend_modules.h: - Add exec_finished() callback for modules - this is the last place where the - modules may touch the symbol table reliably - -2003-07-29 Ilia Alshanetsky - - * tests/bug22836.phpt: - Test case for bug #22836. - -2003-07-29 Jani Taskinen - - * zend.c: - Remove the obfuscation caused by the double "#ifdef ZTS" - -2003-07-27 Stanislav Malyshev - - * zend_compile.c: - fix compare - - * zend_compile.c: - use zend_binary_strncasecmp - - * zend_execute_API.c: - change shutdown order so that dtors would coexist with object error - handlers - - * zend_execute.c: - clean the right one - - * zend_execute_API.c: - make shutdown more granular so in case some dtor goes ape we still - can shut down cleanly - - * zend_compile.c - zend_execute.c - zend_objects.c: - make clone and throw coexist peacefully - - * tests/bug24635.phpt - tests/bug24699.phpt: - add test - - * zend_execute.c: - fix #24635: clean hash before putting into cache - - * zend_language_scanner.l: - fix crash #24550 - - * zend_compile.c - zend_constants.c: - fix leaks with class constants (bug #24699) - - * zend_compile.c: - make __clone call case insensitive, just as other calls are - -2003-07-24 Jani Taskinen - - * tests/bug19859.phpt - tests/bug20240.phpt - tests/bug20242.phpt - tests/bug21478.phpt - tests/bug21888.phpt - tests/bug22725.phpt - tests/bug24436.phpt: - cleanup (CS+ws) - -2003-07-24 Zeev Suraski - - * tests/bug24436.phpt: - Fix expectations :) - - * zend_execute.c: - Fix logic and comments in ASSIGN_DIM - - * zend_compile.c: - Fix another HANDLE_NUMERIC bug. Looks like you opened Pandora's box, - Sterling ;) - - * zend_builtin_functions.c: - Fix each() binary safety for keys - - * zend_execute.c: - Fix assignments to numeric array indices - - * zend_compile.c: - Remove useless code - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - Support references in foreach() - Syntax: - foreach ($arr as &$val) - foreach ($arr as $key => &$val) - - * zend_execute.c: - Fix binary safety in foreach() keys (fixes bug #24783) - - * zend.c: - Make print_r() binary safe with keys - -2003-07-23 Stanislav Malyshev - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_opcode.c: - Remove namespace leftovers - -2003-07-23 Zeev Suraski - - * zend_hash.c - zend_hash.h: - Go back to ZE1-like code - -2003-07-23 Sebastian Bergmann - - * zend_reflection_api.c: - Fix segfault. Patch by Timm Friebe . - -2003-07-22 Marcus Boerger - - * zend_hash.h: - Fix for the moment - -2003-07-22 Zeev Suraski - - * zend_execute.c - zend_hash.c - zend_hash.h - zend_operators.c - zend_operators.h: - Improve infrastructure of numeric handling of elements in symbol tables. - - When you want to work with a symbol table, and you don't know whether you - have a numeric ("string that looks like a number") or a string element in - your hands, use zend_symtable_*() functions, in place of zend_hash_*() - functions. - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - Fix isset()/empty() for non-trivial object elements - (API change - read_property now accepts an extra element) - Fixes bug #24436 - -2003-07-21 Zeev Suraski - - * zend_object_handlers.c: - Fix bug #24499 - - * zend_execute.c: - Revert fix for #24729, and refix - -2003-07-21 Marcus Boerger - - * zend_execute.c: - Go with a better fix for #24729 - -2003-07-21 George Schlossnagle - - * zend_API.h: - reverted at Andi's request. replaced with more generic wrapper. - -2003-07-20 Marcus Boerger - - * zend_execute.c: - Bugfix #24729 = new ; causes crash when is not set - -2003-07-20 George Schlossnagle - - * zend_reflection_api.c: - should nt here - -2003-07-20 Marcus Boerger - - * zend_reflection_api.c: - Fix warnings and whitespace in output - - * zend_reflection_api.c: - Add support for instances in Reflection_Class. - -2003-07-20 George Schlossnagle - - * zend_reflection_api.c: - removed references to smart_str, replaced with private string management - function. When snprintf is integrated into the engine, string_printf - should be altered to use that. - -2003-07-20 Marcus Boerger - - * zend_objects_API.c: - More informative errors here and these are real core errors - - * zend_execute.c: - Fix uncloneable objetcs - -2003-07-20 George Schlossnagle - - * zend_reflection_api.c: - more of Timm's implementation. - -2003-07-20 Marcus Boerger - - * zend_hash.c - zend_hash.h: - Make it a macro - -2003-07-19 Marcus Boerger - - * zend_hash.c: - This is meant to be used in for(;has_more;next) - - * zend_hash.c - zend_hash.h: - Add missing function to ease implementations - -2003-07-19 Jani Taskinen - - * zend.h: - Fix the HPUX alloca fix as suggested by Sascha - -2003-07-19 Marcus Boerger - - * zend_objects.c - zend_objects.h: - Shuffle code to ease writing clone handlers - -2003-07-19 Andi Gutmans - - * zend.h: - - Don't use alloca on HP-UX (Moriyoshi Koizumi ) - -2003-07-16 Zeev Suraski - - * zend_compile.c: - Fix bug in the verification of interface-function implementation - - * zend_compile.c - zend_compile.h - zend_execute.c: - More cleanup for assign-op handling of objects - - * zend_alloc.c: - Fix warning - -2003-07-12 Andi Gutmans - - * zend_API.c: - - WS - -2003-07-11 Andi Gutmans - - * zend_API.c: - - Add support for Z in zend_parse_parameters(). It will allow the extension - - to retreive the zval **, thus allowing it to use the convert_to_*_ex() - - family of functions to do type conversions without effecting the value - in - - the engine itself. (Josh Fuhs ) - -2003-07-08 Zeev Suraski - - * zend_execute.c: - initial refactoring for assign-op handling of objects - -2003-07-07 Zeev Suraski - - * zend_API.c - zend_API.h - zend_compile.c - zend_compile.h: - Rework zend_do_declare_property and related code into one code base - - * zend_API.c: - Fix bug - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - Add get_dim callback - - * zend_execute.c: - Fix naming convention - -2003-07-07 Derick Rethans - - * zend_execute.c: - - Help Zeev fixing ghosts :) - -2003-07-07 Zeev Suraski - - * zend_object_handlers.c - zend_object_handlers.h: - whitespace - - * zend_objects_API.c: - Fix & whitespace - - * zend_object_handlers.c: - fixlet - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Initial support for overloading of array syntax for objects (very initial) - -2003-07-06 George Schlossnagle - - * zend_API.c - zend_API.h: - add convenience functions or adding class properties. Ok'd for commit by - Andi. - -2003-07-04 Andi Gutmans - - * zend_alloc.c - zend_mm.c - zend_mm.h: - - Add heap to memory manager. This should improve performance. - - Enabling it by default so that it gets tested. We should decide before - beta 2 if we want to revert back to malloc or not. - - Thanks to Sebastian for benchmarking it - -2003-07-04 Sebastian Bergmann - - * zend_reflection_api.c: - 2 * TSRMLS_FETCH() -> 1 * TSRMLS_DC - -2003-07-04 George Schlossnagle - - * zend_reflection_api.c: - ws fix - -2003-07-03 Marcus Boerger - - * zend_compile.c: - Allow final private methods - -2003-07-03 George Schlossnagle - - * zend_reflection_api.c: - win build fixes (Rob Richards) - - * zend_reflection_api.c: - can't forget Andrei - -2003-07-03 Stanislav Malyshev - - * zend_compile.c - zend_execute.c: - enable Classname() constructor to be called via parent::__constructor() - - * tests/bug19859.phpt: - add test for Bug #19859 - - * zend_API.c - zend_execute_API.c: - Fix bug #19859 - allow fast_call_user_function to support __call - - * zend_builtin_functions.c: - fix the get_parent_class fix - -2003-07-03 George Schlossnagle - - * zend_reflection_api.c: - more of Timm's patches, and mod authors line to give credit where credit is - due. - -2003-07-02 Marcus Boerger - - * zend_objects.c: - Temporairy solution to overcome shutdown propbelms with objects that have - hidden destructors. - - * zend_objects.c: - Reorganize this a bit to ensure the object memory is destructed before - showing the error. - - * zend_builtin_functions.c: - Bug #24399: is_subclass_of(): fix memleak, too - -2003-07-02 Zeev Suraski - - * zend_execute.c: - Throughly fix scoping change. Fixes, among other things, bug #24403 - -2003-07-02 Andi Gutmans - - * zend_compile.c - zend_globals.h: - - Nuke CG(in_clone_method) - -2003-07-02 Zeev Suraski - - * zend_execute.c: - Fix for bug #22367. - Heads up - this will break syntactical compatiblity, return($foo) will - not work with functions that return references - return $foo should be - used - instead. It never worked well before, and caused all sorts of odd bugs. - It *might* be possible to support this specifically, albeit unlikely - -2003-07-02 Sterling Hughes - - * zend_execute_API.c: - optimize the case where the object is really a class name, as we don't need - to set EX(object) here. - - * zend_execute_API.c: - Timm Friebe points out that object detection should be done regardless of - the function pointer - -2003-07-02 Marcus Boerger - - * zend_objects.c: - Finally fix property cloning and fix the tests accordingly. - - -2003-07-02 Sterling Hughes - - * zend_builtin_functions.c: - Fix bug #24445 - -2003-07-01 Marcus Boerger - - * zend_objects.c: - Fix __clone(). - - - * tests/bug20240.phpt: - Use both destructor and shutdown - - * zend_execute_API.c: - small bugfix - - * tests/bug24436.php - tests/bug24436.phpt: - Rename test to correct extension - - * zend_execute.c: - __clone might not be defined - - * zend_execute.c: - Fix __clone visibility - - * zend_object_handlers.c - zend_object_handlers.h - zend_objects.c: - Fix destructor visibility - -2003-07-01 Derick Rethans - - * tests/bug24436.php: - - Added test for bug #24436 - -2003-07-01 George Schlossnagle - - * zend_reflection_api.c: - Timm Friebe's patches for code celanup and additional functions. - -2003-07-01 Jani Taskinen - - * tests/.cvsignore - tests/bug21478.phpt - tests/zend2.php - tests/zend2.php.txt: - Missing .cvsignore, broken test, renamed zend2.php -> zend2.php.txt - -2003-07-01 Sebastian Bergmann - - * zend_reflection_api.c: - ZTS fixes. - -2003-07-01 George Schlossnagle - - * zend_reflection_api.c: - more incremental changes. add anything that needs a class factory. - - * zend_reflection_api.c: - all the easy parts of Reflection_Class - -2003-06-30 Shane Caraveo - - * zend_operators.h: - this fixes including this header in a c++ file (vs6) - -2003-06-30 Sterling Hughes - - * zend_compile.c: - nuke "main" as a reserved keyword - -2003-06-30 Andi Gutmans - - * zend.c - zend_API.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_mm.c - zend_opcode.c - zend_reflection_api.c: - - ZE coding style requires if ( instead of if( - -2003-06-30 Sebastian Bergmann - - * zend_reflection_api.c: - ZTS fixes. Remove unused local variables. - -2003-06-30 George Schlossnagle - - * Makefile.am - Zend.dsp - ZendTS.dsp - zend_default_classes.c - zend_reflection_api.c - zend_reflection_api.h: - added support for Reflection_Function, the first part of - the reflection api - -2003-06-30 Sterling Hughes - - * zend_builtin_functions.c: - move the check down a little so it catches all cases - - * zend_builtin_functions.c: - Fix bug #24399 from an excellent test case by edin - -2003-06-30 Zeev Suraski - - * zend_execute.c: - Semantically it's a refcount increase, not a lock... - - * zend_execute.c: - Fix 'global' implementation (fixes, at least, bug #24396 - -2003-06-30 Sterling Hughes - - * zend_operators.c: - revert back the optimization for now. - -2003-06-29 Ilia Alshanetsky - - * zend_object_handlers.c: - Fixed bug #24279 (__get() crash when no value is returned) - -2003-06-29 Sebastian Bergmann - - * ZEND_CHANGES: - Remove namespace references. - -2003-06-29 Sterling Hughes - - * zend_operators.c: - Very simple, but very effective optimization. Provides a signifigant speed - improvement to matches done via '=='. This checks that the lengths of two - strings are equal before performing a memcmp() on them. - -2003-06-23 Zeev Suraski - - * zend_execute.c: - Fix crash :) - -2003-06-23 Stanislav Malyshev - - * zend_execute.c: - FIx leak - -2003-06-22 Zeev Suraski - - * zend_execute.c - zend_language_parser.y: - Fix complex expressions for class names in NEW - - * zend_language_parser.y: - Simplify - -2003-06-21 Marcus Boerger - - * zend_language_parser.y: - WS - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Add final classes - -2003-06-16 Stanislav Malyshev - - * zend_execute.c: - no need to init zval - assignment will init - - * zend_execute.c: - Fix bug #22592 - cascading assignments to string offsets - - * zend_constants.c: - support for self:: and parent:: constants - - * zend_builtin_functions.c: - fix lambda function static vars (related to #17115) - -2003-06-15 Sebastian Bergmann - - * zend_constants.c: - Fix ZTS build. - -2003-06-15 Stanislav Malyshev - - * zend.c: - Fix bug #23279 - exception handler exits after first function call - - * zend_execute_API.c: - No need to duplicate code - zend_get_constant() knows to - handle class constants now - - * zend_execute_API.c: - Fix bug #18872 - Improper handling of class constants used as default - function argument values - - * zend_constants.c: - set ending \0 for string - - * zend_compile.c - zend_constants.c - zend_language_parser.y: - Fix bug #23384 - static class::constant constants should now - work in static & array expressions. - - * zend_execute_API.c: - Fix bug #21800 - initialize opcode handlers in interactive mode - -2003-06-14 Marcus Boerger - - * zend_hash.c: - ecalloc doesn't return NULL - - * zend.c: - Bugfix #24182: va_arg macro error in Zend/zend.c - -2003-06-10 Jani Taskinen - - * zend_multiply.h: - - Missing $Id$ tag - -2003-06-10 James Cox - - * acconfig.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.nw.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_default_classes.c - zend_default_classes.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_execute_locks.h - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_istdiostream.h - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_mm.c - zend_mm.h - zend_modules.h - zend_multiply.h - zend_object_handlers.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_stream.c - zend_stream.h - zend_ts_hash.c - zend_ts_hash.h - zend_types.h - zend_variables.c - zend_variables.h: - updating license information in the headers. - -2003-06-09 Wez Furlong - - * zend_execute_API.c: - Fix for Bug #23951 - -2003-06-09 Stanislav Malyshev - - * zend_execute.c: - remove NS leftover - -2003-06-09 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Fix bogus implicit declarations of properties (squash bug #23671) - -2003-06-09 Stanislav Malyshev - - * zend_API.c - zend_execute_API.c: - Support 'self' and 'parent' in call_user_func() - -2003-06-09 Zeev Suraski - - * zend_execute.c: - Fix indirect reference calls to bogus function names - -2003-06-09 Jani Taskinen - - * zend_builtin_functions.c: - ws - -2003-06-08 Zeev Suraski - - * zend_object_handlers.c: - Fix casing issues in access level checks - - * zend.c - zend_compile.c - zend_compile.h: - Nicer handling of protected/private members in print_r() - - * zend_execute.c: - Fix handling of object property assignments in switch expressions - (bug #23925) - - * zend_builtin_functions.c: - Fix set_error_handler() - -2003-06-06 Sascha Schumann - - * zend_multiply.h: - mfb #24025 fix - -2003-06-04 Stanislav Malyshev - - * zend.c: - fix non-ZTS build - -2003-06-04 Sebastian Bergmann - - * zend.c: - Fix segfault. Again. - -2003-06-04 Stanislav Malyshev - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_object_handlers.c: - rm namespace leftovers - -2003-06-04 Sebastian Bergmann - - * zend.c: - Fix segfault. #Hopefully not a Voodoo Fix[TM]. - -2003-06-02 Sebastian Bergmann - - * zend.c - zend_execute.h: - Leftover. - -2003-06-02 Stanislav Malyshev - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend_object_handlers.c - zend_opcode.c: - MEGA-patch: namespaces are R.I.P. - -2003-06-01 Marcus Boerger - - * tests/zend2.php: - No nested classes - - * tests/bug20240.phpt - tests/bug20242.phpt - tests/bug21478.phpt - tests/bug21888.phpt - tests/bug22725.phpt: - Add some ZE2 bug tests - - * zend_opcode.c: - Bugfix #23670: implements and extends cause Apache 2 crash - - * zend_constants.c: - Do it correct always - - * zend_compile.h: - Defining it once is enough - -2003-05-31 Marcus Boerger - - * zend.c: - Fix init shutdown - -2003-05-31 Sterling Hughes - - * zend_compile.c - zend_execute.c: - revert the function call caching patch until a new solution is decided - upon. - -2003-05-31 Marcus Boerger - - * zend_constants.c: - Fix constants (noticed by David Brown ) - - * zend_constants.c: - c->name_len already contains the '\0' - -2003-05-30 Stanislav Malyshev - - * zend_execute.c: - fix crash on exceptions when return value of the inside function is used - -2003-05-29 Marcus Boerger - - * zend_compile.c - zend_language_parser.y: - Fix ~ operator in class constants. - - * zend_compile.c - zend_compile.h - zend_operators.c: - Faster interface inheritance & faster inheritance checks - - * zend_language_scanner.l: - CS - -2003-05-29 Wez Furlong - - * zend_compile.c: - Fix Bug #23285 (Potential Stack Overflow in zendlex). - -2003-05-28 Sterling Hughes - - * zend_alloc.c: - no reason to do this at runtime - - * zend_compile.c - zend_execute.c: - Cache function call lookups with loops (store in a temporary variable on - the - result opline). - Assuming lazy concensus on message that GeorgeS sent to the list last week - -2003-05-27 Sterling Hughes - - * zend.c - zend_object_handlers.c - zend_object_handlers.h - zend_operators.c: - Assume lazy consensus regarding the cast_object() patch. *Only* - implemented - from a internals perspective. This callback has been very useful for both - ext/mono and ext/simplexml - -2003-05-26 Marcus Boerger - - * zend_language_scanner.l: - Add pseudo constant __METHOD__ to easily report namespace::class::method. - - -2003-05-23 Marcus Boerger - - * zend_API.h: - Revert to sizeof() - -2003-05-23 Sterling Hughes - - * zend_execute.c - zend_hash.c - zend_operators.c - zend_operators.h: - move HANDLE_NUMERIC() from the hash table implementation upstream to the - places that actually need to use it. - -2003-05-22 Marcus Boerger - - * zend_execute.c: - No need to copy here unless implicit_clone is active (noticed by rob) - -2003-05-21 Marcus Boerger - - * zend_API.c - zend_builtin_functions.c - zend_constants.c - zend_object_handlers.c: - Make use optimized string lowering - - * zend_operators.c - zend_operators.h: - Use same parameter order as strcpy() - - * zend_API.c - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_operators.h: - Make zend_str_tolower_copy() a copy function (like stccpy). - Supply a dup version (like estrdup). - Fix tolower() handling. - -2003-05-21 Jani Taskinen - - * zend_builtin_functions.c: - Fixed bug #23619 (set_error_handler() registered handler not called for - object instances). (Jani, waboring@qualys.com) - -2003-05-21 Sterling Hughes - - * zend_operators.c: - optimize loops. The check only exists for integers because that's the more - common optimization, and you actually lose performance if you check for - a double too (wierd but true). - - * zend_mm.h: - add some logic to detect zend_mm, which is really only useful when thread - safety support is enabled. - - * zend_mm.h: - leave this off until its more ready/stable - php5 actually beats php4.3.* in my benchmarks now - - - * zend_API.c: - use zend_str_tolower_copy() - - * zend_execute.c: - Bottom drawer optimization to avoid this comparison, but this OP is - executed - quite often (all of the fetch_* ops) - -2003-05-20 Sterling Hughes - - * zend_operators.c: - bah humbug, use the pointer based version, which turns out to be an - instruction - faster - - * zend_operators.c: - use pointer arithmetic for the normal zend_str_tolower() - -2003-05-20 Marcus Boerger - - * zend_execute.c: - No need to copy the zval unless __clone() is called - -2003-05-20 Sterling Hughes - - * zend_operators.c: - make this faster and sexier - - * zend_execute.c: - use the new zend_str_tolower_copy() function - - * zend_operators.c: - doesn't need to be register - - * zend_execute_API.c - zend_operators.c - zend_operators.h: - optimize the lookups by avoiding a copy and then another pass - - Naked Dancing Girls should be given to: Myself, Zeev, Marcus, - and George Schlossnagle (in no particular order) - - * zend_API.h - zend_execute_API.c: - add fast_call_user_function() - -2003-05-20 Hartmut Holzgraefe - - * zend_API.h - zend_constants.h - zend_operators.h: - C++ compile fixes - -2003-05-19 Marcus Boerger - - * zend_execute.c: - Fix exception memleak - -2003-05-19 Stanislav Malyshev - - * zend_compile.c - zend_execute.c: - fix __clone - -2003-05-12 Marcus Boerger - - * zend_execute_API.c: - One function call is enough - -2003-05-08 Marcus Boerger - - * zend_compile.c: - Inheritance fix - -2003-05-07 Edin Kadribasic - - * zend_compile.c: - Reverting Marcus' incomplete patch which broke the build. - -2003-05-07 Marcus Boerger - - * zend_compile.c: - Inheritance fixes - -2003-05-04 Marcus Boerger - - * zend_API.c: - Fix namespace issue: Only CG is needed here - - * zend_API.c - zend_API.h: - Allow functions in internal namespaces (for example factories) - - * zend_execute.c: - Modify the abstract error message so that it shows up to three methods not - implemented. - - * zend_execute.c: - Fix warnings - - * zend_compile.c: - Don't inherit twice what is needed only once - - * zend.c: - Fix bug #23162 user_error() crashs if > 1024 bytes (Marcus, Moriyoshi) - -2003-05-04 Sterling Hughes - - * zend_default_classes.h: - semicolon - -2003-05-03 Sterling Hughes - - * zend_default_classes.h: - proto - - * zend_default_classes.c: - add an accessor for the default exception - -2003-04-29 Sascha Schumann - - * zend_multiply.h: - Fix the *= operator - - Slightly modified patch by Wez Furlong - -2003-04-25 Jani Taskinen - - * zend_language_scanner.l: - Fixed bug #21820 ("$arr[foo]" generates bogus E_NOTICE, should be E_PARSE) - -2003-04-24 Sascha Schumann - - * zend_alloc.c - zend_alloc.h - zend_multiply.h: - add safe_emalloc - -2003-04-21 Stanislav Malyshev - - * zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_object_handlers.c: - Change get_class() so that it returns qualified names for namespaced - classes. - - *HEADS UP*: get_class_name() handler interface is changed, now it should - allocate the space it returns with emalloc, and the users free it. If - anyone has problems with it or has suggestions how to do it without this - - please tell. - - Also: make function_exists() understand namespaces. - - * zend_execute.c: - make import * fail if such classes or functions already there - -2003-04-20 Sterling Hughes - - * zend_compile.c: - Add check for final properties - -2003-04-20 Stanislav Malyshev - - * zend_execute_API.c: - Check name before '::' so that it would be a namespace in - zend_lookup_ns_class - - * zend_builtin_functions.c: - refine the set_error_handler fix - - * zend_builtin_functions.c: - Fix for bug #21094 (set_error_handler can not accept methods), - by Timm Friebe - -2003-04-19 Sebastian Bergmann - - * zend.c: - Corrected patch by Marcus Börger . - -2003-04-18 Sterling Hughes - - * zend.c - zend_opcode.c: - Patch by Marcus Börger to fix some memleaks - -2003-04-18 Derick Rethans - - * zend.h - zend_extensions.c: - - Revert my symbol fix patch, and merge in Stas' fixes to Zend Engine 1. - - * zend.h: - - MacOSX also prepends the _ before symbols in bundles - -2003-04-17 Sebastian Bergmann - - * zend.c: - Patch by Marcus Börger . - -2003-04-11 Sebastian Bergmann - - * zend_compile.c - zend_compile.h: - Fix warnings. - -2003-04-10 Sterling Hughes - - * zend_compile.c: - satisfy andi's switch fetish ;-) - -2003-04-10 Sebastian Bergmann - - * zend_compile.c: - Fix ZTS build. Fix warning. - - * ZEND_CHANGES: - Document 'const' keyword. - -2003-04-10 Sterling Hughes - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - allow expressions within constants, so the following is possible - - class foo { - const a = 1<<0; - const b = 1<<1; - const c = a | b; - } - - this makes const a compile-time expression. all other operators are - unaffected. - -2003-04-10 Zeev Suraski - - * zend_language_parser.y - zend_language_scanner.l: - Revert Harald's commit - -2003-04-10 George Schlossnagle - - * zend_language_parser.y: - One line fix so that it will compile - -2003-04-09 Harald Radi - - * zend_language_parser.y - zend_language_scanner.l: - removing the *syntactical sugar* again - - -2003-04-08 Andrei Zmievski - - * zend_builtin_functions.c: - Switch some functions to use new zend_lookup_ns_class() methods. This - means that they will accept both simple and fully qualified class names. - - * zend_API.c - zend_API.h: - Rename zend_register_internal_class_in_ns() to a better, less filling, - but with the same great taste zend_register_internal_ns_class(). - - * zend_execute.h - zend_execute_API.c: - Add zend_lookup_ns_class() function. - - * zend_operators.h: - Move memnstr into Zend and make an alias for BC in PHP. - -2003-04-07 Jani Taskinen - - * zend_language_scanner.l: - Fixed bug #23093 (highlight_string() crashed with __FUNCTION__) - -2003-04-07 Sterling Hughes - - * zend_compile.h: - add markers that make this file easy to parse for external sources - -2003-04-04 Andrei Zmievski - - * zend_API.h: - Introduce ZEND_ME() and ZEND_METHOD() macros. Use these for declaring - class methods to avoid name collisions. - -2003-04-04 Stanislav Malyshev - - * zend_API.c - zend_API.h: - Fix namespace issues - -2003-04-03 Andrei Zmievski - - * zend_API.c: - Patch from Timm Friede for when EG(active_namespace) is NULL initially. - - * zend.c - zend_API.c - zend_compile.c: - Initialize all relevant zend_class_entry fields to avoid accidental - crashes. - -2003-04-03 Sebastian Bergmann - - * zend_list.c: - Leftover. - -2003-04-03 Sterling Hughes - - * zend_list.c - zend_list.h: - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - i will not commit before 12:00 - -2003-04-02 Andrei Zmievski - - * zend_API.c - zend_API.h: - - Add zend_register_internal_namespace() API function. - - Add zend_register_internal_class_in_ns() API function. - - * zend_compile.h: - Simplify. - -2003-04-02 Derick Rethans - - * zend_list.c: - - Fix whitespace - -2003-04-02 Sterling Hughes - - * zend_list.c - zend_list.h: - add the ability for curl_multi_info to introspect the handles. - - -2003-04-02 Andrei Zmievski - - * zend_compile.c - zend_compile.h - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - Implement a different way to catch documentation comments. - - * zend_compile.c - zend_compile.h - zend_highlight.c - zend_language_parser.y - zend_language_scanner.l: - Revert portions of the doc comment patch. There should be no parser - errors now. - -2003-04-02 Stanislav Malyshev - - * zend_builtin_functions.c - zend_compile.h - zend_execute.c: - allow class_exists() to work with namespaces too. - add CLASS_IS_NAMESPACE macro - - * zend_builtin_functions.c: - fix typo - - * zend_builtin_functions.c: - fix parameterless get_declared_classes call - -2003-04-01 Andrei Zmievski - - * zend_execute.c: - Stas's patch on zend_execute.c (1.448 -> 1.449) resulted in a bug where - the namespaced member accesses didn't work. This should hopefully - correct it. - - * zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_opcode.c: - Split ZEND_NAMESPACE into user and internal namespaces. Hope this is - okay with engine folks. - -2003-04-01 Stanislav Malyshev - - * zend_builtin_functions.c: - improve namespace name hanfling - - * zend_builtin_functions.c: - fix get_declared_classes() - - * zend_language_parser.y - zend_language_scanner.l: - Add __NAMESPACE__ auto-constant. - - * zend_builtin_functions.c: - make get_declared_classes() work with namespaces (based on Tal Peer's - patch) - -2003-03-31 Andrei Zmievski - - * zend.h - zend_compile.c - zend_compile.h - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - Multi-purpose patch: - - The fields of zend_namespace were not completely initialized which - led to a variety of problems. - - The occurrence of class/interface/namespace definition is now - captured. - - Functions/classes/interfaces/namespaces can be preceded by doc - comments which are stored for use by extensions. - -2003-03-31 Stanislav Malyshev - - * zend.c: - Use strncpy instead of sprintf - -2003-03-30 Andrei Zmievski - - * zend_language_parser.y: - Since zend_do_begin_class_member_function_call assumes the previous - opcode is FETCH_CONSTANT, swap the calls around. - -2003-03-30 Sebastian Bergmann - - * zend_execute.c: - ZTS fix. - -2003-03-30 Stanislav Malyshev - - * zend.c: - Try to report class name of the exception - - * zend_execute.c: - Fix namespace switch - -2003-03-29 Zeev Suraski - - * zend_compile.c: - Add missing initialization - - * zend_compile.c: - Fix crash - - * zend_API.c - zend_compile.c - zend_compile.h: - Initial support for enforcing prototype of abstract/interface method - implementations - -2003-03-29 Sterling Hughes - - * zend.c: - remove unused variable - -2003-03-27 Stanislav Malyshev - - * zend_execute.c: - fix fetch_class buglet - -2003-03-26 Stanislav Malyshev - - * zend_execute.c - zend_language_parser.y: - Un-nest namespaces - now namespace X { namespace Y {} } is a parse error - Also refine namespaced includes - -2003-03-26 Ilia Alshanetsky - - * zend_compile.c: - Fixed bug #22900 (declaration of namespaces with same name results in - leaks). - -2003-03-26 Sebastian Bergmann - - * zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_operators.h: - Eliminate TSRMLS_FETCH() calls in destroy_op_array() and - zend_get_class_entry(). - - * zend_API.c - zend_object_handlers.c - zend_objects.c - zend_objects.h: - Eliminate TSRMLS_FETCH() calls in zend_objects_new() and - zend_objects_get_address(). - -2003-03-25 Andi Gutmans - - * zend_compile.c: - - Temporarily fix problem with inheriting from an internal class. This - might - - need some rework in the future (thanks to Marcus) - -2003-03-24 Stanislav Malyshev - - * zend_execute.c: - Fix {include|require}_once error message - if open - fails, don't use tream, use original name. - -2003-03-23 Andi Gutmans - - * zend.c: - - Fix win32 build - -2003-03-23 Stanislav Malyshev - - * zend.c: - resore namespace on shutdown - since some functions use - EG() and CG() pointers - -2003-03-23 Sebastian Bergmann - - * zend_default_classes.c: - ZTS fix. - -2003-03-23 Zeev Suraski - - * zend_compile.c: - Another fix for implicit public, perhaps it was not such a good idea :I - -2003-03-23 Sebastian Bergmann - - * Zend.dsp - ZendTS.dsp - zend_default_classes.c: - Add new files to ZendTS.dsp. Sync list of files in Zend.dsp with - ZendTS.dsp. ZTS fixes. - -2003-03-23 Sterling Hughes - - * zend_default_classes.h: - DEFAULT_CLASSES_H not DEFAULT_INTERFACES_H - - * Makefile.am - zend.c - zend_default_classes.c - zend_default_classes.h: - add a standard Exception class. - -2003-03-22 Shane Caraveo - - * zend_compile.h: - export functions needed by cli - - * zend_language_scanner.l: - fix crash in win32 debug build - -2003-03-20 Stanislav Malyshev - - * Zend.m4: - Add stdlib.h too - it is needed fot strto{ld} - -2003-03-19 Andrei Zmievski - - * zend_compile.c - zend_compile.h - zend_globals.h - zend_highlight.c - zend_language_parser.y - zend_language_scanner.l: - - Keep track of starting/ending line numbers for user functions. - - Store last parsed doc comment in a compiler global for future use. - - * zend_API.c: - Lowercase the function name when used as key in the function name. The - original case is still preserved in zend_function structure. - -2003-03-18 Zeev Suraski - - * zend_compile.c - zend_object_handlers.c: - - Fix situation where a derived class declares a public (or implicit - public) - with the same name as a private in the parent - - Optimize 'static binding' of private properties a bit - -2003-03-18 Stig Bakken - - * RFCs/002.txt: - - email address change - -2003-03-17 Stanislav Malyshev - - * zend_extensions.c: - MFZE1 - -2003-03-17 Jani Taskinen - - * Makefile.am: - Added missing zend_mm.c file and renamed zend_object_API.c -> - zend_objects_API.c - -2003-03-13 Andrei Zmievski - - * zend_API.c: - Fix warning in va_start(). - -2003-03-12 Andrei Zmievski - - * zend_API.c: - Initialize the namespace when registering functions. - -2003-03-12 Zeev Suraski - - * zend_compile.c: - Fix a crash bug in the implicit public declaration - -2003-03-11 Zeev Suraski - - * zend_execute.c - zend_object_handlers.c: - Fix handling of ::func() - -2003-03-10 Zeev Suraski - - * zend_compile.c: - Clean redundant code - -2003-03-10 Jani Taskinen - - * zend_compile.c: - Fixed some leaks. Patch by Moriyoshi - -2003-03-10 Shane Caraveo - - * zend_config.w32.h: - fix isinf for win32 - -2003-03-09 Zeev Suraski - - * zend_language_parser.y: - Optimize - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Fix handling of ::foo - - * zend_compile.c: - Cleanup - -2003-03-09 Andi Gutmans - - * zend_language_scanner.l: - - Nuke junk - -2003-03-09 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Fix parsing rules of namespaces/classes - - * zend_language_parser.y: - Add ability to use ::interface_name in implements - - * zend_compile.c: - Fix :: handling - -2003-03-07 Sebastian Bergmann - - * ZEND_CHANGES: - Dedicated to Greg Beaver . - - * ZEND_CHANGES: - Document 'final'. - - * ZEND_CHANGES: - Fix class type hints example. - - * ZEND_CHANGES: - Update 'abstract' section. - -2003-03-07 Jani Taskinen - - * zend_ini.c - zend_ini.h: - Renamed OnUpdateInt -> OnUpdateLong to prevent further misunderstandings. - - * zend_execute.c: - Better fix for the memleaks (bug 19943) by Moriyoshi - -2003-03-06 Zeev Suraski - - * zend_compile.c - zend_execute.c: - Fix warnings - - * zend_execute.c: - Fix error message - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - Require abstract classes to be explicitly declared 'abstract', in order to - avoid making developers traverse the entire class/interface hierarchy - before they can figure out whether a class is instantiable - (ok, so it makes sense :) - -2003-03-06 Sebastian Bergmann - - * ZEND_CHANGES: - -german+english+. - - * ZEND_CHANGES: - D some TBDs - -2003-03-06 Jani Taskinen - - * zend_execute.c: - Fixed bug #19943 (the memleaks) - -2003-03-06 Ilia Alshanetsky - - * zend_highlight.c: - More cleanup of the zend_strip() function. - No longer strip __LINE__, since while it may become useless it could break - code where __LINE__ is passed as a function parameter. - - * zend_highlight.c: - Fixed in zend_strip() that corrupted heredoc. - Optimized the writing routine by moving from putchar() to fwrite(). - Changed hardcoded opcode # to it's defined name. - -2003-03-06 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_execute.c: - Change opcode name - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - Add class type hints - -2003-03-05 Zeev Suraski - - * zend_compile.c: - Fix auto globals - - * zend_compile.c - zend_execute.c - zend_language_parser.y: - Implement $obj::static_func() - - * zend.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c - zend_operators.c - zend_operators.h: - Add support for interfaces - -2003-03-04 Zeev Suraski - - * zend_compile.c - zend_language_parser.y: - Remove legacy code - - * zend_compile.c: - Remove redundant code - -2003-03-03 Harald Radi - - * zend_API.c: - add missing strtolower - - * zend_API.c - zend_API.h: - commiting zend_disable_class patch for George: - disabled classes will be replaced by dummy classes - that print a warning upon instanciation - -2003-03-02 Zeev Suraski - - * zend_execute_API.c: - Fix destructors some more - - * zend_compile.c - zend_compile.h: - Improve infrastructure - - * zend.c - zend_compile.c - zend_compile.h: - Add infrastructure for JIT initialization of auto globals - -2003-03-01 Zeev Suraski - - * zend_compile.c: - Fix mem leak - -2003-03-01 Andi Gutmans - - * zend_compile.c: - - Make __construct() have higher priority than class name functions - - for constructors. - - Fix problem with the engine allowing final/abstract for the same method. - - Both patches are by Marcus Börger. - -2003-02-27 Rasmus Lerdorf - - * zend_ini_scanner.l: - MFB: We know ini file scanning will never be interactive, so speed it up a - bit. Need a dynamic check for the language scanner. - -2003-02-26 Sebastian Bergmann - - * ZEND_CHANGES: - Syntactic sugar is sweet. - -2003-02-25 Zeev Suraski - - * zend_compile.c: - Get the bits right - final/private fix - -2003-02-25 Jani Taskinen - - * acconfig.h: - Do not redefine zend_isnan if it is already defined. - - * Zend.m4: - - Fixed bug #14245 ('make install' fails on AIX when using --with-apxs). - -2003-02-24 Stanislav Malyshev - - * zend_compile.c: - fix exception handling - -2003-02-24 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_language_parser.y - zend_language_scanner.l: - Add 'final' - -2003-02-24 Sebastian Bergmann - - * ZEND_CHANGES: - Remove obsolete not on redeclaring protected members. - - * ZEND_CHANGES: - Leftover. - - * ZEND_CHANGES: - Initial documentation of namespace {}. - -2003-02-23 Zeev Suraski - - * zend_compile.c: - Move abstract inheritance logic to the right spot - - * zend_compile.c: - Fixed abstract handling in inheritence - -2003-02-20 Wez Furlong - - * zend_stream.c: - -cough* - Fix another stupid mistake. - -2003-02-20 Stanislav Malyshev - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_opcode.c: - Allow namespaces to have a number of parts. I.e., now you can do: - namespace foo { - function abc() {} - } - ... - namespace foo { - functio def() {} - } - -2003-02-19 Wez Furlong - - * zend_stream.c: - Fix stupid mistake that only affected interactive mode. - -2003-02-18 Rasmus Lerdorf - - * zend_stream.c: - fileno() needs a FILE * here, and at least on FreeBSD with gcc-2.95.3 - it is unable to figure out that this is indeed a FILE * and hence it - won't compile without this cast. - -2003-02-18 Zeev Suraski - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_scanner.l - zend_opcode.c: - Avoid using a C++ reserved word - -2003-02-18 Wez Furlong - - * ZendTS.dsp - flex.skl: - Fixup build for win32 - - * Makefile.am - flex.skl - zend.c - zend.h - zend_compile.h - zend_execute.c - zend_globals.h - zend_ini_scanner.l - zend_language_scanner.h - zend_language_scanner.l - zend_stream.c - zend_stream.h: - Implement simple stream support in the ZE scanners. - -2003-02-17 Zeev Suraski - - * zend_language_parser.y: - Whitespace & minor renames - - * zend_language_parser.y: - whitespace - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Improve handling of static member variables - - * zend_config.w32.h - zend_ini_parser.y: - Improve Win32 build performance - -2003-02-16 Zeev Suraski - - * zend_execute.c: - Fix complex cases of self-assignments (bugs #21600, #22231) - - * zend_execute.c: - Make EG(This) and EG(scope) available to internal methods - - * zend_execute.c: - Revert patches - they weren't ready yet! - - * zend.c: - Fix initialization - -2003-02-16 Georg Richter - - * zend_execute.c: - fixed compiler warning - - * zend_execute.c: - tested patch from Zeev (fixes oo-bug in ext/mysqli) - -2003-02-16 Stanislav Malyshev - - * zend_compile.c - zend_language_parser.y: - add support for ::foo syntax meaning "global one" - - * zend_compile.c: - remove debug prints - -2003-02-16 Sebastian Bergmann - - * zend.c - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c: - ZTS fixes - -2003-02-16 Stanislav Malyshev - - * zend_object_handlers.c: - namespace patch - static variable access - - * zend.c - zend.h - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - Namespace patch. Big changes: - 1. Nested classes are gone. - 2. New syntax for namespaces: - namespace foo { - class X { ... } - function bar { ... } - var x = 1; - const ZZ = 2; - } - 3. Namespaced symbol access: $x = new foo::X; - etc. - For now, namespaces are case insensitive, just like classes. - Also, there can be no global class and namespace with the same name - (to avoid ambiguities in :: resolution). - -2003-02-15 Ilia Alshanetsky - - * zend_ini_scanner.l: - Added feature #19645 (ini parser can now handle quoted multi-line values). - -2003-02-14 Thies C. Arntzen - - * zend_execute_API.c: - init current_execute_data befor we start executing - - * Makefile.am: - ups - - * Makefile.am: - add really nice dump_bt function for debugging in gdb - -2003-02-13 Zeev Suraski - - * zend_object_handlers.c: - Fix error handling in illegal property access - -2003-02-13 Harald Radi - - * zend_language_scanner.l: - MFB PHP_4_3 - -2003-02-12 Ilia Alshanetsky - - * zend_API.c - zend_API.h: - Removed zend_get_module(), this function is not used by anything and more - importantly. it does not work. It tries to find data based on numeric keys - in hash table using string keys. - -2003-02-12 Zeev Suraski - - * zend_compile.c: - Fix declaration of class members that don't have an explicit access - modifier - -2003-02-11 Zeev Suraski - - * zend_compile.c: - Fix require() handling - that's an old bug! - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Improve parser handling of 'abstract' - -2003-02-10 Zeev Suraski - - * zend_compile.c: - Fix zend_initialize_class_data() - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h: - Centralize class initialization - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Treat $this->foo inside class X as an implicit 'public $foo' if X::$foo - is not explicitly declared - - Forbid multiple declaration of the same variable - - * zend_execute.c: - whitespace - - * zend_API.c - zend_compile.c: - Add missing destructors - -2003-02-10 Stanislav Malyshev - - * zend_object_handlers.c: - update static constants too - -2003-02-10 Zeev Suraski - - * zend_builtin_functions.c: - Fix get_parent_class() - - * zend_object_handlers.c: - Restore missing check - - * zend_execute.c - zend_execute_API.c: - Add ability to reference self:: and parent:: in constant initializers - (bug #21849) - - * zend_execute.c: - Remove redundant code - -2003-02-09 Zeev Suraski - - * zend_execute.c: - Fix the array() problem (and probably some other problems too) - -2003-02-08 Georg Richter - - * zend_API.c - zend_API.h: - fixed zend_parse_method_param - -2003-02-08 Sebastian Bergmann - - * zend_builtin_functions.c: - zend_config.h (and its Win32 version) is already included by zend.h - -2003-02-08 Ilia Alshanetsky - - * zend_builtin_functions.c: - The string.h is already available through zend.h, so the manual inclusion - is not necessary. - -2003-02-07 Ilia Alshanetsky - - * zend_builtin_functions.c: - Added a check to ensure that string.h is available before trying to use it. - - Thanks Andi. - - * zend_builtin_functions.c: - Added missing header. - -2003-02-07 Zeev Suraski - - * zend_globals.h - zend_object_handlers.c: - Improve PPP handling of properties - - * zend_config.w32.h: - Better fix - - * zend_config.w32.h: - Fix Windows build - -2003-02-07 Ilia Alshanetsky - - * zend_builtin_functions.c: - Fixed bug #15734 (Added an optional parameter to get_defined_constants(), - which if passed, will include information regarding who created the - constant). - -2003-02-06 Ilia Alshanetsky - - * zend_builtin_functions.c: - Fixed bug #19506 (get_extension_funcs() can now retrieve a list of built-in - Zend Engine functions, if "zend" is specified as the module name). - Made get_extension_funcs() on failure. - -2003-02-06 Zeev Suraski - - * zend_compile.c: - Fix the 2nd buglet in the error message :) - - * zend_object_handlers.c: - Fix check - - * zend_hash.c - zend_hash.h: - Fix prototype (may have caused stack corruption) - -2003-02-05 Zeev Suraski - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_objects_API.c: - - read_property cleanup - - Implement unset/isset/empty for PPP - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h - zend_opcode.c: - Rework static class properties - now supports access restrictions - - * zend_hash.c - zend_hash.h: - Add quick_exists() - - * zend_object_handlers.c: - Add PPP support for arrays - - * zend_compile.c: - Fix buglet in error message - -2003-02-04 Zeev Suraski - - * zend_object_handlers.c: - Missing update - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_globals.h - zend_hash.c - zend_hash.h - zend_object_handlers.c - zend_opcode.c - zend_ts_hash.c - zend_ts_hash.h: - Reimplement PPP properties - -2003-02-03 Sebastian Bergmann - - * zend_API.h: - Build fix. - -2003-02-02 Harald Radi - - * zend_API.c - zend_API.h: - extend the parameter parsing API by two functions - for parsing method parameters with automatic - detection if the function was called as such or as - a class method (with a valid this ptr). - if called as a function the first parameter has to be - the object it is operating on, if called as a method - this is used. - - -2003-02-02 Zeev Suraski - - * zend.h - zend_operators.h: - whitespace - - * zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: - Core rearrangements - move Zend Objects specific code to their - specific implementation file - -2003-02-02 Andi Gutmans - - * zend_compile.c: - - Fix warning - -2003-02-01 Sebastian Bergmann - - * zend_ini_scanner.l - zend_language_scanner.l: - Fix build. - -2003-02-01 Jani Taskinen - - * acconfig.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.nw.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_execute_locks.h - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_istdiostream.h - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_mm.c - zend_mm.h - zend_modules.h - zend_object_handlers.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_ts_hash.c - zend_ts_hash.h - zend_types.h - zend_variables.c - zend_variables.h: - - Added some missing CVS $Id$ tags, headers and footers. - -2003-01-30 Ilia Alshanetsky - - * zend_operators.c: - Fixed compiler warning regarding signed/unsigned int comparisons. - -2003-01-30 Harald Radi - - * zend_ts_hash.c - zend_ts_hash.h: - fix non-zts build for wez - -2003-01-30 Ilia Alshanetsky - - * zend_execute_API.c: - Fix ZTS build. - -2003-01-29 Stanislav Malyshev - - * zend_compile.h - zend_execute_API.c - zend_opcode.c: - Add additional stage to post-session cleanup. - We need separate cleanup stage because of the following problem: - Suppose we destroy class X, which destroys function table, - and in function table we have function foo() that has static $bar. Now if - object of class X was assigned to $bar, its destructor will be called and - will - fail since X's function table is in mid-destruction. - So we want first of all to clean up all data and then move to tables - destruction. - Note that only run-time accessed data need to be cleaned up, pre-defined - data can not contain objects and thus are not probelmatic. - -2003-01-29 Zeev Suraski - - * zend_execute.c - zend_object_handlers.c: - Code rearrangements - -2003-01-29 Stanislav Malyshev - - * zend_execute_API.c: - Fix object destructors: - zend_objects_store_call_destructors is not used anymore, we rely on - symbol tables cleaners to destroy all objects. - - * zend_objects_API.c: - extra safety - - * zend_compile.c: - fix memory leak - -2003-01-29 Zeev Suraski - - * zend_execute.c - zend_object_handlers.c: - Fix assignments to $this. - Fixes the 'make install' problem reported on php-dev - -2003-01-28 Zeev Suraski - - * zend_compile.c: - Fix a ticks related crash - - * (PHP_5_0_dev_before_13561_fix) - zend_execute.c: - Allow methods in parent classes to call protected methods in derived - classes - -2003-01-27 Stanislav Malyshev - - * zend_compile.c - zend_compile.h - zend_execute.c: - Replace MAKE_VAR opcode with special 'data' opcode - This opcode is not executeable but only holds data for opcodes - that need more than two arguments (presently only ASSIGN_OBJ and the ilk - but - in the future also ASSIGN_DIM) - -2003-01-26 Sascha Schumann - - * zend_API.c: - Replace snprintf() call using zend_error's capabilities - -2003-01-23 Zeev Suraski - - * zend_execute.c: - Let the scope propagate to internal functions - -2003-01-23 Jani Taskinen - - * zend_execute_API.c: - Fixed bug: #14542, register_shutdown_function() timeout problem - -2003-01-22 Stanislav Malyshev - - * OBJECTS2_HOWTO: - some small refinements for get_class_* - -2003-01-22 Ilia Alshanetsky - - * zend_execute.c: - Fixed bug #21814 (Allow booleans to be used as array keys). - -2003-01-21 Sterling Hughes - - * zend_objects_API.c: - fix by phanto to the cloning - -2003-01-19 Zeev Suraski - - * Zend.m4: - relabel - -2003-01-19 Stanislav Malyshev - - * zend_compile.c: - Restore for now old statics behaviour (so that indirect $$var references - would work again). Comprehensive fix will follow later. - -2003-01-19 Harald Radi - - * zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l: - ini patch to allow 'entry[] = value' entries - -2003-01-17 Harald Radi - - * zend_objects.c - zend_objects.h: - export zend_objects_destroy_object() - static inline was meaningless anyways as the function - was only used as a callback handler and was never - called directly - - * zend_objects_API.c - zend_objects_API.h: - make std_object_handlers struct available for shared modules - -2003-01-16 Ilia Alshanetsky - - * zend_execute.c: - Fixed bug #20933 (isset/empty didn't work when used on string offsets). - -2003-01-15 Andi Gutmans - - * zend_compile.c: - - Revert int -> unsigned int change for str.len - -2003-01-15 Sascha Schumann - - * zend.h: - Revert commit which turned the lengths of strings into zend_uint. - -2003-01-14 Andi Gutmans - - * ZEND_CHANGES - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - zend_operators.c - zend_operators.h: - - Change "is" to "instanceof" as it explains better what the operator - means. - - "is_a" was also appropriate but ugly. - -2003-01-14 Stanislav Malyshev - - * zend_API.c: - fix memory leaks and key size - -2003-01-14 Ilia Alshanetsky - - * zend_ini_parser.y: - MFZE2 - -2003-01-14 Stanislav Malyshev - - * zend_compile.c: - fix warning - - * zend_API.c - zend_API.h: - Make add_property_ functions work via write_property handler - - * zend.c - zend_object_handlers.c: - ws - -2003-01-14 Ilia Alshanetsky - - * zend_ini_parser.y: - Reverting previous patch. - -2003-01-13 Ilia Alshanetsky - - * zend_ini_parser.y: - MFZE2 - -2003-01-13 Andi Gutmans - - * zend_objects_API.c: - - Don't check if the handle is bogus. We should crash. - -2003-01-12 Harald Radi - - * zend_modules.h: - fix wrong dereferenciation - -2003-01-12 Stanislav Malyshev - - * zend_compile.c: - fix inheritance - - * zend_API.h: - Remove handle_property from here too - - * zend.c - zend.h - zend_compile.c: - RIP handle_* functions. ZE2 will use __ handlers instead. - - * zend_object_handlers.c: - Move Z_OBJ_P here. - - * zend_operators.h: - Remove Z_OBJ - it's internal to Zend objects, no generic function except - those in zend_object_handlers.c should use it. - Add Z_OBJ_HANDLER macro for easy access to handlers - -2003-01-12 Sebastian Bergmann - - * zend.c - zend.h - zend_builtin_functions.c: - ZTS fixes. - -2003-01-12 Stanislav Malyshev - - * zend_object_handlers.c: - add get_class_name handler - - * zend.c: - Use generic handlers instead of Z_OBJ - -2003-01-12 Harald Radi - - * zend_modules.h: - - - * zend_ini.h - zend_ini_entry.h - zend_modules.h: - partially revert previous commit and - change zend_modules.h to include - a forward declaration to zend_ini_entry - - * zend_ini.h - zend_ini_entry.h - zend_modules.h: - added zend_ini_entry to zend_modules_entry as - discussed with zeev - - * zend_builtin_functions.c: - fix 'use of uninitialized variable' warning - -2003-01-12 Stanislav Malyshev - - * zend_objects_API.c: - validate handle - -2003-01-12 Zeev Suraski - - * zend.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_ini.c - zend_ini.h - zend_variables.c: - Implemented compatibility mode - To enable - zend2.implicit_clone = on in php.ini or using ini_set() - -2003-01-11 Andi Gutmans - - * zend_execute.c: - - Fix typo and whitespace - -2003-01-11 Derick Rethans - - * zend.c - zend_execute.c - zend_execute.h - zend_execute_API.c: - - Ported the zend_execute_internal hook to ZendEngine2. - -2003-01-11 Harald Radi - - * zend_ts_hash.c: - freed reader twice instead of writer and reader - -2003-01-10 Ilia Alshanetsky - - * zend_alloc.c: - MFZE2 - -2003-01-10 Andrei Zmievski - - * zend_API.c: - Automatically register constructor, destructor, and clone function when - class methods are registered. - -2003-01-09 Zeev Suraski - - * zend_compile.c: - Found some more occurences of that elusive bug... - - * zend_compile.c: - Fix one lousy, annoying lurking bug (memory corruption) - Sebastian - try coWiki again please... - - * zend_API.h: - Unify and make it easy to add code into the broken-string error handler - - * zend_language_parser.y: - Fix writability checks - - * zend.c: - Fix leak - -2003-01-08 James Cox - - * zend.h: - cvs is dev not alpha. - -2003-01-08 Ilia Alshanetsky - - * zend_builtin_functions.c: - MFZE2 - -2003-01-05 Zeev Suraski - - * zend_compile.c - zend_globals.h - zend_language_scanner.l: - MFZE1 - lineno fix - -2003-01-02 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_execute.c: - Fix incorrect linkage of access-levels, when using private methods - -2003-01-01 Zeev Suraski - - * zend_API.c - zend_operators.h: - Win32 build fix - -2003-01-01 Stanislav Malyshev - - * zend_operators.h: - use handler for Z_OBJPROP - -2003-01-01 Zeev Suraski - - * zend_API.c: - Fix Wez's problem - -2002-12-31 Sebastian Bergmann - - * LICENSE - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.nw.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_language_scanner.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_mm.c - zend_mm.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_ts_hash.c - zend_ts_hash.h - zend_types.h - zend_variables.c - zend_variables.h: - Bump year. - -2002-12-31 Stanislav Malyshev - - * zend_object_handlers.h: - fix level of indirection - -2002-12-30 Andrei Zmievski - - * zend_execute_API.c: - Adjust the error message. - -2002-12-30 Stanislav Malyshev - - * zend_object_handlers.h: - Oops, fix it indeed - - * zend_object_handlers.h: - Better check - -2002-12-26 Andrei Zmievski - - * zend_compile.c: - do_inherit_method_check() is supposed to return 0 or 1, not SUCCESS or - FAILURE. - -2002-12-14 Ilia Alshanetsky - - * zend_language_scanner.l: - MFZE2 - -2002-12-10 Zeev Suraski - - * zend_compile.c: - Fix check to allow for static+access level modifiers - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Allow variables to have both 'static' modifier and an access level. - NOTE: This only works at the syntax level right now (parser). It - doesn't actually work as of yet - all statics are considered - public for now - - Prevent users from putting more restrictions on methods in derived - classes - (i.e., you cannot make a public method private in a derived class, etc.) - -2002-12-09 Andi Gutmans - - * zend_mm.c: - - Fix a bug which I just introduced. - - * zend_mm.c: - - Fix typo - - * zend_mm.c: - - Improvements - - * zend_mm.c - zend_mm.h: - - First attempt to improve memory manager during realloc()'s - -2002-12-08 Zeev Suraski - - * zend_compile.c: - Remove comment - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Treat the absence of an access type just as if 'public' was supplied - - * zend_compile.c: - Simplify/fix inheritance checks - - * zend_execute.c: - Support private/protected constructors - -2002-12-07 Sebastian Bergmann - - * ZEND_CHANGES: - Update. - -2002-12-07 Zeev Suraski - - * zend_execute.c: - Fix error messages - - * zend_language_parser.y - zend_language_scanner.l: - Remove unintentional code - -2002-12-07 Andi Gutmans - - * zend_compile.c: - - Dissallow using parent, self and main as class names - -2002-12-06 Zeev Suraski - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_hash.h - zend_language_parser.y - zend_language_scanner.l: - - Implement public/protected/private methods. - - Prevent instantiation of classes with abstract methods. - Based in part on Marcus's patch. - -2002-12-01 Andi Gutmans - - * zend_alloc.c: - - Allow enabling of memory cache with zend_mm - - * zend.c - zend.c - zend.h - zend.h - zend_builtin_functions.c - zend_builtin_functions.c: - - MFZE1 - - * zend.c - zend.h - zend_builtin_functions.c: - - Revert as the patch doesn't compile - - * zend.c - zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_indent.c - zend_object_handlers.c - zend_opcode.c - zend_operators.c - zend_operators.h - zend_variables.c: - h WHitespace - - * zend.c: - - Initialize constants_updated (by Marcus) - - * zend_builtin_functions.c: - - Nuke use of deprecated macro - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - - FN_IS_STATIC -> FN_STATIC - - * zend.c: - - Fix crash - - * zend_compile.c - zend_compile.h: - - My personal cleanups - - * zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_language_parser.y - zend_object_handlers.c: - - Commit Marcus' cleanup of abstract and static inheritance and improve - - error messages - -2002-11-22 Derick Rethans - - * zend_API.c: - - Initialize all functions to non-static (patch by Marcus Börger - . - -2002-11-22 Sebastian Bergmann - - * zend_execute.c: - Show class name as well. Patch by Marcus Börger. - - * zend_execute.c: - Show the name of the abstract method in the error. - - * zend_compile.h: - Fix prototype. - -2002-11-20 Derick Rethans - - * zend_builtin_functions.c: - - MFZE1: Disable leak() and crash() when not using debug mode - -2002-11-20 Andi Gutmans - - * ZEND_CHANGES: - - Add abstract methods - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l: - - Fix build (thanks Marcus) - - Implement abstract methods, syntax: - - abstract function foo($vars); - - I don't see any reason why modifiers such as static/public need to be - - used with abstract. PHP is weakly typed and there would be no meaning to - - this anyway. People who want a strictly typed compiled language are - - looking in the wrong place. - -2002-11-19 Zeev Suraski - - * zend.c - zend.h - zend_builtin_functions.c - zend_execute.c - zend_execute_API.c: - MFZE1 - error_reporting fix - -2002-11-18 Andi Gutmans - - * zend_language_scanner.l: - - MFZE1 - -2002-11-17 Stanislav Malyshev - - * zend_execute.c: - fix the leak - -2002-11-16 Andi Gutmans - - * zend_language_scanner.l - zend_language_scanner.l: - - MFZE1 - - * Zend.m4 - configure.in: - - MFZE1 - - * zend_hash.c: - - Commit fix for bug #19566 (I think it's by Marcus :) - -2002-11-14 Andrei Zmievski - - * zend_llist.h: - MFZE1 - -2002-11-13 Stanislav Malyshev - - * zend_execute.c: - semi-fix string offsets crash - now it doesn't crash, but still leaks - - * zend_object_handlers.c: - fix static - -2002-11-11 Andi Gutmans - - * ZEND_CHANGES: - - Update with statics - -2002-11-11 Sebastian Bergmann - - * zend_execute.c: - Fugbix typo. - -2002-11-11 Ilia Alshanetsky - - * zend.h: - MFZE1 - -2002-11-10 Andi Gutmans - - * zend_compile.c: - - MFZE1 - -2002-11-10 Stanislav Malyshev - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - fix statics - make it behave like $this (fetch type "static") - Side effect: indirect references to statics won't work. - -2002-11-06 Sebastian Bergmann - - * zend_execute.c: - Fix ZTS build. - -2002-11-06 Stanislav Malyshev - - * zend_execute.c: - fix zend_assign_to_object_op - -2002-11-05 Ilia Alshanetsky - - * zend_language_scanner.l: - MFZE1 - -2002-11-05 Andi Gutmans - - * zend_compile.h: - - Shift around zend_op members - - * ZEND_CHANGES: - - A couple of updates - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - - Add support for static methods. Basically methods which are defined as - - static don't have $this. That's the whole difference. - - * tests/zend2.php: - - $clone -> $that - - * zend_execute_API.c: - - Fix bug introduced with type change of free_op1/2 - - * zend_language_parser.y - zend_language_scanner.l: - - ATTENTION: Finally nuke old_function and cfunction. I think it is time - - to get rid of these BC notations. This is from the days of the move from - - PHP/FI 2 -> PHP 3 - -2002-11-05 Ilia Alshanetsky - - * zend_hash.c: - Revert of previous patch. - -2002-11-05 Andi Gutmans - - * zend_compile.c - zend_objects.c: - - Change the automatically created variable $clone in __clone() to - - $that as discussed at the PHP Conference. If there are any objections - - alternative names please let me know. The reason for changing it from - - $clone is because $clone sounds as if it's the newly cloned object and - - not the old one. - -2002-11-05 Stanislav Malyshev - - * zend_compile.c - zend_compile.h: - avoid using 'class' in exported functions - it annoys c++ - -2002-11-05 Stig Bakken - - * zend.c: - Fixed some special cases that were crashing for the exception default - handler. - -2002-11-04 Ilia Alshanetsky - - * zend_compile.c: - Silence compiler warnings. - - * zend_hash.c: - If ordered is not set a random compiler assigned value of *p2 would be - used, - this patch fixes the problem by initializing *p2 to NULL. - - * zend_operators.c: - Silence compile warning, ctype.h is needed for tolower() function. - - * zend_language_scanner.l: - MFZE1 - -2002-11-02 Derick Rethans - - * zend_language_scanner.l: - - Fix segfault when __CLASS__ was used outside a class definition - - * zend.c: - - MFZE1 - -2002-11-02 Ilia Alshanetsky - - * zend_language_scanner.l: - MFZE1 (20214). - -2002-11-01 Andi Gutmans - - * zend_execute.c: - Fix unset($this->foo) - -2002-10-24 Andi Gutmans - - * zend_execute.c - zend_opcode.c: - Also tune jmpz_ex - - * zend_execute.c - zend_opcode.c - zend_compile.h: - - Improve performance of part of the jmps. More to follow. - -2002-10-23 Andi Gutmans - - * zend_execute.c - zend_compile.c: - - This might improve performance. Commiting it so that I can check it on - - Linux - - * zend_execute.c: - - Make Ts access a macro. I need this for my next patch which should - - improve performance but not sure yet if it will. - -2002-10-22 Andi Gutmans - - * zend_execute.c: - Nuke unused get_incdec_op() - - Nuke old comment - - * zend_compile.h - zend_execute.c - zend_globals.h: - Improve overall engine performance - - * zend_execute.c: - Fix bug reported by Daniel T. Gorski - -2002-10-21 Thies C. Arntzen - - * zend_builtin_functions.c: MFZE1 - -2002-10-20 Stanislav Malyshev - - * zend_object_handlers.c: looks like this message should go - - * zend_compile.c: Fix private handling - -2002-10-20 Sebastian Bergmann - - * zend_highlight.c - zend_highlight.h: Sync zend_html_puts parameter list with Zend Engine 1. - -2002-10-19 Andi Gutmans - - * zend_compile.h: - Fix compile warning. - - * zend_opcode.c - zend_compile.h - zend_execute.c: - Improve opcode dispatching - -2002-10-18 Andi Gutmans - - * zend.c - zend_compile.c - zend_execute.c: - - Change opcode dispatch mechanism to use a function per opcode and use - - a lookup table using the opcode # to call the correct function. - - Still have lots of tuning to do. - - * zend_execute.c: - Cleanup - -2002-10-16 Sebastian Bergmann - - * zend_execute.c: Fix ZTS build. - -2002-10-16 Stanislav Malyshev - - * zend_compile.c - zend_execute.c: Fix class static members: now the following code works: - - and returns "Hello" (class statics are not copied anymore, but looked up in - runtime) - - * zend_compile.c - zend_compile.h - zend_execute.c: Fix and generalize $this handling. - ZEND_FETCH_FROM_THIS is removed, IS_UNUSED type on class variables will be - used instead as the sign that it's a fetch from $this - -2002-10-14 Ilia Alshanetsky - - * zend_ini_parser.y - zend_ini_scanner.l - zend_globals.h: MFZE1 - -2002-10-14 Andi Gutmans - - * zend_execute.c - zend_language_parser.y: - Support new classname::$class_name, e.g.: - hello; - ?> - -2002-10-13 Ilia Alshanetsky - - * zend_extensions.h: Increased the API number. (re: floats patch) - -2002-10-12 Ilia Alshanetsky - - * zend_operators.c - zend_operators.h - zend.c - zend_execute_API.c - zend_globals.h: MFZE1 (floats & locale issue) - -2002-10-10 Sebastian Bergmann - - * ZEND_CHANGES: Fugbix typo. - -2002-10-10 Stanislav Malyshev - - * zend_object_handlers.c: add comment - - * zend_object_handlers.c: fix memory leaks - -2002-10-09 Stanislav Malyshev - - * zend_object_handlers.c: Fix object write handler behaviour: - * If this value is already set to given value, don't try to set it again. - * If we have reference, we should not move it. - * If we are assigning referenced variable, we should separate it. - -2002-10-09 Ilia Alshanetsky - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_object_handlers.c - zend_operators.c - zend_operators.h: MFZE1 zend_str_tolower issue. - -2002-10-07 Andi Gutmans - - * tests/zend2.php: - Fix test - - * zend_execute.c: - - Require $this-> when calling a methods. This whole automatic lookup - - first in the class and then in the global scope is confusing, slow and - - not quite BC compatible. - - * zend.c - zend_compile.c - zend_globals.h: - - Allow access to private/protected variables of $clone inside the __clone() - - method - -2002-10-06 Andi Gutmans - - * zend_execute.c: - Fix problem with unsetting object members. - -2002-10-01 Andi Gutmans - - * zend_language_parser.y: - - Fix problem when crashing on illegal tokens in class name during class - - definition. - -2002-09-30 Derick Rethans - - * ZEND_CHANGES: - No tabs :) - -2002-09-28 Derick Rethans - - * zend_builtin_functions.c: - Fix for defines... - - * zend_builtin_functions.c: - Fix build in non-ZTS mode - -2002-09-26 Ilia Alshanetsky - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_object_handlers.c - zend_operators.c - zend_operators.h: MFZE1 - -2002-09-25 Stanislav Malyshev - - * zend_extensions.h: - Propmote API NO year, so that it will never be the same as ZE1 API NO - -2002-09-24 Andi Gutmans - - * zend_compile.c: - Fix leak - - * zend_language_parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - - Megapatch to try and support inheritance from sub-classes. Things might - - be *very* buggy now so don't get too upset if that happens. - - I still need to improve some stuff but it's a good step (hopefully). - -2002-09-23 Andi Gutmans - - * zend_globals.h - zend_ini.c - zend_language_parser.y: - MFZE1. - -2002-09-21 Andi Gutmans - - * zend_extensions.h: - Someone screwed this up. - -2002-09-19 Derick Rethans - - * zend_ini.c: - Make Colin happy - -2002-09-19 Zeev Suraski - - * zend.c - zend.h - zend_execute_API.c: MFZE1 - connection_status() fix - - * zend.c: Fix non ZTS build - - * zend.c: Fix that obscure crash in Debug_TS mode - -2002-09-18 Zeev Suraski - - * zend.c: - Fix the thread-safe initialization of the ZE2. This should solve some - sporadic crashes, as well as the problem with the built-in constants. - - * zend_constants.c: Remove dead code - - * zend_builtin_functions.c: Add useful debugging function - -2002-09-17 Zeev Suraski - - * zend_hash.c - zend_hash.h: Add tracking for hashtable allocation - - * zend.c: ZE2 fix - - * zend_compile.c: whitespace - - * zend.c - zend.h: MFZE1 - threading fix - -2002-09-16 Andrei Zmievski - - * zend_API.h - zend_builtin_functions.c - zend_API.c - zend_execute_API.c: MFZE1 - -2002-09-15 Ilia Alshanetsky - - * zend_highlight.c: Make zend actually strip comments. Bug #18151 - - * zend.c: - Make zend return a proper exit error code when it encounters a parse error. - -2002-09-15 Andi Gutmans - - * zend_compile.c: - - Hopefully fix problem with __autoload not working well with inherited classes. - - There might still be some weird situations I haven't thought of. - - * zend_list.c - zend_execute.c: - WS fix - "while (" instead of "while(" - - * zend_execute_API.c - zend_ini.c - zend_list.c - zend_object_handlers.c - zend_objects_API.c - zend_operators.c - zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_execute.c: - WS - Always use "if (" and not "if(" - - * zend_execute_API.c: - WS - -2002-09-10 Stanislav Malyshev - - * zend_execute_API.c - zend_variables.c: MFZE1 - -2002-09-09 Stanislav Malyshev - - * zend_object_handlers.c: remove comment - -2002-09-08 Andi Gutmans - - * zend.h: - Prepare for alpha 3 - -2002-09-05 Stanislav Malyshev - - * zend_compile.c: quick-n-dirty inheritance support for __handlers - -2002-09-04 Sebastian Bergmann - - * ZEND_CHANGES: Whitespace fixes. - -2002-09-04 Stanislav Malyshev - - * zend_object_handlers.c: remove dead code - - * ZEND_CHANGES - zend_object_handlers.c: Fix __call and add some docs - -2002-09-04 Sebastian Bergmann - - * zend_object_handlers.c: Fix ZTS build. - - * ZEND_CHANGES: TBD: __call(), __get(), __set(). - -2002-09-04 Stanislav Malyshev - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_extensions.h - zend_object_handlers.c - zend_objects.c: Support for __get, __set and __call in classes. - This should work as follows: if class hasn't member with given name, - __get/__set is called. If class has no method with given name, __call is called. - __get/__set are not recursive, __call can be. - -2002-09-04 Sebastian Bergmann - - * ZEND_CHANGES: Workaround for superfluous comma in var_export() result. - - * ZEND_CHANGES: - Let debug_backtrace() example print out the class name, if applicable, and the function/method arguments. - -2002-09-03 Thies C. Arntzen - - * zend_builtin_functions.c: nuke warning - - * zend_builtin_functions.c: nuke unneeded stuff - -2002-09-03 Zeev Suraski - - * zend.c - zend.h - zend_ini.c: MFZE1 - -2002-09-03 Derick Rethans - - * zend_ini.c: - Revert - - * zend_ini.c: - - MFH for: Apply rest of html errors fix (Patch by Jan Lehnardt ) - -2002-09-03 Sebastian Bergmann - - * zend.h: - Add html_errors to zend_utility_values. Patch by Jan Lehnardt . - -2002-09-03 Andi Gutmans - - * zend_builtin_functions.c: - Fix typo - -2002-09-02 Thies C. Arntzen - - * zend_builtin_functions.c: - refine last patch. if the argument-stack is not consistent don't try to show - arguments. no call to zend_error is made as we might end up in an infinite - recursion if called from an error_handler. - so: if the arguments to functions aren't shown in debug_backtrace this is 'cause - the arument stack was not consistent when debug_backtrace was called. - - * zend_builtin_functions.c: - debug_backtrace() now checks the complete argument-stack for consistency. - -2002-09-02 Stanislav Malyshev - - * zend_execute.c: MFZE1 - -2002-09-01 Andi Gutmans - - * zend_llist.c: - Fix leak reported by "l0t3k" - -2002-09-01 Stanislav Malyshev - - * zend_operators.c: MFZE1 - -2002-08-28 Thies Arntzen - - * zend_builtin_functions.c - zend_execute_API.c: debug_backtrace() - - make args passed to functions called vy call_user_function available again. - - * zend_builtin_functions.c: debug_backtrace(): - - make args work if called from the error_handler - - fix refcount for args - - * zend.c: - clear current_execute_data on bailout as it would point into some freed area - on the stack. - -2002-08-28 derick - - * zend.c: - MFZE1 - -2002-08-26 Thies Arntzen - - * zend_builtin_functions.c: - debug_backtrace(): show name of included file for include and require calls - plus some small fixes suggested by andi. - -2002-08-24 Andi Gutmans - - * zend_builtin_functions.c: - Whitespace - - * zend_builtin_functions.c: - Whitespace and better variable name - -2002-08-24 Thies Arntzen - - * zend_builtin_functions.c: fix warning - -2002-08-23 Andi Gutmans - - * Zend.m4: - Add \n to configure fprintf - - * zend_extensions.c: - dlerror -> DL_ERROR - -2002-08-23 Thies Arntzen - - * zend_builtin_functions.c: - debug_backtrace: show include/require/eval as normal functions on the stack - -2002-08-23 derick - - * zend_builtin_functions.c: - No spaces :) - -2002-08-23 Thies Arntzen - - * zend_builtin_functions.c: - - debug_backtrace now also returns an array containing the arguments of the - called function. - - zeev, andi - is knowing the structure of the stack considered a bad thing in - zend_builtin_function? if yes i would have to create a new function in - zend_ptr_stack.c (but i think we are save this way) - - * zend_builtin_functions.c - zend_execute_API.c: - debug_backtrace: - added "type" ('->' or '::') for object calls. - made calls done thru call_user_func show-up correct in backtraces. - - andi, - does this look correct to you? - - * zend_execute.c: those are set by RETURN_FROM_EXECUTE - -2002-08-21 Thies Arntzen - - * zend_execute.c: - zend_execute: make sure that current_execute_data points to the right thing - after coming back from recursion. - -2002-08-19 Zeev Suraski - - * zend_operators.c: MFZE1 - -2002-08-17 Andi Gutmans - - * zend_execute.c: MFZE1 - -2002-08-17 Zeev Suraski - - * zend_execute.c - zend_hash.c: MFZE1 - -2002-08-16 Stig Bakken - - * zend.c: * append emacs footer - - * zend.c: * remove builtin exception class - -2002-08-16 Andi Gutmans - - * zend.c: - Fix whitespace - -2002-08-16 Stig Bakken - - * zend_execute_API.c - zend_globals.h - zend.c - zend_builtin_functions.c: - - Added set_exception_handler() function for registering a global, - catch-all exception handling function - - Added set_exception_handler() function for registering a global, - catch-all exception handling function (Stig) - -2002-08-15 Zeev Suraski - - * flex.skl - zend.c - zend_globals.h - zend_language_scanner.l: MFZE1 - -2002-08-14 jason - - * zend_compile.c - zend_compile.h - zend_globals.h - zend_language_parser.y: - MFZE1 (use token instead of global for opcode counting) - -2002-08-13 Andi Gutmans - - * zend_execute_API.c: - - Fix crash when exception is raised in __autoload function - -2002-08-13 Zeev Suraski - - * zend.h: MFZE1 - -2002-08-08 sebastian - - * zend_objects.c: Fix warning. - -2002-08-08 stas - - * zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h: Add ZEND_API to functions - -2002-08-08 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - zend_operators.c - zend_operators.h: - - Make new 'is' operator work with classes only and return false when - - the object isn't of the said class or the value isn't an object. - - * zend_static_allocator.c: - Bad Harald! :) - -2002-08-08 Zeev Suraski - - * zend_alloc.c: MFZE1 - -2002-08-07 phanto - - * zend_static_allocator.c - zend_alloc.c - zend_config.w32.h - zend_hash.c - zend_ini.c - zend_llist.h - zend_mm.c - zend_operators.c: make win32 debug output more verbose - -2002-08-03 Andi Gutmans - - * tests/zend2.php: - Small fix - -2002-08-03 Zeev Suraski - - * zend_execute.c: MFZE1 - -2002-08-01 stas - - * zend_execute.c - zend_hash.c: MFZE1 - -2002-07-30 jason - - * zend_compile.c - zend_execute.c - zend_globals.h: MFZE1 global declare - - * zend_compile.c: Fix segfault - -2002-07-30 Andrei Zmievski - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - zend_operators.c - zend_operators.h: - - Adding 'is' operator that can be used to check the type of a variable, - or its class. - -2002-07-28 phanto - - * OBJECTS2_HOWTO: update the handlers struct - -2002-07-27 Andi Gutmans - - * zend_compile.c - zend_execute_API.c: - - Make sure classes are first looked for in the current scope. - - Make sure that during inheritance the global scope is searched if the - - current one doesn't work. - -2002-07-26 Andi Gutmans - - * zend_execute.c - zend.c - zend_builtin_functions.c - zend_compile.h: - - Fix problem with debug_backtrace() reported by Stig. We weren't reporting - - global function information because it wasn't available. We have to do - - an additional assignment per-function call so that it'll be available. - - Also don't define the global scope as function name _main_ but leave it - - empty so that frameworks like Pear can decide what they want to do. - -2002-07-25 sniper - - * Zend.m4: Fixed 3 major failures in this test: - - 1. Tests work better when they are actually run.. - 2. When file is opened, it should be closed sometime too. - 3. AC_TRY_RUN cleans after itself (rm -f conftest.*), so it's - good idea to read the values while the file still exists. - - -2002-07-24 Andi Gutmans - - * zend_mm.c: - Fix some compile problems with the new configure checks. - -2002-07-24 James Cox - - * Zend.m4 - zend_mm.c: move testing for the alignment values into configure. - - * Zend.m4: ws fixes. - -2002-07-23 Andi Gutmans - - * zend_hash.c: - Fix WS. - -2002-07-21 Andi Gutmans - - * zend_compile.c: - - Fix bug reported by Sebastian where old constructors didn't work in - - nested classes. - -2002-07-18 derick - - * zend.h - zend_extensions.c: - MFZE1 - MacOSX fixes by Marko Karppinen - -2002-07-17 Andi Gutmans - - * zend_compile.c: - - Remove code which wasn't supposed to go into the patch. - - * zend_compile.c - zend_language_parser.y: - Rejuggle some code. - -2002-07-17 sniper - - * ZEND_CHANGES: This was mentioned already above (with an example too :) - -2002-07-16 Andi Gutmans - - * ZEND_CHANGES: - Before I forget to list it, this was also added. - - * zend_language_scanner.l: - - Syntactic sugar - Add "public" as a synonym for "var". - - Now we have the three P's. - You can do: - - - -2002-07-15 derick - - * zend_operators.c: - MFH of the crap removal - -2002-07-15 Andi Gutmans - - * ZEND_CHANGES - zend.c - zend.h - zend_API.c - zend_compile.c - zend_language_parser.y - zend_language_scanner.l - zend_opcode.c: - - Commit patch to support protected member variables (by Timm Friebe w/ - - some fixes by me). - - You can't access protected variables from outside the object. If you want - - to see a protected member from your ancestors you need to declare the - - member as protected in the class you want to use it in. You can't - - redeclare a protected variable as private nor the other way around. - - * zend_operators.c: - - Really implement bool increment/decrement as flip-flop. - -2002-07-14 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_language_scanner.l - ZEND_CHANGES: - - Nuke delete(). It was a big mistake to introduce it and I finally - - understand why Java didn't do so. - - If you still want to control destruction of your object then either make - - sure you kill all references or create a destruction method which you - - call yourself. - - * zend_execute.c: - Nuke some unused code - -2002-07-14 derick - - * zend_operators.c: MFZE1 - - * zend_operators.c: - MFZE1 - -2002-07-07 Andi Gutmans - - * zend_objects_API.c: - Path which should improve previous fix. - - * zend_objects_API.c: - - First try at solving problem with different objects being allocated the - - same id. - -2002-07-07 Stanislav Malyshev - - * zend_object_handlers.c: name length should be strlen+1 - -2002-07-07 Sebastian Bergmann - - * zend_language_parser.y: - Allow for 'class Namespace::Bar extends Foo' syntax. Patch by Timm Friebe . - -2002-07-06 Andi Gutmans - - * zend_execute.c: - - Fix problem where scope was lost in nested function calls. - - Thanks to Timm Friebe for diving into this one. - -2002-07-06 Zeev Suraski - - * zend_language_parser.y: spelling fix - -2002-07-05 Stig Bakken - - * zend_builtin_functions.c: * folding fixes - -2002-07-01 Andi Gutmans - - * zend_compile.c: - Fix bug when acccessing $this not in class scope. - - * zend_objects.h - zend_objects.c: - Export zend_object_get_address() - -2002-06-30 Andi Gutmans - - * ZEND_CHANGES: - Remember to document autoload when I have time. - -2002-06-30 Derick Rethans - - * zend_modules.h: - MFZE1 - -2002-06-29 Andi Gutmans - - * zend.h: - Get ready for alpha2 - - * zend_execute_API.c: - Invalid -> Undefined - - * zend_language_parser.y: - Add missing semi-colon. - - * zend_execute_API.c - zend_execute.c: - Improve some error messages. - - * zend_compile.c: - Revert previous fix. - - * zend_compile.c: - Change E_ERROR -> E_COMPILE_ERROR where needed. - - * zend_compile.c: - - Fix for bug #17882. We complain if the same method is declared twice. - - * zend.h - zend_operators.c: - Fix bug 15037 - - Bump version to alpha2-dev - -2002-06-28 Andi Gutmans - - * zend_operators.c: - WS fix - -2002-06-26 Andi Gutmans - - * zend_execute_API.c: - - Autoloading support based on patch from Ivan Ristic. - - Again I hope this feature ends up working well because if it doesn't we - - might need to nuke it. This only works for global scoped classes and it - - will never work for sub-classes so don't even ask!!!!! - - Just define an __autoload() function in the global scope and it will be - - called with the class name as the parameter if it doesn't manage to find - - the class. - - * zend_API.c - zend_builtin_functions.c - zend_mm.h: - Centralize global class fetch - - * zend_alloc.c - zend_execute.c: - - Fix problem with scope's not changing correctly during method calls. - - Reapply a tiny optimization to the allocator so that in non-debug mode - - we clean memory without detecting leaks. - -2002-06-24 Andi Gutmans - - * zend_fast_cache.h: - - MFZE1 (Turn off fast cache until we make sure it performs well.) - - * zend_alloc.c: - More fixes (warnings, bug fixes etc.) - - * zend_execute.c: - - Revert patch which checks at run-time if you're allowed to assign - - certain values by reference. - - We still need to find a solution for cases when this shouldn't be allowed - - as it might cause leaks. - - * zend_alloc.c: - Fix crash bug and clean up a bit. - -2002-06-24 Sebastian Bergmann - - * Zend.m4: IMHO, ZTS should no longer be labeled experimental. - -2002-06-24 Andi Gutmans - - * zend_alloc.c: - MFZE1 - - * zend_alloc.c: - Don't use cache if we're using ZEND_MM - - * zend_mm.c: - - Hardcode alignment to 8. We might need a configure check for this. - - * zend_mm.c - zend_mm.h: - Improve memory manager to allocate small blocks quickly. - - * zend_alloc.h - zend_mm.h - zend_alloc.c: - - Don't keep allocated blocks in a linked list if we're in non-debug mode - - as now the memory manager takes care to nuke all leaking blocks. - - * zend.h - zend_types.h: - MFZE1 - -2002-06-23 Andi Gutmans - - * zend_compile.c - zend_execute.c: - - Fix problem with constructor not being inherited and called correctly. - - * zend_mm.c: - Fix small bug - - * zend_mm.c: - - Almost completely implement realloc(). It now resizes in place when - - possible. - -2002-06-22 Andi Gutmans - - * zend_alloc.c - zend_mm.c: - Fix crash when zend_mm_shutdown is called more than once. - - * zend_alloc.c - zend_alloc.h - zend_globals.h - zend_language_parser.y: - MFZE1 - - * zend_constants.h - zend_objects.c - zend_variables.c - zend_variables.h - zend_constants.c - zend_alloc.c - zend_alloc.h: - Nuke persist_alloc(). - -2002-06-19 Andi Gutmans - - * zend_globals.h: - - This was also supposed to be part of the previous ZEND_MM commit :) - - * zend_alloc.c: - - Oops, this was supposed to be part of the previous #ifdef ZEND_MM change - - * zend_mm.h: - Use #ifdef for ZEND_MM - - * zend_mm.c: - Make sure MAX is defined - - * zend_constants.c: - - Fix problem where you couldn't define constants with different cases but - - the same name. - -2002-06-18 Derick Rethans - - * zend.c: - MFZE1 - -2002-06-17 Andi Gutmans - - * zend_mm.c: - Improve speed of alignment calculation - - * zend_mm.c - zend_mm.h - zend_alloc.c: - - Fix a bug and add code which frees actual allocated segments at the end - - of execution (this still doesn't work because some blocks remain - - referenced after the memory manager is killed. - - * zend_mm.c - zend_mm.h: - Save space per-allocated block. - -2002-06-16 Andi Gutmans - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - Fix bug in class constants - - Start centralizing main class lookups. This will help implement - - __autload() - - * zend_mm.c - zend_mm.h: - - Remove debug code which doesn't work anymore and add headers. - - * zend_globals.h - zend_mm.c - zend_mm.h - zend_alloc.c - ZendTS.dsp: - Commit an initial version of a home made memory manager. - - It's just for seeing if this would be an advantage to PHP in MT - - environments. If this is to become production material there is still - - a long way to go. - -2002-06-15 Andi Gutmans - - * zend_objects.h - zend_objects_API.c: - - Fix copy&paste problem where we allocated according to an old structure - - decleration and not the new one. - -2002-06-11 Andi Gutmans - - * zend_builtin_functions.c: - - Don't show debug_backtrace() in the trace itself. - - This patch is a bit ugly because the whole code itself is pretty complex - - and hard to re-order. - - * zend_execute.c - zend_language_parser.y: - - Fix problem with assigning functions by reference. - -2002-06-11 Sebastian Bergmann - - * RFCs/004.txt: Add __delegate(). - -2002-06-10 Harald Radi - - * zend_ts_hash.h - zend_ts_hash.c: added TS_HASH macro - -2002-06-10 Stanislav Malyshev - - * zend_execute.c: Fix leak - -2002-06-09 Harald Radi - - * zend_API.h - zend_builtin_functions.c - zend_object_handlers.h: - only check for an available class entry instead of - the std_object_handlers on some places - - -2002-06-08 Andi Gutmans - - * zend_hash.h - zend.h: - This should improve performance on Windows - - * zend_hash.h: - - Add a loop unrolled version of the hash function and a bit of an - - explanation about our hash function (Ralf S. Engelschall) - -2002-06-06 Sebastian Bergmann - - * RFCs/004.txt: Add RFC on delegation. - -2002-06-05 Sebastian Bergmann - - * zend_execute.c: Remove unused local variable. - -2002-06-05 Andi Gutmans - - * zend_compile.c - zend_execute.c - zend_object_handlers.c: - - Allow overloaded objects to receive the method name in its original - - case. - -2002-06-05 Derick Rethans - - * zend_llist.c: - Fix memleak (patch by Stefan Sesser) - -2002-06-04 Derick Rethans - - * zend_ini_scanner.l: - Fix for bug #17462 (Patch by Edin Kadribasic) - -2002-05-31 Andi Gutmans - - * ZendTS.dsp: - Add zend_objects_API.* to dsp - - * zend_objects_API.c: - Fix build (one more coming up) - - * zend_objects.c: - Fix build - -2002-05-31 Sebastian Bergmann - - * Zend.dsp: Add zend_objects_API.c to project. - -2002-05-31 Stanislav Malyshev - - * Makefile.am - zend_execute_API.c - zend_globals.h - zend_object_handlers.c - zend_objects.c - zend_objects.h - zend_objects_API.c - zend_objects_API.h: Generalize object storage and reference bookkeeping - -2002-05-30 Venkat Raghavan S - - * zend.h - zend_config.nw.h - acconfig.h: NetWare changes - -2002-05-26 Andi Gutmans - - * zend_multibyte.c: - - Add empty zend_multibyte.c to allow build with 4.3.0-dev. - -2002-05-24 Sebastian Bergmann - - * ZEND_CHANGES: Fugbix typo. - -2002-05-24 Andi Gutmans - - * ZEND_CHANGES: - Add a bit of information. - -2002-05-20 Zeev Suraski - - * zend_API.h - zend_execute.h - zend_list.h: MFZE1 (Expose more C++ APIs) - -2002-05-14 Andi Gutmans - - * zend_objects.c - zend_objects.h: - constructor_called is supposed to be destructor_called - -2002-05-13 Sterling Hughes - - * zend_qsort.c: MFZE1 - -2002-05-13 Derick Rethans - - * zend_builtin_functions.c: - MFZE1 - -2002-05-12 Zeev Suraski - - * zend_highlight.c: MFZE1 - -2002-05-12 Sebastian Bergmann - - * ZEND_CHANGES: Rephrase. - - * ZEND_CHANGES: Beautify. - - * ZEND_CHANGES: Start documenting the debug backtracing. - - * ZEND_CHANGES: Whitespace fixes. - -2002-05-11 Zeev Suraski - - * zend_highlight.c - zend_highlight.h: MFZE1 - -2002-05-10 Andi Gutmans - - * zend_builtin_functions.c: - Nuke C++ comment - - * zend_builtin_functions.c: - - Make debug_backtrace() return an array. Still not finished because I - might want to differentiate between method calls and static methods. - - Example: - $bt = debug_backtrace(); - foreach ($bt as $frame) { - if (isset($frame['class'])) { - print $frame['class']; - print "::"; - } - print $frame['function']; - print " ["; - print $frame['file']; - print ":"; - print $frame['line']; - print "]\n"; - } - -2002-05-08 Andi Gutmans - - * zend_execute.c - zend_builtin_functions.c: - - Hopefully fix problems with debug_backtrace() - -2002-05-08 Derick Rethans - - * zend_builtin_functions.c: - MFZE1 - -2002-05-07 Andi Gutmans - - * zend.c - zend_builtin_functions.c - zend_compile.h - zend_execute.c: - - More debug backtrace work. It still doesn't work very well... - -2002-05-02 Andi Gutmans - - * zend.h - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: Initial support for built-in backtracing. - There are still a few problems such as includes and calling other functions - from internal functions which aren't seen (will have to think if and how to - fix this). - Also the main scripts filename isn't available. Need to think about that. - -2002-04-30 Stanislav Malyshev - - * zend_API.h - zend_builtin_functions.c - zend_object_handlers.c - zend_object_handlers.h - zend_operators.h - zend_API.c: Make OBJCE return zend_class_entry*, also some cleanups - -2002-04-28 Sebastian Bergmann - - * zend_alloc.c - zend_alloc.h: Revert. - -2002-04-27 Sebastian Bergmann - - * zend_alloc.c - zend_alloc.h: - MFZE1: If the size-operands of memset are constants, the compiler can turn them into fast inline code. So, instead of using ecalloc, we use emalloc + memset in macro form now. emalloc will not return NULL, so the chosen macro form is safe. This is not true for malloc(3). An inline function accomodates our needs here. Suggested by: http://www.mail-archive.com/dev%40httpd.apache.org/msg02492.html (Sascha) - -2002-04-25 Harald Radi - - * zend_config.w32.h: unbreak the win32 build - -2002-04-24 Harald Radi - - * zend_API.c: MFZE1 saschas 'Avoid exceeding buffer limits' patch - -2002-04-23 Harald Radi - - * zend_hash.c - zend_hash.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ts_hash.c - zend_ts_hash.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_API.c - zend_API.h - zend.h: some type cleanup work - -2002-04-22 Harald Radi - - * zend_object_handlers.c - zend_object_handlers.h - zend_objects.h - zend_operators.h - zend_API.c - zend_API.h - zend_builtin_functions.c: added get_class_entry callback handler to the - object handlers structure - -2002-04-22 Sebastian Bergmann - - * Zend.m4: MFZE1: Change default value of inline-opt to yes (Sascha). - -2002-04-22 Harald Radi - - * zend_config.w32.h - acconfig.h - flex.skl: fixed linkage warning under win32 - -2002-04-20 Zeev Suraski - - * zend_execute_API.c: MFZE1 - -2002-04-19 Sebastian Bergmann - - * zend_list.c - zend_hash.c - zend_hash.h: - MFZE1: make sure the resource-list is always consistent during shutdown (Thies). - - * zend_hash.c: MFZE1: Fix imbalance bug (Zeev). - -2002-04-10 Jani Taskinen - - * zend_language_scanner.l - zend_language_parser.y: MFZE1 - -2002-04-07 Stanislav Malyshev - - * zend.h: make compatible with current PHP - - * zend_compile.c: sync - -2002-03-29 Derick Rethans - - * zend_compile.c: - revert patch - -2002-03-25 Derick Rethans - - * zend_compile.c: - MFZE1 - -2002-03-23 Andi Gutmans - - * zend_ts_hash.c - zend_ts_hash.h: - - Fix build without ZTS. If someone has a nicer fix let me know. - -2002-03-21 Andi Gutmans - - * zend_language_parser.y: - - No idea how this slipped in. Fix delete $obj statement. - -2002-03-20 Harald Radi - - * ZendTS.dsp - zend.h - zend_ts_hash.c - zend_ts_hash.h: added thread safe hashtable which allows concurrent - reads but only exclusive writes - -2002-03-19 Andi Gutmans - - * zend_language_parser.y - zend.h: - - Finish covering all parsed methods to check for validity in parser. - - Change zval's refcount to zend_uint (If it doesn't slow down the Engine - - too much it should probably stay this way). If anyone has time to test - - the difference in speed between zend_ushort & zend_uint in zend.h of - - the struct _zval_struct (one line change) I'd be glad to get some - - figures. - -2002-03-18 Andi Gutmans - - * zend_compile.c - zend_language_parser.y: - - More fixes to check for member/function call legality. - -2002-03-17 Andi Gutmans - - * zend_language_parser.y - zend_compile.c: - - Start putting error handling where method calls are being used in a - - context where only writable variables should be used. - -2002-03-15 Andi Gutmans - - * zend_execute.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_variables.c: - Pass TSRMLS to callbacks. - - * zend_execute.c: - - Scope fix. When calling an imported function the scope will change - - correctly to the scope of the functions class. - - - * zend_opcode.c - zend_execute.c - zend_compile.h - zend_compile.c: - - Fix issues with $this when using it by itself without indirection such as - - $this->foo. - -2002-03-14 Stanislav Malyshev - - * OBJECTS2_HOWTO: more cleanup - - * OBJECTS2_HOWTO: Update howto - - * zend_execute.c: fix for delete $this and unset $this - - * zend_execute_API.c: Fix call_user_function - -2002-03-12 Andi Gutmans - - * zend.h: - Forgot to close comment. - - * zend.h: - Macro for duality between Engine 1 and 2 - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_opcode.c - zend_operators.c: - Another couple of indirection fixes. - - Make class_entry->refcount be part of the structure and not allocated. - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c: - Fix bug introduced with latest class hash table change. - -2002-03-12 Stanislav Malyshev - - * zend_API.c: Fix standard object creation - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend.c - zend.h: - make class tables contain class_entry *, not class_entry - - fix isset($this) - -2002-03-10 Andi Gutmans - - * zend_execute.c: - Fix build in ZTS mode. - -2002-03-10 Stanislav Malyshev - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_object_handlers.c - zend_object_handlers.h: New stuff for objects API: - - Better assignment handling - - More flexible operations with zval-containing objects - -2002-03-09 Andi Gutmans - - * tests/zend2.php: - - Add the original example script to the CVS so that it's always available. - -2002-03-08 Sebastian Bergmann - - * ZEND_CHANGES: Add 'import const' example. - -2002-03-08 Andi Gutmans - - * zend_execute.c: - Support importing constants. e.g.: - - - * ZEND_CHANGES: - Add another 'import' example and merge 'import' section into 'Namespaces' section. - -2002-03-06 Andi Gutmans - - * zend_execute.c: - - Add function * and class * functionality. Only constants are left. - - - * ZEND_CHANGES: Consistency. - - * ZEND_CHANGES: Add 'import statement' section. - -2002-03-02 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - - Initial patch to support importing from class scopes (for Stig). - - It isn't complete yet but I want to work on it from another machine. It - - shouldn't break anything else so just don't try and use it. - - The following is a teaser of something that already works: - - -2002-03-02 Derick Rethans - - * zend_builtin_functions.c: - MFZE1 - -2002-03-01 Andrei Zmievski - - * zend_API.c: MFZE1 - -2002-03-01 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - - Remove use of C++ reserved words namespace/this - - * zend_opcode.c - zend_language_parser.y - zend_compile.h - zend_compile.c - zend_API.c: - Fix bug in nested try/catch's - - Infrastructure for implementing imports of methods. - - * zend_objects.c: - - Fix crash reported by Sebastian when destructor function causes a fatal - - error. I hope this does it and we don't find any other problems. - -2002-02-26 Andi Gutmans - - * zend_alloc.h - zend_alloc.c - zend.c: - MFZE1 - -2002-02-21 Sebastian Bergmann - - * ZEND_CHANGES: - Maintain ZEND_CHANGES to account for the addition of private member variables. - -2002-02-21 Andi Gutmans - - * zend_object_handlers.c - zend_opcode.c - zend_language_parser.y - zend_language_scanner.l - zend_compile.c - zend.c - zend.h - zend_API.c: - Experimental support for private members. - Hello; - } - } - - class MyClass2 extends MyClass { - function printHello() - { - MyClass::printHello(); /* Should print */ - print $this->Hello; /* Shouldn't print out anything */ - } - } - - $obj = new MyClass(); - print $obj->Hello; /* Shouldn't print out anything */ - $obj->printHello(); /* Should print */ - - $obj = new MyClass2(); - print $obj->Hello; /* Shouldn't print out anything */ - $obj->printHello(); - ?> - -2002-02-14 Stanislav Malyshev - - * zend.h - zend_API.c: Pass TSRM to create_object - -2002-02-14 Andrei Zmievski - - * zend_compile.c: - Fix the bug where the declared properties without init values were not - entered into the table. - -2002-02-13 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - * zend_compile.h: - Export lex_scan(). Both the PHPDoc and tokenizer extension need this. I hope this is okay with Z&A. - -2002-02-08 Andi Gutmans - - * zend_objects.c: - Remove object debug messages. - -2002-02-07 Stanislav Malyshev - - * Makefile.am - OBJECTS2_HOWTO - ZendTS.dsp - configure.in - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_object_handlers.c - zend_object_handlers.h - zend_objects.c - zend_objects.h - zend_operators.c - zend_operators.h - zend_variables.c: Mega-commit: Enter the new object model - Note: only standard Zend objects are working now. This is definitely going to - break custom objects like COM, Java, etc. - this will be fixed later. - Also, this may break other things that access objects' internals directly. - -2002-02-04 Andi Gutmans - - * zend_execute.c: - - This small patch should also take care of allowing unseting of $this->foo - - and static members. The unset() opcode was luckily already suitable for - - object overloading. - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_objects.c: - - Fix problem with the objects_destructor called during shutdown. It was - - freeing objects from id 0 instead of id 1. id 0 is not used. - - Change isset/empty opcodes to support static members and the new way of - - doing $this->foobar. Also the opcodes operate now on the hash table - - combined with the variable names so that they can be overloaded by the - - soon to be added overloading patch. - -2002-02-03 Adam Dickmeiss - - * Makefile.am - configure.in: - Zend config sets ZEND_EXTRA_LIBS. Bugs 14452, 14602, 14616, 14824 - -2002-02-02 Sebastian Bergmann - - * zend_builtin_functions.c: Revert per Andi's request. Sorry :-( - - * zend_builtin_functions.c: Fix warning. Again :-) - -2002-02-02 Andi Gutmans - - * zend_builtin_functions.c: - - Please don't use strcmp() and friends in Zend but only the mem* - - functions. I didn't check this patch so please check that it works. - -2002-02-02 Sebastian Bergmann - - * zend_builtin_functions.c: Fix a warning. - -2002-02-02 Andi Gutmans - - * zend_modules.h: - Nice catch by Derick. GINIT is dead. - -2002-02-01 Sebastian Bergmann - - * zend_builtin_functions.c: MFZE1: is_a() - -2002-01-27 Sebastian Bergmann - - * zend_config.w32.h: - MFZE1: define a couple of macros under win32. (Patch By: Jon Parise ) - -2002-01-25 Andi Gutmans - - * zend_compile.c - zend_execute_API.c - zend_objects.c - zend_objects.h - zend_opcode.c: - - First destructor hell fix. There was a situation where an object's - - destructor could be run after its class was already dead. Right now - - object destructors is the first thing whic happens during shutdown in - - order to prevent this problem. It's very likely that destructors will - - cause more grief and we'll have to outline exactly when you should use - - them and what kind of logic you're allowed to do inside of them. - - This bug was reported by sebastian. - -2002-01-22 Andi Gutmans - - * zend_execute.c: - - Fix a bug reported by Sebastian with indirect class names not working. - -2002-01-20 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_opcode.c: - Improve performance of functions that use $GLOBALS[] - - Please check this and make sure it doesn't break anything. - -2002-01-19 Thies C. Arntzen - - * zend_language_parser.y: MFZE1 - -2002-01-14 Andi Gutmans - - * zend_execute_API.c: - - Fix crash bug in call_user_function_ex(). Thanks to Sebastian for the - - very nice and short reproducing script. - - -2002-01-14 Sebastian Bergmann - - * ZEND_CHANGES: Update Exceptions example. - -2002-01-13 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y: - - Change exception handling to use the Java-like catch(MyException $exception) - - semantics. Example: - exception = $exception; - } - - function Display() - { - print "MyException: $this->exception\n"; - } - - } - class MyExceptionFoo extends MyException { - function __construct($exception) - { - $this->exception = $exception; - } - function Display() - { - print "MyException: $this->exception\n"; - } - } - - try { - throw new MyExceptionFoo("Hello"); - } catch (MyException $exception) { - $exception->Display(); - } - ?> - - * zend_ini_scanner.l: - MFZE1 - -2002-01-06 Andi Gutmans - - * zend.c: - - Output error when there's an uncaught exception (by Timm Friebe) - - * zend_execute.c: - Make sure $this is passed on to methods - -2002-01-06 Sebastian Bergmann - - * zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_variables.c - zend_variables.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c: Happy New Year. - -2002-01-05 Andi Gutmans - - * zend_compile.c: - Small fix - - * zend_compile.c - zend_compile.h - zend_execute.c: - Allow passing of $this as function arguments. - - Fix a bug which I introduced a couple of months ago - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: - - Significantly improve the performance of method calls and $this->member - - lookups. - -2002-01-04 Andi Gutmans - - * zend_execute.c: - - Improve performance of indirect-referenced function calls - - * zend_compile.c: - Nuke C++ comments - - * zend_compile.c - zend_compile.h - zend_execute.c: - Separate other kinds of function calls too. - - Significantly improve performance of function calls by moving lowercasing - - the function name to compile-time when possible. - - * zend_compile.c - zend_compile.h - zend_execute.c: - - Start splitting up different kinds of function calls into different - - opcodes. - -2002-01-03 Derick Rethans - - * zend_API.c - zend_API.h - zend_execute.c - zend_list.c: - - MFZE1 for exit fix, exposing current function name in error messages and - exposing zend_zval_type_name(). - -2001-12-31 Sebastian Bergmann - - * ZEND_CHANGES: Consistency. - -2001-12-31 Andi Gutmans - - * ZEND_CHANGES: - - Add example of default argument for argument passed by-ref - -2001-12-30 Sebastian Bergmann - - * ZEND_CHANGES: Typo. - -2001-12-29 Andi Gutmans - - * zend.h: - - #define to help #ifdef stuff in PHP sources to make them work w/ ZE1 and - - 2 - - * ZEND_CHANGES: - A few clarifications - -2001-12-29 Sebastian Bergmann - - * ZEND_CHANGES: Integrate Andi's examples and some notes by Stig. - - * ZEND_CHANGES: Update Exceptions example. - -2001-12-28 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Fix some case insensitivity stuff in respect to classes - - * zend_execute.c - zend_language_parser.y: - - Support default arguments for reference parameters - - Fix two compile warnings - - * zend_compile.c: - - Wasn't adding the lower case version of the class name to the hash - -2001-12-27 Andi Gutmans - - * zend_compile.c - zend_objects.c: - - Use two underscores for __construct(), __clone and friends... - - * zend_objects.c: - - Only check refcount of object if the destructor was called. - - * zend.c - zend.h - zend_API.h - zend_compile.c - zend_objects.c - zend_objects.h: - - Experimental support for destructors. We need to see if destructors - - will actually work well in the context of PHP so we should consider this - - as experimental. Possible problems might be that when the constructor is - - run PHP might not be in a stable state. - - * zend_compile.c - zend_compile.h - zend_execute.c: - Support parent:: again - - * zend_compile.c: - Support unified constructor name _construct() - -2001-12-26 Andi Gutmans - - * zend_execute.c - zend_execute_API.c: - Fix scoping issue. The following works now: - id = self::$id++; - } - - function _clone() - { - $this->name = $clone->name; - $this->address = "New York"; - $this->id = self::$id++; - } - } - - - - $obj = new MyClass(); - - $obj->name = "Hello"; - $obj->address = "Tel-Aviv"; - - print $obj->id; - print "\n"; - - $obj = $obj->_clone(); - - print $obj->id; - print "\n"; - print $obj->name; - print "\n"; - print $obj->address; - print "\n"; - - * zend.c: - Print out object id for easier debugging - - * zend.c - zend.h - zend_API.h - zend_compile.c - zend_objects.c: - Pretty much finish _clone() support - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - Initial support for _clone() - - * zend_compile.c - zend_language_parser.y: - - Start fixing the parsing rules so that function and method calls - - can't be used in a write context. - - * zend.c: - Fix crash correctly. - -2001-12-25 Andi Gutmans - - * zend_language_parser.y: - Revert delete syntax patch - - * zend.c - zend_execute.c: - Fix a crash (not a thorough fix). - - Commented old code - -2001-12-24 Andi Gutmans - - * zend_execute.c: - - Fixed bug where global functions weren't called if they didn't exist - - in the class scope - -2001-12-23 Andi Gutmans - - * zend.c: - - Fix a bug where function's didn't work anymore in multi-threaded - - servers after the latest startup changes. - -2001-12-22 Andi Gutmans - - * zend_compile.c - zend_execute_API.c - zend_language_parser.y: - - Add initial capability of defining nested classes as class foo::bar - -2001-12-18 Zeev Suraski - - * zend_language_scanner.h - zend_language_scanner.l: MFZE1 - -2001-12-16 Sebastian Bergmann - - * ZEND_CHANGES: I'm too trigger-happy. - - * ZEND_CHANGES: delete is now function - -2001-12-16 Andi Gutmans - - * zend_language_parser.y: - - Seems like most people prefer delete($obj) over delete $obj. - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Start adding parsed variable checks. - - * zend_compile.h - zend_language_parser.y: - - Framework for knowing what kind of variable we just parsed. - - This will be used in compile-time error checking which couldn't be done - - at the level of the grammar. - -2001-12-13 Andi Gutmans - - * zend_language_parser.y: - - Rearrange grammar to allow dereferencing of objects returned from - - functions. It still crashes though. - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_opcode.c: - Fix crash bug in startup code. - - Start work on being able to reference global and local scope - -2001-12-12 Andi Gutmans - - * Zend.dsp - zend.c - zend_constants.c - zend_globals.h: - - Infrastructure changes for allowing to access the global scope from - - within a class scope. - - Fix the Zend.dsp project a bit. It seems someone pretty much killed it - - when commiting their own personal configuration. Please be careful in - - future. - - * zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y: - - Make classes have scope and function/constant lookups default to the class - -2001-12-11 Andi Gutmans - - * zend.c: - Merge from ZE1 - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_opcode.c: - - Rename zend_class_entry.constants -> zend_class_entry.constants_table - - * zend_execute.c: - - Start making scope change correctly when calling namespace functions. - - When inside a namespace fallback to global namespace when function - - or constant is not found. - -2001-12-11 Sebastian Bergmann - - * LICENSE: Forgot to update the LICENSE. - - * LICENSE - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_qsort.c - zend_qsort.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_variables.c - zend_variables.h: Update headers. - - * Zend.m4 - zend.h: MFZE1 (AIX fixes) - - * zend_highlight.h - zend_highlight.c: MFZE1 (added zend_strip mode in the highliter) - -2001-12-10 Andi Gutmans - - * zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - More namespaces work. - - Nuke memory leak. - -2001-12-08 Andi Gutmans - - * zend.c: - Fix crash with unhandled exceptions - -2001-12-06 Andi Gutmans - - * zend_execute.c: - Support constants. The following works now: - - - * zend_language_parser.y - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h: - - Initial work on changing namespace scope. Only methods & variables - - right now. - - - * zend.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y: - - Nuke the namespace work I did. It'll be redone differently. - -2001-12-05 Sebastian Bergmann - - * ZEND_CHANGES: Document recent changes. - -2001-12-04 Andi Gutmans - - * zend_builtin_functions.c: - Damn Zeev :) - -2001-12-01 Andi Gutmans - - * zend_API.c: - - Revert one of the changes because it might be before the memory - - manager has started. - - * zend_API.c - zend_constants.c: - Use alloca() when possible. - -2001-11-30 Andi Gutmans - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_language_parser.y - zend_opcode.c: - - Initial support for class constants. There are still a few semantic - - issues which need to be looked into but basically it seems to work. - - Example: - - - * Zend.m4: - Fix typo - -2001-11-27 Andi Gutmans - - * zend_language_parser.y: - - Support syntax for class constants (doesn't do anything yet but - - required some reworking of the grammar). - -2001-11-26 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - - Support static $var = 0; style initialization of static class - - members. For example: - - class foo { - - static $my_static = 5; - - - - } - - - - print foo::$my_static; - -2001-11-25 Andi Gutmans - - * zend.c - zend_compile.c: - Fix crash and leak - - * zend_compile.c: - Whitespace - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y - zend_opcode.c: - Support static members. The following script works: - - -2001-11-24 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c: - MFZE1 - -2001-11-15 Zeev Suraski - - * zend_compile.c: MFZE1 - -2001-11-05 stig - - * zend_objects.h: add newline at end of file to avoid warnings - - * zend_language_parser.y: non-zts compile fix - -2001-11-04 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_language_parser.y: - - Support instantiation of nested class. The following script now should - - work: - -bar(); - - - - $obj = new foo::barbara(); - - $obj->bar(); - - - -2001-11-03 Andi Gutmans - - * zend.h: - RISC OS patch by Alex Waugh - - * zend.c - zend_API.h - zend_compile.c: - Add some initializations - - * zend_compile.c - zend_execute.c - zend.h: - - Add constructor to the zend_class_entry instead of looking it up each - - time by name. - - This will allow the next patch of being able to instantiate nested - - classes such as new foo::bar::barbara(); - -2001-10-29 Andi Gutmans - - * zend_API.c - zend_opcode.c: - Fix internal classes - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_globals.h - zend_language_parser.y - zend_opcode.c: - Initial support for nested class definitions - -2001-10-27 Zeev Suraski - - * zend_execute.c: MFTGZE1 - -2001-10-26 Andi Gutmans - - * zend_execute_API.c: - Fix Zeev's MFZE1 - -2001-10-23 Zeev Suraski - - * zend_constants.c - zend_execute_API.c - zend_globals.h: MFZE1 - -2001-10-20 Andrei Zmievski - - * zend_API.c: MFHZ1 - -2001-10-12 Sebastian Bergmann - - * zend_API.c - zend_API.h - zend_modules.h: MFZE1: Introduced extension version numbers (Stig) - -2001-10-04 Sebastian Bergmann - - * zend_hash.c: MFZE1 - -2001-09-30 Andi Gutmans - - * zend.c - zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - - Merge the NAMESPACES_BRANCH. It wasn't a good idea to have a branch when - - the whole CVS tree is work in progress - - * zend_compile.h - zend_execute.c: - - At last I've had some time to move all execute() locals into one struct. - - No immediate gain but it makes it more clear what variables are temps - - and which ones are execute() locals. - -2001-09-27 Andi Gutmans - - * zend_modules.h: - Bump it up in the right place - - * zend_modules.h: - Increase API number - -2001-09-26 Andi Gutmans - - * zend.c - zend.h - zend_compile.c - zend_execute.c: - Good catch by Sterling - -2001-09-24 Andi Gutmans - - * zend_execute.c - zend_execute_API.c - zend_globals.h: - More namespaces work - -2001-09-22 Sebastian Bergmann - - * ZEND_CHANGES: Keep ZEND_CHANGES up-to-date. - -2001-09-22 Zeev Suraski - - * zend_globals.h - flex.skl - zend.c - zend_ini_scanner.l - zend_language_scanner.l: MFZE1 - -2001-09-20 Andi Gutmans - - * zend.c - zend_compile.c: - Fix build on Win32 - - * zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l - zend.c: - - Create a branch for namespaces. This isn't even remotely close to - - working. - - * zend_list.h: - Nuke unused enum - -2001-09-19 Zeev Suraski - - * flex.skl - zend.c - zend_globals.h - zend_ini_scanner.l - zend_language_scanner.l: MFZE1 - -2001-09-19 Andi Gutmans - - * Makefile.am: - MFZE1 - -2001-09-19 Sebastian Bergmann - - * Makefile.am - zend_hash.c - zend_hash.h - zend_ini.c - zend_llist.c - zend_llist.h - zend_qsort.c - zend_qsort.h - Zend.dsp - ZendTS.dsp: MFZE1 - -2001-09-17 Brian L. Moon - - * RFCs/003.txt: adding RFC for loose type requirements for functions - -2001-09-16 Zeev Suraski - - * zend_compile.c: MFZE1 - -2001-09-10 Zeev Suraski - - * zend_compile.h - zend_globals.h - zend_ini_scanner.h - zend_ini_scanner.l - zend_language_scanner.h - zend_language_scanner.l: MFZE1 (nuke cplusplus code) - - * zend.c - zend_execute_API.c - zend_globals.h: MFZE1 (support return value in execute_scripts) - -2001-09-08 stig - - * RFCs/002.txt: remove bogus comment :) - - * RFCs/002.txt: RFC document for namespaces - - * RFCs/001.txt: wrapped to 80 columns :) - -2001-09-07 Andi Gutmans - - * zend_compile.c - zend_language_parser.y: - - Shift around the variable parsing code to make it simpler. - - * zend_llist.c: - - Fix warning (was fixed in ZE1 and not merged at some point). Please make - sure you merge patches! - -2001-09-05 Stanislav Malyshev - - * zend_operators.c: MFZE1 - -2001-09-03 Andi Gutmans - - * zend_language_parser.y: - CLS_CC -> TSRMLS_CC - -2001-08-31 Sterling Hughes - - * zend_llist.h: spaces->tabs - - * zend_llist.c - zend_llist.h - zend_execute_locks.h: MFZE1 - -2001-08-31 Zeev Suraski - - * zend.c - zend_compile.h: MFZE1 - -2001-08-30 Andi Gutmans - - * zend_compile.h - zend_compile.c: - Make it compile in thread-safe mode. - - * zend_compile.c - zend_compile.h - zend_execute.c: - Get rid of warning and C++ comments - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - Initial support for exceptions. - -2001-08-30 Zeev Suraski - - * zend_execute.c: MFZE1 - -2001-08-28 Zeev Suraski - - * zend_language_scanner.l: MFZE1 - -2001-08-27 Andi Gutmans - - * RFCs/001.txt: - Add sample RFC - -2001-08-26 Stanislav Malyshev - - * Zend.m4 - zend.h: Add dlsym underscore detection, by Jani Taskinen - -2001-08-26 Andi Gutmans - - * zend_operators.c: - MFZE1 - - * zend_API.c: - - Merge Andrei's fix from Engine 1. Please commit patches to both trees! - -2001-08-21 Zeev Suraski - - * zend.c - zend_execute_API.c: MFZE1 - -2001-08-20 Zeev Suraski - - * zend_hash.c - zend_hash.h: MFZE1 - -2001-08-19 Andi Gutmans - - * zend.h: - Fix compile problem - -2001-08-19 Zeev Suraski - - * zend_compile.c: MFZE1 - -2001-08-18 Andi Gutmans - - * zend_execute.c - zend_llist.c - zend_llist.h: - Merge Sterling's patches from ZE1 - -2001-08-17 Andrei Zmievski - - * zend_execute.c: MFZE1 - -2001-08-17 Zeev Suraski - - * zend_alloc.c: MFZE1 - -2001-08-16 Zeev Suraski - - * flex.skl - zend_ini_scanner.l - zend_language_scanner.l: MFZE1 - -2001-08-16 Andi Gutmans - - * zend_execute.c: - Try and nuke get_object_zval_ptr() - - * zend_objects.c: - Remove bogus notice - - * zend_variables.c: - Sync with ZE1 - - * zend.h - zend_execute.c - zend_objects.c - zend_objects.h - zend_operators.c - zend_operators.h - zend_variables.c: - Fix a bug in method calls. - - Try to get the old copying behavior of objects to work (doesn't work yet). - -2001-08-15 Zeev Suraski - - * zend_extensions.c: MFZE1 - -2001-08-14 Zeev Suraski - - * zend_constants.c - zend_constants.h - zend_variables.c - zend_variables.h: MFZE1 - -2001-08-13 Andi Gutmans - - * zend_execute.c: - MFZE1 - - * zend_execute.c: - Merge from Engine 1 - -2001-08-13 Zeev Suraski - - * zend_API.c - zend_operators.c - zend_operators.h: MFZE1 - -2001-08-12 Stanislav Malyshev - - * zend_API.h: _FUNCTION is used in definition, so use _D - -2001-08-11 Andi Gutmans - - * zend_API.c - zend_API.h - zend_objects.c - zend_operators.c: - More work on making objects work - - * zend_API.c - zend_objects.c - zend_objects.h - zend_operators.c: - - Fix some places which create objects. The fixes are ugly and will be - revised when things start working well - -2001-08-11 Zeev Suraski - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_compile.c - zend_constants.c - zend_constants.h - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_ini.h - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_operators.c: Whitespace - -2001-08-11 Andi Gutmans - - * Makefile.am - zend_objects.c: - Fix UNIX build. - - * zend_compile.c: - - Need to do some rewriting in the parser instead of this. - - * zend.h: - - For Sebastian. Will allow to see you're using the Engine 2 CVS via - phpinfo() - -2001-08-10 Andi Gutmans - - * zend_API.h: - Merge from Engine 1 - - * zend_compile.c: - A couple of fixes - - * zend_API.h: - Merge from Engine 1 CVS - -2001-08-09 Andi Gutmans - - * zend.c: - Merge from Engine 1 tree - -2001-08-08 Andi Gutmans - - * zend.c - zend_compile.c - zend_compile.h - zend_globals.h: - Merge new $_GET, $_POST etc. patch from Engine 1 tree - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Preliminary patch for method() dereferencing - - * zend.c - zend.h: - Merge zend_try fix from Engine 1 - -2001-08-07 Zeev Suraski - - * ZendTS.dsp: Migrate .dsp patches - -2001-08-07 Andi Gutmans - - * ZendTS.dsp: - Forgot to commit the updated dsp - - * ZendTS.dsp: - More sync with latest CVS - - * zend_objects.c - zend_objects.h - zend_operators.h - zend_variables.c - ZendTS.dsp - zend.h - zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_language_parser.y - zend_language_scanner.l: - Sync Engine2 CVS with latest Engine CVS - -2001-08-06 Zeev Suraski - - * zend_indent.c: Commit uncommitted build fix - - * zend_compile.c - zend_globals.h - zend_language_scanner.l: - Fix an off by one lineno issue, in case of an implicit ; - - * flex.skl - zend_highlight.c: Better shared code - - * Makefile.am - Zend.dsp - Zend.m4 - ZendTS.dsp - flex.skl - zend.c - zend_globals.h - zend_globals_macros.h - zend_highlight.c - zend_indent.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_language_scanner.h - zend_language_scanner.l: - Merge from branch - move to standard C scanners in thread safe mode - - * Makefile.am - Zend.m4 - flex.skl - zend_ini_scanner.l - zend_language_scanner.l: Make the C++less scanner compile under UNIX - -2001-08-06 Andi Gutmans - - * zend_execute.c: - Move to using Z_ macros - - * zend_API.h: - Use Z_ macros - -2001-08-05 Zeev Suraski - - * zend_globals_macros.h: More nulled-out macros - - * zend.c - zend_API.c - zend_API.h: TSRMLS_FETCH work - -2001-08-04 stig - - * .cvsignore: added some more stuff to .cvsignore - -2001-08-03 Zeev Suraski - - * zend_alloc.c: Fix buglet - - * zend_alloc.c: Fix macro - - * zend.c - zend_alloc.c - zend_globals.h: - Implement fast memory allocation and reduced fragmentation under Windows. - - * zend_globals_macros.h: Some compat macros - -2001-08-02 Zeev Suraski - - * zend_execute.c: - require_once()/include_once will return true in case a file was not included - because it was already included earlier. - Changed the default return value type of the include() family from long to - boolean - - * zend_constants.c - zend_execute_API.c - zend_hash.c - zend_hash.h: - Avoid going over huge lists of functions, classes and constants. - Special thanks to the guys from the MS lab for the profiling tools :) - - * zend.c - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h: Some cleanup - - * zend_builtin_functions.c - zend_hash.c - zend_hash.h: TSRMLS fixes - - * zend_ini_parser.y: non ZTS build fix - - * Zend.dsp - ZendTS.dsp - flex.skl - zend.c - zend_globals.h - zend_globals_macros.h - zend_highlight.c - zend_indent.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_language_scanner.h - zend_language_scanner.l: - Implement a standard C thread safe scanner within flex - -2001-08-01 Zeev Suraski - - * flex.skl - zend_language_scanner.l: - Implement fast scanning in the multithreaded environment - -2001-07-31 Zeev Suraski - - * zend_language_scanner.l: the make Sebastian happy part of the day :) - - * zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l: More TSRMLS_FETCH work - - * zend_list.c - zend_list.h: More TSRMLS_FETCH annihilation - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_hash.c - zend_hash.h - zend_ini.c - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c: More TSRMLS_FETCH work - -2001-07-30 Zeev Suraski - - * zend_language_scanner.l: Compile fix - - * zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_highlight.c - zend_highlight.h - zend_ini.c - zend_ini.h - zend_ini_parser.y - zend_language_scanner.l - zend_modules.h: More TSRMLS_FETCH work - - * zend_API.c - zend_API.h - zend_builtin_functions.c - zend_modules.h: - More TSRMLS_FETCH work, and get rid of redundant ParametersPassedByRef - -2001-07-30 Andrei Zmievski - - * zend_API.c - zend_API.h: - Let's be consisten and keep TSRMLS_DC declaration after num_args. - -2001-07-30 Zeev Suraski - - * zend_API.c - zend_API.h - zend_builtin_functions.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_hash.c - zend_hash.h - zend_highlight.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.l - zend_list.c - zend_list.h - zend_operators.c - zend_operators.h - zend_variables.c: More TSRMLS_FETCH annihilation - - * zend_API.c - zend_API.h: Get rid of more TSRMLS_FETCH's - - * zend.c - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_opcode.c: Avoid TSRMLS_FETCH()'s (still lots of work left) - -2001-07-29 Andi Gutmans - - * zend_execute.h: - More object junk - - * zend.c: - Object macros... - -2001-07-28 Andi Gutmans - - * zend_operators.c: - Fix build - - * zend_operators.c: - More object macros. - - * zend_builtin_functions.c: - Use the Z_OBJ* macros for accessing objects - - * zend.h - zend_operators.h: - - Small patch to allow fixing the PHP tree to be compatible w/ the initial - - Zend 2 objects patch. Hopefully I can commit that this week. - -2001-07-28 Zeev Suraski - - * Zend.dsp - ZendTS.dsp - zend.c - zend.h - zend_API.c - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_fast_cache.h - zend_globals_macros.h - zend_highlight.c - zend_indent.c - zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_opcode.c: Redesigned thread safety mechanism - nua nua - -2001-07-28 sascha - - * zend.h: Fix build - -2001-07-27 Zeev Suraski - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_execute_locks.h - zend_globals_macros.h - zend_ini.c - zend_ini.h - zend_language_parser.y - zend_language_scanner.l - zend_list.c - zend_list.h - zend_modules.h - zend_operators.c - zend_variables.c - zend.c: Get rid of ELS_*(), and use TSRMLS_*() instead. - This patch is *bound* to break some files, as I must have had typos somewhere. - If you use any uncommon extension, please try to build it... - -2001-07-23 sascha - - * zend_alloc.c: tsrm_error is only available, if TSRM_DEBUG is defined. - -2001-07-21 Zeev Suraski - - * zend.c - zend.h: Always track bailout file/lineno - - * zend.c: Fix Release builds - - * zend.c - zend.h - zend_execute_API.c - zend_globals.h - zend_list.c: - Improve bailout mechanism, supports nesting of bailouts a-la try..catch - - * zend_hash.c: Fix compile warning - -2001-07-21 Andrei Zmievski - - * zend_compile.c: - Fix certain cases where inheritance of base class's overloaded handlers wasn't - being done. - -2001-07-20 Zeev Suraski - - * zend.c - zend_execute_API.c - zend_list.c: - Implement a more granular shutdown mechanism for the executor - - prevent corruption of constants and missing destructions of resources - -2001-07-19 Zeev Suraski - - * zend_compile.c: Unfix, it has too strong effects - - * zend_compile.c: Catch all cases - - * zend_compile.c: Fix bug #11970, strike 2 - - * zend_execute.c: Revert bogus patch - -2001-07-18 Stanislav Malyshev - - * zend_operators.c: fix double->long conversion - -2001-07-17 Andi Gutmans - - * zend_hash.c: - Remove unused code - -2001-07-16 Zeev Suraski - - * zend_API.h - zend_compile.c - zend_globals.h - zend_variables.c: - Fix bug #10287 - avoid crashing under a bogus usage of list() - - * zend.h - zend_compile.c - zend_execute_API.c: Fix bug #10467 - -2001-07-15 Zeev Suraski - - * zend_hash.h: Minor cleaning - - * zend_language_parser.y: Optimize the parser a bit - - * zend_language_scanner.h - zend_language_scanner.l: Fix an inline - - * zend_variables.c - zend_variables.h: - Time to bid this old timer goodbye - get rid of var_uninit() - - * zend_hash.c: Fix bug #6239 - - * zend_language_parser.y: - Allow indirect reference to method names in class::method() construct - - * zend_execute_API.c: Fix bug #10257 - - * zend_execute.c: Fix bug #11970 - - * zend_compile.c: Fix bug #9884 - - * zend.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_language_scanner.l - zend_opcode.c: - Improved interactive mode - it is now available in all builds, without any significant slowdown - - * zend.c: Early initialization - -2001-07-13 Zeev Suraski - - * zend_hash.c: layout - -2001-07-13 Thies C. Arntzen - - * zend_hash.c - zend_hash.h - zend_list.c: - the resource-lists are now destroyed backwards. this will make sure that - resources get destroyed in the opposite order they were created and thereby - db-cursors will always be released before their corresponding connection etc. - this sould not break anything! - -2001-07-11 Zeev Suraski - - * zend_API.c - zend_ptr_stack.c - zend_ptr_stack.h: Remove the last couple of bogus inlines - -2001-07-11 Andi Gutmans - - * zend_hash.c - zend_hash.h: - Move inline_zend_hash_func() to header file - -2001-07-11 Thies C. Arntzen - - * zend_API.h: fixed ZVAL_FALSE and ZVAL_TRUE - -2001-07-11 Stanislav Malyshev - - * zend_hash.h: No hashpjw anymore, but we have zend_hash_func - -2001-07-11 Zeev Suraski - - * zend_operators.c - zend_variables.h: Get rid of ZVAL_RESET... - - * zend_API.c - zend_operators.c - zend_variables.c - zend_variables.h: Get rid of some inlines - -2001-07-10 Andi Gutmans - - * zend_extensions.h - zend_hash.c - zend_hash.h: - Merge faster hash implementation. - - The hash function parameter in hash_init(...) is not used anymore. - - It should be removed but it is "to be decided" if we want to do that now - - or in a major version as it means changing MANY places and third party - - modules might stop working. - -2001-07-10 Thies C. Arntzen - - * zend_API.h - zend_variables.c: cleaned up the RETVAL_ RETURN_ and ZVAL_ macros - - added check for \0 at end-of-string at some places. all strings in PHP - have to be terminated with \0 because 3th party libraries might not be - binary-safe. - -2001-07-10 Andi Gutmans - - * zend_compile.c: - Commit Thies' patch. str.len was too long. - -2001-07-09 Andrei Zmievski - - * zend_API.c - zend_API.h: Adding new parameter parsing API. - -2001-07-09 Andi Gutmans - - * zend_hash.c - zend_hash.h: - - Significantly improve hash table performance by using djb's hash function - instead of hashpjw() and by using power of two sizes of hash tables (this - saves the % and isn't necessary with a good hash function). - Please try this patch. - -2001-07-03 Rasmus Lerdorf - - * zend_API.c: Trivial fix - but the period looks odd in error messages - -2001-06-30 Andi Gutmans - - * zend_alloc.c: - Fix the memory limit fix. - -2001-06-29 Andi Gutmans - - * zend_operators.c: - Remove bogus comment. - -2001-06-29 Zeev Suraski - - * zend_alloc.c: Fix memory_limit, kill warning - -2001-06-28 Zeev Suraski - - * zend_execute_locks.h: Fix warnings - -2001-06-27 Zeev Suraski - - * zend_execute.c: - Fix leak in the patch, and revert a couple of lines I didn't mean to commit - - * zend_execute.c: - Warn about illegal offsets - - Allow assignments to uninitialized string offsets (automatically pads the - string with spaces) - -2001-06-26 Zeev Suraski - - * zend_operators.c: - Fixed autoconversion of negative values to double (Fix bug #11685) - -2001-06-26 Andi Gutmans - - * zend_builtin_functions.c: - Fix crash bug (fix by Jani). - -2001-06-24 Andi Gutmans - - * zend.h: - Bump Zend version - -2001-06-21 Andi Gutmans - - * zend_execute.c - zend_execute_locks.h - zend_globals.h: - - Hopefully fix bug #11476 and improve garbage to be freed very quickly. - Tree tagged as PRE_GRANULAR_GARBAGE_FIX before commiting. - - * zend_execute_locks.h: - - Use inline instead of macro for PZVAL_LOCK()/PZVAL_UNLOCK() so that it - can be debugged. - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - - Nuke dependency of all of PHP on zend_execute_locks.h. - -2001-06-21 Zeev Suraski - - * zend_execute.c: - Eliminate the leak that the original bogus code tried to solve - - * zend_compile.c - zend_execute.c - zend_globals.h: - parent::methodname() now works better with runtime classes (fix bug #11589) - - * zend_execute.c: - Fix bug #11590 (I want Andi to also review this patch before it goes into 4.0.6) - -2001-06-20 Andi Gutmans - - * zend_execute.c: - MFH - - * zend_execute.c: - Fix string offsets crash. - -2001-06-19 Andi Gutmans - - * zend_alloc.c: - Real MFH of memory fragmentation patch - - * zend_alloc.c: - Bad merge. Revert the previous patch (damn CVS). - - * zend_alloc.c: - MFH - - * zend_alloc.c: - - Fix memory fragmention problem which could lead to web server processes - growing much more than they should. (bug #11344?) - - * zend_execute.c - zend_execute.h: - MFH - -2001-06-19 Zeev Suraski - - * zend_execute.c - zend_execute.h: Add missing exports - - * zend_execute.c: Fix warning - -2001-06-13 Zeev Suraski - - * zend.c: MFH - - * zend.c: - Avoid crashing if the error reporting function is called after a bailout during shutdown - -2001-06-12 Zeev Suraski - - * zend_highlight.c: - Improve XHTML compliance (suggested by Anil Madhavapeddy) - -2001-06-10 Zeev Suraski - - * zend.c: Fix ZTS build problem - -2001-06-07 Andi Gutmans - - * zend_compile.h: - Avoid breaking op_array compatibility for 4.0.6 - -2001-05-30 Zeev Suraski - - * Zend.m4 - zend_execute_API.c: Add missing check - -2001-05-25 Andi Gutmans - - * zend_compile.c: - - Change if() to while() to make sure we skip enough opcodes - - * zend_compile.c: - MFH - - * zend_compile.c: - Fix memory leak - -2001-05-23 Andrei Zmievski - - * zend_builtin_functions.c: - Fix segfault -- need to copy-construct constant value. - -2001-05-21 Andrei Zmievski - - * zend_builtin_functions.c: Moving some functions into Zend. - -2001-05-20 sascha - - * .cvsignore: ignore ylwrap - -2001-05-20 Andi Gutmans - - * zend_list.h: - The previous name could be confused with resource # - - * zend_list.c - zend_list.h: - - Whitespace and change the name of the macro to something more verbose - ZEND_GET_RESOURCE_ID(...) - -2001-05-20 James Moore - - * zend_list.c - zend_list.h: - Add new ZEND_GET_LE macro for retrieving destructor - id's from remote extensions. (Jmoore, Zend Engine) - -2001-05-20 Andi Gutmans - - * zend_list.c: - Don't allow resource types of 0 - -2001-05-19 sascha - - * zend_hash.c: Fix segfault when using zend_hash_add_empty_element - -2001-05-18 Thies C. Arntzen - - * zend_alloc.c: reset allocated_memory_peak after each request. - -2001-05-17 Zeev Suraski - - * zend_language_scanner.l: That's slightly clearer that way :) - - * zend_alloc.c: Fix build - - * zend.c: MFH - - * zend.c: Fix corruption issue - -2001-05-16 Zeev Suraski - - * zend_hash.c - zend_hash.h: - Implement zend_hash_add_empty_element() using the existing infrastructure - - * zend_globals.h: Commit missing fix - - * Zend.m4 - zend_alloc.c - zend_globals.h: Merge memory usage into memory limit - -2001-05-14 sascha - - * zend_hash.c: - Initialize empty pDataPtr to a pseudo value to prevent a pefree on - pData. - -2001-05-12 Andi Gutmans - - * zend_variables.c: - Remove check for ht == NULL in copy_ctor. - If ht is NULL at this point then we are better off crashing and fixing - the bug that caused it. - -2001-05-11 sascha - - * zend.h: add missing closing paranthesis - - * zend_hash.c: Some extensions don't associate any data with hash entries, - except the key. Prior to this change, a separate chunk of memory - was allocated in that case to store exactly zero bytes (plus - memory manager overhead). We treat that case similar to the - pointer case, but don't copy any data at all (because the pointer - is usually the NULL pointer). - - * zend_constants.c: - Fix a memory leak which occured upon registering an already existing - constant. - -2001-05-11 Thies C. Arntzen - - * Zend.m4 - zend_alloc.c - zend_globals.h: added --enable-memory-usage-info - -2001-05-11 Andi Gutmans - - * zend_opcode.c: - MFH - - * zend_opcode.c: - - Fix crash bug when opcodes array is erealloc()'ed to a different memory - area before it reaches the loop. - - Some whitespace stuff - -2001-05-10 Zeev Suraski - - * zend_operators.c: - Treat numeric strings as numbers in the increment operator - -2001-05-09 Andrei Zmievski - - * zend_API.c: Nuke unused variable. - - * zend_API.c: Fix a few bugs in zend_is_callable() and make it stricter. - -2001-05-08 Andi Gutmans - - * zend_language_scanner.l: - Fix line numbers when some lines end with \r - - * zend_opcode.c: - Fix crash bug reported by DBG author Dmitri Dmitrienko. - -2001-05-07 Zeev Suraski - - * zend.c: Make zend_execute_scripts() reentrant - -2001-05-06 Zeev Suraski - - * zend.c - zend_compile.c - zend_compile.h: - Recover from a parse error in include files (before, it could result in a crash under certain circumstances). Fix bug #8663 - -2001-05-06 Andi Gutmans - - * .cvsignore: - .cc files were renamed. Update .cvsignore. - -2001-05-06 Zeev Suraski - - * zend_operators.h: Yikes, that would have been a very bad bug :) - - * zend_execute.c: - Floating point keys didn't work in array() (fix bug #6662) - - * zend_compile.c - zend_execute_API.c: - Hear hear, interactive mode is finally showing some progress: - - Support function calls - - Fix crash bug - - * zend_compile.h - zend_language_parser.y - zend_language_scanner.l: Support interactive mode in thread-safe builds - - * zend_operators.h: Fix autoconversion of hexadecimal strings - It's time to close bug #5404 :) - - * zend_highlight.c: Retain single spaces as spaces to condense HTML - -2001-05-02 Andi Gutmans - - * zend_ini_scanner.l: - Support \r as newline in the ini scanner - - * zend_language_scanner.l: - Handle MAC OS X \r line endings - - * zend_execute.c: - - Patch by Andrei to prevent crash in error situation when not all - object overloading handles are defined. - -2001-05-01 Andi Gutmans - - * zend.h: - Bump up Zend version - -2001-04-30 Andi Gutmans - - * zend_builtin_functions.c: - Add mistakenly removen closing bracket - - * zend_builtin_functions.c: - Get rid of warning - - * zend_alloc.c: - - Try to solve crash on OS400. There is actually no reason I can see for - why his fix should solve a crash but it doesn't harm. - - * zend_execute_API.c: - Fix crash bug in interactive mode - -2001-04-29 Andi Gutmans - - * zend_alloc.h: - Whitespace - - * zend_alloc.c - zend_alloc.h: - Improve overwrite detection in debug mode. - - * zend_operators.c: - - Previous patch for too early freeing of resources seemed to have worked. - - Clean it up a bit. - - * zend_operators.c: - - Try and solve the too early resource destruction problem. - -2001-04-28 Zeev Suraski - - * zend.h - zend_hash.c - zend_language_scanner.l - zend_operators.c: include limits.h if available - - * zend.h: Fix bug 5661 - -2001-04-28 Andi Gutmans - - * zend_operators.c: - Move all cases into switch(). - - * zend_alloc.c: - Just some little whitespace stuff. - - * zend_alloc.c: - - Don't add/remove cached memory blocks from blocks list as this will slow - - down performance a bit. - -2001-04-28 Zeev Suraski - - * zend_operators.c: - Resources weren't being properly destroyed by the convert_to_*() functions - -2001-04-27 Andi Gutmans - - * zend_API.c - zend_builtin_functions.c - zend_hash.c - zend_language_scanner.l - zend_operators.c - zend_operators.h: - More whitespace fixes while I'm at it. - - * zend.h - zend_alloc.c - zend_builtin_functions.c - zend_execute_API.c - zend_extensions.c - zend_language_scanner.l: - - Whitespace changes to be standard like the rest of Zend - -2001-04-24 Andi Gutmans - - * zend_execute.c: - Due to popular demand merge the foreach() crash fix. - -2001-04-24 Andrei Zmievski - - * zend_builtin_functions.c: MFH. - -2001-04-21 Andi Gutmans - - * zend_llist.c - zend_llist.h: - Add typedef for function pointer of llist dtor - -2001-04-20 Andi Gutmans - - * zend_execute.c: - - Fix for crash bug when using invalid arguments in the foreach() loop. - - Reported by Yasuo Ohgaki - -2001-04-19 Andi Gutmans - - * zend_API.h: - Patch from Jason Greene. - - Make it easier to write PHP function definitions in more than just one .c - file while accessing the same module globals. - -2001-04-17 Zeev Suraski - - * zend_alloc.c: small beautification - -2001-03-28 Zeev Suraski - - * zend_list.c: Fix warning - - * zend_list.c: Make Windows happy - - * zend_list.c: Get rid of more redundant code - - * zend_list.c: - Cleaner way of making sure resources start at 1 and not 0... - - * zend_list.c - zend_list.h: Remove redundant code - -2001-03-27 Zeev Suraski - - * zend_list.c - zend_list.h: God knows what this code was doing... - -2001-03-26 Andrei Zmievski - - * zend_builtin_functions.c: - Updated get_class_methods() to take class instance as well as class name. - - * zend_builtin_functions.c: - Making it possible to pass a class name to get_parent_class() as well - as a class instance. - -2001-03-23 Andrei Zmievski - - * zend_builtin_functions.c: Fixing function name length. - -2001-03-19 Andi Gutmans - - * zend_language_parser.y: - - Add support for isset($var1, $var2, $var3); - Will be true only if all - - variables are set. - -2001-03-15 Andi Gutmans - - * zend_language_parser.y: - Nuke commented code - -2001-03-12 Andrei Zmievski - - * zend_API.c: Name length is already known. - -2001-03-12 Andi Gutmans - - * zend_API.c: - Missed second place. - - * zend_API.c: - Nuke snprintf() - - * zend_language_scanner.l: - White space - - * zend_language_scanner.l: - - Fix by Jani Taskinen for whole path also to work - with include_once()/require_once(). - -2001-03-12 Andrei Zmievski - - * zend_API.c - zend_API.h: - Improve zend_is_callable() to the point where it's actually useful. - Now it just needs to be invoked everywhere in PHP where a callback is - expected. - -2001-03-11 Andi Gutmans - - * Zend.m4 - acconfig.h: - Fix for Solaris. - -2001-03-10 Andi Gutmans - - * zend_execute.c: - Whitespace - -2001-03-07 Zeev Suraski - - * zend_ini.h: Add missing #define's - - * zend_compile.c - zend_execute.c: Make parent:: work in runtime bindings as well - -2001-03-06 sascha - - * Zend.m4: We actually only need AC_PROG_LEX here. - -2001-03-04 Zeev Suraski - - * zend_execute.c: Fix bug #8899 (thanks Jani) - -2001-03-03 sascha - - * Zend.m4: -Os is a valid GCC optimization level. - -2001-03-02 Zeev Suraski - - * zend_compile.c: Whitespace fix - -2001-02-28 Andrei Zmievski - - * zend_execute_API.c: Do case-insensitive class name matching when parsing - array('Class', 'method') structure. - You guys can clean it up, if there is a better way. - -2001-02-27 Andi Gutmans - - * zend_variables.c - zend_variables.h: - Nuke zval_del_ref() - -2001-02-27 Andrei Zmievski - - * zend_compile.c: Don't overwrite existing handlers with parent ones. - -2001-02-26 Andi Gutmans - - * Zend.dsp - ZendCore.dep - ZendTS.dsp - zend.c - zend_API.c - zend_API.h: - Rename modules.h to zend_modules.h - - * LICENSE: - One more copyright year update - - * zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_static_allocator.c - zend_static_allocator.h - zend_variables.c - zend_variables.h - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_ini.c - zend_modules.h: - Update copyright year - -2001-02-25 Andi Gutmans - - * zend_modules.h: - Fix dll linkage warnings - -2001-02-24 Andi Gutmans - - * zend_builtin_functions.c - zend_modules.h: - Add exports from Daniel Beulshausen - -2001-02-14 Stanislav Malyshev - - * zend.h: allow more extensions with resources - -2001-02-13 Zeev Suraski - - * zend_extensions.c: Move version registration to a more correct place - -2001-02-12 Andi Gutmans - - * zend_operators.c - zend_operators.h: - Remove two unused functions - - * zend_execute_API.c: - Fix whitespace. - -2001-02-12 Zeev Suraski - - * zend_execute_API.c: - Fix a bug that could cause corruption in case of an error during - get_zval_ptr() - -2001-02-09 Andi Gutmans - - * zend_execute.c: - - Remove duplicate code and do a tiny optimization in DO_FCALL - -2001-02-05 Zeev Suraski - - * zend_execute.c: Fix string offset data corruption - -2001-02-04 Andrei Zmievski - - * zend_execute_API.c: - Allow passing class name as well as an object instance to call methods. - -2001-02-03 Andrei Zmievski - - * zend_execute_API.c: - Set the correct function state during execution. This is mainly to have - get_active_function_name() to return proper value. - - * zend_compile.c: Inherit overloaded handlers. - -2001-02-01 Andrei Zmievski - - * zend_API.c - zend_API.h: - Added zend_is_callable() function that checks whether passed zval - represents a valid and exiting callable construct. - -2001-01-31 Andi Gutmans - - * zend_API.h - zend_API.c: - Change unset() functions to null(). unset() is legacy - - * zend_API.h: - - Quick fix. I'm for changing these to add_property_null() as we've nuked - - unset. - -2001-01-27 Andi Gutmans - - * zend_execute.c: - That doesn't seem like a smart thing to do :) - - I wonder if gcc optimized it out. - -2001-01-23 Thies C. Arntzen - - * zend_extensions.h - zend_ini_scanner.h - zend_list.c - zend_list.h: fix a couple of warnings - - * zend_API.c: fixed crash in add_index_bool. - -2001-01-22 Andrei Zmievski - - * zend_API.h: Make add_index_zval() available to the outside world. - -2001-01-21 Andi Gutmans - - * zend.h: - - Make people happy who like the Zend version number bumped up in parallel - with PHP. - -2001-01-20 Andi Gutmans - - * zend_API.c - zend_API.h: - - Patch from Sterling. Add API calls to add zval's as array indeces/ - object properties. Add _ex functions which take the string length as an - argument for better performance. - -2001-01-19 Andi Gutmans - - * zend_API.h - zend_API.c: - - For Sterling. I wonder if not all of the API functions should take the - - key_length as a parameter in order to save that strlen(). - -2001-01-17 Andi Gutmans - - * zend_execute.c: - - Fix leak in fetch_dim_address() which was already fixed in - - fetch_dim_object(). Take the oppertunity to make both use the same - - function and not duplicate the code. - -2001-01-16 Zeev Suraski - - * zend_list.c: Fix persistent resources, once and for all... - -2001-01-15 Zeev Suraski - - * zend.c - zend.h - zend_compile.c: Add free_estring() - -2001-01-12 Zeev Suraski - - * zend_istdiostream.h: Add newline - -2001-01-12 Rasmus Lerdorf - - * zend_highlight.c: Fix for bug number 8666 - -2001-01-07 Zeev Suraski - - * zend_ini.c: Fix mismatch in return values - - * zend.c - zend.h - zend_alloc.c - zend_ini.c - zend_ini.h: - Remove backward dependency from PHP -> Zend - - Rename get_ini_entry() as get_configuration_directive() for clarity - (it doesn't use the INI subsystem, but the module-supplied function for - retrieving configuration directives) - - * Zend.dsp - ZendTS.dsp: Remove -S option on all bison calls - - * zend.c: - Fix possibility of a crash during startup (very unlikely, but possible) - -2001-01-06 Zeev Suraski - - * ZendTS.dsp: Remove -S - -2001-01-06 Andi Gutmans - - * zend_ini.c: - This slipped in by mistake. - -2001-01-05 Zeev Suraski - - * zend_ini.c - zend_ini.h: - Merge in some ZEND_API additions from Daniel Beulshausen (needed for the - Win32 Apache module) - -2001-01-04 Andi Gutmans - - * zend_list.c: - - Make plist_destructor work like list_destructor to allow it to call - extended destructors. - -2001-01-03 Zeev Suraski - - * zend.h: Fix Zend version while we're at it - - * zend_execute_API.c: Merge call_user_function_ex() fixes - - * zend_language_scanner.l: Merge line number corruption bug fix - - * zend_language_scanner.l: - Fix another case of possible line number corruption - - * zend.h: Commit missing declaration - -2001-01-01 Andi Gutmans - - * zend_execute.c: - Remove unreachable code - -2000-12-30 Zeev Suraski - - * zend_language_scanner.l - zend_opcode.c: Fix possible corruption in line number information - -2000-12-27 Zeev Suraski - - * zend.c - zend_globals.h - zend_ini.c - zend_ini.h - ZendTS.dsp: - Make the INI mechanism thread safe (or at least thread safer :) - -2000-12-26 Zeev Suraski - - * zend_compile.h: - Use iostream.h instead of istream.h (IBM's compiler doesn't come with istream.h, - and iostream.h should include it) - - * ZendTS.dsp - zend_ini_scanner.l - zend_istdiostream.h - zend_language_scanner.l: - - Use supplied istdiostream definition for the INI scanner too - - Add Release_TSDbg configuration - -2000-12-24 Zeev Suraski - - * zend_extensions.h: This needs updating as well - - * zend_execute_API.c: - More aggressive protection in call_user_function_ex() - -2000-12-23 Zeev Suraski - - * zend_execute_API.c: - Fix a possible crash bug in call_user_function_ex(), if the function is - in fact not a user function - -2000-12-22 sascha - - * zend.c - zend_modules.h: - Set the floating-point exception mask on FreeBSD to 0 (as do other - FreeBSD system applications). Also bump up the module API number - as the zend_hash_get_current_key change affects source and binary - compatibility. - -2000-12-22 Zeev Suraski - - * zend.c - zend_builtin_functions.c - zend_execute.c - zend_hash.c - zend_hash.h: - Allow get_current_key() not to return the key itself, instead of a duplicate - - * zend_hash.c: * Fixed a possible crash in get_class_methods() - -2000-12-19 Stanislav Malyshev - - * zend_language_scanner.l: Add support for ASP tags in one-line comment - -2000-12-18 Andi Gutmans - - * flex.skl: - Success! Yay! - - * flex.skl: - Yet another one. - - * flex.skl: - Testing - - * flex.skl: - No luck - - * flex.skl: - Make this damn commit stuff work. - - * flex.skl: - Testing - -2000-12-18 Stanislav Malyshev - - * zend.c: - Use HashPosition iterator instead of saving/restoring internal pointer - - * zend.c: Preserve internal pointer over print_r (fix #8289) - -2000-12-18 Andi Gutmans - - * zend_compile.c: - Fix leak with useless statements such as "foo"; - - * flex.skl: - - Testing Sascha's CVS commit script which should work with branches. - - * flex.skl: - Testing - - * flex.skl: - Testin - -2000-12-18 Zeev Suraski - - * flex.skl: Test, ignore - -2000-12-18 Stanislav Malyshev - - * zend_operators.c: Add notice when auto-converting array to string - -2000-12-17 Andi Gutmans - - * zend_language_scanner.l: - - Clean up the scanner a tiny bit while messing with it. - - * zend_language_scanner.l: - - %> without asp_tags should not be treated as inline_html but as regular - tokens. Of course the parser will die with a parse error which is the - correct behavior. - - * zend_language_scanner.l: - - Fix problem in one line comments with line endings such as ??> - -2000-12-17 Stanislav Malyshev - - * zend_operators.c: Fix #8279 (-2147483647 > 2147483647). - -2000-12-14 Zeev Suraski - - * zend_modules.h: Update module_api_no - -2000-12-13 Zeev Suraski - - * zend_API.h - zend_execute_API.c: - Fix call_user_function() with objects - it could leak under certain circumstances - -2000-12-12 Stanislav Malyshev - - * zend_operators.c: Fix #8195: strncasecmp returns incorrect value - -2000-12-07 sascha - - * zend_builtin_functions.c: - Hardcode strlen due to problems on SCO OpenServer 5.0.4 which defines - strlen to __std_hdr_strlen. - -2000-12-07 Stanislav Malyshev - - * zend_compile.c: Whitespace fix - - * zend_compile.c: Allow var $foo = array(ABC => 1) constructs - - * zend_builtin_functions.c: - Fix memory leak - get_current_key mallocs it's result, no need to - copy it. - -2000-12-06 sascha - - * zend_hash.c: - INIT_DATA/UPDATE_DATA assumed that pData elements of the size of a void - pointer would actually be aligned like a void pointer. This lead - to bus errors on architectures which don't allow unaligned 32-bit accesses. - -2000-12-05 Andi Gutmans - - * zend_language_parser.y: - - Support for $var =& new foo() syntax. This allows you to use objects - which create extra references to themselves in the constructor. - -2000-12-05 Zeev Suraski - - * zend_execute.h: Expose all timeout functions - -2000-12-02 sascha - - * acconfig.h - configure.in: - Use the hardly-documented third parameter of AM_INIT_AUTOMAKE to suppress - defining PACKAGE/VERSION. - -2000-11-27 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c: - - Allow passing references which are returned from functions and new - - statements to be passed by reference. - -2000-11-27 Andrei Zmievski - - * zend_builtin_functions.c: - Update class constants before trying to get default properties. - -2000-11-22 Andi Gutmans - - * zend_compile.c: - Remove code which has been commented out for ages. - -2000-11-22 sascha - - * zend_execute.c - zend_globals.h: Pass on the exit status - -2000-11-21 Zeev Suraski - - * zend_operators.c - zend_operators.h: Fix build - -2000-11-21 Andi Gutmans - - * zend_execute.c: - The baby patch wasn't that innocent :) - -2000-11-21 Andrei Zmievski - - * zend_builtin_functions.c: - Sterling's patch to make get_defined_vars() simpler and better. - -2000-11-20 Andi Gutmans - - * zend_execute.c: - NEVER copy and paste :) - - * zend_compile.c - zend_execute.c: - Baby patch towards making the damn pass-by-ref work. - -2000-11-20 Zeev Suraski - - * zend_extensions.h: Update API number - -2000-11-20 Stanislav Malyshev - - * zend.h: - Add macro to replace value of zval with another value while preserving - referencing structure - -2000-11-20 Andi Gutmans - - * zend_execute.c: - This patch is broken and needs more thorough fixing. - -2000-11-19 Andi Gutmans - - * zend_execute.c: - - Try and fix the problem when sending references returned from a function by reference. - -2000-11-19 Zeev Suraski - - * zend_alloc.h: Fix Zend build for non ZTS - -2000-11-18 Zeev Suraski - - * zend_alloc.c: Forgot to commit the non-debug build fix yesterday... - - * zend_alloc.c - zend_alloc.h: - Add thread-safety debugging information (idea - Dmitri Dmitrienko) - -2000-11-14 Stanislav Malyshev - - * zend_language_scanner.l: Restore compatibility with old broken way - - * zend_language_scanner.l: - Better 0x handling - not change non-0x number behaviour - - * zend_language_scanner.l: - Attempt at better handling long 0x-numbers, like 0xffffffff - -2000-11-13 Andi Gutmans - - * zend_extensions.c - zend_extensions.h: - Remove unused function - - * zend_extensions.h: - - Use typedef's for function pointers so that we can easily define arrays - - of these function pointers. - -2000-11-13 Stanislav Malyshev - - * zend_llist.c: - Fix zend_llist_apply_with_del - it should remove from list, - not only call dtor - -2000-11-12 Zeev Suraski - - * ZEND_CHANGES: Test, ignore - -2000-11-11 Andi Gutmans - - * zend_compile.c - zend_compile.h: - Move SET_UNUSED() to header - - * zend_opcode.c: - Beautify by using the standard #define. - -2000-11-10 Andi Gutmans - - * zend_compile.h - zend_compile.c: - Remove this damn thing once again. - - * .cvsignore: - Add files to .cvsignore thanks to Jon Parise - -2000-11-09 Andi Gutmans - - * zend_compile.c - zend_compile.h: - Maybe it's OK now? :) - - * zend_compile.c - zend_compile.h: - Undo the previous commit for fixing $obj = new foo(). - - * zend_compile.c - zend_compile.h: - - Commit experimental patch to fix the problem when doing $a = new foo() - and the constructor assigns $this by reference to other symbol table - elements. Thanks to Daniel J. Rodriguez on this one. - -2000-11-08 Zeev Suraski - - * zend_extensions.c - zend_extensions.h: Add ability to find extensions by name - -2000-11-06 sascha - - * zend_ini.c: Kill a misleading warning which is intended for old code - which assumes sizeof(int) == sizeof(void *). - -2000-11-03 Andi Gutmans - - * zend_ini_scanner.h: - Add trailing \n? - -2000-11-03 Zeev Suraski - - * zend_ini_scanner.l: Fix for bug #5571 (by mookid@sigent.ru) - -2000-11-03 Andi Gutmans - - * Makefile.am: - Fix dependency. - -2000-11-03 Zeev Suraski - - * zend_operators.h: Fix build - - * zend_operators.h: Add RESVAL macros - -2000-11-02 Zeev Suraski - - * zend.c: Fix bug #7599 - - * zend_language_parser.y - zend_language_scanner.l: Missed those - - * zend_API.c - zend_compile.c - zend_compile.h: Maintain consistency - -2000-11-02 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_language_parser.y: - Replace do_exit() with zend_do_exit(). - - Problem reported by David Hedbor - -2000-11-02 Zeev Suraski - - * zend_ini_parser.y: Remove unnecessary variables - - * zend_ini.c: - explicit declaration here too - sigh, way too early in the morning - - * zend_ini.h: oops - - * zend_ini.h: explicit declaration - -2000-10-31 Zeev Suraski - - * zend_highlight.h: Fix Apache build - - * zend_ini.c - zend_ini.h: Remove unnecessary code, fix phpinfo() - - * Zend.m4: Require bison 1.28 - -2000-10-30 Zeev Suraski - - * Zend.dsp: Fix non-thread-safe Windows build - - * zend_globals.h - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l: Final touches on the INI parser - -2000-10-30 Stanislav Malyshev - - * Makefile.am: Another attempt to make it build - - * Makefile.am - zend_ini_scanner.l: Fix build - -2000-10-29 Zeev Suraski - - * zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l: Fix leaks - - * zend_alloc.h - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.h - zend_ini_scanner.l: The new INI parser is showing some signs of life - - * zend_compile.c - zend_compile.h - zend_execute.c: - Fix a corruption bug, when erroneously allowing to send non-variables by reference (several - bug-db reports seem to originate in this bug) - - * zend_extensions.c - zend_ini_parser.y: Fix build - - * zend_ini_scanner.h: Forgot this one - - * Makefile.am - ZendTS.dsp - zend_globals.h - zend_ini.h - zend_ini_parser.y - zend_ini_scanner.l: Generalization work - -2000-10-29 Stanislav Malyshev - - * zend_extensions.c - zend_extensions.h: - Allow module to proclaim compatibility with any Zend version - -2000-10-29 Zeev Suraski - - * Makefile.am - ZendTS.dsp - zend_ini_parser.y - zend_ini_scanner.l - zend_language_scanner.l: Some more work on the INI parser/scanner - - * Makefile.am - zend_ini_parser.y - zend_ini_scanner.l: Initial step in rewriting the INI parsing mechanism - - * .cvsignore - Makefile.am - Zend.dsp - ZendCore.dep - ZendTS.dsp - zend-parser.y - zend-scanner.h - zend-scanner.l - zend_compile.c - zend_compile.h - zend_highlight.c - zend_indent.c - zend_language_parser.y - zend_language_scanner.h - zend_language_scanner.l: Unify the names of these last 3 files... - - * Zend.dsp - ZendTS.dsp: Fix Windows build - - * Makefile.am - zend_ini.c - zend_ini.h - zend_operators.c - zend_operators.h: - Initial steps to move the INI mechanism to the Zend engine - -2000-10-27 Andrei Zmievski - - * zend_operators.h: Added macros for object properties and class entry. - -2000-10-26 Andi Gutmans - - * zend_API.c - zend_modules.h: - Fix new -m on Windows - -2000-10-25 Andrei Zmievski - - * zend_list.h: Remove the patch to register_list_destructors(). - -2000-10-20 Andrei Zmievski - - * zend_list.c - zend_list.h: - Fixed a bug in zend_rsrc_list_get_rsrc_type() - - Switched register_list_destructors() to use - zend_register_list_destructors_ex() instead - -2000-10-19 Andi Gutmans - - * zend_compile.c: - - Constant expressions which are used multiple times need to be copy_ctored - -2000-10-18 Andi Gutmans - - * zend_llist.c: - Fix whitespace - - * zend_extensions.c - zend_llist.c - zend_llist.h: - - Try #2. Wasn't allowed to delete in the previous manner because we were - in the middle of an llist_apply() - -2000-10-18 sascha - - * zend_fast_cache.h: - Add explicit conversion from 'void *', otherwise ANSI C++ compilers - will break out. - -2000-10-18 Andi Gutmans - - * zend_extensions.c: - Fix crash - -2000-10-17 Andi Gutmans - - * zend_builtin_functions.c: - Fix copy&paste bug - -2000-10-15 Andi Gutmans - - * zend_opcode.c: - - Increase op_array size faster and make eralloc() it in the end to save - memory. - -2000-10-14 Andi Gutmans - - * zend_builtin_functions.c: - Add another patch from Sterling. - - * zend_builtin_functions.c: - - Preliminary commit of Sterlings get_defined_functions()/get_defined_vars - functions - - * zend_extensions.c: - - Only run startup() if ZEND_EXTENSIONS is defined to 1. - This fixes a link error on platforms which don't support libdl - -2000-10-13 Andi Gutmans - - * zend_operators.c: - Make increment of "" become "1" - -2000-10-11 Andi Gutmans - - * zend_hash.c - zend_hash.h: Don't use 'new' symbol - -2000-10-11 Zeev Suraski - - * zend_execute.c - zend_execute_API.c: - Fix -a interactive mode (no idea how the previous commit got committed) - - * zend_execute.c: *** empty log message *** - - * zend.h: Update version - - * zend_hash.c - zend_hash.h: Add zend_hash_merge_ex(), for selective merging - -2000-10-06 Andi Gutmans - - * zend_execute.h: - Fix Bug #7061 - -2000-10-05 Andi Gutmans - - * zend-scanner.l: - - Updated included_files() also for plain include()/require(). - -2000-10-04 Andi Gutmans - - * zend_alloc.c: - Fix fprintf - -2000-10-02 Andi Gutmans - - * zend_extensions.h: - Change zend_extension_api_no - -2000-09-30 Andi Gutmans - - * zend_builtin_functions.c: - Cleanup error output - -2000-09-28 Andi Gutmans - - * zend_hash.c: - - Another has optimization/fix like the hash_copy one from earlier on - -2000-09-28 Stanislav Malyshev - - * zend_hash.c: - Make hash_copy call copy constructor on a real copy, not on a temp - -2000-09-28 Andi Gutmans - - * ZendTS.dsp: - Remove zend_gcc_inline.c - -2000-09-26 sascha - - * Makefile.am - Zend.m4 - zend_execute.h - zend_gcc_inline.c - zend_operators.h: - Remove --enable-c9x-inline option. We now use a syntax which is compatible - with all compilers by providing the function with static linkage in every - compilation unit. - -2000-09-25 Zeev Suraski - - * zend.c - zend_extensions.c - zend_extensions.h: - Fix previous update - move extension startup further down the startup sequence - - * zend.c: Move extension startup further down the startup sequence - -2000-09-19 Andi Gutmans - - * zend_operators.h: - Add Z_BVAL* macros - -2000-09-19 Stanislav Malyshev - - * zend_execute_locks.h: - Fix crash on Solaris with function parameter destruction - -2000-09-18 Stanislav Malyshev - - * zend_builtin_functions.c: - Made get_included_files() work again, in somewhat different way - -2000-09-17 Stanislav Malyshev - - * zend_compile.c: Set filename even on recursive include - -2000-09-14 Andi Gutmans - - * zend_execute.c: - - Fix NULL handling in ARRAY opcode and resolve memory leak - -2000-09-12 Zeev Suraski - - * zend-scanner.l - zend.c - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_highlight.h: Make compile_string() accept a description of the code - -2000-09-11 Andi Gutmans - - * zend_compile.c: - - Forgot to create extended info in include()/require() call - -2000-09-10 Stanislav Malyshev - - * zend-parser.y: Allow require_once to take expressions, just like require - - * ZEND_CHANGES: Try once more to remove dups - - * ZEND_CHANGES: Test commit - weed out duplicate messages - -2000-09-09 Zeev Suraski - - * zend.c: Don't use unsafe sprintf() - -2000-09-08 Stanislav Malyshev - - * zend.c: Don't trust snprintf return - -2000-09-06 Andi Gutmans - - * zend_config.w32.h: - Save two lines - - * zend_config.w32.h: - Fix header - -2000-09-06 sascha - - * Zend.m4: Unless overwritten, default to no optimization in debug mode. - -2000-09-05 Andi Gutmans - - * zend_operators.h - zend_operators.c: - Commiting Sterling's new multi_convert* functions - -2000-09-05 Andrei Zmievski - - * zend_builtin_functions.c: Fix memory overrun. - -2000-09-05 Stanislav Malyshev - - * zend_builtin_functions.c: - Fix crash with trigger_error having no args (#6549) - -2000-09-04 Andi Gutmans - - * Makefile.am: - Remove two tabs - -2000-09-02 Andi Gutmans - - * ZendTS.dsp: - - Defining TSRM_WIN32 in each and every dsp sucked. Revert this change - - * ZendTS.dsp: - Fix windows build - -2000-08-31 Andi Gutmans - - * ZendTS.dsp: - - This should fix the performance problem with Release builds - - * zend-scanner.l - zend.c - zend_execute.c: - - Use emalloc() for opened_path now. This was a potential leak before. - - This patch has potential to break stuff but I tested it as much as I - - could. Fixes should be easy. - - * zend.c: - Remove support for __string_value() in print $obj - -2000-08-31 Zeev Suraski - - * zend.c: Safer shutdown process - -2000-08-29 Andi Gutmans - - * zend.h: - Update Zend version. - -2000-08-26 Andi Gutmans - - * zend_builtin_functions.c: - Don't define this function in non-debug mode - -2000-08-24 Andi Gutmans - - * zend_execute.c: - - Revert patch from 9/7/2000 which seems to have broken unset(). - - I hope what made me do this patch doesn't appear again. - -2000-08-22 Andi Gutmans - - * zend_execute_API.c: - - Fix bug report by Andrei when using a method as a sort user function - - parameter in usort() like functions - -2000-08-20 Zeev Suraski - - * zend_config.w32.h: Fix Win32 build - -2000-08-20 sascha - - * zend_config.w32.h: - _isnan seems to be supported on Win32, add an appropiate macro. - - * acconfig.h: If available, use fpclassify for substituting zend_finite. - - * acconfig.h: - Including math.h before using macros defined there will work better :) - - * acconfig.h: Add zend_isinf and zend_isnan. - -2000-08-19 Andrei Zmievski - - * zend-scanner.l: One more fix to C compile. - -2000-08-19 Zeev Suraski - - * zend-scanner.l: Fix C build - - * zend-scanner.l: Fix eval() leakage in ZTS mode - - * zend_compile.c - zend_globals.h: Eliminate run-time leak with eval()'s - - * zend_alloc.c: Fix build with no memory_limit - - * zend_alloc.c: Fix memory_limit - -2000-08-19 Andi Gutmans - - * zend_execute.c: - Beautify - -2000-08-17 Stanislav Malyshev - - * zend_API.h: Fix EMPTY_STRING macros - -2000-08-15 Zeev Suraski - - * zend_extensions.h - zend-scanner.l - zend.c - zend_compile.c - zend_compile.h - zend_execute.c: - Fix warning issue (compile errors inside require()'d files were incorrectly supressed) - -2000-08-14 Zeev Suraski - - * zend_execute.c: - Fix leak and some logic - -2000-08-14 Andi Gutmans - - * zend_compile.c - zend_execute.c: - - This patch should hopefully fix situations where a constructor uses - - the $this pointer as a reference. - -2000-08-14 Stanislav Malyshev - - * zend_execute.c: Fix crash - -2000-08-14 Andi Gutmans - - * zend_compile.c - zend_execute.h: - - Unused results should be marked with EXT_TYPE_UNUSED and not IS_UNUSED - -2000-08-13 Stanislav Malyshev - - * zend-scanner.l - zend.c - zend_compile.c - zend_compile.h - zend_execute.c: Fix zend_fiel_handle handling. Should fix URL include - and various opened_path inconsistencies. - -2000-08-13 Andi Gutmans - - * zend-parser.y: - - Revert foreach() change which only allowed variables and array(...) - -2000-08-11 Andi Gutmans - - * zend-parser.y: - Only support variables and array(...) in foreach loops - -2000-08-10 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - Fix problem with nested foreach()'s (Andi, Zend Engine) - - * zend_compile.c: - Fix switch which only has a default rule (Andi, Zend Engine) - Change require_once() to use the same file list as include_once(). - Patch includes making require() & include() to behave the same when it - comes to scoping. require() is now an include() which isn't allowed to fail. - require() caused too many memory reallocations which ended up being quite - slow for sites that required lots of files. (Andi & Zeev, Zend Engine) - - Fix switch() which only has default rule (bug #5879, - -2000-08-09 Zeev Suraski - - * zend_modules.h: that too - - * zend_extensions.h: Update API number - - * zend-parser.y - zend-scanner.l - zend.c - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_opcode.c: - The patch we promised - redesigned the compilation/execution API: - Advantages: - - Smaller memory footprint for the op arrays - - Slightly faster compilation times (due to saved erealloc() calls and faster zend_op - initialization) - - include_once() & require_once() share the same file list - - Consistency between include() and require() - this mostly means that return() - works inside require()'d files just as it does in include() files (it used to - be meaningless in require()'d files, most of the time (see below)) - - Made require() consistent with itself. Before, if the argument was not a constant - string, require() took the include() behavior (with return()). - - Removed lots of duplicate code. - Bottom line - require() and include() are very similar now; require() is simply an include() - which isn't allowed to fail. Due to the erealloc() calls for large op arrays, require() - didn't end up being any faster than include() in the Zend engine. - -2000-08-05 Andi Gutmans - - * zend_execute.c: - - Use some more SEPARATE_ZVAL macros instead of replicated code. - -2000-08-05 Stanislav Malyshev - - * zend_execute.c: Fix memory leak - -2000-08-04 Andi Gutmans - - * zend.h - zend_execute.c: - - Beautify code. Try and use more macros for splitting instead of - - replicating the code everywhere. - -2000-08-02 Andi Gutmans - - * zend_execute.c: - Remove commented code - -2000-07-29 Zeev Suraski - - * zend-scanner.l - zend_execute.c: Fix filename issues - -2000-07-28 Stanislav Malyshev - - * zend_builtin_functions.c - zend_constants.c - zend_constants.h: - Make define return false and issue E_NOTICE when trying to redefine constant - -2000-07-27 Andi Gutmans - - * zend-scanner.l - zend_execute.c: Always store full filename as compiled file name - -2000-07-26 Zeev Suraski - - * zend_compile.c: - Fix a possible issue with runtime inheritence under fairly rare circumstance - and optimize a tiny bit - -2000-07-26 Stanislav Malyshev - - * zend_builtin_functions.c - zend_operators.c - zend_operators.h: Add strncasecmp function - -2000-07-18 Zeev Suraski - - * zend_builtin_functions.c: Forgot to link this function... - - * zend_hash.c: This is probably the oldest bug in PHP :) - Luckily it's unlikely we're ever actually bitten by this bug. - -2000-07-16 Andi Gutmans - - * zend_compile.c: - Beautify Zeev's patch a bit. - -2000-07-16 Zeev Suraski - - * zend_compile.c: Implement parent::foo() - -2000-07-15 Zeev Suraski - - * zend-parser.y - zend_compile.c: Add more extended_info calls - -2000-07-14 Zeev Suraski - - * zend_builtin_functions.c - zend_list.c - zend_list.h: Improve register_resource_ex() infrastructure - -2000-07-12 Thies C. Arntzen - - * zend.c: fix ZTS startup without filename (thanx purify!) - - * zend.c: unset active_symbol_table on zend-shutdown. - -2000-07-11 Zeev Suraski - - * zend_list.c: Another persistent hash - disable apply protection - - * zend.c - zend_hash.c - zend_hash.h: - Disable the hash_apply() protection on hashes that persist across requests - it's unsafe - because we may be aborted at any point - -2000-07-11 Stanislav Malyshev - - * zend_execute.c: - Fix a bug in passing second parameter of RECV_INIT with is_ref set - -2000-07-11 Andi Gutmans - - * zend_compile.h: - Oops. Too early in the morning - - * zend_compile.h: - Include iostream.h in C++. - -2000-07-09 Andi Gutmans - - * zend_execute.c: - Fix memory leak. - - * zend_execute.c: - Need to seperate if the hash isn't a reference - -2000-07-08 Andi Gutmans - - * zend.h: - Add zend_ulong - -2000-07-07 Stanislav Malyshev - - * zend_execute.c: Remove C++ commennts. - -2000-07-06 Andi Gutmans - - * zend-scanner.l: - - Remove code which has never been used (neither in PHP 3) - - * zend_compile.c: - - Make is_method_call() static and remove a couple of old lines - - * zend_execute.c - zend_extensions.h: - Yet another fix... - - * zend_execute.c: - One more... - - * zend_compile.c: - One more fix for the latest patch - - * zend_compile.c: - One dumb bug in my latest patch - - * zend-parser.y - zend_compile.c - zend_execute.c: - - Complex fix for solving a problem with objects & method calls. - - Previous version is tagged PRE_METHOD_CALL_SEPERATE_FIX_PATCH. - - I need to check this fix on a server so if it doesn't work I will revert - - it. - - * zend-scanner.l: - - Fix problem with newlines not being recognized under certain conditions - -2000-07-03 Andi Gutmans - - * zend_compile.c: - Fix bug #4120 - -2000-07-03 Stanislav Malyshev - - * zend_execute_API.c: Unblock SIGPROF signal when starting timer. - On Linux, this signal is blocked by default after first signal is run - -2000-07-03 sascha - - * FlexLexer.h - zend-scanner.h - zend_alloc.h - zend_compile.h - zend_constants.h - zend_dynamic_array.h - zend_execute.h - zend_globals.h - zend_hash.h - zend_highlight.h - zend_list.h - zend_operators.h - zend_static_allocator.h - zend_variables.h: - Replace macros which begin with an underscore through an appropiately - named macro. - -2000-07-02 sascha - - * zend.h - zend_API.h - zend_builtin_functions.h - zend_config.w32.h - zend_dynamic_array.h - zend_errors.h - zend_execute_locks.h - zend_extensions.h - zend_fast_cache.h - zend_globals_macros.h - zend_indent.h - zend_llist.h - zend_modules.h - zend_ptr_stack.h - zend_stack.h: Change header protection macros to conform to standard. - - Draft 3 of IEEE 1003.1 200x, "2.2 The Compilation Environment" - - All identifiers that begin with an underscore and either an uppercase - letter or another underscore are always reserved for any use by the - implementation. - -2000-07-02 Andi Gutmans - - * zend-parser.y: - Take #2 with tab size 4 - - * zend-parser.y: - - Beautify parser a bit. It still could do with some more at some point - - * zend_execute.h - zend_execute_API.c: - Forgot ZEND_API - -2000-06-30 Zeev Suraski - - * zend_config.w32.h: - Add a messagebox style that's safe to use from an ISAPI filter - - * zend_builtin_functions.c - zend_execute_API.c - zend_globals.h: error_reporting fix - -2000-06-29 Zeev Suraski - - * zend.c - zend.h: Add $context argument to error handler - -2000-06-28 Zeev Suraski - - * zend.c: Improve error handling code - - * zend-scanner.l: Be HTML friendly - -2000-06-28 Andi Gutmans - - * zend.h: version update - -2000-06-26 Zeev Suraski - - * zend.h - zend_constants.c - zend_extensions.h: - Make it possible to detect whether we're thread safe or not from PHP scripts and the php.ini - file - -2000-06-26 Andi Gutmans - - * zend_extensions.c: - Add another "\n" at the end of error messages. - -2000-06-26 Zeev Suraski - - * zend_execute_API.c: - Make max_execution_time work properly when set to 0 under Win32 (disable) - -2000-06-25 Andi Gutmans - - * zend.c: - I wrote a long msg but the commit didn't go through. - - So here is the short version: - - a) Start moving to binary opens in Windows - - b) Give checkuid_mode() a small face lift including the fopen-wrappers.c - - The mode to this function should at least be a #define but that is for - - another day. Anyway this whole stuff should be given more face lifts in - - the future. - -2000-06-24 Zeev Suraski - - * zend_alloc.c: Nuke a warning - -2000-06-23 Andi Gutmans - - * zend_static_allocator.c - zend_static_allocator.h: - Not returning a value anymore - - * zend_static_allocator.h: - Don't need SUCCESS/FAILURE anymore - - * zend_static_allocator.c - zend_static_allocator.h: - Add license - - * zend_static_allocator.c - zend_static_allocator.h: - - Commit static allocator structure which we might use in an upcoming Zend - - change - -2000-06-22 Andi Gutmans - - * zend-scanner.l: - Fix asp_tags. - - * zend_extensions.c: - Oops I miss-wrote that field - - * zend_extensions.c - zend_extensions.h: - - Change API version and make the error messages more meaningful. - - * zend_alloc.c - zend_alloc.h: - Change cache size and only initialize part of it. - -2000-06-22 Stanislav Malyshev - - * zend_alloc.c: - Cached-freed memory blocks should not be in "occupied" list - - * zend_alloc.c - zend_globals.h: Make cache counters to be unsigned int - Start collecting statistics after cache pre-fill - -2000-06-18 sascha - - * Zend.m4 - acinclude.m4 - zend.c: fp_except check for FreeBSD 1.0-2.2.5 - - * Zend.m4 - acconfig.h - zend_config.w32.h - zend_operators.h: Welcome zend_finite(n). - - This chooses the best combination of what is available: - - finite, isfinite, isinf, isnan - -2000-06-18 Stanislav Malyshev - - * zend.h - zend.c: Make error callback be publicly accessible - -2000-06-18 Andi Gutmans - - * zend.c: - Better FreeBSD fix. Does fp_except_t exist on 3.4? - - * zend.c: - - I don't know how this happened. I tested the bloody thing and I remember - - copy&pasting from code which used ~. - -2000-06-17 Zeev Suraski - - * zend_builtin_functions.c - zend_execute_API.c - zend_globals.h - zend_ptr_stack.c - zend_ptr_stack.h: - Add restore_error_handler() - error_handler's are now stored in a stack - - * zend-scanner.l - zend.c - zend_API.h - zend_execute_API.c: - Allow the symbol_table to be passed to call_user_function_ex() - - * zend-scanner.h - zend-scanner.l: Fix filenames and line numbers in ZTS mode - - * zend_hash.c - zend_hash.h: - Avoid crashing with recursive applies - limit apply nest level to 3 (I'm not aware of a place - in which applying recursively on the same hash makes sense with more than one nest level, but - 3 should be enough) - -2000-06-16 Zeev Suraski - - * zend.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h: - Ok, this time here's some real Win32 system programming :) - Redesigned the timeout system using a single timeout thread and a single window, - and used a much quicker check. - -2000-06-16 Andi Gutmans - - * zend_execute_API.c: Fix UNIX build - -2000-06-16 Zeev Suraski - - * zend_execute.c: Macro it up the right way - - * zend_execute.c: Macro this up, so it can be moved to other places - - * zend.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h: - Move timeout code to Zend - - Implement timeouts in Win32 - -2000-06-15 Zeev Suraski - - * Zend.dsp - zend.c: - Fix non thread-safe mode - asp_tags/short_tags etc weren't getting initialized properly - -2000-06-15 Andi Gutmans - - * zend_list.c: *** empty log message *** - - * zend-parser.y: - Support multiple arguments to unset() - -2000-06-15 Thies C. Arntzen - - * zend_list.h: ups. - - * zend_list.h: - changed return type of ZEND_VERIFY_RESOURCE from FALSE to NULL - -2000-06-14 sascha - - * zend_operators.h - zend_operators.c: - Move some stuff to zend_operators.h which is required by the - moved inline functions. - -2000-06-14 Andi Gutmans - - * zend_alloc.c - zend_alloc.h: - More correct way of doing bit mask - -2000-06-14 sascha - - * Zend.m4: Only replaced C0X and C0x, but not c0x.. - - * Zend.m4 - zend_execute.h - zend_gcc_inline.c - zend_operators.h: - Rename C0x-inline to C9x-inline, and frame preprocessor directives in - zend_gcc_inline.c with #ifndef C9X_INLINE_SEMANTICS..#endif. - -2000-06-14 Andi Gutmans - - * ZendTS.dsp: - Make Win32 build - -2000-06-13 Andi Gutmans - - * zend_compile.c - zend_compile.h: Add to the API - -2000-06-13 sascha - - * Makefile.am - Zend.m4 - zend_API.h - zend_compile.h - zend_execute.h - zend_execute_API.c - zend_gcc_inline.c - zend_globals.h - zend_operators.c - zend_operators.h: Add optional support for C0x inline semantics. - - These are enabled by specifying `--enable-c0x-inline' on the command - line. We might add an autoconf check for this particular feature - later. - - * zend_llist.h: - Add llist_apply_func_t and make prototypes use the typedefs. - -2000-06-12 Zeev Suraski - - * zend_builtin_functions.c: Make Egon happy :) - - * zend_builtin_functions.c: - Return the previous error handler from set_error_handler() - - * zend_API.c - zend_API.h - zend_builtin_functions.c: - Avoid using E_CORE_* errorlevels in any place which is not in the global startup sequence - - * zend-parser.y - zend-scanner.l - zend.h - zend_compile.c: Get rid of - -2000-06-11 Andi Gutmans - - * zend.c: - Solve floating point precision crash on FreeBSD. - - * zend.c: - - Fixes crash problem on FreeBSD when losing precision. Need to still see - - how to detect we're on FreeBSD - -2000-06-11 Zeev Suraski - - * zend_API.c: Fix zend_get_parameters() - -2000-06-10 Andi Gutmans - - * zend_operators.c: - - Fixed problem when using uninitialized values in comparisons with strings. - - They behave as empty strings again just like in PHP 3. - -2000-06-10 Zeev Suraski - - * zend_execute.c: - I can't think of a reason of why it should just be a notice... Make it a warning, like it was in PHP 3. - - * zend_API.c - zend_builtin_functions.c: Fix bug #4768 - -2000-06-09 Andrei Zmievski - - * zend_builtin_functions.c - zend_hash.h: Made an alias for hash apply with arguments. - -2000-06-09 Andi Gutmans - - * zend_alloc.c: - Forgot to remove the FIXME - - * zend_alloc.c: - Make the memory limit accurate - - * zend_alloc.c: - Fix cache initialization - - * zend_alloc.c - zend_alloc.h: - - Allocate and cache in 8 byte blocks. Most allocators anyway use 8 byte - - blocks. This should help fragmentation and cache hits. - - The old tree is tagged as PRE_EIGHT_BYTE_ALLOC_PATCH - -2000-06-09 Zeev Suraski - - * zend_execute.c: Fix bug #4933 - - * zend_builtin_functions.c: Fixed bug #4819 - -2000-06-09 Andi Gutmans - - * zend_modules.h: - - Time to change it. We changed register_internal_class() -> - - zend_register_internal_class() - - * zend_API.c - zend_API.h - zend_compile.c - zend_compile.h: - Andrei, this is for you! - - Add zend_register_internal_class_ex() which allows you to specify a - - parent to inherit from. You can either specify the parent directly or via - - its name. - - * zend-parser.y - zend-scanner.l: - Typo - - * zend_execute.c: - Remove old obsolete code. - - * zend_execute.c: - Make unset consistent with the way array offsets work - -2000-06-09 Stanislav Malyshev - - * zend_execute.c: Handle unset with empty key - -2000-06-09 Andi Gutmans - - * zend_API.c - zend_API.h: - - Change register_internal_class to zend_register_internal_class for - - consistency. - - Andrei: I'm still thinking about the _ex you want me to implement - -2000-06-08 sascha - - * Zend.m4 - acconfig.h: Clean up acconfig.h - - * zend_execute_API.c - zend_operators.c: Add a couple of casts - -2000-06-06 Zeev Suraski - - * zend.c - zend.h - zend_compile.c: - Enable asp_tags/short_tags/allow_call_time_pass_by_reference to work on a per-directory - basis as well - -2000-06-06 sascha - - * zend_API.c: - Add newline at the end of the file (breaks at least SCO and Tru64 C compiler). - -2000-06-05 Andi Gutmans - - * zend-scanner.l: - Revert internazionalization fix. - - * zend_builtin_functions.c: - Complete change to create_function() - -2000-06-04 Zeev Suraski - - * zend_compile.c - zend_execute_API.c: - Change shutdown order to sort out a crash when assigning a resource id to a static. - - * zend_hash.c - zend_hash.h - zend_operators.c: - Support unordered hash comparisons - - Make == perform an unordered comparison with arrays/objects, and === perform an ordered comparison - - * zend_builtin_functions.c: Rename lambda() - -2000-06-03 Zeev Suraski - - * zend_hash.c - zend_hash.h - zend_operators.c - zend_operators.h: - Support comparisons of arrays (with arrays) and objects (with objects) - -2000-06-03 Andi Gutmans - - * zend.c: - Change #if to #ifdef. - -2000-06-03 Zeev Suraski - - * ZendTS.dsp - zend.c: Don't take chances with new include files - - * zend_execute_API.c: - Improve call_user_function() to support array($obj, $method) - - * zend-parser.y - zend.h - zend_operators.c: - Export normalize_bool - - This global/static syntax fix brought us back to the 4 documented conflicts - - * zend_builtin_functions.c: Fix a lambda() bug - - * zend_builtin_functions.c: Add missing { - - * zend_globals.h - zend_hash.c - ZendTS.dsp - zend-scanner.l - zend.c - zend.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h: - Fix Win32 compilation (Use winsock2.h from now on) - - Add lambda() support - -2000-06-02 Andi Gutmans - - * zend-parser.y: - global/static require a trailing ';' - -2000-06-02 Zeev Suraski - - * zend_builtin_functions.c: Update error code - - * zend.c - zend.h - zend_config.w32.h: Nuke the old error code, use the new one - -2000-05-31 Zeev Suraski - - * zend.h: IS_BC isn't really being used, but still... - - * zend-parser.y - zend.h - zend_API.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.h - zend_variables.c: - Fix a bug in static initializers/default values/class member variables that contained - array values - -2000-05-29 Zeev Suraski - - * zend_API.c - zend_API.h: Allow disabling of functions for security reasons - -2000-05-28 Andi Gutmans - - * zend_operators.c: - - Use pointer arithmetic to speed up the function a bit - - * Zend.m4: - This should have been done for 4.0.0. - - Default build is without debug now. Use --enable-debug if you want a - - debug build which includes leak/memory overwrite etc. detection - -2000-05-26 Andi Gutmans - - * zend-scanner.l - zend_operators.c - zend_operators.h: - - Fixed scanning decimal numbers in internationalized environments. They should - - always be in standard US format e.g. 23.3 - -2000-05-25 Zeev Suraski - - * zend_compile.c: - Fix a crash bug in certain situations of class redeclarations - -2000-05-24 Thies C. Arntzen - - * zend_hash.h: rename hastable -> _hashtable to avoid clashes - - * zend-scanner.l: - add rdbuf() to our own istdiostream implementation, allowing C++ compile - using SUN and SGI native compilers. (by Jayakumar Muthukumarasamy ) - -2000-05-22 Zeev Suraski - - * zend.c: - Remove ugly Ltd. - -2000-05-21 Sam Ruby - - * zend.c: Windows build failure - -2000-05-21 Andi Gutmans - - * zend.c - zend_compile.h: - - Fix Apache php source highlighting mode. It was crashing due to the - - module shutdown functions being called when the startup functions weren't - - being called. - - * zend.h - zend_extensions.h: - Get ready for release - -2000-05-19 Zeev Suraski - - * zend_highlight.c - zend_highlight.h: Open these up for the API - -2000-05-18 Zeev Suraski - - * zend_alloc.c: Do it in thread unsafe mode for now. - -2000-05-18 sascha - - * zend_alloc.c: Kill warnings - -2000-05-18 Andi Gutmans - - * zend_alloc.c: - Do this someplace else. - - * zend_execute.c - zend_operators.c: - - Fix include() when used on resources (shouldn't work but shouldn't crash - either). - -2000-05-18 Andrei Zmievski - - * zend_operators.c: - Update for sort functions - user can now specify sort type. - -2000-05-17 Andi Gutmans - - * zend_operators.h - zend_operators.c: - - Add support for string_compare_function() and number_compare_function(). - UNTESTED! - -2000-05-17 Zeev Suraski - - * zend_operators.c: Normalize results of compare_function() - - * zend-scanner.l: - Fix crash if %> is encountered in HTML while ASP-tags are disabled - -2000-05-17 Andi Gutmans - - * zend_opcode.c: Fix order - -2000-05-17 sascha - - * zend_operators.h: Add missing prototype - -2000-05-16 Zeev Suraski - - * zend_alloc.c: - - Small optimization. Filling up the Cache helps performance. - -2000-05-12 sascha - - * Makefile.am: Fix parallel makes on BSD - -2000-05-11 Zeev Suraski - - * zend-parser.y - zend-scanner.l - zend.h - zend_operators.c: - Get rid of chval - it's really not necessary and seems to be confusing people - - * zend_compile.c: Refined fix - - * zend_compile.c: - Fix a memory corruption bug with by-ref function arguments - -2000-05-10 Andi Gutmans - - * zend_extensions.h: - Bump up Zend extension version number - -2000-05-10 Thies C. Arntzen - - * zend_compile.c: make waning readable - -2000-05-08 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_opcode.c: Thoroughly initialize IS_UNUSED for proper cleanup - - * zend.h: - Change Zend Engine version number - - * zend_alloc.c: - Return real size allocated - -2000-05-08 Zeev Suraski - - * zend_operators.c: Make zend_binary_strcasecmp compile again - -2000-05-08 sascha - - * zend_operators.c: Make strcasecmp() act correctly WRT SUS II. - - Patch by: hholzgra@php.net - PR: #3556 - -2000-05-06 Andi Gutmans - - * zend_execute.h - zend_execute_API.c: - Make zend_eval_string() return SUCCESS/FAILURE - - * zend_execute.c: - - Make $obj->test = 5; work again (assigning to uninitialized objects) - -2000-05-05 sascha - - * Zend.m4: - Linking directly against libc might result in unexpected behaviour. - We check for dlopen in libdl first, and check then whether dlopen exists. - -2000-05-03 Andi Gutmans - - * zend_compile.h: - Change fetch_type to be zend_uint - - * zend_compile.c - zend_execute.c: - Change the place CAST uses for the op_type - -2000-05-02 Zeev Suraski - - * zend_hash.c - zend_hash.h: - Change zend_hash_get_current_key_ex() to also return the string length - -2000-05-02 sascha - - * zend_API.c: - Fix segfault occuring when a temporary module was unloaded and if this - module did not have a request shutdown function. - - * zend_API.h: - Add ZEND_GET_MODULE(name). This is a short-cut for the common - get_module function. - -2000-05-01 sascha - - * zend.c: - Source file does not end with a newline. Some old compilers don't like that. - -2000-05-01 Andrei Zmievski - - * zend_builtin_functions.c: Added a way to get all declared classes. - -2000-05-01 sascha - - * Makefile.am: Fix dependency - -2000-04-29 Zeev Suraski - - * zend_extensions.h - zend_opcode.c: - Pass the op_array to the ctor/dtor, instead of just the resource - - * zend_extensions.c: crash fix - - * zend_extensions.c - zend_extensions.h - zend_llist.c - zend_llist.h: - Add zend_llist_apply_with_arguments() - - Add a message handler to the extensions - - * zend_compile.h - zend_opcode.c: - Fix possible bug with extension dtors being called without the ctors being called first - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_opcode.c: Beautify - -2000-04-28 Zeev Suraski - - * zend.c - zend_extensions.c - zend_extensions.h: Fix a bug in the resource dispencer - - * zend_operators.c - zend_operators.h: Make convert_to_string() allocations traceable - -2000-04-27 Zeev Suraski - - * zend_extensions.h - zend-scanner.l - zend.c - zend_compile.c - zend_compile.h - zend_execute.c: *** empty log message *** - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_execute.c: Change to using the #define's - - * zend.c - zend.h: More error handling work (still completely disabled) - -2000-04-26 Zeev Suraski - - * zend_execute_API.c - zend_variables.c: Fix - forgot to split away if refcount>1 - -2000-04-25 Zeev Suraski - - * zend_extensions.c: Fix bug - - * zend.h: We'll need two... - - * zend_hash.h: Add useful macros - -2000-04-25 Andi Gutmans - - * zend_llist.c: - Fix persistence of llist - -2000-04-24 Zeev Suraski - - * zend_compile.c: - Forgot to keep the ':' in the class_name - - * zend_API.c: Correct fix - -2000-04-24 Thies C. Arntzen - - * zend_API.c: MODULE_TEMPORARY should get a call to RSHUTDOWN as well! - - * zend.c: - fixed shutdown crash if MSHUTDOWN tries to php_error() something. - -2000-04-21 Thies C. Arntzen - - * zend_variables.c - zend_variables.h: export zval_add-ref and zvale_del_ref - -2000-04-20 Zeev Suraski - - * zend_operators.h: - Change macro names from Z to Z_ - - * zend_operators.h: Add some macros for nicer zval handling - -2000-04-20 Andrei Zmievski - - * zend_operators.c: Do proper ieeefp.h check. - -2000-04-20 Thies C. Arntzen - - * zend_operators.c: - compile before commit! compile before commit! compile before commit! - - * zend_operators.c: - revert andrei's path (i can't compile anymore on linux) - we're always using #ifndef HAVE_BLA instead of if !HAVE_BLA and if we need ieeefp.h for some weird platform (which one is that?) we need an autoconf check for it. - -2000-04-19 Andrei Zmievski - - * zend_operators.c: Include proper files for finite. - -2000-04-19 Zeev Suraski - - * zend.c - zend.h - zend_builtin_functions.c - zend_execute_API.c - zend_globals.h: - Initial support for trapping errors (not complete and disabled; will be enabled only - post-PHP 4.0.0) - - * zend_builtin_functions.c - zend_constants.c - zend_errors.h: - - Renamed get_used_files() to get_required_files() for consistency - - Documented some functions - - Added user-level warning messages - - Added user_error() - -2000-04-19 Andi Gutmans - - * zend_opcode.c - zend_compile.h: - Export pass_include() for Windows - -2000-04-18 Zeev Suraski - - * zend_operators.h: - Add convert_to_writable_*_ex() macros (unused at this time) - -2000-04-17 Andi Gutmans - - * zend_compile.c - zend_execute.c: - Fix order of JMPZNZ arguments - -2000-04-17 Thies C. Arntzen - - * zend_operators.c: ups, finite is already a macro on Win32 - - * Zend.m4 - zend_operators.c: HPUX11 only has isfinite() - -2000-04-15 Andi Gutmans - - * zend-scanner.l: - Fix leak in require_once() - -2000-04-15 Thies C. Arntzen - - * zend_extensions.c: fixes compile on platforms without dl() support. - -2000-04-15 Zeev Suraski - - * zend.c: Fix ZTS - -2000-04-15 Andi Gutmans - - * zend-scanner.l: - "use" is not yet supported; instead use include_once() or require_once() - for the time being (Andi, Zend library) - -2000-04-15 Zeev Suraski - - * zend.c - zend_API.c - zend_compile.c - zend_execute_API.c - zend_list.c - zend_list.h: - Clean up resource lists namespace - - Prepare extended resource list destructor APIs (currently unused) - -2000-04-13 Zeev Suraski - - * zend_operators.c: - Fix a memory leak when using assign-op bitwise operators on strings - -2000-04-12 Zeev Suraski - - * zend_execute.c: *** empty log message *** - -2000-04-11 Andi Gutmans - - * zend_execute_API.c: - Fix memory leak - -2000-04-11 Zeev Suraski - - * zend_execute.c: Fix warnings - - * zend_execute.c: Fix fd leak in include_once() - -2000-04-10 Andi Gutmans - - * zend-scanner.l - zend_execute.c: - - -2000-04-10 Zeev Suraski - - * zend.h - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_operators.c: Fix object overloading support - -2000-04-10 Andi Gutmans - - * zend_execute.c: - Add warnings - - * zend_compile.c: - Two more places needed changing - -2000-04-10 Zeev Suraski - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.h: Clean up last/size definitions - -2000-04-09 Zeev Suraski - - * zend_compile.h: *** empty log message *** - -2000-04-07 Zeev Suraski - - * zend_execute.c: Thoroughly fix include_once() - - * zend_execute.c: Fix include_once() - -2000-04-06 Andi Gutmans - - * zend-parser.y: *** empty log message *** - - * zend_execute.c - zend_execute.h: Initial preparation for OO overloading patch - -2000-04-05 Andi Gutmans - - * zend_extensions.h: - Bump up version number - - * zend_compile.c - zend_execute.c: - FIx JMPZNZ - -2000-04-03 Zeev Suraski - - * zend_list.c: - Fix the problem with dl()'d modules not freeing their resources properly - -2000-04-01 Zeev Suraski - - * zend_API.h - zend_config.w32.h: *** empty log message *** - - * acconfig.h: Have a standard way of exporting symbols - - * zend_modules.h: Use int - - * zend_API.h: Generalize some common thread-safety stuff - - * zend_modules.h: Have a standard entry for the globals id - -2000-03-31 Zeev Suraski - - * zend_compile.c: - The previous fix ended up being broken, this one should do it - -2000-03-31 Andi Gutmans - - * zend_compile.c: - Fix bug - -2000-03-30 Zeev Suraski - - * zend_extensions.c: Fix zend_register_extension() - -2000-03-30 Andi Gutmans - - * zend_extensions.h: - Bump up API number after Lars' change - -2000-03-30 sascha - - * Makefile.am: Give another hint to BSD makes - - * Makefile.am: - Specifically mention $(srcdir), so that OpenBSD's make gets it - -2000-03-29 Zeev Suraski - - * zend_stack.c - zend_stack.h - zend_compile.c: - - Make the argument order for the stack applies more consistent with other Zend - data structures - - Fix a possible corruption problem due to switch() C-level optimization - -2000-03-29 Torben Wilson - - * zend-parser.y - zend-scanner.l - zend_compile.h - zend_execute.c - zend_opcode.c - zend_operators.c - zend_operators.h: - - Added !== (is not identical) operator. - -2000-03-29 Zeev Suraski - - * zend_extensions.c - zend_extensions.h: *** empty log message *** - -2000-03-29 Andi Gutmans - - * zend_API.h: - - Make sure zend_API.h has Zend'ish versions of the ZEND macros so that - Zend'ish modules don't need to mix PHP & Zend notation. - -2000-03-28 Zeev Suraski - - * zend_builtin_functions.c: - The checks for func_num_args() and friends were broken - fixed - -2000-03-27 Sam Ruby - - * Zend.dsp: Remove debug libraries from debug build - -2000-03-26 Andi Gutmans - - * zend_execute.c - zend_execute_API.c - zend_API.c - zend_builtin_functions.c: - Stop zend_func_args() and co. from crashing - - * zend.h: - - Didn't see Thies' commit message although I can't really see how it would - make a difference - - * zend.h - zend_opcode.c: - Include Andrea's fix for alloca.h - -2000-03-26 Thies C. Arntzen - - * zend.h - zend_execute.c: - needs to be included before we define macros calling alloca() - atleast using SGI's cc - should not harm other platforms (i hope) - - * zend_opcode.c: fix cast - -2000-03-25 Andi Gutmans - - * zend_alloc.c - zend_alloc.h: *** empty log message *** - -2000-03-25 Zeev Suraski - - * zend-parser.y - zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_variables.c: - Some header dependencies cleanup - - Generalize zval_print() and zval_print_r() - -2000-03-25 Sam Ruby - - * zend.h: RTLD_NOW => RTLD_LAZY|RTLD_GLOBAL - -2000-03-25 Zeev Suraski - - * Zend.dsp: Update dsp's - -2000-03-24 Zeev Suraski - - * zend_execute.c: - - Fixed a crash when sending a non-variable expression to a runtime-bound function - that expected a reference. - -2000-03-24 Andi Gutmans - - * zend_API.c - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_hash.c - zend_hash.h: - Nuke hash_*_ptr functions - -2000-03-23 Andrei Zmievski - - * zend_builtin_functions.c: Use WRONG_PARAM_COUNT. - -2000-03-23 Zeev Suraski - - * zend_builtin_functions.c: - Make it compile - -2000-03-23 Andrei Zmievski - - * zend_builtin_functions.c: Added get_class_methods(). - -2000-03-22 Andi Gutmans - - * zend.h: - Change Zend version as API has changed - -2000-03-22 Zeev Suraski - - * zend_operators.c: - Wrong fix - - * zend_operators.c: - Only free when result != op1 - -2000-03-21 Andi Gutmans - - * zend.c - zend.h: - - Change zend_startup to accept a flag for starting builtin functions - - * zend.h - zend_API.h: - Move #defines - -2000-03-19 Thies C. Arntzen - - * zend_compile.h: kill warning - -2000-03-18 Andi Gutmans - - * zend.h: - Fix compile problem on FreeBSD - - * zend.h: - - No reason for refcount to be signed and move to zend_* typedefs - -2000-03-18 Thies C. Arntzen - - * zend.c: renamed _string_value_() to __string_value(). - -2000-03-18 Zeev Suraski - - * zend_builtin_functions.c: - The third argument to define() wasn't working right, fixed - - * zend_execute.c: - false wouldn't automaticaly switch to an array type, which resulted in an - incompatibility with PHP 3. Fixed. - -2000-03-16 Thies C. Arntzen - - * zend.c: renamed "to_string" -> "_string_value_" - -2000-03-15 Zeev Suraski - - * zend-scanner.l - zend.h - zend_execute.c: - Fix newly introduced problem reported by Sam Ruby - -2000-03-15 Andrei Zmievski - - * zend_hash.c - zend_hash.h: - Make zend_hash_move_forward()/zenv_hash_move_backwards() a little smarter. - -2000-03-15 Zeev Suraski - - * zend_opcode.c: - Fix warning (I thought I fixed this one before) - -2000-03-14 Andrei Zmievski - - * zend_llist.c - zend_llist.h: Implemented external list traversing. - -2000-03-14 Andi Gutmans - - * zend-parser.y: - - Allow array(1,2,3,) i.e. with trailing comma. You can only have one - trailing comma. - -2000-03-13 Zeev Suraski - - * zend_compile.c: - - - * zend_compile.c: - Spare a byte :) - -2000-03-13 Andi Gutmans - - * zend_compile.h - zend_modules.h: - Another zend_uchar - - * zend_compile.c: *** empty log message *** - - * zend.h - zend_compile.h: - - define zend_uint and zend_uchar and use them in a few places - -2000-03-13 Andrei Zmievski - - * zend_hash.c - zend_hash.h: - Introduced a way to traverse hashes through external pointers. - -2000-03-13 Andi Gutmans - - * zend_compile.h: - Change type from int -> char - -2000-03-13 Zeev Suraski - - * zend-scanner.l: - Fix filename/lineno initialization for do_return - -2000-03-12 Zeev Suraski - - * zend_builtin_functions.c - zend_modules.h: - - -2000-03-11 Andi Gutmans - - * zend_execute.c: - - Remove inline from functions which are pretty large and besides eating up - memory in compile time probably doesn't boost performance. - -2000-03-10 Andi Gutmans - - * zend_operators.c: - - Seems to be a problem here with the return value not being set - - * zend-parser.y - zend_builtin_functions.c - zend_execute.c - zend_execute_API.c - zend_globals.h: - Quick way of supporting include_once(). - Good enough for RC1. - - * zend-parser.y - zend-scanner.l - zend_compile.c - zend_compile.h: - Support require_once(). - - * zend_compile.h - zend_execute.c: - Cleanup old IMPORT stuff - - * zend-parser.y - zend-scanner.l: - - Nuke import, add include_once and include_require scanner/parser rules. - Hope to nuke use too :) - - * zend_modules.h: - That broke the Win32 build - - * zend_modules.h: - Fix a bug and define an API_NO for the ZEND_MODULE_API - - * zend_modules.h: - zend_config.h is enough - - * zend_modules.h: - Save ZEND_DEBUG, ZTS, ZEND_API information - -2000-03-09 Andi Gutmans - - * zend_highlight.c: - Fix bug in syntax highlighter - -2000-03-06 stig - - * zend_modules.h: added GINIT_FUNC_ARGS and GINIT_FUNC_ARGS_PASSTHRU - -2000-03-06 Zeev Suraski - - * zend_extensions.h: - Bump up Zend's API version - -2000-03-06 stig - - * zend_modules.h: Added ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU. - -2000-03-06 Andi Gutmans - - * zend-scanner.l: - Fix memory leak - - * zend.c: - Missed one - -2000-03-06 Sam Ruby - - * zend.c - zend.h: Unresolved externs - -2000-03-06 Zeev Suraski - - * zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h - LICENSE - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_modules.h: It's official now... - -2000-03-05 Zeev Suraski - - * ZendTS.dsp - zend.c - zend.h: Wrap some commonly unused callbacks - -2000-03-04 Zeev Suraski - - * zend-scanner.l: - The default return value from include() and eval() changed from 1 to 0 - unintentionally after the old return-reference patches - fixed - -2000-03-02 Sam Ruby - - * zend_config.w32.h: Fix Win32 build breakage - -2000-03-01 Andi Gutmans - - * zend.c: - Upgrade to year 2000 - - * ZEND_CHANGES - zend_compile.c - zend_execute.c: - Fix typos - -2000-03-01 Thies C. Arntzen - - * zend_operators.c: now - -2000-02-27 Egon Schmid - - * zend_builtin_functions.c: Fixed some protos. - -2000-02-26 Sam Ruby - - * zend_builtin_functions.c: compilation error - Win32 - -2000-02-26 Andrei Zmievski - - * zend_builtin_functions.c: - Added get_class_vars() and get_object_vars() functions. - - * zend_execute.c: Fix typo. - -2000-02-26 Zeev Suraski - - * zend_operators.c: Fix comparisons of "inf"=="inf" and "-inf"=="-inf" - -2000-02-25 Zeev Suraski - - * zend_fast_cache.h - zend_variables.c: Use the fast cache here too - -2000-02-19 Zeev Suraski - - * zend-parser.y - zend-scanner.h - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_builtin_functions.c - zend_builtin_functions.h - zend_compile.c - zend_compile.h - zend_config.w32.h - zend_constants.c - zend_constants.h - zend_dynamic_array.c - zend_dynamic_array.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: (c) patch - - * zend_API.c - zend_API.h - zend_fast_cache.h - zend_hash.c: - - Fix a nasty bug in the hash, introduced in the recent migration to macros - - Make array_init() and friends trackable - - * zend_API.c - zend_API.h - zend_execute.c - zend_operators.c - zend_operators.h: Generalize macros - -2000-02-18 Zeev Suraski - - * zend-scanner.l: *** empty log message *** - -2000-02-18 sascha - - * zend_llist.c - zend_llist.h: - Get rid of second declaration of compare_func_t. Either put in a common - header file or prefix it with i.e. zend_llist_ - -2000-02-18 Andi Gutmans - - * zend_llist.c - zend_llist.h: - - Quick and dirty hack for supporting sorts. Improve later on when I wake up. - - * ZendTS.dsp - zend_dynamic_array.c: - Didn't compile on Win32 - - * zend_dynamic_array.c: - - Tiny change (I know I don't have to cast malloc() to void * but I like - casting my malloc()'s) - - * Makefile.am - zend_dynamic_array.c - zend_dynamic_array.h: - - Preliminary support for dynamic arrays. I need it on order to try out a - new hash implementation. It isn't used anywhere. - -2000-02-17 Andi Gutmans - - * zend.c - zend.h: - Add ZEND_API - -2000-02-16 Andi Gutmans - - * zend_execute.c: -Fix bug 3504 concerning leaks with unset() - - * zend_execute.c - zend.h - zend_compile.h: - Hopefully fix Thies' bug report. - -2000-02-16 Zeev Suraski - - * zend_builtin_functions.c: - ZEND_TEST_EXCEPTIONS should be defined/undefined before it's checked - -2000-02-16 Andi Gutmans - - * zend_execute.c: - Fix bug #3309 - -2000-02-14 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - - Put in the infrastructure for the unset() fix. Right now it has the old - behavior but I just need time tomorrow to add the correct behavior. - - * zend_builtin_functions.c: - Fix bug in func_get_arg() - - Get rid of compiler warnings for unused function crash() - -2000-02-13 Zeev Suraski - - * zend_constants.c: Fix a memory leak - -2000-02-13 Andi Gutmans - - * zend_hash.c: - Save a function call one very hash_add - - * zend_hash.c - zend_hash.h: - - Make startup a bit faster by changing some hash_update()'s and hash_add()'s - to hash_update_ptr()/hash_add_ptr() - - * zend_hash.c: - - Fix a couple of potential bugs where we were using emalloc/efree instead - of pemalloc/pefree. - - Fix a bug were we potentially would be freeing the key by mistake - -2000-02-13 Zeev Suraski - - * zend_builtin_functions.c: *** empty log message *** - - * zend_operators.c: Make (array) false == array() and not array(false) - -2000-02-11 Andrei Zmievski - - * zend_hash.c - zend_hash.h: Made a couple of typedefs for zend_hash_apply_*() calls. - -2000-02-11 Zeev Suraski - - * Zend.dsp - ZendTS.dsp - zend_config.w32.h: Update .dsp's - - * zend-scanner.l - zend.h - zend_API.h - zend_alloc.c - zend_config.w32.h - zend_constants.c - zend_execute.c - zend_extensions.c: Fine tune Andi's patch - -2000-02-10 Andi Gutmans - - * zend.h: - #define ZEND_WIN32 differently - - * zend-scanner.l - zend.h - zend_API.h - zend_alloc.c - zend_constants.c - zend_execute.c - zend_extensions.c: - Finally beautify those WIN32|WINNT checks - - * zend_execute.c: - Shouldn't be there - - * zend_execute.c: - Cleanup the code - -2000-02-09 Zeev Suraski - - * zend-parser.y - zend_execute.c: - Fix last known nasty bugs in Zend. It'll be cool if there are no new ones :) - -2000-02-09 Thies C. Arntzen - - * zend_execute.c: foreach() works now for objects as well. - -2000-02-08 Zeev Suraski - - * zend_operators.c: Fix declaration - - * zend_execute.c: Fix an elusive bug - -2000-02-08 Andrei Zmievski - - * zend_operators.c: Fix up the patch. - - * zend_builtin_functions.c - zend_operators.c - zend_operators.h: Patches from Walter for strncmp() stuff. - -2000-02-07 Zeev Suraski - - * zend_highlight.c: Remove old unnecessary check - - * zend-parser.y - zend-scanner.l - zend_compile.c - zend_highlight.c: - Syntax highlighting was erronously emitting more than one semicolon and/or garbage with heredocs - -2000-02-06 Andi Gutmans - - * zend_compile.c: - - Support the string offset syntax $a{2} with the regular array opcodes. - Will need to write new opcodes sometime but right now it's good enough - to announce the change to this string offset syntax for beta 4. - -2000-02-05 Andi Gutmans - - * zend-parser.y - zend_compile.c: - - This hopefully fixes the list($a, $a) = array(1,2) crash, i.e. when list - by mistake contains the same variable twice. - - BTW, there is no defined order of assignment. The value of $a after the - previous example is undefined, and should not be assumed to be either 1 - nor 2. - -2000-02-05 Zeev Suraski - - * zend_execute.c: More cleanup - - * zend.h - zend_builtin_functions.c - zend_execute.c - zend_execute_API.c: Pass the executor globals to internal functions - - * zend.c - zend.h - zend_API.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_modules.h - zend_variables.c: - Stop passing list/plist to internal functions - - Add a typedef for the pCopyConstructor function pointer - - Minor hacks - - * zend-scanner.l: - That was the broken downcasting that prevented the interactive C++ mode from working properly under UNIX - -2000-02-04 Zeev Suraski - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_opcode.c: - Maintain a state of whether we're compiling and/or executing - -2000-02-03 Andrei Zmievski - - * zend_API.c - zend_API.h: *** empty log message *** - -2000-02-02 Zeev Suraski - - * zend_API.c: - Fix built-in classes with more than 5 methods - - * zend_compile.c: - - Fix the annoying problem with list(), that surfaced up after our recent cleaning - patches - -2000-02-01 Andrei Zmievski - - * zend_API.c - zend_API.h: Added add_property_unset() and add_property_bool(). - -2000-02-01 Zeev Suraski - - * ZendTS.dsp - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_execute_locks.h: Improve dependencies - - * zend_execute.c: Sort out a gdb problem - - * zend_execute.c: Fix warning - -2000-02-01 Andi Gutmans - - * zend_compile.c - zend_execute_API.c - zend_globals.h: - Get rid of remains of garbage. - - This should fix Thies' UMR - -2000-02-01 Thies C. Arntzen - - * zend_execute_API.c: - moved destroying of garbage before resource-list gets destroyed - (see my previous mail) - zeev, andi - please comment! - - * zend.c: added missing break. - - * zend_hash.c - zend_hash.h: - took out zend_hash_pointer_update() & zend_hash_pointer_index_update_or_next_insert() - i really prefer link-errors instead of runtime-errors, don't you? - -2000-01-31 Andi Gutmans - - * zend_compile.h: - This has to always be done. - -2000-01-31 Zeev Suraski - - * zend-parser.y - zend_compile.h - zend_execute.c - zend_execute_API.c: - Optimized garbage mechanism - - Fixed another buglet in the parser - - * zend-parser.y - zend_alloc.c - zend_execute.c - zend_fast_cache.h: - Fix foreach() - - Fix indirect reference with object properties - -2000-01-30 Andi Gutmans - - * zend_execute.c: - - Fix the bug Thies found where I forgot to change a break; to NEXT_OPCODE(); - - If you find anymore let me know - - * zend_alloc.h: - Run it on align_test - -2000-01-29 Zeev Suraski - - * zend_compile.c: Fix ``'s - - * zend-parser.y - zend-scanner.l - zend_compile.h: Fix require() - -2000-01-29 Andi Gutmans - - * zend-parser.y: - Get rid of another rule which isn't needed. - - * zend-parser.y - zend_compile.c - zend_compile.h: - - Add parser support for string offsets. This added three shift/reduce - conflicts but they all seem to be fine. - - Cleaned up the parsing rules a bit and made them much more compact and - elegant. - - Please CVS update and see that I didn't break anything. - - * zend_alloc.h: - - This will save some memory w/ GCC compilers on some platforms - - * zend_execute.c: - Yet another tiny optimization. - -2000-01-28 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_execute.c: - Make loop a bit faster. - - * zend.h: - Make sure its use is understood. - - * zend.h - zend_execute.c: - Double the speed of some key switch() tests for Win32. - - * zend_execute.c: - - This makes the switch() statement twice as quick. Moving to enum - might make this a general speed up for other platforms too - -2000-01-26 Andi Gutmans - - * zend_execute_API.c: - Keep objects as references. - - * zend_execute_API.c - zend_opcode.c: - - Allow is_ref to become 0 in case the refcount is back to 1. - -2000-01-24 Andi Gutmans - - * zend_compile.c - zend_execute.c: - - Make foreach() now copy the array but use the original array. It can - still be optimized A LOT but it's only a performance issue and not - a feature issue. - -2000-01-24 Zeev Suraski - - * zend-parser.y - zend-scanner.l - zend.c - zend.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_operators.c - zend_operators.h: - Implement declare() with declarables framework - - Implement ticks - Germany&Norway - 5 points! - - * zend_execute.c - zend_execute_API.c: Fixes - -2000-01-22 Zeev Suraski - - * zend_execute_API.c: Fix an elusive bug - -2000-01-20 Zeev Suraski - - * zend_hash.c: Add some order... - - * zend_hash.c: Indentation fixes - -2000-01-19 Andi Gutmans - - * zend_hash.c: - Optimize zend_hash_del a tiny bit. - - * zend_hash.c - zend_hash.h: - Hopefully fix the hash problem. - - * zend_hash.c: - Hrm I'm not concentrating - - * zend_hash.c: - - Actually the destructor should run after the data is already detached - from the hash but before the bucket is freed. - - * zend_hash.c: - - Rollback hash_apply and friends. They assume now that hash_del is reentrant - as it first applies the destructor and only later nukes the bucket - - * zend_hash.c: - - Run destructor before the hash structure is modified, thus, making - hash_del, reentrant (BLOCK_INTERRUPTIONS needs to be made a counter now). - - * zend_hash.c: - Undo a bug we introduced. (Another one out there). - -2000-01-19 Thies C. Arntzen - - * zend_API.h: - RETURN_NULL -> RETURN_NULL() // we don't want macros without an argumnet - -2000-01-18 Zeev Suraski - - * zend_execute.c: Leak fix - -2000-01-18 Thies C. Arntzen - - * zend_API.h: RETURN_NULL & RETVAL_NULL don't need (). - -2000-01-17 Thies C. Arntzen - - * zend_hash.c: use defines - -2000-01-17 Zeev Suraski - - * zend_hash.c - zend_hash.h - zend_variables.c: Get rid of the IsPointer functionality in the hash. - - * zend_hash.c: - Fixes a newly introduced bug in the hash - - * zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h - zend_modules.h - zend_opcode.c - zend_variables.c - zend_variables.h: - Destructors no longer return ints, the low level problem it was intended to solve is long gone now... - -2000-01-16 Zeev Suraski - - * zend.c - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h: - - Make zend_hash_apply() (and friends) reentrant and much, much quicker - - Introduce zend_hash_graceful_destroy(), which allows the destructor functions to - use zend_hash_apply() and/or zend_hash_graceful_destroy() - - Switch to zend_hash_graceful_destroy() in the resource list shutdowns - - * zend.c - zend_compile.c - zend_compile.h: - Allow module startup to be separate from the compiler/executor startup - -2000-01-16 Thies C. Arntzen - - * zend_hash.c: make the ht->inconsistent stuff less ugly:) - -2000-01-15 Zeev Suraski - - * zend_execute_API.c - zend_list.c: Fix a bug in call_user_function_ex() - - * zend-parser.y: - Added support for $foo->{$bar}["foobar"] notation (was supported in PHP 3) - -2000-01-15 Thies C. Arntzen - - * zend_hash.c - zend_hash.h: - if ZEND_DEBUG mode is on we'll now see warnings when a HashTable is accessed - while it's inconsistent. - - Zeev, Andi - you welcome to revert this patch if you don't like it - i find it - useful! accesssing inconsistent hashtables is one of the hardest things to track! - -2000-01-14 Andrei Zmievski - - * zend_highlight.c: - Since we're highlighting code, put and around the code. - -2000-01-13 Zeev Suraski - - * zend.h - zend_config.w32.h: Make Win32 compile again - -2000-01-12 sascha - - * acconfig.h - zend.h: - Move dl stuff from acconfig.h into zend.h. That allows us finer control - when it comes to suppressing dlfcn.h. - -2000-01-09 Zeev Suraski - - * zend_execute.c: Functionality & crash fixes - -2000-01-04 Andi Gutmans - - * zend.h - zend_operators.c: - - Rename IS_BC to FLAG_IS_BC. We will probably nuke it. - -2000-01-04 Thies C. Arntzen - - * zend_API.h: added ZVAL_*() macros. - -2000-01-04 Andi Gutmans - - * zend.h - zend_execute.c: - - Separate the overloaded objects' types from Zend's data types. - There is no reason for them to be the same, and IS_METHOD just cluttered - there data types. - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_variables.c - zend-parser.y - zend.c: - Change IS_UNSET -> IS_NULL - -2000-01-03 Zeev Suraski - - * zend_execute.c: Fix a bug when using [] on a string - -2000-01-03 Joey Smith - - * zend_operators.c: number.h comes from ext/bcmath, not functions/ - -2000-01-03 Zeev Suraski - - * zend_execute.c: Fix - -2000-01-03 Andi Gutmans - - * zend_operators.c: - Fix compare_function() for IS_UNSET - -2000-01-02 Zeev Suraski - - * zend_execute.c: Fix - -2000-01-02 Thies C. Arntzen - - * zend_API.h: renamed RET???_UNSET -> RET???_NULL - -2000-01-01 sascha - - * Zend.m4 - acconfig.h - acinclude.m4: Some cleanup - -2000-01-01 Andi Gutmans - - * zend_operators.c: - - IS_NULL should be 0 when converted to a long although I don't think it - really should be documented. - -2000-01-01 Zeev Suraski - - * zend_operators.c: Fix buglet - -1999-12-31 Zeev Suraski - - * Zend.dsp - ZendTS.dsp: .dsp updates - - * Zend.dsp - ZendTS.dsp - zend_config.w32.h: - Add Release_inline builds - - * zend-parser.y - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_constants.c - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_operators.h - zend_variables.c: - Nuke undefined_variable_string - - Introduce IS_UNSET - -1999-12-31 Andi Gutmans - - * ZendTS.dsp - zend-parser.y - zend_compile.c - zend_compile.h: - - Fix bug #3073. continue in do..while() loops should work now - -1999-12-30 Zeev Suraski - - * zend.c - zend_alloc.c - zend_fast_cache.h - zend_globals.h - zend_globals_macros.h: - This should enable people to use ALLOC_ZVAL() in code outside the php4.dll - -1999-12-30 sascha - - * Zend.m4: - Solaris' sed does not like this expression. Since -O0 is the default, - we can also omit it. - -1999-12-29 Zeev Suraski - - * zend_variables.c: - - Change var_reset() to set bool(0) instead of string("") - - Authors should go over their code and change it to use var_reset() instead of manually - setting it to string(""), in case they're interested in the false value. - - * zend_alloc.c: time_t is an int under Linux... this should always work. - -1999-12-28 sascha - - * zend_alloc.c: Fix warnings - -1999-12-28 Thies C. Arntzen - - * zend_API.h - zend_constants.c: new constant: SQL_NULL - new macros: RETURN_SQLNULL,RETVAL_SQLNULL,IS_SQLNULL - -1999-12-27 Zeev Suraski - - * zend_fast_cache.h: Fix - -1999-12-27 Andi Gutmans - - * zend_API.c: - Get rid of warning - -1999-12-27 Zeev Suraski - - * Zend.dsp - ZendTS.dsp - zend_API.c - zend_API.h - zend_alloc.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_fast_cache.h - zend_globals.h - zend_opcode.c - zend_operators.c - zend_variables.c - zend_zval_alloc.h: - Generalize the fast cache mechanism - - Add the HashTable struct to the fast cache mechanism - -1999-12-27 Andi Gutmans - - * zend_API.c: - - Make zend_internal_function allocate a full zend_function structure so - that we don't get memory overruns and Thies doesn't get angry :) - -1999-12-27 Zeev Suraski - - * zend_alloc.c: *** empty log message *** - - * zend_globals.h - zend_zval_alloc.h - zend_alloc.c: Add cache statistics support - -1999-12-27 Thies C. Arntzen - - * zend.c: fix UMR in ZTS mode - -1999-12-26 Zeev Suraski - - * Zend.dsp - ZendTS.dsp - zend_alloc.c - zend_globals.h - zend_zval_alloc.h: - - Enable the new zval cache on debug too. No real reason not to, and it keeps - the code cleaner. - - ZTS compile fixes - - * zend_alloc.c: Fix buglet - - * zend_zval_alloc.h: Add missing file - - * zend.h - zend_API.h - zend_alloc.c - zend_compile.c - zend_execute.c - zend_globals.h - zend_operators.c: - Introduce a zval-specific cache - 5-15% speed improvement - -1999-12-26 sascha - - * Makefile.am - acinclude.m4: Makefile.am: Add dummy target for dependencies - acinclude.m4: Cache result of broken sprintf check - -1999-12-26 Zeev Suraski - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_operators.c: Change ALLOC_ZVAL() semantics - - * zend_alloc.c - zend_alloc.h - zend_globals.h: namespace protection - -1999-12-25 Zeev Suraski - - * zend_ptr_stack.c - zend_ptr_stack.h: inline functions cannot accept varargs - -1999-12-25 Andi Gutmans - - * zend-parser.y: - Prepare Zend for the new $a{2} string offset syntax. - -1999-12-24 Zeev Suraski - - * zend_config.w32.h: - Use __forceinline under Win32 (inlining under Win32 gives roughly 30% performance - increase) - - * zend-scanner.l: Shut gcc up - - * zend_compile.c: Optimize - -1999-12-24 Andi Gutmans - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_variables.c: - - Create two new macro's. ALLOC_ZVAL() and FREE_ZVAL(z) and make Zend use - them. - -1999-12-24 Zeev Suraski - - * zend_compile.c: - Use function_add_ref() here too - -1999-12-23 Zeev Suraski - - * zend_compile.c - zend_opcode.c: - Fix a class inheritence leak, when using static varibles in a parent class member function - - * zend_compile.c: This one slipped away - -1999-12-23 sascha - - * Zend.m4: Rename option to match description string - -1999-12-23 Zeev Suraski - - * zend-parser.y - zend-scanner.l - zend_compile.c - zend_compile.h - zend_execute.c: - - require() of a dynamic expression now has the standard require() semantics - - Fixed a memory leak in require() of a dynamic expression - -1999-12-23 sascha - - * Makefile.am - Zend.m4: - Compile zend_execute.c with special CFLAGS. For GCC, INLINE_CFLAGS - contains -O0 to disable optimizations. This can be disabled by using - the appropiate parameter. - -1999-12-22 sascha - - * zend_builtin_functions.c: Kill compiler warning - - * Zend.m4: Don't set DEBUG_CFLAGS to -g, if -g is already in CFLAGS - -1999-12-22 Zeev Suraski - - * zend.c - zend.h: export - - * zend_extensions.h: Those void's don't belong in there - - * zend_API.h - zend_builtin_functions.c: - Fix function_exists() - - * zend_execute.c: - - Fix a very old legacy memory leak in break(n) statements - - * zend_execute.c: Fix for the array() initialization bug Stas found - -1999-12-22 Andi Gutmans - - * zend_compile.c: - Remove unused variable. - -1999-12-21 Zeev Suraski - - * zend-scanner.l - zend.h - zend_compile.c - zend_execute.c: - Fix the highlighting problem. STR_REALLOC() should be used instead of plain erealloc() - whenever you're dealing with strings that might be coming back from the engine - there seem - to be a few other places like this in PHP. - -1999-12-21 Andrei Zmievski - - * zend.c - zend_API.c - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_operators.c - zend_variables.c - zend_variables.h: We're using ZVAL's now. - -1999-12-21 Zeev Suraski - - * zend_execute.c: - Fix Sascha's leak. Good report! - - * zend_alloc.c: No need to block for interruptions so early - -1999-12-21 sascha - - * Zend.m4: - Explicitly check for C++ preprocessor, otherwise autoconf forces it onto - us at the wrong place (subsequent autoconf checks failed). - -1999-12-20 Zeev Suraski - - * zend_compile.c: - Fix @expr - - * zend.h - zend_compile.c - zend_execute.c: - - Fix the crash Thies was experiencing (returning a function call could cause a crash) - - Fix the leak Thies was experiencing (@fcall() leaked) - -1999-12-19 Zeev Suraski - - * Zend.dsp: Some updates - - * Zend.dsp - ZendTS.dsp: Make these work again - - * FlexLexer.h - Makefile.am - Zend.dsp - Zend.m4 - ZendTS.dsp - configure.in - flex.skl - libzend.dsp - libzend.m4 - libzendts.dsp: libzend -> Zend - - * zend.h - zend_API.h - zend_compile.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h: - - Made things work again (Thies, everybody - please check the latest CVS and see if you're - still getting any problems) - - Changed the interface of call_user_function_ex() to support returning of references - -1999-12-19 Andi Gutmans - - * zend.c - zend.h - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h: - More fixes related to the return references patch - - eval_string() and call_user_function_ex() still don't work. - - The libzend tree is untested and might not be stabl yet. - -1999-12-19 sascha - - * Makefile.am: Add zend_sprintf.c - - * acconfig.h - zend_sprintf.c: configure sets ZEND_BROKEN_SPRINTF - - * acinclude.m4: Variables are not interpolated unless we use _UNQUOTED - -1999-12-18 Zeev Suraski - - * zend.h - zend_API.h: - The tree compiles again - -1999-12-18 sascha - - * libzend.m4: Let autoconf check for the proper inline keyword - - * Makefile.am - libzend.m4: - automake created illegal target names due to the ZEND_SCANNER definition. - We now substitute @ZEND_SCANNER@ directly - -1999-12-18 Zeev Suraski - - * zend.h - zend_API.c - zend_API.h - zend_builtin_functions.c: - - Introduce ZEND_NUM_ARGS(), to replace ARG_COUNT(ht) - - Rename getParameters() and friends for consistency and namespace cleanliness - -1999-12-17 Zeev Suraski - - * zend_constants.c: - Made PHP_VERSION and PHP_OS work again - - More php3_ cleanup - - Restored the PHP_VERSION and PHP_OS constants - -1999-12-17 sascha - - * libzend.m4: Define inline to inline explicitly - - * Makefile.am - acinclude.m4 - configure.in - libzend.m4: Move config code into separate file - -1999-12-17 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h: - - By mistake commited this to the branch. It fixes a bug we introduced with - the return reference patch. - -1999-12-15 Andrei Zmievski - - * zend_builtin_functions.c: Doh! I'm an idiot. - - * zend_builtin_functions.c - zend_compile.c: - s/inheritence/inheritance/g - - Added is_subclass_of() function - -1999-12-15 Zeev Suraski - - * zend-parser.y - zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_opcode.c: - Implement return by reference: - - In function declaration instead of the return statement - - In the assignment phase - - Implement ability to turn off support for call-time pass by reference - -1999-12-15 Andrei Zmievski - - * zend_builtin_functions.c: val->len - - * zend_builtin_functions.c: Faster, must go faster. - -1999-12-15 Andi Gutmans - - * zend_execute.c - zend_opcode.c - zend-parser.y - zend_compile.c - zend_compile.h: - - Preliminary return ref patch. It breaks libzend so don't use this branch - right now. - -1999-12-14 Andrei Zmievski - - * zend_builtin_functions.c: - Added class_exists() - - Moved function_exists() here from from the basic_functions.c - - Modified method_exists() to convert method name to lowercase - when checking - -1999-12-13 Andi Gutmans - - * zend_execute.c: - - Fix problem when return_value's is_ref/refcount is overwritten by the - internal function. - -1999-12-11 Andi Gutmans - - * zend_execute.c: - Another small fix. - - * zend_execute.c: - Support returning references - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: - - This is supposed to be commited to the RETURN_REF_PATCH branch which is - the beginning of work on allowing returning of references from functions. - -1999-12-07 Andi Gutmans - - * zend-scanner.l: - - opened_path should not be freed here as the zend_file_dtor() takes care - of it. This doesn't fix the bug report for the crash of highlight_file() - though. - -1999-12-07 Zeev Suraski - - * zend-parser.y: Support ZTS definition in zend_config.h - -1999-12-06 Zeev Suraski - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_highlight.c - zend_indent.c: Move the #include of zend-parser.h out of zend_compile.h - - * zend-parser.y - zend_globals_macros.h: More localization - - * zend-parser.y - zend_compile.h - zend_globals_macros.h: Localize a couple of macros - -1999-12-05 Zeev Suraski - - * zend-scanner.l: *** empty log message *** - -1999-12-05 sascha - - * .cvsignore - zend-parser.y - zend.c - zend_API.c - zend_compile.c - zend_execute_API.c: Fix some warnings - -1999-12-04 Andrei Zmievski - - * zend_API.c: *** empty log message *** - - * zend_API.c - zend_API.h - zend_hash.h: Added zend_set_hash_symbol() function. - -1999-12-04 Thies C. Arntzen - - * zend_API.h: - backed out last change after andi decided on a different approach. - -1999-12-04 Andi Gutmans - - * zend_API.h: - - Call ZEND_SET_SYMBOL_WITH_LENGTH() with refcount 1 from the standard - ZEND_SET_SYMBOL() - -1999-12-04 Zeev Suraski - - * zend-scanner.l - zend_builtin_functions.c - zend_compile.c: - Implement get_used_files() and get_imported_files() - - * zend-parser.y - zend-scanner.l - zend.c - zend.h - zend_compile.c - zend_compile.h: - - Break the zend->PHP dependency introduced by the .php extension for use(), - by providing an API - - Enable Stig's patch for use() extensions (it wasn't refered to by the parser) - - Fix a memory leak in that code - -1999-12-04 Thies C. Arntzen - - * zend_API.h: the new SET_VAR_* macros forgot to set the refcount! - -1999-12-04 Sam Ruby - - * zend-scanner.l: build error - windows - -1999-12-04 stig - - * zend-scanner.l - zend_compile.h: Fix typo, add prototype for use_filename(). - - * zend-scanner.l: "use" should use arg+".php" as parameter to require - -1999-12-04 Zeev Suraski - - * zend-scanner.l: This should fix the fd leak with include()/require() - -1999-12-03 Andrei Zmievski - - * zend_API.h: *** empty log message *** - - * zend_API.h: Added ZEND_SET_GLOBAL_VAR_WITH_LENGTH_EX() macro. - -1999-12-03 Thies C. Arntzen - - * zend-scanner.l: revert my last patch - WARNING: we leak fd's again. - add initialzation of opened_path highlight_file() - -1999-12-03 Andi Gutmans - - * zend_API.h: - Remove _EX and make it the old _LENGTH - -1999-12-02 Andi Gutmans - - * zend_API.h: - Add _EX macro for Andrei - -1999-12-02 Zeev Suraski - - * zend-scanner.h - zend_compile.h: Solve a couple of compile issues - -1999-12-02 Thies C. Arntzen - - * zend-scanner.l: - php_fopen_wrapper_for_zend() does *NOT* insert the opened files into any list - the caller needs to fclose() the file. (not sure if this is desired) - fixed "Uninitialized memory read" when including URLs - -1999-12-01 stig - - * zend-scanner.h - zend.c - zend.h - zend_alloc.h - zend_builtin_functions.h - zend_compile.h - zend_constants.h - zend_execute.c - zend_execute.h - zend_extensions.h - zend_globals_macros.h - zend_hash.h - zend_indent.h: Fix warnings surfacing in maintainer-mode. - -1999-12-01 Zeev Suraski - - * zend_API.h: - Make it possible to explicitly set refcount in ZEND_SET_SYMBOL_WITH_LENGTH(), part 2 - - * libzendts.dsp - zend_API.h: - Allow to set the reference count explicitly for ZEND_SET_SYMBOL_WITH_LENGTH() - -1999-12-01 Andi Gutmans - - * zend_execute.c: - - Forgot to check for BP_VAR_IS in the fix made for Thies' string offset - problem. - -1999-11-30 Andi Gutmans - - * zend_API.c: - Applied Thies' bug fix. Great work! - - * zend-parser.y - zend-scanner.l - zend.c - zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: - - Add use support (behaves like require, but will not use the same file twice) - - Add import support (behaves like include, but requires parentheses; will not - use the same file twice; Currently, it is not yet properly implemented, and - only behaves like include) - - * zend_execute.c: - - Fix problem Thies reported. We by mistake separated variables which were - being fetched for read only. - -1999-11-27 Zeev Suraski - - * zend_alloc.c: Add ability to disable the memory cache - -1999-11-26 Zeev Suraski - - * zend-scanner.l: - Fix fd leak in ZTS mode - - * zend-scanner.l - zend_compile.c: UNIX/non ZTS compile fixes - - * zend-scanner.l - zend_compile.c - zend_compile.h: - Improve the file handle closing code - - * zend_llist.c - zend_llist.h: - Modify zend_llist_del() to receive a comparison function - - * zend_API.c: - This request_shutdown() is no longer needed (never was needed really) - - * zend-scanner.l: This should get the file to close properly - -1999-11-26 sascha - - * Makefile.am: Rebuild libzend.la, if the scanner was rebuilt - -1999-11-26 Zeev Suraski - - * zend_API.c - zend_modules.h: Remove request_started, increase thread safety - -1999-11-25 Zeev Suraski - - * zend_execute.c: That's a more thorough fix... - - * zend_execute.c: - Fix bug #2817 - assignments to string offsets could erronously modify unrelated strings - -1999-11-22 Zeev Suraski - - * zend_alloc.c: Fix compile problem with enable-memory-limit - - * zend-scanner.l: Fix inconsistencies with here-docs implementation - - * zend-scanner.l - zend_globals.h: Fix #2744 - -1999-11-21 Andi Gutmans - - * zend_execute.c: That slipped away - -1999-11-21 Zeev Suraski - - * zend.h - zend_API.c - zend_compile.c - zend_execute.h - zend_execute_API.c: - Optimize class instanciation - - Fix constant instanciation for array elements inside objects - -1999-11-19 Andi Gutmans - - * zend_execute.c: - - Moved var_uninit() for return_value to the beginning of DO_FCALL. - We forgot to do it for overloaded methods - - * zend.h - zend_execute.c: - - Functions whose return values aren't used have them freed in DO_FCALL - and don't need a special ZEND_FREE opcode following them anymore - -1999-11-17 Andi Gutmans - - * zend_compile.c - zend_execute.c: - - If a function's return value is unused then don't create a ZEND_FREE - opcode but free it after the function call in zend_execute. - - * zend_execute.c: - Forgot this - -1999-11-16 Andi Gutmans - - * zend_execute_API.c: - Weird that this compiled for me. - - * zend.h: - CHange used_return_value -> return_value_used - - * zend_compile.c: - - In any case create the free opcode. Need to allow the functions to - create a hint. - - * zend.h - zend_compile.c - zend_execute.c: - - Add support for used_return_value passed to internal functions. - -1999-11-14 Andi Gutmans - - * zend_compile.h: - Fix comment as to Joey's findings - -1999-11-13 Andi Gutmans - - * zend_execute.c: - Fix crash with string offset assignments. - -1999-11-04 Andrei Zmievski - - * zend_hash.c - zend_hash.h: Made zend_hash_rehash() callable from outside. - -1999-11-03 Andi Gutmans - - * zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c: - Add support for BYREF_FORCE_REST - -1999-10-28 Andi Gutmans - - * zend_compile.c - zend_execute.c: - Fix for Thies' leak and Andrei's crash - -1999-10-25 Zeev Suraski - - * zend_compile.h: *** empty log message *** - -1999-10-23 Sam Ruby - - * libzend.dsp - libzendts.dsp: - Allow CYGWIN directory to be specified as via environment variable - -1999-10-22 Andi Gutmans - - * zend_execute.c: - Fix isset() with string offsets. - -1999-10-19 Thies C. Arntzen - - * zend_operators.c: fixed is_identicat_function() - -1999-10-19 Andi Gutmans - - * zend_compile.h: - Move IS_IDENTICAL next to IS_EQUAL - - * zend_operators.c: - Fix is_identical function - - * zend-parser.y - zend-scanner.l - zend_compile.h - zend_execute.c - zend_opcode.c - zend_operators.c - zend_operators.h: - - Preliminary submit of Thie's patch. Will fix the rest on Windows - as this was added on UNIX with patch. Changed IS_SAME -> IS_IDENTICAL - -1999-10-18 Andrei Zmievski - - * zend_API.h: Be safe, use (). - -1999-10-15 Andrei Zmievski - - * zend_operators.c - zend_operators.h: unstatic'fy is_numeric_string() - - * zend_hash.c - zend_hash.h - zend_compile.c: *** empty log message *** - -1999-10-15 Andi Gutmans - - * zend_operators.h: - Add convert_to_number_ex() - -1999-10-14 sascha - - * configure.in: - Add "--disable-inline" for low-memory machines (be it limited - RAM or virtual memory). It's also useful for Digital C where - the C++ compiler thinks "inline" is an invalid specifier. - - * Makefile.am: Use sources from $(srcdir) - -1999-10-13 sascha - - * Makefile.am: Do not use $< for anything but implicit rules. - -1999-10-13 Thies C. Arntzen - - * zend_list.c: - (zend_fetch_resource) added warinig if resource is of wrong type - -1999-10-13 sascha - - * acconfig.h: Disable ZEND_EXTENSIONS_SUPPORT, if RTLD_NOW is not defined. - - Note that this part could be made platform independent by using - libltdl (for Solaris, Linux, *BSD, HP-UX, Win16/32, BeOS). - -1999-10-12 Thies C. Arntzen - - * zend_list.c - zend_list.h: new improved resource-API - -1999-10-12 sascha - - * acconfig.h: - Use DL_LAZY for OpenBSD. This seems to be a compatibility flag which - should be used for the 2nd parameter to dlopen. - - http://www.openbsd.org/cgi-bin/cvsweb/src/share/man/man3/dlfcn.3?rev=1.8 - -1999-10-12 Andi Gutmans - - * zend_execute.c: - - object.ptr was made NULL in DO_FCALL but wasn't restored. Right now I - push it in DO_FCALL and at the end of do_fcall_common it always gets - popped. We might be able to optimize it out. - -1999-10-11 Andrei Zmievski - - * .cvsignore: *** empty log message *** - - * zend_hash.c - zend_hash.h: Modified zend_hash() to accept a pointer to sort function. - -1999-10-11 Andi Gutmans - - * zend_execute.c: - - No idea why this bug didn't exist before. But I'm too tired to think of it. - During a regular do_fcall we need to set object.ptr to NULL and, thus, - push it in the beginning and pop it in the end. - I hope this fix more or less cuts it. I just want to sleep :) - -1999-10-10 Andi Gutmans - - * zend_execute.c: - - Didn't lower refcount when doing an internal function call linked to a regular object. - -1999-10-10 Thies C. Arntzen - - * .cvsignore: added some more autoconf/libtool stuff to be ignored - -1999-10-10 Andi Gutmans - - * zend_execute.c: - - Clean up a bit. Separate before the locking so that we can use SEPARATE_ZVAL - macro. - -1999-10-10 sascha - - * build.mk: Add clean target which removes standard targets - - * build.mk: build.mk can be used to generate build tools. It is usually - faster than buildconf, since it rebuilds only components, if - it is necessary. To use it, run - - $ make -f build.mk - -1999-10-09 Andi Gutmans - - * zend_execute.c: - Shouldn't be needed - - * zend_execute.c: - - God damn this sucked. I hopefully fixed the problems with classes although - we might need to clean stuff up a bit. - -1999-10-09 sascha - - * acconfig.h: - Define RTLD_NOW to DL_NOW, if RTLD_NOW is not defined (for OpenBSD). - -1999-10-07 Thies C. Arntzen - - * zend_variables.c - zend_variables.h: added zval_del_ref() function - -1999-10-07 Andi Gutmans - - * zend_execute.c: - Reverse my patch - -1999-10-06 Andi Gutmans - - * zend_execute.c: - - Fixed memory leak with this pointer. It was somtimes initialized with refcount - of 2 instead of 1. - - Also fixed a place where object.ptr_ptr is set to pointing to a zval* instead - of zval**. I don't think this is ever used so we might be able to remove it - altogether. - -1999-10-06 Thies C. Arntzen - - * zend_execute.c: fix for using resources as array indices - -1999-10-05 sascha - - * configure.in - zend.h - zend_globals.h: More portability stuff - - * configure.in: OSF/1 V4.0 wants -lcxx - - * zend_compile.h: - This causes link problems with anything higher than -O0. - -1999-10-04 sascha - - * Makefile.am: Add necessary rule. - - * Makefile.am - acconfig.h - acinclude.m4 - buildconf - configure.in - zend_config.in: Use libtool to build. - -1999-10-04 Thies C. Arntzen - - * zend_builtin_functions.c: use getParametersEx for all builtin functions - - * zend_API.c - zend_API.h: added add_*_resource() and add_*_bool() functions - -1999-10-03 Andi Gutmans - - * zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h: - Hooray. This might actually work. (I hope) - -1999-10-03 sascha - - * configure.in: Make it executable. - -1999-10-02 Andi Gutmans - - * zend_execute.c: - Another locking fix. - - * zend_execute.c: - Fixed locking problem when fetching string offsets - -1999-10-02 Zeev Suraski - - * zend_execute.c: - Fix the leak reported on the PHP 3 list (isset() on string offsets) - -1999-10-01 Andi Gutmans - - * zend.h - zend_API.h - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_operators.h: - - Move is_ref back to being an unsigned char and not a bit field. - - * zend.h - zend_API.h - zend_builtin_functions.c - zend_compile.h - zend_execute.c - zend_execute_API.c: - Remove locking support completely - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - - For Andrei. Implement references in array() initializations - -1999-09-29 Zeev Suraski - - * zend_config.w32.h: *** empty log message *** - -1999-09-29 Andi Gutmans - - * zend_operators.c: Fix leak in += with arrays - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - - Fix SEND_VAR problem after fetch'ing a variable and not knowing the fetch type - -1999-09-29 Thies C. Arntzen - - * zend_API.c - zend_API.h: added add_property_resource - -1999-09-28 Andi Gutmans - - * zend_compile.h - zend_execute.c - zend_execute_API.c: - - Stop using the locking mechanism and start using refcount. - Now we know when we need to free but we still need to support it - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - - First part of the patch which makes reads use ptr and not ptr_ptr. - -1999-09-28 sascha - - * acconfig.h - configure.in - zend-scanner.l: Provide alternative istdiostream. - - This has been tested with Sun WorkShop 4.2 C++ which does not - contain class istdiostream. - -1999-09-26 sascha - - * Makefile.am - configure.in: Actually allow to set CXXFLAGS - - * configure.in - zend_config.in: - Build communication channel and add checks for C++ library - -1999-09-26 Andi Gutmans - - * zend_execute.c - zend_execute.h - zend_execute_API.c: - Changed Ts{}.var to Ts{}.var.ptr_ptr. - -1999-09-24 sascha - - * zend_operators.h: Add _ex API implementation for booleans. - -1999-09-24 Zeev Suraski - - * zend_list.c - zend_list.h: Exify the standardized resource stuff - -1999-09-23 Andi Gutmans - - * zend_operators.c: - Fix bug #2364. - I haven't checked all of the conversion macros yet but there's a change - there are more such bugs there. - -1999-09-23 sascha - - * configure.in: Fix vpath build w/ thread-safe enabled on Unix. - -1999-09-22 Thies C. Arntzen - - * zend_builtin_functions.c: - preliminary fix for each until andi & zeev clean up! - - * zend_list.c: - if you pass NULL as the resource_type_name to zend_fetch_resource*&friends the functions will not print any warnings if the resource is not found! - -1999-09-21 Andi Gutmans - - * zend_compile.c: - - Fix problem where function parameter fetches were created too late. - -1999-09-21 Zeev Suraski - - * zend_builtin_functions.c: Add get_func_args() - - * zend_builtin_functions.c: *** empty log message *** - -1999-09-20 Andi Gutmans - - * zend_builtin_functions.c: - - Move some more Zend internal functions from PHP - - * zend-parser.y: - Next part of locking fix. - $var = expr; and $var += expr; first create code for expr and later on - for the fetch_w of $var. - - * zend_builtin_functions.c: - Newline for Sun's compiler - - * zend_API.h - zend_builtin_functions.c: - Add some internal functions to Zend - - * zend_compile.c - zend_compile.h - zend_opcode.c: - - First step in fixing locking problem. Array fetches are now always done last. - Later on we will want to delay the write fetches even longer until after their - resulting expression is parsed. The way it is now, will make it very easy - to delay as long as we need. - - * zend_compile.c - zend_compile.h: - - Indirect references had all of the fetches by mistakenly backpatched. - Actually all of the fetches are supposed to be read, except for the last - one. - -1999-09-20 Zeev Suraski - - * libzend.dsp - libzendts.dsp - zend_builtin_functions.c: Added zend_num_args() and zend_get_arg() - - * Makefile.am - zend.c - zend_builtin_functions.c - zend_builtin_functions.h: - Add a file in which we can put Zend builtin functions - -1999-09-18 Andi Gutmans - - * zend_execute.c: - - Try to fix the leak Rasmus reported. It's pretty sucky code so I'm really - not sure this fix is OK.I can't remember all of what we did there. - -1999-09-18 Zeev Suraski - - * zend_list.c: Safer behavior - -1999-09-17 Thies C. Arntzen - - * zend_execute.c: make SUNs c89 happy - - * zend_execute_API.c: no // in the sources please - - * zend_globals_macros.h: added newline at end of file - -1999-09-17 Zeev Suraski - - * zend_execute.c: - Fix bug #2318 - -1999-09-16 Zeev Suraski - - * zend_operators.h: Introduce convert_to_*_ex() - -1999-09-16 sascha - - * configure.in: this helps compiling on non-ANSI C compliant platforms - -1999-09-13 stig - - * acconfig.h - configure.in: Make sure HAVE_LIBDL gets defined. - Disable more C++ tests when not configured for thread safety. - -1999-09-12 Zeev Suraski - - * zend.c: Make this class instanciatable - -1999-09-12 sascha - - * configure.in: check for c++ only, if thread safety is enabled - -1999-09-10 Zeev Suraski - - * zend_compile.c: Shut up a warning - -1999-09-09 Andi Gutmans - - * zend_compile.c - zend_globals.h - zend_stack.c - zend_stack.h: - Add foreach() freeing code. - - Fix switch() freeing code to only free current function's switch expressions. - - I have a feeling break expr; in a switch where expr > 1 leaks because it - won't free all of the expressions. Fix is probably not trivial. - - * zend_operators.c: - - Fix leak when decrementing strings which actually are longs. - -1999-09-08 Andi Gutmans - - * zend_execute.c: - - Fix for floating point array offsets. Same behaviour as in PHP 3.0. We - casted to (long). - - * Makefile.am - libzendts.dsp: - Add -b option to flex++ - -1999-09-07 stig - - * acconfig.h: define tests first, use after. - -1999-09-06 Andi Gutmans - - * zend_config.w32.h: - Fix win32 compile - - * zend_config.w32.h: - Make zend compile again in Win32. - -1999-09-06 stig - - * .cvsignore: ignore zend-scanner.cc - - * ZendCore.dep - libzend.dsp - libzendts.dsp: hand-patched some MSVC files - - * Makefile.am - acconfig.h - acinclude.m4 - config.unix.h - config.w32.h - configure.in - zend-scanner.l - zend.h - zend_API.c - zend_alloc.c - zend_compile.h - zend_config.w32.h - zend_execute.c - zend_hash.c - zend_list.c - zend_ptr_stack.c - zend_sprintf.c: * header file cleanup - * fixed --enable-thread-safety build for UNIX - - I don't have a Win32 environment available, could someone please try - compiling on Win32 to see if I got all the header file stuff right there? - -1999-09-05 Andi Gutmans - - * zend_globals_macros.h: - Oops - - * libzendts.dsp - zend.c - zend.h - zend_alloc.c - zend_alloc.h - zend_globals.h: - Shift around header files. - -1999-09-04 Zeev Suraski - - * zend_list.c: Fix a stupid bug (from stefan@roehri.ch) - -1999-09-03 Zeev Suraski - - * zend_list.h: Damn, forgot to commit that - - * zend_list.c - zend_list.h - zend_modules.h: Add new API for resources - -1999-09-03 sascha - - * zend_modules.h: Add global startup/shutdown functions - -1999-09-03 Zeev Suraski - - * zend_operators.c: - Revert the IS_RESOURCE patch. It had some unintended behavior. - - * zend_variables.c: Let $GLOBALS actually work... - - * zend_operators.c: - Release resources when converting to other types (fix Thies's reported problem) - -1999-09-02 Zeev Suraski - - * zend_compile.c: - Use \0NameFilenameLineno as key instead of numeric index for runtime defined functions - -1999-08-28 Zeev Suraski - - * zend_extensions.c - zend.h - zend_alloc.c - zend_extensions.h - zend_variables.c - zend_variables.h: *** empty log message *** - - * zend.h - zend_alloc.c - zend_alloc.h - zend_variables.c: Beef up debug macros - -1999-08-27 Zeev Suraski - - * zend_execute_API.c: Fix a crash bug in case of aborted execution - - * zend.h - zend_alloc.c - zend_alloc.h - zend_execute_API.c - zend_variables.c - zend_variables.h: Better debug macros - -1999-08-26 Andi Gutmans - - * zend_execute_API.c: - Damn. It wasn't a correct fix. This should do it. - When the zval ** are equal we don't want to assign_ref, in any other case - I can think of we do want to assign_ref. - - * zend_execute_API.c: - Fix leak when global is used in the global scope. - - * zend_compile.c: - Fix when redefining classes at run-time. - -1999-08-25 sascha - - * zend.h: make it compile with gcc again - -1999-08-25 Andi Gutmans - - * zend_hash.c - zend_hash.h: - Add hash_apply_with_arguments() - - * zend-scanner.l: - More elegant fix for Win32 include_path - - * zend-scanner.l: - - Temporary fix to allow Win32 MT safe version to use zend_fopen(). - -1999-08-23 Andi Gutmans - - * zend_execute.c: - Fixed a specific memory leak linked to locking. - -1999-08-22 sascha - - * zend.h - zend_globals.h: This changes makes it work on egcs 1.1.2/Alpha - - * configure.in - zend.h: remove checks - -1999-08-20 Zeev Suraski - - * zend_constants.c - zend_constants.h - zend.c: Fix for Thies's UMR - -1999-08-19 Andi Gutmans - - * zend-parser.y - zend_opcode.c: - - Make sure expr_list and echo_list are either empty or comma seperated - expressions - -1999-08-18 Thies C. Arntzen - - * zend-scanner.l: on unix ZTS gets defined in zend_config.h - -1999-08-17 Zeev Suraski - - * zend_execute_API.c: Fix #2012 - - * zend_execute.c: Fix #2070 - -1999-08-17 Andi Gutmans - - * zend.c - zend.h: - Add some ZENDAPI's - -1999-08-15 Andi Gutmans - - * zend_execute.c: - Oopsie - - * zend.h - zend_compile.h - zend_execute.c - zend_globals.h: - Optimize the execute stack a bit. - -1999-08-14 Zeev Suraski - - * zend_compile.c: Fix several class issues - - * zend_compile.c - zend_compile.h: - Generate better warnings for class/function redefinitions - -1999-08-10 Andi Gutmans - - * zend_compile.c - zend_constants.c: - Got rid of the C++ comments. - -1999-08-09 Andi Gutmans - - * zend_execute.c: - Thies's crash fix. - -1999-08-07 Zeev Suraski - - * zend_compile.h - zend_execute.c - zend_execute_API.c: Fix a few leaks - -1999-08-06 Zeev Suraski - - * zend_execute_API.c: Fix a bug in call_user_func_ex() - - * zend_API.h: Now that's an annoying bug. - - * zend_API.h - zend_execute_API.c: Introduce call_user_func_ex() - - * zend_execute.c: *** empty log message *** - -1999-08-03 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c: - - Initialize extended value's and put the fetch_type in it's own variable - name. - -1999-08-02 Andi Gutmans - - * zend_compile.c - zend_compile.h: - Make set_compiled_filename() return a pointer to the allocated file name - -1999-07-31 Zeev Suraski - - * zend_API.h: These aren't necessary - -1999-07-30 Zeev Suraski - - * zend_API.h: Support symbols in any symbol table, not just the active one - -1999-07-30 Andi Gutmans - - * zend_ptr_stack.c: - Damn that's more like it. - - * zend_ptr_stack.c: - Cut&paste crap - - * zend_execute.c - zend_ptr_stack.c - zend_ptr_stack.h: - - Add ptr_stack_n_{push,pop} in order to speed up function calls a bit. - There seems to be no reason for stack->top in the ptr_stack except for - when realloc()'in the stack. I think I'll remove it. - -1999-07-30 Zeev Suraski - - * zend_API.h: - * Setting variables in the global scope wasn't handling is_ref's properly - -1999-07-29 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h: - - Fixed a leak when doing inheritance. The parent class name wasn't being freed. - - Fixed a stack leak. Functions that had late argument binding were set up as - INIT_FCALL_BY_NAME but were using DO_FCALL and not the corresponding - DO_FCALL_BY_NAME. - -1999-07-28 Andi Gutmans - - * zend_compile.c - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_hash.c: - Fixed various inheritance problems & Andrey's leak - -1999-07-27 Zeev Suraski - - * zend_compile.c: Inherit parent's constructor - - * zend_compile.c: - Fix runtime inheritence (child functions/members should have higher precedence) - -1999-07-27 Andi Gutmans - - * zend_execute.c: - Add missing lock - - * zend_execute.c: - Fix up the new operator a bit more. - -1999-07-27 Zeev Suraski - - * zend_execute.c: Set reference count and is_ref values for new objects - -1999-07-26 Zeev Suraski - - * zend_operators.c: - - Fixed a memory leak when using assignment-op operators with lvalue of type - string (or array/object) - - * zend_compile.c: *** empty log message *** - - * zend_compile.c - zend_compile.h - zend_execute.c: - Fix a bug in inheritence from classes defined in include files, that are - inherited from require()'d files - -1999-07-26 Andi Gutmans - - * zend_execute.c: - Oops I erased this by mistake - - * zend_execute.c: - - Should be a complete fix now. This break away code should maybe be made - somewhat generic - - * zend_execute.c: - Temporary fix for "this". Have to fix it tomorrow. - - * zend_execute.c: - - Fix compile error. Weird that Visual didn't catch this one. - - * zend-parser.y - zend.h - zend_compile.c - zend_compile.h - zend_execute.c: - Fix the new operator incompatibility. - - I commented PHP_FUNCTION(strtotime) in datetime.c because it stopped - win32 from compiling. This needs to be fixed!!! - - Check out libzend to compile the tree now. - - * zend.h - zend_execute.c: - new operator fixes - -1999-07-25 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - Commiting to branch newoperator. - - To check it out do cvs checkout -rnewoperator libzend - -1999-07-24 Zeev Suraski - - * zend_compile.c: Fix that memory leak... nested function issue remains - - * zend_compile.c - zend_stack.c - zend_stack.h: Fix RETURN & SWITCH memory leak issue - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c: - Thoroughly fix the SWITCH problem. No RETURN handling yet. - -1999-07-23 Zeev Suraski - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h: Fix bug #1812 - - * zend.h - zend_operators.c: - * Add an API macro users can use to ensure an array member can be modifed - before they modify it. - * Fix a bug and remove redundant code in convert_to_long() (booleans and - resources weren't changing their types - -1999-07-22 Zeev Suraski - - * zend_constants.c: New constants - -1999-07-22 stig - - * buildconf: identify ourselves - -1999-07-20 Andi Gutmans - - * zend_execute.c: - Include alloca.h when need and available. - - * zend_compile.c - zend_execute_API.c - zend_list.c - zend_operators.c: - Get rid of C++ comments - -1999-07-19 Zeev Suraski - - * config.unix.h - config.w32.h - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_globals.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: 0.91 update - -1999-07-19 Andi Gutmans - - * zend.h - zend_execute.c - zend_extensions.h: * Fix Zend version - * Fix a method call bug - - * LICENSE - libzendts.dsp: License update - - * zend_errors.h: Make error codes PHP 3.0 compatible - -1999-07-18 Andi Gutmans - - * zend_execute_API.c: - - Should fix the memory leak when returning from the main scope. - -1999-07-17 Zeev Suraski - - * configure.in: Debug on by default - -1999-07-16 Zeev Suraski - - * zend_compile.c: - Ignore T_PHP_TRACK_VARS in the parser (handled in the scanner) - - * config.unix.h - config.w32.h - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_errors.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_globals.h - zend_hash.c - zend_hash.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_list.c - zend_list.h - zend_llist.c - zend_llist.h - zend_modules.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_sprintf.c - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: License update - -1999-07-15 Andi Gutmans - - * zend.c: Change true/false back to 1/"" - - * zend_execute.c: Fix a lock issue - -1999-07-15 sascha - - * zend_execute_API.c: disable zend_handle_sigsegv - -1999-07-14 Andi Gutmans - - * libzendts.dsp - zend.c: Fix thread unsafe constants startup - - * LICENSE - zend.c - zend_constants.c - zend_constants.h: - License update - - Fix multithreaded constants startup - - * zend_operators.c: - Fix for boolean convert to number - -1999-07-12 Andi Gutmans - - * zend_execute.c: - Fixed a purify warning - -1999-07-10 Zeev Suraski - - * zend_alloc.c: Oh, that dumb bug. - -1999-07-10 Andi Gutmans - - * zend_execute.c - zend_hash.c: Ok, so we do have to lock in there - - * zend.c - zend_execute.c: Fix assignments of reference variables - -1999-07-10 Zeev Suraski - - * zend_execute_API.c: Woops, fix. - - * zend_execute.c - zend_execute_API.c - zend_globals.h: Put the garbage in the garbage bin - - * zend_alloc.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_variables.c: Get rid of AiCount completely - - * zend_execute.c: Final tweaks - - * zend_execute.c - zend_hash.c: More locking work - -1999-07-09 Zeev Suraski - - * zend_execute.c: *** empty log message *** - - * zend_execute.c: More stuff - - * zend-parser.y - zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_operators.c - zend_variables.c: Step 4: - Move to a 7-bit counter (not fully implemented yet) - - * zend_API.c - zend_compile.h - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_variables.c: Phase 3: - Use a single bit to mark IS_REF variables - - * zend-parser.y - zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_execute.c - zend_execute_API.c - zend_opcode.c - zend_operators.c: Step 2: - Rename is_ref to EA - - * zend.c - zend_API.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_constants.h - zend_execute_API.c - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h - zend_modules.h - zend_opcode.c - zend_variables.c - zend_variables.h: Step 1 in nuking the garbage collector: - - Change the hash destructor to return int - - Don't kill the bucket on hash_destroy if the destructor returns 0 - - * config.w32.h - configure.in - zend_alloc.c: *** empty log message *** - - * zend_alloc.c: Send a SIGSEGV instead of exiting, to trigger a core dump - - * zend_alloc.c - zend_alloc.h - zend_hash.c: * Support recoverable failure from erealloc() - * Fix the shutdown code on an unrecoverable erealloc() failure - - * zend_execute_API.c: Fix the mess in SIGSEGV handling, hopefully - -1999-07-08 Zeev Suraski - - * zend_compile.h - zend_compile.c: - Support definition of classes that are derived from classes that are defined in runtime - -1999-07-06 sascha - - * zend.h: enable it, until we find a better way - -1999-07-05 sascha - - * zend.h: make Solaris gcc happy - - * configure.in - zend.h: use void * instead of long for 64-bit test - -1999-07-05 Thies C. Arntzen - - * zend_API.h: added RETVAL_RESOURCE and RETURN_RESOURCE - -1999-07-04 Zeev Suraski - - * zend_operators.c: - Make convert_to_string() regard false as "" instead of "0" - -1999-07-03 sascha - - * Makefile.am: don't wipe files for distributions - - * configure.in - zend.h: - checking for ints won't work, since they are 32 bit on both platforms - -1999-07-03 Zeev Suraski - - * zend_execute.c: Support isset()/empty() for string offsets - - * zend-scanner.l: Fix a crash - -1999-07-03 sascha - - * configure.in: add usual rhapsody hack - - * config.unix.h: missing DL_HANDLE broke build - - * zend_extensions.c: typo - -1999-07-02 sascha - - * acconfig.h - configure.in - zend.h: workaround for 64-bit platforms - -1999-07-02 Zeev Suraski - - * acconfig.h - configure.in - zend_globals.h: define zend_bool - -1999-06-30 Zeev Suraski - - * zend-parser.y: Make require accept any parameter - -1999-06-26 Zeev Suraski - - * zend_alloc.h - zend_operators.c - zend_alloc.c: - * Make the memory leak reporting code much better with repeats - * Remove useless variables - -1999-06-22 Zeev Suraski - - * zend_compile.c: Fix Thies's bug report - - * zend_alloc.c - zend_compile.c - zend_operators.c: - * Fix concatenation of arrays (it was PHP 3.0 style, copying zval's instead - of zval *, and it wasn't using reference counting) - * Fix a memory leak in static array()'s with textual indices - -1999-06-19 Zeev Suraski - - * zend.c: *** empty log message *** - - * zend.h - zend_extensions.h: - Add a standard get_ini_entry() to interface between Zend and the outside world - - * configure.in: *** empty log message *** - -1999-06-16 stig - - * zend_modules.h: - added INIT_FUNC_ARGS_PASSTHRU and SHUTDOWN_FUNC_ARGS_PASSTHRU - -1999-06-15 stig - - * zend_operators.c - zend_operators.h: * added zend_binary_strcasecmp() - -1999-06-12 Zeev Suraski - - * zend-parser.y: - We can't quite go with expr there (shift/reduce conflict), go with scalar. - - * zend-parser.y: require() improvement as per Andi's suggestion - -1999-06-11 Zeev Suraski - - * zend_operators.c: - Make the concatenation operator use make_printable as well - - * zend-scanner.l: Don't take failing on an include file so badly - - * zend-scanner.l: Support E_COMPILE_ERROR in the compiler - - * zend_compile.c: Two fixes: - * The error generated by a failed class inheritence wasn't properly - displaying the file in which he error occured. - * Inheritence didn't work if the parent class had uppercase letters in it. - - * zend-parser.y - zend-scanner.l - zend_execute.c: * Use to_string() instead of __print() - * Support boolean casts ((bool) and (boolean)) - - * zend.c: Change __print into to_string() - - * zend.c - zend.h - zend_execute.c - zend_execute_API.c: - * Make the output handling of variables much, much cooler. - Uses zend_make_printable_zval() instead of convert_to_string() now: - - $foo = true; - print "\$foo is $foo"; - will now print - $foo is true - (instead of "$foo is 1", earlier). - - Also, with objects, it automatically tries to call __print() and use it as a printing - function. - - For example: - - class foo { - function __print() { return "Foo Object"; } - }; - - $foo = new foo; - print $foo; - - will print "Foo Object". - -1999-06-10 Zeev Suraski - - * zend_operators.c: Now THAT's an annoying bug. - -1999-06-09 Zeev Suraski - - * zend_extensions.c: Fix - - * zend_API.c - zend_execute.c: - * Fix cases where you assign an array element to the parent array (the array was - being erased before the assignment, so the element was being smashed). - - * zend_execute.c - zend_execute_API.c: * Fix foreach() that receives a non array argument - * Clean up some C++ comments - -1999-06-09 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_operators.c: - Fix the static array() initializing - -1999-06-08 Zeev Suraski - - * zend_extensions.c: Replace error messages - -1999-06-08 Andi Gutmans - - * zend_compile.c - zend_compile.h - zend_execute.c: * Fix a by-name call/method call bug - * Clean and optimize the whole function call process - -1999-06-07 Zeev Suraski - - * zend_hash.c - zend_hash.h: Add zend_hash_get_current_key_type() - -1999-06-06 Andi Gutmans - - * zend_compile.c: - Work around a compiler bug - mark variables that are sent to functions that aren't yet - defined as FETCH_W (because they might end up being sent by reference) - -1999-06-05 Zeev Suraski - - * zend.c - zend.h - zend_compile.c - zend_compile.h: * Centralized shutdown - * Change shutdown order again - - * zend_compile.c: - Call the request_shutdown on modules before destroying symbol tables, so that - the session module can be implemented - - * zend-scanner.l - zend_compile.c - zend_execute.c: - - Fixed Karl's bug report. It's not really a thorough fix, we really need to rethink the INIT_FCALL/DO_FCALL issue. - - Fixed numerous AiCount problems - -1999-06-04 Zeev Suraski - - * zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c: New $GLOBALS init - - * zend_execute_API.c: - Fix that GLOBALS leak. We were explicitly adding GLOBALS to the main symbol table, - but there's no reason to do it (INIT_GLOBALS takes care of it if necessary.) - - * zend.c - zend.h - zend_API.c - zend_API.h - zend_list.c - zend_list.h - zend_opcode.c - zend_operators.c: Minor updates (mostly __declspec() stuff) - -1999-06-04 Thies C. Arntzen - - * zend_API.h: added is_ref=0 and refcount=1 to SET_VAR_* macros - -1999-06-03 Zeev Suraski - - * zend-parser.y: T_BAD_CHARACTER is actually a string. - -1999-06-03 Andi Gutmans - - * zend-scanner.l - zend_execute.c: - - We weren't counting newlines in heredocs. The only place which is still questionable - is when there's a \ followed by a newline but it seems we have a parse error in this - case anyways. - - Fixed the alloca() macros so that the alloca() #define in win32 mode won't clash - with the real win32 alloca(). - -1999-06-01 Andi Gutmans - - * zend_execute.c: - - Make execute() use less stack in thread-safe win32 due to Microsoft's shitty 256kb stack. - -1999-05-31 Zeev Suraski - - * zend.h - zend_alloc.c: *** empty log message *** - -1999-05-31 Andi Gutmans - - * zend-scanner.l - zend_compile.c - zend_execute.c - zend_execute_API.c: Fixes - -1999-05-30 sascha - - * zend_alloc.c - zend_compile.h - zend_execute_API.c - zend_indent.c - zend_opcode.c: * fix some casts - * introduce unary_op_type - cleaner than casting data voids to function ptrs - -1999-05-29 Zeev Suraski - - * zend_execute_API.c: - That got fucked up when we went back to using uninitialized_zval - -1999-05-29 sascha - - * Makefile.am: another VPATH related change - -1999-05-29 Zeev Suraski - - * zend-parser.y: Fix a bug - - * zend_hash.c - zend_hash.h - zend_operators.c: Support overwrite mode in zend_hash_merge() - -1999-05-29 sascha - - * Makefile.am: - clean is not called from automake. use CLEANFILES instead - - allow VPATH compilation - -1999-05-29 Zeev Suraski - - * zend_execute.c: Correct fix - - * zend_execute_API.c: *** empty log message *** - - * zend_execute.c: Fix a leak - -1999-05-28 Zeev Suraski - - * zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute_API.c: * Support getThis() for internal functions. - * Fix 'new object or die' and AiCount issue thoroughly (earlier fix didn't - work with the optimizer). - * Add new macros for standardized definition of classes. - * Only report AiCount problems if shutdown was not silent. - -1999-05-27 Zeev Suraski - - * zend_execute.c: Fix the AiCount issue with objects - - * zend_API.h: Moved all #define's for SET_ and RETURN_ to zend_API.h - -1999-05-25 Zeev Suraski - - * zend_execute_API.c: - Avoid crashing if an error occurs before we open the first file. - -1999-05-24 Zeev Suraski - - * zend_operators.c: The last fix was wrong - - * zend_operators.c: Another operators fix - -1999-05-23 Zeev Suraski - - * zend_operators.c: - boolean comparison didn't work with smaller-than and greater-than, something that - fucked up berber's site a bit. fixed. - -1999-05-22 Zeev Suraski - - * zend_execute.c: - Sigh, another leak bites the dust. FREE_OP missing in case of a SEND_VAR. - - * zend-parser.y: I'm on a roll. Fix a nasty yet stupid AiCount bug - - * zend_alloc.c: Warn about AiCount not zeroing out - - * zend-parser.y - zend-scanner.h - zend.h - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_compile.h - zend_constants.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_extensions.h - zend_highlight.h - zend_list.h - zend_llist.h - zend_ptr_stack.h - zend_stack.h: - * Add struct name to all typedef's so that they can be debugged with MSVC - * Fix an AiCount bug - list(...) = $var was using $var multiple times, and thus - causing AiCount to be decreased multiple times even though it was increased only - once for $var. Mark all FETCH_DIM's so that they won't decrease AiCount, and only - decrease AiCount on the last FETCH_DIM. - * Fix a stupid bug - forgot to pass CLS_C to some compiler function. For some reason - MSVC doesn't report these :I - - * zend.h - zend_alloc.c - zend_execute_API.c: - Give more information and save log lines in memory leak reports - - * zend-scanner.l - zend_compile.c - zend_compile.h - zend_globals.h - zend_llist.c - zend_llist.h: Avoid leaking fd's in case of failures - - * zend-scanner.l: more fixes - -1999-05-21 Zeev Suraski - - * zend-scanner.l: That wasn't supposed to slip in - - * zend-scanner.l: * Properly handle failed file opens in C++ - * Properly handle failed require()'s within libzend - - * zend-scanner.l: * Fix the comments issue. yymore() worked like a charm. - * Change all flex states to be prefixed with ST_ - -1999-05-20 Zeev Suraski - - * zend_compile.h - zend_execute.c: Optimize allocations into uninitialized_zval assignments - -1999-05-20 Andi Gutmans - - * config.w32.h - libzend.dsp - libzendts.dsp - zend_compile.c - zend_compile.h: - Updates we did today - - * zend_compile.c: - Fix a small problem with class decelerations. - - * zend-scanner.l: -Open curly braces fix? - -1999-05-15 Zeev Suraski - - * zend.c - zend.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_hash.c - zend-parser.y: - * Fix all hash checks that checked Bucket.arKey for NULL, when it was changed - to char[1], these checks should have been changed to Bucket.nKeyLength==0 - * Support runtime declaration of functions. I ended up changing the grammar - to catch top level functions vs. nested functions. The reason is simple - - if we don't have functions properly declared at compile-time, function calls - cannot be resolved at compile time, and have to be resolved at runtime, which - ends up being much much slower (without the optimizer, that is). - It's no biggy though, the grammar change isn't that bad. - -1999-05-14 Zeev Suraski - - * configure.in - zend-scanner.l: - If a require() dies, we must bail out (since it corrupts an existing op_array - - * zend-scanner.l: Fix a bug - -1999-05-14 stig - - * Makefile.am: don't install Zend on the system - -1999-05-14 Zeev Suraski - - * zend-scanner.l: - Add \012 and \xff missing support to constant quoted string - -1999-05-12 Zeev Suraski - - * zend.h: *** empty log message *** - -1999-05-12 stig - - * Makefile.am: install libzend.a and header files on "make install" - - * acconfig.h - configure.in: add --enable-thread-safety option - -1999-05-12 Zeev Suraski - - * zend_llist.c - zend_llist.h: Added prepend to llist - -1999-05-11 Zeev Suraski - - * zend-scanner.l - zend.c: Fixes: - * Avoid closing stdin (I could have sworn I've committed that already) - * unclean_shutdown patches - - * zend_alloc.c: Easier Win32 debug code - - * zend-scanner.l - zend_compile.c - zend_globals.h - zend_highlight.c: - * Fix a bug that occured in case of parse errors. We need to restore the lexical state - even if the compilation failed. - -1999-05-10 Zeev Suraski - - * zend-scanner.h - zend-scanner.l - zend.c - zend_alloc.c - zend_compile.h: - Weed out all BoundsChecker-found bugs (including a serious file descriptor leak - in the C++ scanner) - -1999-05-09 Zeev Suraski - - * zend_modules.h: Change argument name - - * zend.c - zend_API.c - zend_API.h - zend_modules.h: Almost forgot to commit those - -1999-05-06 Zeev Suraski - - * zend-scanner.l: Ok, I tested it now. It works very nicely! - -1999-05-05 Andi Gutmans - - * zend_llist.c - zend_llist.h: llist improvements - -1999-05-02 Andi Gutmans - - * zend.c - zend_compile.h: - Don't support interactive mode when thread safe. - -1999-05-01 Zeev Suraski - - * zend_operators.c: Several operator fixes. Should fix the MySQL problem. - -1999-04-30 Andi Gutmans - - * zend_opcode.c: - Free refcount when destroying the last class reference. - - * zend-parser.y: - Missed one place - - * zend-parser.y: - First try at fixing $a->foo[] syntax. - - * zend-scanner.l: - - Move back to yyless(). I haven't tested it yet because it's taking too long - to compile and I have to disconnect - -1999-04-30 Zeev Suraski - - * zend-parser.y - zend-scanner.l: - Fix Boris's problem (in my never ending struggle to show I never mean what I say - when I say something's not gonna happen :) - - * zend-scanner.l - zend_compile.c: - * Fix a problem with constant quoted strings, that was causing Thies's problem - * Remove a development-time printf - -1999-04-29 Andi Gutmans - - * zend-scanner.l: - No reason to handle newlines here. - -1999-04-28 Zeev Suraski - - * zend-scanner.l: Make the C++ scanner support interactive input - -1999-04-27 Zeev Suraski - - * zend-scanner.l - zend_compile.h - zend_execute_API.c - zend_extensions.c - zend_extensions.h - zend_opcode.c: * Fix debugger+interactive mode bug - * Recognize whether an extension is with debug information or not - -1999-04-26 Zeev Suraski - - * libzendts.dsp: fix - - * config.w32.h - libzend.dsp - libzendts.dsp - zend-scanner.l - zend.c - zend_alloc.c - zend_compile.h - zend_globals.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_opcode.c - zend_sprintf.c: Various thread safety fixes and DLL updates - -1999-04-26 Andi Gutmans - - * zend-scanner.l - zend.c - zend_alloc.c - zend_globals.h: -More commits - -1999-04-24 Zeev Suraski - - * zend_compile.c: Another small fix - - * libzendts.dsp: dsp update - - * zend.c - zend_globals.h: Thread safety fixes - - * zend_list.c: Remove redundant includes - -1999-04-24 zeevread - - * zend-scanner.l: g++ compile fix - -1999-04-24 Zeev Suraski - - * Makefile.am - zend-scanner.l: *** empty log message *** - - * zend_API.c - zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c - zend-parser.y - zend-scanner.l: Cleanups, remove old ts code - -1999-04-23 Zeev Suraski - - * zend_operators.c: Arithmetics bug fix - - * zend-scanner.h - zend-scanner.l: Support eval() and highlight_string() in the C++ scanner - -1999-04-23 Andi Gutmans - - * zend-scanner.l: - - Use yyless() instead of unput() where possible. I'll erase the commented - out code in a day or so. - -1999-04-23 Zeev Suraski - - * FlexLexer.h - flex.skl - zend-scanner.h - zend-scanner.l - zend.h - zend_alloc.c - zend_alloc.h - zend_compile.h - zend_globals.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_operators.h - zend_variables.h: Ok, call me crazy, because I probably am. - Thread safe version now uses a C++ scanner object. Works fully. - -1999-04-22 Zeev Suraski - - * acconfig.h - zend-parser.y - zend-scanner.l - zend_compile.c - zend_compile.h - zend_execute.c - zend_globals.h - zend_highlight.c - zend_indent.c - zend_opcode.c: Make token names uniform, they all begin with T_ now. - -1999-04-21 stig - - * buildconf: state which aclocal.m4 and configure files are created - - * Makefile.am: - zend-parser.o and zend-scanner.o were included twice in libzend.a - -1999-04-21 Zeev Suraski - - * FlexLexer.h - flex.skl - libzendts.dsp - zend_API.c - zend_API.h - zend_globals.h: - * Change the thread safe project to create a C++ scanner. - * Add in a slightly modified skeleton file (only a couple of #if's for #include's - that we dont have in Windows) - - It does NOT compile or work yet :) - - * zend_list.h: Fix - - * zend.c - zend_compile.c - zend_constants.c - zend_constants.h - zend_list.c - zend_list.h: - Thread safety patch. It works now with 'just in time' resource initialization! - - * libzend.dsp - libzendts.dsp - zend_globals.h: Thread-safe project - -1999-04-21 stig - - * buildconf: move automake back to before autoconf - - * buildconf: - autoheader must be called after autoconf, automake after autoheader - - * zend_config.h.in: think before one commits - - * zend_config.h.in: doh. cvs appears to ignore .in files by default - -1999-04-21 Zeev Suraski - - * zend-parser.y - zend-scanner.l - zend.c - zend_API.c - zend_API.h - zend_alloc.c - zend_compile.c - zend_compile.h - zend_constants.c - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_opcode.c: - Thread safety patch. We're still not quite there but it compiles again, and - more logic has been implemented. - -1999-04-20 stig - - * .cvsignore - Makefile.am - Makefile.in - aclocal.m4 - buildconf: Makefile.in and aclocal.m4 are generated - added buildconf script - -1999-04-19 Zeev Suraski - - * zend_extensions.c - zend_extensions.h: - Return a success value from the startup function, so we can unload immediately - if it fails. - -1999-04-19 stig - - * .cvsignore - Makefile.am - Makefile.in - acconfig.h - acinclude.m4 - aclocal.m4 - config.h.in - configure.in - zend.h: convert to automake - -1999-04-19 Andi Gutmans - - * zend_API.c - zend_API.h: Add a couple of ZEND_API's - - * config.w32.h - zend-parser.y - zend_compile.c - zend_execute.c: Support =unset as arguments - -1999-04-19 stig - - * acconfig.h - config.h.in - configure.in: removed -lnsl and -lsocket checks from zend - -1999-04-18 Zeev Suraski - - * zend_execute.c: AiCount needs to be decreased here - - * configure.in - zend-scanner.l - zend.c - zend.h - zend_API.c - zend_API.h - zend_alloc.c - zend_compile.c - zend_extensions.c - zend_extensions.h - zend_globals.h - zend_llist.c - zend_modules.h - zend_opcode.c: Whatnot: - * updated alloc_persist to use critical sections - * changed extension shutdown to two-phase - * updated dependencies - * PR support (don't remember if there was any really) - -1999-04-15 Andi Gutmans - - * zend_execute.c: - - one more place which seems to have needed fixing. I don't have time to look - more into it. I hope we don't have anymore places which need fixing. - - * zend_compile.c: - - Should fix the pass by reference problem. This happened because we moved - start from arg 1 now and not arg 0. There might be more places which need fixing - like in the executor but the bug seems OK now. - -1999-04-14 Zeev Suraski - - * zend_compile.h: Compile fix - -1999-04-14 Andi Gutmans - - * config.w32.h - libzend.dsp - zend-scanner.l - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_opcode.c: -Tiny patches - -1999-04-13 Zeev Suraski - - * zend_execute.c: Better detection - - * zend_execute.c: - Move Ai stuff before get_zval_*(), like Andi suggested. Fixes Sascha's huge - memory leak - -1999-04-13 Andi Gutmans - - * zend-parser.y - zend_compile.c - zend_execute.c - zend_execute_API.c: - Fix various memory leaks. - - * zend_execute.c: Refcount bugfix - - * libzend.dsp - zend_API.c - zend_execute_API.c - zend_ptr_stack.c: * Optimize argument_stack top lookup - * Fix a nasty bug in zend_ptr_stack_clean() - -1999-04-12 Zeev Suraski - - * zend_execute_API.c - zend_globals.h: Remove unnecessary stack - - * zend_API.c: off by one - - * zend_execute.c: Minor optimization - - * zend_API.c: Make functions that don't take arguments somewhat happier:) - - * zend_execute.c: - This should take care of "this" for user-defined functions. It wasn't yet working - for built-in functions anyway, this one is coming soon. - - * zend_compile.c - zend_execute_API.c: - Destroy the resource list after destroying the symbol table, otherwise the - auto-destructor for resources are run when the resource list is no longer valid - - * zend-parser.y - zend.h - zend_API.c - zend_API.h - zend_compile.c - zend_compile.h - zend_execute.c - zend_execute.h - zend_execute_API.c - zend_globals.h - zend_ptr_stack.c: - This patch is a go. Not fully optimized yet, but working properly. - Prepatch tagged as BEFORE_STACK_PATCH. - - * zend_compile.c - zend_execute.c: Minor fixes: - missing zval_copy_ctor() - messed up AiCount fix - -1999-04-10 Zeev Suraski - - * zend_alloc.c - zend_alloc.h: Allow runtime setting of the memory limit - - * zend_alloc.c - zend_alloc.h - zend_globals.h: Get rid of php3_ini in Zend - - * zend.c - zend.h: - We need to initialize the utility values after we initialize the INI file, which in - turn, is after we initialize Zend. Set the utility values separately from Zend's - initialization - -1999-04-09 Andi Gutmans - - * zend-scanner.l: - Changed here-docs to <<< followed by whitespace. - -1999-04-09 stig - - * .cvsignore: ignore file - -1999-04-09 Andi Gutmans - - * zend-parser.y - zend_compile.h: - - I guess print $GLOBALS and print "$GLOBALS" should yield the same result - so I returned the one in encaps_var. - - Made INITAL_OP_ARRAY_SIZE smaller (64? can't remeber). I don't think the - erealloc()'s during compile time are such a biggy, we might make it even - smaller. We can have a configure time option as to it's size. - - * zend-parser.y: - - Support $GLOBALS in cvar's. Now list(..) = each($GLOBALS) will work. - - Remove support of $GLOBALS in enacapsed strings. print "$GLOBALS" isn't - supposed to work in any case. - -1999-04-09 Zeev Suraski - - * zend-scanner.l: - Honor a semicolon on the same line as an ending token of a heredoc - - * zend_compile.c: Prevent class redeclarations - -1999-04-08 Zeev Suraski - - * zend_API.c - zend_modules.h: * Add arguments to shutdown functions - * Remove traces of php_ini stuff - - * zend-parser.y: "Our favourite mistake" - - * zend-parser.y - zend_compile.c - zend_compile.h - zend_execute.c - zend_opcode.c: $GLOBALS support - -1999-04-08 Andi Gutmans - - * ZEND_CHANGES: foreach() syntax has changed - -1999-04-08 Zeev Suraski - - * zend_compile.c - zend_execute.c: Fix static assignment - -1999-04-07 Zeev Suraski - - * zend_execute_API.c: Remove an unused variable - - * libzend.dsp: That's better. - - * libzend.dsp: We didn't save the .dsp back then... - - * ZendCore.dsp - ZendCore.dsw - ZendCore.mak - diffs - libzend.dsp: Cleanups: ZendCore->libzend - -1999-04-07 Rasmus Lerdorf - - * zend.c: *** empty log message *** - -1999-04-07 Andi Gutmans - - * LICENSE - Makefile.in - ZEND_CHANGES - configure.in - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.h - zend_API.c - zend_API.h - zend_compile.h - zend_errors.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h - zend_llist.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: New file. - - * LICENSE - Makefile.in - ZEND_CHANGES - configure.in - zend-parser.y - zend-scanner.h - zend-scanner.l - zend.h - zend_API.c - zend_API.h - zend_compile.h - zend_errors.h - zend_execute.c - zend_execute_API.c - zend_globals.h - zend_hash.c - zend_hash.h - zend_list.c - zend_list.h - zend_llist.h - zend_opcode.c - zend_operators.c - zend_operators.h - zend_ptr_stack.c - zend_ptr_stack.h - zend_stack.c - zend_stack.h - zend_variables.c - zend_variables.h: Zend Library - - * ZendCore.dep - ZendCore.dsp - ZendCore.dsw - ZendCore.mak - acconfig.h - aclocal.m4 - config.h.in - config.unix.h - config.w32.h - diffs - zend.c - zend.ico - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_constants.c - zend_constants.h - zend_execute.h - zend_extensions.c - zend_extensions.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_llist.c - zend_modules.h - zend_sprintf.c: New file. - - * ZendCore.dep - ZendCore.dsp - ZendCore.dsw - ZendCore.mak - acconfig.h - aclocal.m4 - config.h.in - config.unix.h - config.w32.h - diffs - zend.c - zend.ico - zend_alloc.c - zend_alloc.h - zend_compile.c - zend_constants.c - zend_constants.h - zend_execute.h - zend_extensions.c - zend_extensions.h - zend_highlight.c - zend_highlight.h - zend_indent.c - zend_indent.h - zend_llist.c - zend_modules.h - zend_sprintf.c: Zend Library - diff --git a/Zend/FlexLexer.h b/Zend/FlexLexer.h deleted file mode 100644 index fd65258570..0000000000 --- a/Zend/FlexLexer.h +++ /dev/null @@ -1,186 +0,0 @@ -// $Header$ - -// FlexLexer.h -- define interfaces for lexical analyzer classes generated -// by flex - -// Copyright (c) 1993 The Regents of the University of California. -// All rights reserved. -// -// This code is derived from software contributed to Berkeley by -// Kent Williams and Tom Epperly. -// -// Redistribution and use in source and binary forms with or without -// modification are permitted provided that: (1) source distributions retain -// this entire copyright notice and comment, and (2) distributions including -// binaries display the following acknowledgement: ``This product includes -// software developed by the University of California, Berkeley and its -// contributors'' in the documentation or other materials provided with the -// distribution and in all advertising materials mentioning features or use -// of this software. Neither the name of the University nor the names of -// its contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. - -// THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED -// WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - -// This file defines FlexLexer, an abstract class which specifies the -// external interface provided to flex C++ lexer objects, and yyFlexLexer, -// which defines a particular lexer class. -// -// If you want to create multiple lexer classes, you use the -P flag -// to rename each yyFlexLexer to some other xxFlexLexer. You then -// include in your other sources once per lexer class: -// -// #undef yyFlexLexer -// #define yyFlexLexer xxFlexLexer -// #include -// -// #undef yyFlexLexer -// #define yyFlexLexer zzFlexLexer -// #include -// ... - -#ifndef FLEXLEXER_H -// Never included before - need to define base class. -#define FLEXLEXER_H -#include - -extern "C++" { - -struct yy_buffer_state; -typedef int yy_state_type; - -class FlexLexer { -public: - virtual ~FlexLexer() { } - - const char* YYText() { return yytext; } - int YYLeng() { return yyleng; } - - virtual void - yy_switch_to_buffer( struct yy_buffer_state* new_buffer ) = 0; - virtual struct yy_buffer_state* - yy_create_buffer( istream* s, int size ) = 0; - virtual void yy_delete_buffer( struct yy_buffer_state* b ) = 0; - virtual void yyrestart( istream* s ) = 0; - - virtual int yylex() = 0; - - // Call yylex with new input/output sources. - int yylex( istream* new_in, ostream* new_out = 0 ) - { - switch_streams( new_in, new_out ); - return yylex(); - } - - // Switch to new input/output streams. A nil stream pointer - // indicates "keep the current one". - virtual void switch_streams( istream* new_in = 0, - ostream* new_out = 0 ) = 0; - - int lineno() const { return yylineno; } - - int debug() const { return yy_flex_debug; } - void set_debug( int flag ) { yy_flex_debug = flag; } - -protected: - char* yytext; - int yyleng; - int yylineno; // only maintained if you use %option yylineno - int yy_flex_debug; // only has effect with -d or "%option debug" -}; - -} -#endif - -#if defined(yyFlexLexer) || ! defined(yyFlexLexerOnce) -// Either this is the first time through (yyFlexLexerOnce not defined), -// or this is a repeated include to define a different flavor of -// yyFlexLexer, as discussed in the flex man page. -#define yyFlexLexerOnce - -class yyFlexLexer : public FlexLexer { -public: - // arg_yyin and arg_yyout default to the cin and cout, but we - // only make that assignment when initializing in yylex(). - yyFlexLexer( istream* arg_yyin = 0, ostream* arg_yyout = 0 ); - - virtual ~yyFlexLexer(); - - void yy_switch_to_buffer( struct yy_buffer_state* new_buffer ); - struct yy_buffer_state* yy_create_buffer( istream* s, int size ); - void yy_delete_buffer( struct yy_buffer_state* b ); - void yyrestart( istream* s ); - - virtual int yylex(); - virtual void switch_streams( istream* new_in, ostream* new_out ); - -protected: - virtual int LexerInput( char* buf, int max_size ); - virtual void LexerOutput( const char* buf, int size ); - virtual void LexerError( const char* msg ); - - void yyunput( int c, char* buf_ptr ); - int yyinput(); - - void yy_load_buffer_state(); - void yy_init_buffer( struct yy_buffer_state* b, istream* s ); - void yy_flush_buffer( struct yy_buffer_state* b ); - - int yy_start_stack_ptr; - int yy_start_stack_depth; - int* yy_start_stack; - - void yy_push_state( int new_state ); - void yy_pop_state(); - int yy_top_state(); - - yy_state_type yy_get_previous_state(); - yy_state_type yy_try_NUL_trans( yy_state_type current_state ); - int yy_get_next_buffer(); - - istream* yyin; // input source for default LexerInput - ostream* yyout; // output sink for default LexerOutput - - struct yy_buffer_state* yy_current_buffer; - - // yy_hold_char holds the character lost when yytext is formed. - char yy_hold_char; - - // Number of characters read into yy_ch_buf. - int yy_n_chars; - - // Points to current character in buffer. - char* yy_c_buf_p; - - int yy_init; // whether we need to initialize - int yy_start; // start state number - - // Flag which is used to allow yywrap()'s to do buffer switches - // instead of setting up a fresh yyin. A bit of a hack ... - int yy_did_buffer_switch_on_eof; - - // The following are not always needed, but may be depending - // on use of certain flex features (like REJECT or yymore()). - - yy_state_type yy_last_accepting_state; - char* yy_last_accepting_cpos; - - yy_state_type* yy_state_buf; - yy_state_type* yy_state_ptr; - - char* yy_full_match; - int* yy_full_state; - int yy_full_lp; - - int yy_lp; - int yy_looking_for_trail_begin; - - int yy_more_flag; - int yy_more_len; - int yy_more_offset; - int yy_prev_more_offset; -}; - -#endif diff --git a/Zend/LICENSE b/Zend/LICENSE deleted file mode 100644 index 8acb9af4f8..0000000000 --- a/Zend/LICENSE +++ /dev/null @@ -1,56 +0,0 @@ --------------------------------------------------------------------- - The Zend Engine License, Version 2.00 -Copyright (c) 1999-2006 Zend Technologies Ltd. All rights reserved. --------------------------------------------------------------------- - -Redistribution and use in source and binary forms, with or without -modification, is permitted provided that the following conditions -are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - 3. The names "Zend" and "Zend Engine" must not be used to endorse - or promote products derived from this software without prior - permission from Zend Technologies Ltd. For written permission, - please contact license@zend.com. - - 4. Zend Technologies Ltd. may publish revised and/or new versions - of the license from time to time. Each version will be given a - distinguishing version number. - Once covered code has been published under a particular version - of the license, you may always continue to use it under the - terms of that version. You may also choose to use such covered - code under the terms of any subsequent version of the license - published by Zend Technologies Ltd. No one other than Zend - Technologies Ltd. has the right to modify the terms applicable - to covered code created under this License. - - 5. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes the Zend Engine, freely available at - http://www.zend.com" - - 6. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "The Zend Engine is freely available at http://www.zend.com" - -THIS SOFTWARE IS PROVIDED BY ZEND TECHNOLOGIES LTD. ``AS IS'' AND -ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ZEND -TECHNOLOGIES LTD. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - --------------------------------------------------------------------- diff --git a/Zend/Makefile.am b/Zend/Makefile.am deleted file mode 100644 index bd55716b34..0000000000 --- a/Zend/Makefile.am +++ /dev/null @@ -1,54 +0,0 @@ -## Process this file with automake to produce Makefile.in -*- makefile -*- - -#CLEANFILES = zend_language_parser.c zend_language_parser.h zend_language_scanner.c zend_language_parser.output zend_ini_parser.c zend_ini_parser.h zend_ini_scanner.c zend_ini_parser.output - -AUTOMAKE_OPTIONS=foreign -noinst_LTLIBRARIES=libZend.la - -libZend_la_SOURCES=\ - zend_language_parser.y zend_language_scanner.l \ - zend_ini_parser.y zend_ini_scanner.l \ - zend_alloc.c zend_compile.c zend_constants.c zend_dynamic_array.c \ - zend_execute.c zend_execute_API.c zend_highlight.c zend_llist.c \ - zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \ - zend_variables.c zend.c zend_API.c zend_extensions.c zend_hash.c \ - zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c \ - zend_ini.c zend_qsort.c zend_objects.c zend_object_handlers.c \ - zend_objects_API.c zend_ts_hash.c zend_stream.c zend_mm.c \ - zend_default_classes.c \ - zend_iterators.c zend_interfaces.c zend_exceptions.c \ - zend_strtod.c zend_multibyte.c - -libZend_la_LDFLAGS = -libZend_la_LIBADD = @ZEND_EXTRA_LIBS@ - -# automake isn't too clever about "non-standard" use of lex and yacc - -$(libZend_la_OBJECTS): zend_language_parser.h - -zend_ini_scanner.lo: zend_ini_parser.h - -# Language parser/scanner rules - -zend_language_scanner.c: $(srcdir)/zend_language_scanner.l - $(LEX) -Pzend -S$(srcdir)/flex.skl -o$@ -i $(srcdir)/zend_language_scanner.l - -zend_language_parser.h: zend_language_parser.c -zend_language_parser.c: $(srcdir)/zend_language_parser.y - $(YACC) -p zend -v -d $(srcdir)/zend_language_parser.y -o zend_language_parser.c - -# INI parser/scanner rules - -zend_ini_parser.c: $(srcdir)/zend_ini_parser.y - $(YACC) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o zend_ini_parser.c - -zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l - $(LEX) -Pini_ -S$(srcdir)/flex.skl -o$@ -i $(srcdir)/zend_ini_scanner.l - -zend_ini_parser.h: zend_ini_parser.c - -depend: - -zend_execute.lo: $(srcdir)/zend_execute.c - $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) $(INLINE_CFLAGS) -c $(srcdir)/zend_execute.c - diff --git a/Zend/Makefile.frag b/Zend/Makefile.frag deleted file mode 100755 index 3ab617d715..0000000000 --- a/Zend/Makefile.frag +++ /dev/null @@ -1 +0,0 @@ -Zend/zend_execute.lo: $(srcdir)/zend_vm_execute.h $(srcdir)/zend_vm_opcodes.h diff --git a/Zend/OBJECTS2_HOWTO b/Zend/OBJECTS2_HOWTO deleted file mode 100644 index 302d1e9087..0000000000 --- a/Zend/OBJECTS2_HOWTO +++ /dev/null @@ -1,195 +0,0 @@ -Creating an object ------------------- - -Object can be created in the following ways: - -1. As a result of a function call. E.g.: - -$foo = create_new_foo("parameter"); -$foo->run(); - -The function should create a new zval, create new object and get the -handle for it, set handle and handler table as needed. Note that the -handle is the only ID of the object, so it should be enough to -identify it. - -2. Overriding create_object handler for class. E.g.: - -$foo = new Java("some.Class.here", "parameter"); -$foo->run(); - -The create_object handler function should create a new zval, create -new object and get the handle for it, set handle and handler table as -needed, and also provide constructor method that would handle -constructor call. The get_constructor handler table entry should be -used for that. Do not rely class entry's constructor, unless you refer -to it from get_constructor handler. - -Object maintenance ------------------- - -The handlers add_ref and del_ref are called when a new zval referring -to the object is created. This does not create a new object - both -zvals still refer to the same object. - -clone_obj handler should create a new object, identical to an old one, -but being a separate entity. - -delete_obj should destroy an object, all references to it become -invalid. - -Object access - read --------------------- - -read_property is used to read object's property. This value is not -meant to be changed. The handler returns zval * with the value. - -Object access - write ---------------------- - -write_property is used to directly write object's property by -name. This handler is used to assign property variables or to change them -in operations like += or ++ (unless get_property_zval_ptr is also set). - -get_property_zval_ptr is used to obtain pointer to modifiable zval for -operations like += or ++. This should be used only if your object model -stores properties as real zval's that can be modified from outside. -Otherwise this handler should be NULL and the engine will use -read_property and write_property instead. - -get_property_ptr is used to obtain zval ** for future writing to -it. If your object properties are stored as zval*, return real place -where the property is stored. If the aren't, the best way is to create -proxy object and handle it via get and set methods (see below). -This method is meant to be used for send-by-reference and assign-by-reference -use of object properties. If you don;t want to implement property -referencing for your objects, you can set this handler to NULL. - -get and set handlers are used when engine needs to access the object -as a value. E.g., in the following situation: - -$foo =& $obj->bar; -$foo = 1; - -if $foo is an object (e.g., proxy object from get_property_ptr) it -would be accessed using write handler. - -Object access - method call ---------------------------- - -get_method handler is used to find method description by name. It -should set right type, function name and parameter mask for the -method. If the type is ZEND_OVERLOADED_FUNCTION, the method would be -called via call_method handler, otherwise it would be called with -standard Zend means. - -get_constructor performs the same function as get_method, but for the -object constructor. - -call_method handler is used to perform method call. Parameters are -passed like to any other Zend internal function. - -Object - comparison -------------------- - -Objects can be compared via compare_objects handler. This is used with -== operation, === compares objects by handles, i.e., return true if -and only if it's really the same object. Note that objects from -different object types (i.e., having different handlers) can not be -compared. - -Objects - reflection --------------------- - -get_class_name is used to retrieve class name of the object. -get_class_entry returns class entry (zend_class_entry) for the object, -in case there exists PHP class for it. -No other reflection functions are currently implemented. - -Objects - data structures and handlers ---------------------------------------- - -The object is represented by the following structure: - -struct _zend_object_value { - zend_object_handle handle; - zend_object_handlers *handlers; -}; - -handle is an ID of the object among the objects of the same type (not -class!). The type of the object and how it behaves is determined by -the handler table. - -typedef struct _zend_object_handlers { - zend_object_add_ref_t add_ref; - zend_object_del_ref_t del_ref; - zend_object_delete_obj_t delete_obj; - zend_object_clone_obj_t clone_obj; - zend_object_read_property_t read_property; - zend_object_write_property_t write_property; - zend_object_get_property_ptr_t get_property_ptr; - zend_object_get_property_zval_ptr_t get_property_zval_ptr; - zend_object_get_t get; - zend_object_set_t set; - zend_object_has_property_t has_property; - zend_object_unset_property_t unset_property; - zend_object_get_properties_t get_properties; - zend_object_get_method_t get_method; - zend_object_call_method_t call_method; - zend_object_get_constructor_t get_constructor; - zend_object_get_class_entry_t get_class_entry; - zend_object_get_class_name_t get_class_name; - zend_object_compare_t compare_objects; -} zend_object_handlers; - -See zend_object_handlers.h for prototypes. All objects are passed as zval's. - -Handlers explained: - -add_ref - called when a copy of the object handle is created. - -del_ref - called when a copy of the object handle is destroyed. - -delete_obj - called when an object needs to be destroyed. - -clone_obj - called when a new object identical to an old one should be -created (unlike Zend Engine 1, this never happens unless explicitly -asked for). - -read_property - returns zval *, containing the value of the -property. Is used when value of the property should be retrieved for -reading. - -write_property - assigns value to certain property of the object. - -get_property_zval_ptr - retrieves zval** for being directly modified by -the engine. If your properties are not zval's, don't define it. - -get_property_ptr - retrieves zval** for the property of the value, to -be used for read and write. If object properties are not zval's -natively, this method should create and return proxy object for use -with get and set methods. - -get - retrieves zval* for object contents. To be used mainly with -proxy objects from get_property_ptr, but also may be used for -convert_to_* functions. - -set - sets value for object contents. To be used mainly with -proxy objects from get_property_ptr. - -has_property - checks if the object has certain property set. - -unset_property - removes value for the property of the object - -get_method - retrieves description of the method - -call_method - calls the method (parameters should be put on stack like -for any other PHP internal function). - -get_constructor - get description for the object constructor method - -get_class_entry - should return the class entry for the object - -get_class_name - get the name of the class the object belongs to - -compare_objects - compares if two objects are equal diff --git a/Zend/README.ZEND_MM b/Zend/README.ZEND_MM deleted file mode 100644 index 0825e08b40..0000000000 --- a/Zend/README.ZEND_MM +++ /dev/null @@ -1,13 +0,0 @@ -The goal of the new memory manager (PHP 5.2 and later) is reducing memory allocation overhead and speedup memory management. - -The new manager's "configure" has no "--disable-zend-memory-manager" option, but it has "--enable-malloc-mm" instead. It is enabled by default in DEBUG build and disabled by default in RELEASE built. It allows select malloc/emalloc at runtime. So you can use internal and external memory debuggers without recompilation. - -$ sapi/cli/php -r 'leak();' - -$ USE_ZEND_ALLOC=0 valgrind --leak-check=full -r 'leak();' - -The patch allows tweaking memory manager with ZEND_MM_MEM_TYPE and ZEND_MM_SEG_SIZE environment variables. Default values are "malloc" and "256K". Dependent on target system you can also use "mmap_anon", "mmap_zero" -and "win32" storage managers. - -$ ZEND_MM_MEM_TYPE=mmap_anon ZEND_MM_SEG_SIZE=1M sapi/cli/php - diff --git a/Zend/README.ZEND_VM b/Zend/README.ZEND_VM deleted file mode 100644 index 15ff6fd86f..0000000000 --- a/Zend/README.ZEND_VM +++ /dev/null @@ -1,108 +0,0 @@ -ZEND_VM -======= - -ZEND_VM architecture allows specializing opcode handlers according to op_type -fields and using different execution methods (call threading, switch threading -and direct threading). As a result ZE2 got more than 20% speedup on raw PHP -code execution (with specialized executor and direct threading execution -method). As in most PHP applications raw execution speed isn't the limiting -factor but system calls and database callls are, your mileage with this patch -will vary. - -Most parts of the old zend_execute.c go into zend_vm_def.h. Here you can -find opcode handlers and helpers. The typical opcode handler template looks -like this: - -ZEND_VM_HANDLER(, , , ) -{ - -} - - is a opcode number (0, 1, ...) - is an opcode name (ZEN_NOP, ZEND_ADD, :) - & are masks for allowed operand op_types. Specializer -will generate code only for defined combination of types. You can use any -combination of the following op_types UNUSED, CONST, VAR, TMP and CV also -you can use ANY mask to disable specialization according operand's op_type. - is a handler's code itself. For most handlers it stills the -same as in old zend_execute.c, but now it uses macros to access opcode operands -and some internal executor data. - -You can see the conformity of new macros to old code in the following list: - -EXECUTE_DATA - execute_data -ZEND_VM_DISPATCH_TO_HANDLER() - return _helper(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU) -ZEND_VM_DISPATCH_TO_HELPER() - return (ZEND_OPCODE_HANDLER_ARGS_PASSTHRU) -ZEND_VM_DISPATCH_TO_HELPER_EX(,,) - return (, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU) -ZEND_VM_CONTINUE() - return 0 -ZEND_VM_NEXT_OPCODE() - NEXT_OPCODE() -ZEND_VM_SET_OPCODE( - SET_OPCODE( -ZEND_VM_INC_OPCODE() - INC_OPCOD() -ZEND_VM_RETURN_FROM_EXECUTE_LOOP() - RETURN_FROM_EXECUTE_LOOP() -ZEND_VM_C_LABEL(\n"); - zend_printf(""); -} - - - -ZEND_API void zend_strip(TSRMLS_D) -{ - zval token; - int token_type; - int prev_space = 0; - - token.type = 0; - while ((token_type=lex_scan(&token TSRMLS_CC))) { - switch (token_type) { - case T_WHITESPACE: - if (!prev_space) { - zend_write(" ", sizeof(" ") - 1); - prev_space = 1; - } - /* lack of break; is intentional */ - case T_COMMENT: - case T_DOC_COMMENT: - token.type = 0; - continue; - - case EOF: - return; - - case T_END_HEREDOC: - zend_write(LANG_SCNG(yy_text), LANG_SCNG(yy_leng)); - efree(token.value.str.val); - /* read the following character, either newline or ; */ - if (lex_scan(&token TSRMLS_CC) != T_WHITESPACE) { - zend_write(LANG_SCNG(yy_text), LANG_SCNG(yy_leng)); - } - zend_write("\n", sizeof("\n") - 1); - prev_space = 1; - token.type = 0; - continue; - - default: - zend_write(LANG_SCNG(yy_text), LANG_SCNG(yy_leng)); - break; - } - - if (token.type == IS_STRING) { - switch (token_type) { - case T_OPEN_TAG: - case T_OPEN_TAG_WITH_ECHO: - case T_CLOSE_TAG: - case T_WHITESPACE: - case T_COMMENT: - case T_DOC_COMMENT: - break; - - default: - efree(token.value.str.val); - break; - } - } - prev_space = token.type = 0; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ - diff --git a/Zend/zend_highlight.h b/Zend/zend_highlight.h deleted file mode 100644 index 555198666e..0000000000 --- a/Zend/zend_highlight.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_HIGHLIGHT_H -#define ZEND_HIGHLIGHT_H - -#define HL_COMMENT_COLOR "#FF8000" /* orange */ -#define HL_DEFAULT_COLOR "#0000BB" /* blue */ -#define HL_HTML_COLOR "#000000" /* black */ -#define HL_STRING_COLOR "#DD0000" /* red */ -#define HL_BG_COLOR "#FFFFFF" /* white */ -#define HL_KEYWORD_COLOR "#007700" /* green */ - - -typedef struct _zend_syntax_highlighter_ini { - char *highlight_html; - char *highlight_comment; - char *highlight_default; - char *highlight_string; - char *highlight_keyword; -} zend_syntax_highlighter_ini; - - -BEGIN_EXTERN_C() -ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC); -ZEND_API void zend_strip(TSRMLS_D); -ZEND_API int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC); -ZEND_API int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name TSRMLS_DC); -ZEND_API void zend_html_putc(char c); -ZEND_API void zend_html_puts(const char *s, uint len TSRMLS_DC); -END_EXTERN_C() - -extern zend_syntax_highlighter_ini syntax_highlighter_ini; - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_indent.c b/Zend/zend_indent.c deleted file mode 100644 index bff8f2c408..0000000000 --- a/Zend/zend_indent.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* This indenter doesn't really work, it's here for no particular reason. */ - - -#include "zend.h" -#include -#include "zend_compile.h" -#include "zend_indent.h" - -#define zendtext LANG_SCNG(yy_text) -#define zendleng LANG_SCNG(yy_leng) - - -static void handle_whitespace(int *emit_whitespace) -{ - unsigned char c; - int i; - - for (c=0; c<128; c++) { - if (emit_whitespace[c]>0) { - for (i=0; i0) { - ZEND_PUTS(" {\n"); - memset(emit_whitespace, 0, sizeof(int)*256); - } else { - ZEND_PUTS("{"); - } - break; - case '}': - nest_level--; - if (emit_whitespace['\n']==0) { - ZEND_PUTS("\n"); - } - for (i=0; i0) { - for (i=0; i | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_INDENT_H -#define ZEND_INDENT_H - -BEGIN_EXTERN_C() -ZEND_API void zend_indent(void); -END_EXTERN_C() - -#endif /* ZEND_INDENT_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c deleted file mode 100644 index 1cade26d6a..0000000000 --- a/Zend/zend_ini.c +++ /dev/null @@ -1,596 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_qsort.h" -#include "zend_API.h" -#include "zend_ini.h" -#include "zend_alloc.h" -#include "zend_operators.h" -#include "zend_strtod.h" - -static HashTable *registered_zend_ini_directives; - -#define NO_VALUE_PLAINTEXT "no value" -#define NO_VALUE_HTML "no value" - -/* - * hash_apply functions - */ -static int zend_remove_ini_entries(zend_ini_entry *ini_entry, int *module_number TSRMLS_DC) -{ - if (ini_entry->module_number == *module_number) { - return 1; - } else { - return 0; - } -} - - -static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage TSRMLS_DC) -{ - if (ini_entry->modified) { - if (ini_entry->on_modify) { - zend_try { - /* even if on_modify bails out, we have to continue on with restoring, - since there can be allocated variables that would be freed on MM shutdown - and would lead to memory corruption later ini entry is modified again */ - ini_entry->on_modify(ini_entry, ini_entry->orig_value, ini_entry->orig_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC); - } zend_end_try(); - } - efree(ini_entry->value); - ini_entry->value = ini_entry->orig_value; - ini_entry->value_length = ini_entry->orig_value_length; - ini_entry->modified = 0; - ini_entry->orig_value = NULL; - ini_entry->orig_value_length = 0; - } - return 0; -} - -static int zend_restore_ini_entry_wrapper(zend_ini_entry **ini_entry TSRMLS_DC) -{ - zend_restore_ini_entry_cb(*ini_entry, ZEND_INI_STAGE_DEACTIVATE TSRMLS_CC); - return 1; -} - -/* - * Startup / shutdown - */ -ZEND_API int zend_ini_startup(TSRMLS_D) -{ - registered_zend_ini_directives = (HashTable *) malloc(sizeof(HashTable)); - - EG(ini_directives) = registered_zend_ini_directives; - EG(modified_ini_directives) = NULL; - if (zend_hash_init_ex(registered_zend_ini_directives, 100, NULL, NULL, 1, 0)==FAILURE) { - return FAILURE; - } - return SUCCESS; -} - - -ZEND_API int zend_ini_shutdown(TSRMLS_D) -{ - zend_hash_destroy(EG(ini_directives)); - free(EG(ini_directives)); - return SUCCESS; -} - - -ZEND_API int zend_ini_global_shutdown(TSRMLS_D) -{ - zend_hash_destroy(registered_zend_ini_directives); - free(registered_zend_ini_directives); - return SUCCESS; -} - - -ZEND_API int zend_ini_deactivate(TSRMLS_D) -{ - if (EG(modified_ini_directives)) { - zend_hash_apply(EG(modified_ini_directives), (apply_func_t) zend_restore_ini_entry_wrapper TSRMLS_CC); - zend_hash_destroy(EG(modified_ini_directives)); - FREE_HASHTABLE(EG(modified_ini_directives)); - EG(modified_ini_directives) = NULL; - } - return SUCCESS; -} - - -#ifdef ZTS -ZEND_API int zend_copy_ini_directives(TSRMLS_D) -{ - zend_ini_entry ini_entry; - - EG(modified_ini_directives) = NULL; - EG(ini_directives) = (HashTable *) malloc(sizeof(HashTable)); - if (zend_hash_init_ex(EG(ini_directives), registered_zend_ini_directives->nNumOfElements, NULL, NULL, 1, 0)==FAILURE) { - return FAILURE; - } - zend_hash_copy(EG(ini_directives), registered_zend_ini_directives, NULL, &ini_entry, sizeof(zend_ini_entry)); - zend_ini_refresh_caches(ZEND_INI_STAGE_STARTUP TSRMLS_CC); - return SUCCESS; -} -#endif - - -static int ini_key_compare(const void *a, const void *b TSRMLS_DC) -{ - Bucket *f; - Bucket *s; - - f = *((Bucket **) a); - s = *((Bucket **) b); - - if (f->nKeyLength==0 && s->nKeyLength==0) { /* both numeric */ - return ZEND_NORMALIZE_BOOL(f->nKeyLength - s->nKeyLength); - } else if (f->nKeyLength==0) { /* f is numeric, s is not */ - return -1; - } else if (s->nKeyLength==0) { /* s is numeric, f is not */ - return 1; - } else { /* both strings */ - return zend_binary_strcasecmp(f->arKey, f->nKeyLength, s->arKey, s->nKeyLength); - } -} - - -ZEND_API void zend_ini_sort_entries(TSRMLS_D) -{ - zend_hash_sort(EG(ini_directives), zend_qsort, ini_key_compare, 0 TSRMLS_CC); -} - -/* - * Registration / unregistration - */ - -ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_number TSRMLS_DC) -{ - zend_ini_entry *p = ini_entry; - zend_ini_entry *hashed_ini_entry; - zval default_value; - HashTable *directives = registered_zend_ini_directives; - zend_bool config_directive_success = 0; - -#ifdef ZTS - /* if we are called during the request, eg: from dl(), - * then we should not touch the global directives table, - * and should update the per-(request|thread) version instead. - * This solves two problems: one is that ini entries for dl()'d - * extensions will now work, and the second is that updating the - * global hash here from dl() is not mutex protected and can - * lead to death. - */ - if (directives != EG(ini_directives)) { - directives = EG(ini_directives); - } -#endif - - while (p->name) { - p->module_number = module_number; - config_directive_success = 0; - if (zend_hash_add(directives, p->name, p->name_length, p, sizeof(zend_ini_entry), (void **) &hashed_ini_entry)==FAILURE) { - zend_unregister_ini_entries(module_number TSRMLS_CC); - return FAILURE; - } - if ((zend_get_configuration_directive(p->name, p->name_length, &default_value))==SUCCESS) { - if (!hashed_ini_entry->on_modify - || hashed_ini_entry->on_modify(hashed_ini_entry, default_value.value.str.val, default_value.value.str.len, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC)==SUCCESS) { - hashed_ini_entry->value = default_value.value.str.val; - hashed_ini_entry->value_length = default_value.value.str.len; - config_directive_success = 1; - } - } - - if (!config_directive_success && hashed_ini_entry->on_modify) { - hashed_ini_entry->on_modify(hashed_ini_entry, hashed_ini_entry->value, hashed_ini_entry->value_length, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC); - } - p++; - } - return SUCCESS; -} - - -ZEND_API void zend_unregister_ini_entries(int module_number TSRMLS_DC) -{ - zend_hash_apply_with_argument(registered_zend_ini_directives, (apply_func_arg_t) zend_remove_ini_entries, (void *) &module_number TSRMLS_CC); -} - - -static int zend_ini_refresh_cache(zend_ini_entry *p, int stage TSRMLS_DC) -{ - if (p->on_modify) { - p->on_modify(p, p->value, p->value_length, p->mh_arg1, p->mh_arg2, p->mh_arg3, stage TSRMLS_CC); - } - return 0; -} - - -ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC) -{ - zend_hash_apply_with_argument(EG(ini_directives), (apply_func_arg_t) zend_ini_refresh_cache, (void *)(long) stage TSRMLS_CC); -} - - -ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage) -{ - zend_ini_entry *ini_entry; - char *duplicate; - TSRMLS_FETCH(); - - if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry)==FAILURE) { - return FAILURE; - } - - if (!(ini_entry->modifiable & modify_type)) { - return FAILURE; - } - - duplicate = estrndup(new_value, new_value_length); - - if (!ini_entry->on_modify - || ini_entry->on_modify(ini_entry, duplicate, new_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC)==SUCCESS) { - if (!ini_entry->modified) { - ini_entry->orig_value = ini_entry->value; - ini_entry->orig_value_length = ini_entry->value_length; - ini_entry->modified = 1; - if (!EG(modified_ini_directives)) { - ALLOC_HASHTABLE(EG(modified_ini_directives)); - zend_hash_init(EG(modified_ini_directives), 8, NULL, NULL, 0); - } - zend_hash_add(EG(modified_ini_directives), name, name_length, &ini_entry, sizeof(zend_ini_entry*), NULL); - } else { /* we already changed the value, free the changed value */ - efree(ini_entry->value); - } - ini_entry->value = duplicate; - ini_entry->value_length = new_value_length; - } else { - efree(duplicate); - } - - return SUCCESS; -} - - -ZEND_API int zend_restore_ini_entry(char *name, uint name_length, int stage) -{ - zend_ini_entry *ini_entry; - TSRMLS_FETCH(); - - if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry)==FAILURE || - (stage == ZEND_INI_STAGE_RUNTIME && (ini_entry->modifiable & ZEND_INI_USER) == 0)) { - return FAILURE; - } - - if (EG(modified_ini_directives)) { - zend_restore_ini_entry_cb(ini_entry, stage TSRMLS_CC); - zend_hash_del(EG(modified_ini_directives), name, name_length); - } - - return SUCCESS; -} - - -ZEND_API int zend_ini_register_displayer(char *name, uint name_length, void (*displayer)(zend_ini_entry *ini_entry, int type)) -{ - zend_ini_entry *ini_entry; - - if (zend_hash_find(registered_zend_ini_directives, name, name_length, (void **) &ini_entry)==FAILURE) { - return FAILURE; - } - - ini_entry->displayer = displayer; - return SUCCESS; -} - - - -/* - * Data retrieval - */ - -ZEND_API long zend_ini_long(char *name, uint name_length, int orig) -{ - zend_ini_entry *ini_entry; - TSRMLS_FETCH(); - - if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry)==SUCCESS) { - if (orig && ini_entry->modified) { - return (ini_entry->orig_value ? strtol(ini_entry->orig_value, NULL, 0) : 0); - } else if (ini_entry->value) { - return strtol(ini_entry->value, NULL, 0); - } - } - - return 0; -} - - -ZEND_API double zend_ini_double(char *name, uint name_length, int orig) -{ - zend_ini_entry *ini_entry; - TSRMLS_FETCH(); - - if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry)==SUCCESS) { - if (orig && ini_entry->modified) { - return (double) (ini_entry->orig_value ? zend_strtod(ini_entry->orig_value, NULL) : 0.0); - } else if (ini_entry->value) { - return (double) zend_strtod(ini_entry->value, NULL); - } - } - - return 0.0; -} - - -ZEND_API char *zend_ini_string(char *name, uint name_length, int orig) -{ - zend_ini_entry *ini_entry; - TSRMLS_FETCH(); - - if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry)==SUCCESS) { - if (orig && ini_entry->modified) { - return ini_entry->orig_value; - } else { - return ini_entry->value; - } - } - - return ""; -} - - -static void zend_ini_displayer_cb(zend_ini_entry *ini_entry, int type) -{ - if (ini_entry->displayer) { - ini_entry->displayer(ini_entry, type); - } else { - char *display_string; - uint display_string_length; - - if (type==ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { - if (ini_entry->orig_value) { - display_string = ini_entry->orig_value; - display_string_length = ini_entry->orig_value_length; - } else { - if (zend_uv.html_errors) { - display_string = NO_VALUE_HTML; - display_string_length = sizeof(NO_VALUE_HTML)-1; - } else { - display_string = NO_VALUE_PLAINTEXT; - display_string_length = sizeof(NO_VALUE_PLAINTEXT)-1; - } - } - } else if (ini_entry->value && ini_entry->value[0]) { - display_string = ini_entry->value; - display_string_length = ini_entry->value_length; - } else { - if (zend_uv.html_errors) { - display_string = NO_VALUE_HTML; - display_string_length = sizeof(NO_VALUE_HTML)-1; - } else { - display_string = NO_VALUE_PLAINTEXT; - display_string_length = sizeof(NO_VALUE_PLAINTEXT)-1; - } - } - ZEND_WRITE(display_string, display_string_length); - } -} - - -ZEND_INI_DISP(zend_ini_boolean_displayer_cb) -{ - int value, tmp_value_len; - char *tmp_value; - - if (type==ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { - tmp_value = (ini_entry->orig_value ? ini_entry->orig_value : NULL ); - tmp_value_len = ini_entry->orig_value_length; - } else if (ini_entry->value) { - tmp_value = ini_entry->value; - tmp_value_len = ini_entry->value_length; - } else { - tmp_value = NULL; - tmp_value_len = 0; - } - - if (tmp_value_len == 4 && strcasecmp(tmp_value, "true") == 0) { - value = 1; - } - else if (tmp_value_len == 3 && strcasecmp(tmp_value, "yes") == 0) { - value = 1; - } - else if (tmp_value_len == 2 && strcasecmp(tmp_value, "on") == 0) { - value = 1; - } - else { - value = atoi(tmp_value); - } - - if (value) { - ZEND_PUTS("On"); - } else { - ZEND_PUTS("Off"); - } -} - - -ZEND_INI_DISP(zend_ini_color_displayer_cb) -{ - char *value; - - if (type==ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { - value = ini_entry->orig_value; - } else if (ini_entry->value) { - value = ini_entry->value; - } else { - value = NULL; - } - if (value) { - if (zend_uv.html_errors) { - zend_printf("%s", value, value); - } else { - ZEND_PUTS(value); - } - } else { - if (zend_uv.html_errors) { - ZEND_PUTS(NO_VALUE_HTML); - } else { - ZEND_PUTS(NO_VALUE_PLAINTEXT); - } - } -} - - -ZEND_INI_DISP(display_link_numbers) -{ - char *value; - - if (type==ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { - value = ini_entry->orig_value; - } else if (ini_entry->value) { - value = ini_entry->value; - } else { - value = NULL; - } - - if (value) { - if (atoi(value)==-1) { - ZEND_PUTS("Unlimited"); - } else { - zend_printf("%s", value); - } - } -} - - -/* Standard message handlers */ - -ZEND_API ZEND_INI_MH(OnUpdateBool) -{ - zend_bool *p; -#ifndef ZTS - char *base = (char *) mh_arg2; -#else - char *base; - - base = (char *) ts_resource(*((int *) mh_arg2)); -#endif - - p = (zend_bool *) (base+(size_t) mh_arg1); - - if (new_value_length==2 && strcasecmp("on", new_value)==0) { - *p = (zend_bool) 1; - } - else if (new_value_length==3 && strcasecmp("yes", new_value)==0) { - *p = (zend_bool) 1; - } - else if (new_value_length==4 && strcasecmp("true", new_value)==0) { - *p = (zend_bool) 1; - } - else { - *p = (zend_bool) atoi(new_value); - } - return SUCCESS; -} - - -ZEND_API ZEND_INI_MH(OnUpdateLong) -{ - long *p; -#ifndef ZTS - char *base = (char *) mh_arg2; -#else - char *base; - - base = (char *) ts_resource(*((int *) mh_arg2)); -#endif - - p = (long *) (base+(size_t) mh_arg1); - - *p = zend_atoi(new_value, new_value_length); - return SUCCESS; -} - - -ZEND_API ZEND_INI_MH(OnUpdateReal) -{ - double *p; -#ifndef ZTS - char *base = (char *) mh_arg2; -#else - char *base; - - base = (char *) ts_resource(*((int *) mh_arg2)); -#endif - - p = (double *) (base+(size_t) mh_arg1); - - *p = zend_strtod(new_value, NULL); - return SUCCESS; -} - - -ZEND_API ZEND_INI_MH(OnUpdateString) -{ - char **p; -#ifndef ZTS - char *base = (char *) mh_arg2; -#else - char *base; - - base = (char *) ts_resource(*((int *) mh_arg2)); -#endif - - p = (char **) (base+(size_t) mh_arg1); - - *p = new_value; - return SUCCESS; -} - - -ZEND_API ZEND_INI_MH(OnUpdateStringUnempty) -{ - char **p; -#ifndef ZTS - char *base = (char *) mh_arg2; -#else - char *base; - - base = (char *) ts_resource(*((int *) mh_arg2)); -#endif - - if (new_value && !new_value[0]) { - return FAILURE; - } - - p = (char **) (base+(size_t) mh_arg1); - - *p = new_value; - return SUCCESS; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_ini.h b/Zend/zend_ini.h deleted file mode 100644 index d0f1321b94..0000000000 --- a/Zend/zend_ini.h +++ /dev/null @@ -1,216 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_INI_H -#define ZEND_INI_H - -#define ZEND_INI_USER (1<<0) -#define ZEND_INI_PERDIR (1<<1) -#define ZEND_INI_SYSTEM (1<<2) - -#define ZEND_INI_ALL (ZEND_INI_USER|ZEND_INI_PERDIR|ZEND_INI_SYSTEM) - -#ifndef XtOffsetOf -# if defined(CRAY) || (defined(__arm) && !defined(LINUX)) -# ifdef __STDC__ -# define XtOffset(p_type, field) _Offsetof(p_type, field) -# else -# ifdef CRAY2 -# define XtOffset(p_type, field) \ - (sizeof(int)*((unsigned int)&(((p_type)NULL)->field))) - -# else /* !CRAY2 */ - -# define XtOffset(p_type, field) ((unsigned int)&(((p_type)NULL)->field)) - -# endif /* !CRAY2 */ -# endif /* __STDC__ */ -# else /* ! (CRAY || __arm) */ - -# define XtOffset(p_type, field) \ - ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL))) - -# endif /* !CRAY */ - -# ifdef offsetof -# define XtOffsetOf(s_type, field) offsetof(s_type, field) -# else -# define XtOffsetOf(s_type, field) XtOffset(s_type*, field) -# endif - -#endif - -typedef struct _zend_ini_entry zend_ini_entry; - -#define ZEND_INI_MH(name) int name(zend_ini_entry *entry, char *new_value, uint new_value_length, void *mh_arg1, void *mh_arg2, void *mh_arg3, int stage TSRMLS_DC) -#define ZEND_INI_DISP(name) void name(zend_ini_entry *ini_entry, int type) - -struct _zend_ini_entry { - int module_number; - int modifiable; - char *name; - uint name_length; - ZEND_INI_MH((*on_modify)); - void *mh_arg1; - void *mh_arg2; - void *mh_arg3; - - char *value; - uint value_length; - - char *orig_value; - uint orig_value_length; - int modified; - - void (*displayer)(zend_ini_entry *ini_entry, int type); -}; - -BEGIN_EXTERN_C() -ZEND_API int zend_ini_startup(TSRMLS_D); -ZEND_API int zend_ini_shutdown(TSRMLS_D); -ZEND_API int zend_ini_global_shutdown(TSRMLS_D); -ZEND_API int zend_ini_deactivate(TSRMLS_D); - -ZEND_API int zend_copy_ini_directives(TSRMLS_D); - -ZEND_API void zend_ini_sort_entries(TSRMLS_D); - -ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_number TSRMLS_DC); -ZEND_API void zend_unregister_ini_entries(int module_number TSRMLS_DC); -ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC); -ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage); -ZEND_API int zend_restore_ini_entry(char *name, uint name_length, int stage); -ZEND_API void display_ini_entries(zend_module_entry *module); - -ZEND_API long zend_ini_long(char *name, uint name_length, int orig); -ZEND_API double zend_ini_double(char *name, uint name_length, int orig); -ZEND_API char *zend_ini_string(char *name, uint name_length, int orig); - -ZEND_API int zend_ini_register_displayer(char *name, uint name_length, void (*displayer)(zend_ini_entry *ini_entry, int type)); - -ZEND_API ZEND_INI_DISP(zend_ini_boolean_displayer_cb); -ZEND_API ZEND_INI_DISP(zend_ini_color_displayer_cb); -ZEND_API ZEND_INI_DISP(display_link_numbers); -END_EXTERN_C() - -#define ZEND_INI_BEGIN() static zend_ini_entry ini_entries[] = { -#define ZEND_INI_END() { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, NULL } }; - -#define ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, arg3, displayer) \ - { 0, modifiable, name, sizeof(name), on_modify, arg1, arg2, arg3, default_value, sizeof(default_value)-1, NULL, 0, 0, displayer }, - -#define ZEND_INI_ENTRY3(name, default_value, modifiable, on_modify, arg1, arg2, arg3) \ - ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, arg3, NULL) - -#define ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, arg1, arg2, displayer) \ - ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, NULL, displayer) - -#define ZEND_INI_ENTRY2(name, default_value, modifiable, on_modify, arg1, arg2) \ - ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, arg1, arg2, NULL) - -#define ZEND_INI_ENTRY1_EX(name, default_value, modifiable, on_modify, arg1, displayer) \ - ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, NULL, NULL, displayer) - -#define ZEND_INI_ENTRY1(name, default_value, modifiable, on_modify, arg1) \ - ZEND_INI_ENTRY1_EX(name, default_value, modifiable, on_modify, arg1, NULL) - -#define ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, displayer) \ - ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, NULL, NULL, NULL, displayer) - -#define ZEND_INI_ENTRY(name, default_value, modifiable, on_modify) \ - ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, NULL) - -#ifdef ZTS -#define STD_ZEND_INI_ENTRY(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr) \ - ZEND_INI_ENTRY2(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id) -#define STD_ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr, displayer) \ - ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id, displayer) -#define STD_ZEND_INI_BOOLEAN(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr) \ - ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id, NULL, zend_ini_boolean_displayer_cb) -#else -#define STD_ZEND_INI_ENTRY(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr) \ - ZEND_INI_ENTRY2(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr) -#define STD_ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr, displayer) \ - ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, displayer) -#define STD_ZEND_INI_BOOLEAN(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr) \ - ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, NULL, zend_ini_boolean_displayer_cb) -#endif - -#define INI_INT(name) zend_ini_long((name), sizeof(name), 0) -#define INI_FLT(name) zend_ini_double((name), sizeof(name), 0) -#define INI_STR(name) zend_ini_string((name), sizeof(name), 0) -#define INI_BOOL(name) ((zend_bool) INI_INT(name)) - -#define INI_ORIG_INT(name) zend_ini_long((name), sizeof(name), 1) -#define INI_ORIG_FLT(name) zend_ini_double((name), sizeof(name), 1) -#define INI_ORIG_STR(name) zend_ini_string((name), sizeof(name), 1) -#define INI_ORIG_BOOL(name) ((zend_bool) INI_ORIG_INT(name)) - - -#define REGISTER_INI_ENTRIES() zend_register_ini_entries(ini_entries, module_number TSRMLS_CC) -#define UNREGISTER_INI_ENTRIES() zend_unregister_ini_entries(module_number TSRMLS_CC) -#define DISPLAY_INI_ENTRIES() display_ini_entries(zend_module) - -#define REGISTER_INI_DISPLAYER(name, displayer) zend_ini_register_displayer((name), sizeof(name), displayer) -#define REGISTER_INI_BOOLEAN(name) REGISTER_INI_DISPLAYER(name, zend_ini_boolean_displayer_cb) - -/* Standard message handlers */ -BEGIN_EXTERN_C() -ZEND_API ZEND_INI_MH(OnUpdateBool); -ZEND_API ZEND_INI_MH(OnUpdateLong); -ZEND_API ZEND_INI_MH(OnUpdateReal); -ZEND_API ZEND_INI_MH(OnUpdateString); -ZEND_API ZEND_INI_MH(OnUpdateStringUnempty); -END_EXTERN_C() - -#define ZEND_INI_DISPLAY_ORIG 1 -#define ZEND_INI_DISPLAY_ACTIVE 2 - -#define ZEND_INI_STAGE_STARTUP (1<<0) -#define ZEND_INI_STAGE_SHUTDOWN (1<<1) -#define ZEND_INI_STAGE_ACTIVATE (1<<2) -#define ZEND_INI_STAGE_DEACTIVATE (1<<3) -#define ZEND_INI_STAGE_RUNTIME (1<<4) - -/* INI parsing engine */ -typedef void (*zend_ini_parser_cb_t)(zval *arg1, zval *arg2, int callback_type, void *arg); -BEGIN_EXTERN_C() -ZEND_API int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg); -ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg); -END_EXTERN_C() - -#define ZEND_INI_PARSER_ENTRY 1 -#define ZEND_INI_PARSER_SECTION 2 -#define ZEND_INI_PARSER_POP_ENTRY 3 - -typedef struct _zend_ini_parser_param { - zend_ini_parser_cb_t ini_parser_cb; - void *arg; -} zend_ini_parser_param; - -#endif /* ZEND_INI_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y deleted file mode 100644 index 9346acfda7..0000000000 --- a/Zend/zend_ini_parser.y +++ /dev/null @@ -1,316 +0,0 @@ -%{ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#define DEBUG_CFG_PARSER 0 -#include "zend.h" -#include "zend_API.h" -#include "zend_ini.h" -#include "zend_constants.h" -#include "zend_ini_scanner.h" -#include "zend_extensions.h" - -#define YYSTYPE zval - -#ifdef ZTS -#define YYPARSE_PARAM tsrm_ls -#define YYLEX_PARAM tsrm_ls -#endif - -#define ZEND_INI_PARSER_CB (CG(ini_parser_param))->ini_parser_cb -#define ZEND_INI_PARSER_ARG (CG(ini_parser_param))->arg - -int ini_lex(zval *ini_lval TSRMLS_DC); -#ifdef ZTS -int ini_parse(void *arg); -#else -int ini_parse(void); -#endif - -zval yylval; - -#ifndef ZTS -extern int ini_lex(zval *ini_lval TSRMLS_DC); -extern FILE *ini_in; -extern void init_cfg_scanner(void); -#endif - -void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2) -{ - int i_result; - int i_op1, i_op2; - char str_result[MAX_LENGTH_OF_LONG]; - - i_op1 = atoi(op1->value.str.val); - free(op1->value.str.val); - if (op2) { - i_op2 = atoi(op2->value.str.val); - free(op2->value.str.val); - } else { - i_op2 = 0; - } - - switch (type) { - case '|': - i_result = i_op1 | i_op2; - break; - case '&': - i_result = i_op1 & i_op2; - break; - case '~': - i_result = ~i_op1; - break; - case '!': - i_result = !i_op1; - break; - default: - i_result = 0; - break; - } - - result->value.str.len = zend_sprintf(str_result, "%d", i_result); - result->value.str.val = (char *) malloc(result->value.str.len+1); - memcpy(result->value.str.val, str_result, result->value.str.len); - result->value.str.val[result->value.str.len] = 0; - result->type = IS_STRING; -} - -void zend_ini_init_string(zval *result) -{ - result->value.str.val = malloc(1); - result->value.str.val[0] = 0; - result->value.str.len = 0; - result->type = IS_STRING; -} - -void zend_ini_add_string(zval *result, zval *op1, zval *op2) -{ - int length = op1->value.str.len + op2->value.str.len; - - result->value.str.val = (char *) realloc(op1->value.str.val, length+1); - memcpy(result->value.str.val+op1->value.str.len, op2->value.str.val, op2->value.str.len); - result->value.str.val[length] = 0; - result->value.str.len = length; - result->type = IS_STRING; -} - -void zend_ini_get_constant(zval *result, zval *name) -{ - zval z_constant; - TSRMLS_FETCH(); - - if (!memchr(name->value.str.val, ':', name->value.str.len) - && zend_get_constant(name->value.str.val, name->value.str.len, &z_constant TSRMLS_CC)) { - /* z_constant is emalloc()'d */ - convert_to_string(&z_constant); - result->value.str.val = zend_strndup(z_constant.value.str.val, z_constant.value.str.len); - result->value.str.len = z_constant.value.str.len; - result->type = z_constant.type; - zval_dtor(&z_constant); - free(name->value.str.val); - } else { - *result = *name; - } -} - -void zend_ini_get_var(zval *result, zval *name) -{ - zval curval; - char *envvar; - TSRMLS_FETCH(); - - if (zend_get_configuration_directive(name->value.str.val, name->value.str.len+1, &curval) == SUCCESS) { - result->value.str.val = zend_strndup(curval.value.str.val, curval.value.str.len); - result->value.str.len = curval.value.str.len; - } else if ((envvar = zend_getenv(name->value.str.val, name->value.str.len TSRMLS_CC)) != NULL || - (envvar = getenv(name->value.str.val)) != NULL) { - result->value.str.val = strdup(envvar); - result->value.str.len = strlen(envvar); - } else { - zend_ini_init_string(result); - } -} - - -static void ini_error(char *str) -{ - char *error_buf; - int error_buf_len; - char *currently_parsed_filename; - TSRMLS_FETCH(); - - currently_parsed_filename = zend_ini_scanner_get_filename(TSRMLS_C); - if (currently_parsed_filename) { - error_buf_len = 128+strlen(currently_parsed_filename); /* should be more than enough */ - error_buf = (char *) emalloc(error_buf_len); - - sprintf(error_buf, "Error parsing %s on line %d\n", currently_parsed_filename, zend_ini_scanner_get_lineno(TSRMLS_C)); - } else { - error_buf = estrdup("Invalid configuration directive\n"); - } - - if (CG(ini_parser_unbuffered_errors)) { -#ifdef PHP_WIN32 - MessageBox(NULL, error_buf, "PHP Error", MB_OK|MB_TOPMOST|0x00200000L); -#else - fprintf(stderr, "PHP: %s", error_buf); -#endif - } else { - zend_error(E_WARNING, "%s", error_buf); - } - efree(error_buf); -} - - -ZEND_API int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg) -{ - int retval; - zend_ini_parser_param ini_parser_param; - TSRMLS_FETCH(); - - ini_parser_param.ini_parser_cb = ini_parser_cb; - ini_parser_param.arg = arg; - - CG(ini_parser_param) = &ini_parser_param; - if (zend_ini_open_file_for_scanning(fh TSRMLS_CC)==FAILURE) { - return FAILURE; - } - - CG(ini_parser_unbuffered_errors) = unbuffered_errors; - retval = ini_parse(TSRMLS_C); - - zend_ini_close_file(fh TSRMLS_CC); - - if (retval==0) { - return SUCCESS; - } else { - return FAILURE; - } -} - - -ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg) -{ - zend_ini_parser_param ini_parser_param; - TSRMLS_FETCH(); - - ini_parser_param.ini_parser_cb = ini_parser_cb; - ini_parser_param.arg = arg; - - CG(ini_parser_param) = &ini_parser_param; - if (zend_ini_prepare_string_for_scanning(str TSRMLS_CC)==FAILURE) { - return FAILURE; - } - - CG(ini_parser_unbuffered_errors) = unbuffered_errors; - - if (ini_parse(TSRMLS_C)) { - return SUCCESS; - } else { - return FAILURE; - } -} - - -%} - -%pure_parser -%token TC_STRING -%token TC_ENCAPSULATED_STRING -%token BRACK -%token SECTION -%token CFG_TRUE -%token CFG_FALSE -%token TC_DOLLAR_CURLY -%left '|' '&' -%right '~' '!' - -%% - -statement_list: - statement_list statement - | /* empty */ -; - -statement: - TC_STRING '=' string_or_value { -#if DEBUG_CFG_PARSER - printf("'%s' = '%s'\n", $1.value.str.val, $3.value.str.val); -#endif - ZEND_INI_PARSER_CB(&$1, &$3, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG); - free($1.value.str.val); - free($3.value.str.val); - } - | TC_STRING BRACK '=' string_or_value { -#if DEBUG_CFG_PARSER - printf("'%s'[ ] = '%s'\n", $1.value.str.val, $4.value.str.val); -#endif - ZEND_INI_PARSER_CB(&$1, &$4, ZEND_INI_PARSER_POP_ENTRY, ZEND_INI_PARSER_ARG); - free($1.value.str.val); - free($4.value.str.val); - } - | TC_STRING { ZEND_INI_PARSER_CB(&$1, NULL, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG); free($1.value.str.val); } - | SECTION { ZEND_INI_PARSER_CB(&$1, NULL, ZEND_INI_PARSER_SECTION, ZEND_INI_PARSER_ARG); free($1.value.str.val); } - | '\n' -; - - -string_or_value: - expr { $$ = $1; } - | CFG_TRUE { $$ = $1; } - | CFG_FALSE { $$ = $1; } - | '\n' { zend_ini_init_string(&$$); } - | /* empty */ { zend_ini_init_string(&$$); } -; - - -var_string_list: - cfg_var_ref { $$ = $1; } - | TC_ENCAPSULATED_STRING { $$ = $1; } - | constant_string { $$ = $1; } - | var_string_list cfg_var_ref { zend_ini_add_string(&$$, &$1, &$2); free($2.value.str.val); } - | var_string_list TC_ENCAPSULATED_STRING { zend_ini_add_string(&$$, &$1, &$2); free($2.value.str.val); } - | var_string_list constant_string { zend_ini_add_string(&$$, &$1, &$2); free($2.value.str.val); } -; - -cfg_var_ref: - TC_DOLLAR_CURLY TC_STRING '}' { zend_ini_get_var(&$$, &$2); free($2.value.str.val); } -; - -expr: - var_string_list { $$ = $1; } - | expr '|' expr { zend_ini_do_op('|', &$$, &$1, &$3); } - | expr '&' expr { zend_ini_do_op('&', &$$, &$1, &$3); } - | '~' expr { zend_ini_do_op('~', &$$, &$2, NULL); } - | '!' expr { zend_ini_do_op('!', &$$, &$2, NULL); } - | '(' expr ')' { $$ = $2; } -; - -constant_string: - TC_STRING { zend_ini_get_constant(&$$, &$1); } -; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_ini_scanner.h b/Zend/zend_ini_scanner.h deleted file mode 100644 index 95499f0722..0000000000 --- a/Zend/zend_ini_scanner.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef _ZEND_INI_SCANNER_H -#define _ZEND_INI_SCANNER_H - -BEGIN_EXTERN_C() -int zend_ini_scanner_get_lineno(TSRMLS_D); -char *zend_ini_scanner_get_filename(TSRMLS_D); -int zend_ini_open_file_for_scanning(zend_file_handle *fh TSRMLS_DC); -int zend_ini_prepare_string_for_scanning(char *str TSRMLS_DC); -void zend_ini_close_file(zend_file_handle *fh TSRMLS_DC); -int ini_lex(zval *ini_lval TSRMLS_DC); -END_EXTERN_C() - -#endif /* _ZEND_INI_SCANNER_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_ini_scanner.l b/Zend/zend_ini_scanner.l deleted file mode 100644 index e2740261d6..0000000000 --- a/Zend/zend_ini_scanner.l +++ /dev/null @@ -1,253 +0,0 @@ -%{ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#define yyleng SCNG(yy_leng) -#define yytext SCNG(yy_text) -#define yytext_ptr SCNG(yy_text) -#define yyin SCNG(yy_in) -#define yyout SCNG(yy_out) -#define yy_last_accepting_state SCNG(_yy_last_accepting_state) -#define yy_last_accepting_cpos SCNG(_yy_last_accepting_cpos) -#define yy_more_flag SCNG(_yy_more_flag) -#define yy_more_len SCNG(_yy_more_len) - -#include -#include "zend.h" -#include "zend_globals.h" -#include -#include "zend_ini_scanner.h" - -#undef YYSTYPE -#define YYSTYPE zval - -#define YY_DECL int ini_lex(zval *ini_lval TSRMLS_DC) - -/* Globals Macros */ -#define SCNG INI_SCNG -#ifdef ZTS -ZEND_API ts_rsrc_id ini_scanner_globals_id; -#else -ZEND_API zend_scanner_globals ini_scanner_globals; -#endif - - -static char *ini_filename; - -void init_ini_scanner(TSRMLS_D) -{ - SCNG(lineno)=1; -} - - -int zend_ini_scanner_get_lineno(TSRMLS_D) -{ - return SCNG(lineno); -} - - -char *zend_ini_scanner_get_filename(TSRMLS_D) -{ - return ini_filename; -} - - -int zend_ini_open_file_for_scanning(zend_file_handle *fh TSRMLS_DC) -{ - if (FAILURE == zend_stream_fixup(fh TSRMLS_CC)) { - return FAILURE; - } - - init_ini_scanner(TSRMLS_C); - yyin = fh; - yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE TSRMLS_CC) TSRMLS_CC); - ini_filename = fh->filename; - return SUCCESS; -} - - -int zend_ini_prepare_string_for_scanning(char *str TSRMLS_DC) -{ - int len = strlen(str); - - yyin = NULL; - yy_scan_buffer(str, len + 2 TSRMLS_CC); - ini_filename = NULL; - return SUCCESS; -} - - -void zend_ini_close_file(zend_file_handle *fh TSRMLS_DC) -{ - zend_stream_close(fh); -} - -%} - -NEWLINE ("\r"|"\n"|"\r\n") - -%option noyywrap -%option never-interactive - -%% - -[ ]*[\[][ ]*[\]][ ]* { - return BRACK; -} - -[ ]*("true"|"on"|"yes")[ ]* { - ini_lval->value.str.val = zend_strndup("1", 1); - ini_lval->value.str.len = 1; - ini_lval->type = IS_STRING; - return CFG_TRUE; -} - - -[ ]*("false"|"off"|"no"|"none")[ ]* { - ini_lval->value.str.val = zend_strndup("", 0); - ini_lval->value.str.len = 0; - ini_lval->type = IS_STRING; - return CFG_FALSE; -} - -[[][^\]\n]+[\]][ ]*{NEWLINE}? { - /* SECTION */ - - /* eat trailing ] and spaces */ - while (yyleng>0 && (yytext[yyleng-1]=='\n' || yytext[yyleng-1]=='\r' || yytext[yyleng-1]==']' || yytext[yyleng-1]==' ')) { - yyleng--; - yytext[yyleng]=0; - } - - SCNG(lineno)++; - - /* eat leading [ */ - yytext++; - yyleng--; - - ini_lval->value.str.val = zend_strndup(yytext, yyleng); - ini_lval->value.str.len = yyleng; - ini_lval->type = IS_STRING; - return SECTION; -} - - -["][^"]*["] { - char *p = yytext; - - /* ENCAPSULATED TC_STRING */ - - while ((p = strpbrk(p, "\r\n"))) { - if (*p == '\r' && *(p + 1) == '\n') { - p++; - } - SCNG(lineno)++; - p++; - } - - /* eat trailing " */ - yytext[yyleng-1]=0; - - /* eat leading " */ - yytext++; - - ini_lval->value.str.val = zend_strndup(yytext, yyleng - 2); - ini_lval->value.str.len = yyleng - 2; - ini_lval->type = IS_STRING; - return TC_ENCAPSULATED_STRING; -} - -[&|~$(){}!] { - return yytext[0]; -} - -"${" { - return TC_DOLLAR_CURLY; -} - -"}" { - ini_lval->value.lval = (long) yytext[0]; - return yytext[0]; -} - -[^=\n\r\t;|&$~(){}!"\[]+ { - /* STRING */ - register int i; - - /* eat trailing whitespace */ - for (i=yyleng-1; i>=0; i--) { - if (yytext[i]==' ' || yytext[i]=='\t') { - yytext[i]=0; - yyleng--; - } else { - break; - } - } - /* eat leading whitespace */ - while (yytext[0]) { - if (yytext[0]==' ' || yytext[0]=='\t') { - yytext++; - yyleng--; - } else { - break; - } - } - if (yyleng!=0) { - ini_lval->value.str.val = zend_strndup(yytext, yyleng); - ini_lval->value.str.len = yyleng; - ini_lval->type = IS_STRING; - return TC_STRING; - } else { - /* whitespace */ - } -} - -[=\n] { - if (yytext[0] == '\n') { - SCNG(lineno)++; - } - return yytext[0]; -} - -{NEWLINE} { - SCNG(lineno)++; - return '\n'; -} - -[;][^\r\n]*{NEWLINE}? { - /* comment */ - SCNG(lineno)++; - return '\n'; -} - -[ \t] { - /* eat whitespace */ -} - -. { -#if DEBUG - php_error(E_NOTICE,"Unexpected character on line %d: '%s' (ASCII %d)\n", yylineno, yytext, yytext[0]); -#endif -} - -<> { - yy_delete_buffer(YY_CURRENT_BUFFER TSRMLS_CC); - yyterminate(); -} diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c deleted file mode 100755 index c5badb1a6c..0000000000 --- a/Zend/zend_interfaces.c +++ /dev/null @@ -1,566 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_API.h" -#include "zend_interfaces.h" -#include "zend_exceptions.h" - -ZEND_API zend_class_entry *zend_ce_traversable; -ZEND_API zend_class_entry *zend_ce_aggregate; -ZEND_API zend_class_entry *zend_ce_iterator; -ZEND_API zend_class_entry *zend_ce_arrayaccess; -ZEND_API zend_class_entry *zend_ce_serializable; - -/* {{{ zend_call_method - Only returns the returned zval if retval_ptr != NULL */ -ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, char *function_name, int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC) -{ - int result; - zend_fcall_info fci; - zval z_fname; - zval *retval; - HashTable *function_table; - - zval **params[2]; - - params[0] = &arg1; - params[1] = &arg2; - - fci.size = sizeof(fci); - /*fci.function_table = NULL; will be read form zend_class_entry of object if needed */ - fci.object_pp = object_pp; - fci.function_name = &z_fname; - fci.retval_ptr_ptr = retval_ptr_ptr ? retval_ptr_ptr : &retval; - fci.param_count = param_count; - fci.params = params; - fci.no_separation = 1; - fci.symbol_table = NULL; - - if (!fn_proxy && !obj_ce) { - /* no interest in caching and no information already present that is - * needed later inside zend_call_function. */ - ZVAL_STRINGL(&z_fname, function_name, function_name_len, 0); - fci.function_table = !object_pp ? EG(function_table) : NULL; - result = zend_call_function(&fci, NULL TSRMLS_CC); - } else { - zend_fcall_info_cache fcic; - - fcic.initialized = 1; - if (!obj_ce) { - obj_ce = object_pp ? Z_OBJCE_PP(object_pp) : NULL; - } - if (obj_ce) { - function_table = &obj_ce->function_table; - } else { - function_table = EG(function_table); - } - if (!fn_proxy || !*fn_proxy) { - if (zend_hash_find(function_table, function_name, function_name_len+1, (void **) &fcic.function_handler) == FAILURE) { - /* error at c-level */ - zend_error(E_CORE_ERROR, "Couldn't find implementation for method %s%s%s", obj_ce ? obj_ce->name : "", obj_ce ? "::" : "", function_name); - } - if (fn_proxy) { - *fn_proxy = fcic.function_handler; - } - } else { - fcic.function_handler = *fn_proxy; - } - fcic.calling_scope = obj_ce; - fcic.object_pp = object_pp; - result = zend_call_function(&fci, &fcic TSRMLS_CC); - } - if (result == FAILURE) { - /* error at c-level */ - if (!obj_ce) { - obj_ce = object_pp ? Z_OBJCE_PP(object_pp) : NULL; - } - if (!EG(exception)) { - zend_error(E_CORE_ERROR, "Couldn't execute method %s%s%s", obj_ce ? obj_ce->name : "", obj_ce ? "::" : "", function_name); - } - } - if (!retval_ptr_ptr) { - if (retval) { - zval_ptr_dtor(&retval); - } - return NULL; - } - return *retval_ptr_ptr; -} -/* }}} */ - -/* iterator interface, c-level functions used by engine */ - -/* {{{ zend_user_it_new_iterator */ -ZEND_API zval *zend_user_it_new_iterator(zend_class_entry *ce, zval *object TSRMLS_DC) -{ - zval *retval; - - return zend_call_method_with_0_params(&object, ce, &ce->iterator_funcs.zf_new_iterator, "getiterator", &retval); - -} -/* }}} */ - -/* {{{ zend_user_it_dtor */ -ZEND_API void zend_user_it_invalidate_current(zend_object_iterator *_iter TSRMLS_DC) -{ - zend_user_iterator *iter = (zend_user_iterator*)_iter; - - if (iter->value) { - zval_ptr_dtor(&iter->value); - iter->value = NULL; - } -} -/* }}} */ - -/* {{{ zend_user_it_dtor */ -static void zend_user_it_dtor(zend_object_iterator *_iter TSRMLS_DC) -{ - zend_user_iterator *iter = (zend_user_iterator*)_iter; - zval *object = (zval*)iter->it.data; - - zend_user_it_invalidate_current(_iter TSRMLS_CC); - zval_ptr_dtor(&object); - efree(iter); -} -/* }}} */ - -/* {{{ zend_user_it_valid */ -ZEND_API int zend_user_it_valid(zend_object_iterator *_iter TSRMLS_DC) -{ - if (_iter) { - zend_user_iterator *iter = (zend_user_iterator*)_iter; - zval *object = (zval*)iter->it.data; - zval *more; - int result; - - zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_valid, "valid", &more); - if (more) { - result = i_zend_is_true(more); - zval_ptr_dtor(&more); - return result ? SUCCESS : FAILURE; - } - } - return FAILURE; -} -/* }}} */ - -/* {{{ zend_user_it_get_current_data */ -ZEND_API void zend_user_it_get_current_data(zend_object_iterator *_iter, zval ***data TSRMLS_DC) -{ - zend_user_iterator *iter = (zend_user_iterator*)_iter; - zval *object = (zval*)iter->it.data; - - if (!iter->value) { - zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_current, "current", &iter->value); - } - *data = &iter->value; -} -/* }}} */ - -/* {{{ zend_user_it_get_current_key_default */ -#if 0 -static int zend_user_it_get_current_key_default(zend_object_iterator *_iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) -{ - *int_key = _iter->index; - return HASH_KEY_IS_LONG; -} -#endif -/* }}} */ - -/* {{{ zend_user_it_get_current_key */ -ZEND_API int zend_user_it_get_current_key(zend_object_iterator *_iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC) -{ - zend_user_iterator *iter = (zend_user_iterator*)_iter; - zval *object = (zval*)iter->it.data; - zval *retval; - - zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_key, "key", &retval); - - if (!retval) { - *int_key = 0; - if (!EG(exception)) - { - zend_error(E_WARNING, "Nothing returned from %s::key()", iter->ce->name); - } - return HASH_KEY_IS_LONG; - } - switch (Z_TYPE_P(retval)) { - default: - zend_error(E_WARNING, "Illegal type returned from %s::key()", iter->ce->name); - case IS_NULL: - *int_key = 0; - zval_ptr_dtor(&retval); - return HASH_KEY_IS_LONG; - - case IS_STRING: - *str_key = estrndup(Z_STRVAL_P(retval), Z_STRLEN_P(retval)); - *str_key_len = Z_STRLEN_P(retval)+1; - zval_ptr_dtor(&retval); - return HASH_KEY_IS_STRING; - - case IS_DOUBLE: - *int_key = (long)Z_DVAL_P(retval); - zval_ptr_dtor(&retval); - return HASH_KEY_IS_LONG; - - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - *int_key = (long)Z_LVAL_P(retval); - zval_ptr_dtor(&retval); - return HASH_KEY_IS_LONG; - } -} -/* }}} */ - -/* {{{ zend_user_it_move_forward */ -ZEND_API void zend_user_it_move_forward(zend_object_iterator *_iter TSRMLS_DC) -{ - zend_user_iterator *iter = (zend_user_iterator*)_iter; - zval *object = (zval*)iter->it.data; - - zend_user_it_invalidate_current(_iter TSRMLS_CC); - zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_next, "next", NULL); -} -/* }}} */ - -/* {{{ zend_user_it_rewind */ -ZEND_API void zend_user_it_rewind(zend_object_iterator *_iter TSRMLS_DC) -{ - zend_user_iterator *iter = (zend_user_iterator*)_iter; - zval *object = (zval*)iter->it.data; - - zend_user_it_invalidate_current(_iter TSRMLS_CC); - zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_rewind, "rewind", NULL); -} -/* }}} */ - -zend_object_iterator_funcs zend_interface_iterator_funcs_iterator = { - zend_user_it_dtor, - zend_user_it_valid, - zend_user_it_get_current_data, - zend_user_it_get_current_key, - zend_user_it_move_forward, - zend_user_it_rewind, - zend_user_it_invalidate_current -}; - -/* {{{ zend_user_it_get_iterator */ -static zend_object_iterator *zend_user_it_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) -{ - zend_user_iterator *iterator; - - if (by_ref) { - zend_error(E_ERROR, "An iterator cannot be used with foreach by reference"); - } - - iterator = emalloc(sizeof(zend_user_iterator)); - - object->refcount++; - iterator->it.data = (void*)object; - iterator->it.funcs = ce->iterator_funcs.funcs; - iterator->ce = Z_OBJCE_P(object); - iterator->value = NULL; - return (zend_object_iterator*)iterator; -} -/* }}} */ - -/* {{{ zend_user_it_get_new_iterator */ -ZEND_API zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) -{ - zval *iterator = zend_user_it_new_iterator(ce, object TSRMLS_CC); - zend_object_iterator *new_iterator; - - zend_class_entry *ce_it = iterator && Z_TYPE_P(iterator) == IS_OBJECT ? Z_OBJCE_P(iterator) : NULL; - - if (!ce_it || !ce_it->get_iterator || (ce_it->get_iterator == zend_user_it_get_new_iterator && iterator == object)) { - if (!EG(exception)) { - zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Objects returned by %s::getIterator() must be traversable or implement interface Iterator", ce ? ce->name : Z_OBJCE_P(object)->name); - } - if (iterator) { - zval_ptr_dtor(&iterator); - } - return NULL; - } - - new_iterator = ce_it->get_iterator(ce_it, iterator, by_ref TSRMLS_CC); - zval_ptr_dtor(&iterator); - return new_iterator; -} -/* }}} */ - -/* {{{ zend_implement_traversable */ -static int zend_implement_traversable(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) -{ - /* check that class_type is traversable at c-level or implements at least one of 'aggregate' and 'Iterator' */ - zend_uint i; - - if (class_type->get_iterator || (class_type->parent && class_type->parent->get_iterator)) { - return SUCCESS; - } - for (i = 0; i < class_type->num_interfaces; i++) { - if (class_type->interfaces[i] == zend_ce_aggregate || class_type->interfaces[i] == zend_ce_iterator) { - return SUCCESS; - } - } - zend_error(E_CORE_ERROR, "Class %s must implement interface %s as part of either %s or %s", - class_type->name, - zend_ce_traversable->name, - zend_ce_iterator->name, - zend_ce_aggregate->name); - return FAILURE; -} -/* }}} */ - -/* {{{ zend_implement_aggregate */ -static int zend_implement_aggregate(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) -{ - int i, t = -1; - - if (class_type->get_iterator) { - if (class_type->type == ZEND_INTERNAL_CLASS) { - /* inheritance ensures the class has necessary userland methods */ - return SUCCESS; - } else if (class_type->get_iterator != zend_user_it_get_new_iterator) { - /* c-level get_iterator cannot be changed (exception being only Traversable is implmented) */ - if (class_type->num_interfaces) { - for (i = 0; i < class_type->num_interfaces; i++) { - if (class_type->interfaces[i] == zend_ce_iterator) { - return FAILURE; - } - if (class_type->interfaces[i] == zend_ce_traversable) { - t = i; - } - } - } - if (t == -1) { - return FAILURE; - } - } - } - class_type->iterator_funcs.zf_new_iterator = NULL; - class_type->get_iterator = zend_user_it_get_new_iterator; - return SUCCESS; -} -/* }}} */ - -/* {{{ zend_implement_iterator */ -static int zend_implement_iterator(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) -{ - if (class_type->get_iterator && class_type->get_iterator != zend_user_it_get_iterator) { - if (class_type->type == ZEND_INTERNAL_CLASS) { - /* inheritance ensures the class has the necessary userland methods */ - return SUCCESS; - } else if (class_type->get_iterator != zend_user_it_get_new_iterator) { - /* c-level get_iterator cannot be changed */ - return FAILURE; - } - } - class_type->get_iterator = zend_user_it_get_iterator; - class_type->iterator_funcs.zf_valid = NULL; - class_type->iterator_funcs.zf_current = NULL; - class_type->iterator_funcs.zf_key = NULL; - class_type->iterator_funcs.zf_next = NULL; - class_type->iterator_funcs.zf_rewind = NULL; - if (!class_type->iterator_funcs.funcs) { - class_type->iterator_funcs.funcs = &zend_interface_iterator_funcs_iterator; - } - return SUCCESS; -} -/* }}} */ - -/* {{{ zend_implement_arrayaccess */ -static int zend_implement_arrayaccess(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) -{ -#if 0 - /* get ht from ce */ - if (ht->read_dimension != zend_std_read_dimension - || ht->write_dimension != zend_std_write_dimension - || ht->has_dimension != zend_std_has_dimension - || ht->unset_dimension != zend_std_unset_dimension) { - return FAILURE; - } -#endif - return SUCCESS; -} -/* }}}*/ - -/* {{{ zend_user_serialize */ -int zend_user_serialize(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC) -{ - zend_class_entry * ce = Z_OBJCE_P(object); - zval *retval; - int result; - - zend_call_method_with_0_params(&object, ce, &ce->serialize_func, "serialize", &retval); - - - if (!retval || EG(exception)) { - result = FAILURE; - } else { - switch(Z_TYPE_P(retval)) { - case IS_NULL: - /* we could also make this '*buf_len = 0' but this allows to skip variables */ - zval_ptr_dtor(&retval); - return FAILURE; - case IS_STRING: - *buffer = estrndup(Z_STRVAL_P(retval), Z_STRLEN_P(retval)); - *buf_len = Z_STRLEN_P(retval); - result = SUCCESS; - break; - default: /* failure */ - result = FAILURE; - break; - } - zval_ptr_dtor(&retval); - } - - if (result == FAILURE) { - zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "%s::serialize() must return a string or NULL", ce->name); - } - return result; -} -/* }}} */ - -/* {{{ zend_user_unserialize */ -int zend_user_unserialize(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC) -{ - zval * zdata; - - object_init_ex(*object, ce); - - MAKE_STD_ZVAL(zdata); - ZVAL_STRINGL(zdata, (char*)buf, buf_len, 1); - - zend_call_method_with_1_params(object, ce, &ce->unserialize_func, "unserialize", NULL, zdata); - - zval_ptr_dtor(&zdata); - - if (EG(exception)) { - return FAILURE; - } else { - return SUCCESS; - } -} -/* }}} */ - -/* {{{ zend_implement_serializable */ -static int zend_implement_serializable(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) -{ - if ((class_type->serialize && class_type->serialize != zend_user_serialize) - || (class_type->unserialize && class_type->unserialize != zend_user_unserialize) - ) { - return FAILURE; - } - class_type->serialize = zend_user_serialize; - class_type->unserialize = zend_user_unserialize; - return SUCCESS; -} -/* }}}*/ - -/* {{{ function tables */ -zend_function_entry zend_funcs_aggregate[] = { - ZEND_ABSTRACT_ME(iterator, getIterator, NULL) - {NULL, NULL, NULL} -}; - -zend_function_entry zend_funcs_iterator[] = { - ZEND_ABSTRACT_ME(iterator, current, NULL) - ZEND_ABSTRACT_ME(iterator, next, NULL) - ZEND_ABSTRACT_ME(iterator, key, NULL) - ZEND_ABSTRACT_ME(iterator, valid, NULL) - ZEND_ABSTRACT_ME(iterator, rewind, NULL) - {NULL, NULL, NULL} -}; - -zend_function_entry *zend_funcs_traversable = NULL; - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_arrayaccess_offset, 0, 0, 1) - ZEND_ARG_INFO(0, offset) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_arrayaccess_offset_get, 0, 0, 1) /* actually this should be return by ref but atm cannot be */ - ZEND_ARG_INFO(0, offset) -ZEND_END_ARG_INFO(); - -static -ZEND_BEGIN_ARG_INFO_EX(arginfo_arrayaccess_offset_value, 0, 0, 2) - ZEND_ARG_INFO(0, offset) - ZEND_ARG_INFO(0, value) -ZEND_END_ARG_INFO(); - -zend_function_entry zend_funcs_arrayaccess[] = { - ZEND_ABSTRACT_ME(arrayaccess, offsetExists, arginfo_arrayaccess_offset) - ZEND_ABSTRACT_ME(arrayaccess, offsetGet, arginfo_arrayaccess_offset_get) - ZEND_ABSTRACT_ME(arrayaccess, offsetSet, arginfo_arrayaccess_offset_value) - ZEND_ABSTRACT_ME(arrayaccess, offsetUnset, arginfo_arrayaccess_offset) - {NULL, NULL, NULL} -}; - -static -ZEND_BEGIN_ARG_INFO(arginfo_serializable_serialize, 0) - ZEND_ARG_INFO(0, serialized) -ZEND_END_ARG_INFO(); - -zend_function_entry zend_funcs_serializable[] = { - ZEND_ABSTRACT_ME(serializable, serialize, NULL) - ZEND_FENTRY(unserialize, NULL, arginfo_serializable_serialize, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT|ZEND_ACC_CTOR) - {NULL, NULL, NULL} -}; -/* }}} */ - -#define REGISTER_ITERATOR_INTERFACE(class_name, class_name_str) \ - {\ - zend_class_entry ce;\ - INIT_CLASS_ENTRY(ce, # class_name_str, zend_funcs_ ## class_name) \ - zend_ce_ ## class_name = zend_register_internal_interface(&ce TSRMLS_CC);\ - zend_ce_ ## class_name->interface_gets_implemented = zend_implement_ ## class_name;\ - } - -#define REGISTER_ITERATOR_IMPLEMENT(class_name, interface_name) \ - zend_class_implements(zend_ce_ ## class_name TSRMLS_CC, 1, zend_ce_ ## interface_name) - -/* {{{ zend_register_interfaces */ -ZEND_API void zend_register_interfaces(TSRMLS_D) -{ - REGISTER_ITERATOR_INTERFACE(traversable, Traversable); - - REGISTER_ITERATOR_INTERFACE(aggregate, IteratorAggregate); - REGISTER_ITERATOR_IMPLEMENT(aggregate, traversable); - - REGISTER_ITERATOR_INTERFACE(iterator, Iterator); - REGISTER_ITERATOR_IMPLEMENT(iterator, traversable); - - REGISTER_ITERATOR_INTERFACE(arrayaccess, ArrayAccess); - - REGISTER_ITERATOR_INTERFACE(serializable, Serializable) -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_interfaces.h b/Zend/zend_interfaces.h deleted file mode 100755 index 81cadfb907..0000000000 --- a/Zend/zend_interfaces.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_INTERFACES_H -#define ZEND_INTERFACES_H - -#include "zend.h" -#include "zend_API.h" - -BEGIN_EXTERN_C() - -extern ZEND_API zend_class_entry *zend_ce_traversable; -extern ZEND_API zend_class_entry *zend_ce_aggregate; -extern ZEND_API zend_class_entry *zend_ce_iterator; -extern ZEND_API zend_class_entry *zend_ce_arrayaccess; -extern ZEND_API zend_class_entry *zend_ce_serializable; - -typedef struct _zend_user_iterator { - zend_object_iterator it; - zend_class_entry *ce; - zval *value; -} zend_user_iterator; - -ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, char *function_name, int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC); - -#define zend_call_method_with_0_params(obj, obj_ce, fn_proxy, function_name, retval) \ - zend_call_method(obj, obj_ce, fn_proxy, function_name, sizeof(function_name)-1, retval, 0, NULL, NULL TSRMLS_CC) - -#define zend_call_method_with_1_params(obj, obj_ce, fn_proxy, function_name, retval, arg1) \ - zend_call_method(obj, obj_ce, fn_proxy, function_name, sizeof(function_name)-1, retval, 1, arg1, NULL TSRMLS_CC) - -#define zend_call_method_with_2_params(obj, obj_ce, fn_proxy, function_name, retval, arg1, arg2) \ - zend_call_method(obj, obj_ce, fn_proxy, function_name, sizeof(function_name)-1, retval, 2, arg1, arg2 TSRMLS_CC) - -ZEND_API void zend_user_it_rewind(zend_object_iterator *_iter TSRMLS_DC); -ZEND_API int zend_user_it_valid(zend_object_iterator *_iter TSRMLS_DC); -ZEND_API int zend_user_it_get_current_key(zend_object_iterator *_iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC); -ZEND_API void zend_user_it_get_current_data(zend_object_iterator *_iter, zval ***data TSRMLS_DC); -ZEND_API void zend_user_it_move_forward(zend_object_iterator *_iter TSRMLS_DC); -ZEND_API void zend_user_it_invalidate_current(zend_object_iterator *_iter TSRMLS_DC); - -ZEND_API zval *zend_user_it_new_iterator(zend_class_entry *ce, zval *object TSRMLS_DC); -ZEND_API zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC); - -ZEND_API void zend_register_interfaces(TSRMLS_D); - -END_EXTERN_C() - -#endif /* ZEND_INTERFACES_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_istdiostream.h b/Zend/zend_istdiostream.h deleted file mode 100644 index 0337305629..0000000000 --- a/Zend/zend_istdiostream.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef _ZEND_STDIOSTREAM -#define _ZEND_STDIOSTREAM - -#if defined(ZTS) && !defined(HAVE_CLASS_ISTDIOSTREAM) -class istdiostream : public istream -{ -private: - stdiobuf _file; -public: - istdiostream (FILE* __f) : istream(), _file(__f) { init(&_file); } - stdiobuf* rdbuf()/* const */ { return &_file; } -}; -#endif - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_iterators.c b/Zend/zend_iterators.c deleted file mode 100755 index 8baa3ce3a9..0000000000 --- a/Zend/zend_iterators.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - | Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_API.h" - -static zend_class_entry zend_iterator_class_entry; - -static zend_object_handlers iterator_object_handlers = { - ZEND_OBJECTS_STORE_HANDLERS, - NULL, /* prop read */ - NULL, /* prop write */ - NULL, /* read dim */ - NULL, /* write dim */ - NULL, - NULL, /* get */ - NULL, /* set */ - NULL, /* has prop */ - NULL, /* unset prop */ - NULL, /* has dim */ - NULL, /* unset dim */ - NULL, /* props get */ - NULL, /* method get */ - NULL, /* call */ - NULL, /* get ctor */ - NULL, /* get_ce */ - NULL, /* get class name */ - NULL, /* compare */ - NULL, /* cast */ - NULL /* count */ -}; - -ZEND_API void zend_register_iterator_wrapper(TSRMLS_D) -{ - INIT_CLASS_ENTRY(zend_iterator_class_entry, "__iterator_wrapper", NULL); - free(zend_iterator_class_entry.name); - zend_iterator_class_entry.name = "__iterator_wrapper"; -} - -static void iter_wrapper_dtor(void *object, zend_object_handle handle TSRMLS_DC) -{ - zend_object_iterator *iter = (zend_object_iterator*)object; - iter->funcs->dtor(iter TSRMLS_CC); -} - -ZEND_API zval *zend_iterator_wrap(zend_object_iterator *iter TSRMLS_DC) -{ - zval *wrapped; - - MAKE_STD_ZVAL(wrapped); - Z_TYPE_P(wrapped) = IS_OBJECT; - Z_OBJ_HANDLE_P(wrapped) = zend_objects_store_put(iter, iter_wrapper_dtor, NULL, NULL TSRMLS_CC); - Z_OBJ_HT_P(wrapped) = &iterator_object_handlers; - - return wrapped; -} - -ZEND_API enum zend_object_iterator_kind zend_iterator_unwrap( - zval *array_ptr, zend_object_iterator **iter TSRMLS_DC) -{ - switch (Z_TYPE_P(array_ptr)) { - case IS_OBJECT: - if (Z_OBJ_HT_P(array_ptr) == &iterator_object_handlers) { - *iter = (zend_object_iterator *)zend_object_store_get_object(array_ptr TSRMLS_CC); - return ZEND_ITER_OBJECT; - } - if (HASH_OF(array_ptr)) { - return ZEND_ITER_PLAIN_OBJECT; - } - return ZEND_ITER_INVALID; - - case IS_ARRAY: - if (HASH_OF(array_ptr)) { - return ZEND_ITER_PLAIN_ARRAY; - } - return ZEND_ITER_INVALID; - - default: - return ZEND_ITER_INVALID; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_iterators.h b/Zend/zend_iterators.h deleted file mode 100755 index 664e2ca42a..0000000000 --- a/Zend/zend_iterators.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong | - | Marcus Boerger | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* These iterators were designed to operate within the foreach() - * structures provided by the engine, but could be extended for use - * with other iterative engine opcodes. - * These methods have similar semantics to the zend_hash API functions - * with similar names. - * */ - -typedef struct _zend_object_iterator zend_object_iterator; - -typedef struct _zend_object_iterator_funcs { - /* release all resources associated with this iterator instance */ - void (*dtor)(zend_object_iterator *iter TSRMLS_DC); - - /* check for end of iteration (FAILURE or SUCCESS if data is valid) */ - int (*valid)(zend_object_iterator *iter TSRMLS_DC); - - /* fetch the item data for the current element */ - void (*get_current_data)(zend_object_iterator *iter, zval ***data TSRMLS_DC); - - /* fetch the key for the current element (return HASH_KEY_IS_STRING or HASH_KEY_IS_LONG) (optional, may be NULL) */ - int (*get_current_key)(zend_object_iterator *iter, char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC); - - /* step forwards to next element */ - void (*move_forward)(zend_object_iterator *iter TSRMLS_DC); - - /* rewind to start of data (optional, may be NULL) */ - void (*rewind)(zend_object_iterator *iter TSRMLS_DC); - - /* invalidate current value/key (optional, may be NULL) */ - void (*invalidate_current)(zend_object_iterator *iter TSRMLS_DC); -} zend_object_iterator_funcs; - -struct _zend_object_iterator { - void *data; - zend_object_iterator_funcs *funcs; - ulong index; /* private to fe_reset/fe_fetch opcodes */ -}; - -typedef struct _zend_class_iterator_funcs { - zend_object_iterator_funcs *funcs; - union _zend_function *zf_new_iterator; - union _zend_function *zf_valid; - union _zend_function *zf_current; - union _zend_function *zf_key; - union _zend_function *zf_next; - union _zend_function *zf_rewind; -} zend_class_iterator_funcs; - -enum zend_object_iterator_kind { - ZEND_ITER_INVALID, - ZEND_ITER_PLAIN_ARRAY, - ZEND_ITER_PLAIN_OBJECT, - ZEND_ITER_OBJECT -}; - -BEGIN_EXTERN_C() -/* given a zval, returns stuff that can be used to iterate it. */ -ZEND_API enum zend_object_iterator_kind zend_iterator_unwrap(zval *array_ptr, zend_object_iterator **iter TSRMLS_DC); - -/* given an iterator, wrap it up as a zval for use by the engine opcodes */ -ZEND_API zval *zend_iterator_wrap(zend_object_iterator *iter TSRMLS_DC); - -ZEND_API void zend_register_iterator_wrapper(TSRMLS_D); -END_EXTERN_C() - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y deleted file mode 100644 index 679021013a..0000000000 --- a/Zend/zend_language_parser.y +++ /dev/null @@ -1,932 +0,0 @@ -%{ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* - * LALR shift/reduce conflicts and how they are resolved: - * - * - 2 shift/reduce conflicts due to the dangeling elseif/else ambiguity. Solved by shift. - * - 1 shift/reduce conflict due to arrays within encapsulated strings. Solved by shift. - * - 1 shift/reduce conflict due to objects within encapsulated strings. Solved by shift. - * - */ - - -#include "zend_compile.h" -#include "zend.h" -#include "zend_list.h" -#include "zend_globals.h" -#include "zend_API.h" -#include "zend_constants.h" - - -#define YYERROR_VERBOSE -#define YYSTYPE znode -#ifdef ZTS -# define YYPARSE_PARAM tsrm_ls -# define YYLEX_PARAM tsrm_ls -#endif - - -%} - -%pure_parser -%expect 4 - -%left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE -%left ',' -%left T_LOGICAL_OR -%left T_LOGICAL_XOR -%left T_LOGICAL_AND -%right T_PRINT -%left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL T_XOR_EQUAL T_SL_EQUAL T_SR_EQUAL -%left '?' ':' -%left T_BOOLEAN_OR -%left T_BOOLEAN_AND -%left '|' -%left '^' -%left '&' -%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL -%nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL -%left T_SL T_SR -%left '+' '-' '.' -%left '*' '/' '%' -%right '!' -%nonassoc T_INSTANCEOF -%right '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@' -%right '[' -%nonassoc T_NEW T_CLONE -%token T_EXIT -%token T_IF -%left T_ELSEIF -%left T_ELSE -%left T_ENDIF -%token T_LNUMBER -%token T_DNUMBER -%token T_STRING -%token T_STRING_VARNAME -%token T_VARIABLE -%token T_NUM_STRING -%token T_INLINE_HTML -%token T_CHARACTER -%token T_BAD_CHARACTER -%token T_ENCAPSED_AND_WHITESPACE -%token T_CONSTANT_ENCAPSED_STRING -%token T_ECHO -%token T_DO -%token T_WHILE -%token T_ENDWHILE -%token T_FOR -%token T_ENDFOR -%token T_FOREACH -%token T_ENDFOREACH -%token T_DECLARE -%token T_ENDDECLARE -%token T_AS -%token T_SWITCH -%token T_ENDSWITCH -%token T_CASE -%token T_DEFAULT -%token T_BREAK -%token T_CONTINUE -%token T_FUNCTION -%token T_CONST -%token T_RETURN -%token T_TRY -%token T_CATCH -%token T_THROW -%token T_USE -%token T_GLOBAL -%right T_STATIC T_ABSTRACT T_FINAL T_PRIVATE T_PROTECTED T_PUBLIC -%token T_VAR -%token T_UNSET -%token T_ISSET -%token T_EMPTY -%token T_HALT_COMPILER -%token T_CLASS -%token T_INTERFACE -%token T_EXTENDS -%token T_IMPLEMENTS -%token T_OBJECT_OPERATOR -%token T_DOUBLE_ARROW -%token T_LIST -%token T_ARRAY -%token T_CLASS_C -%token T_METHOD_C -%token T_FUNC_C -%token T_LINE -%token T_FILE -%token T_COMMENT -%token T_DOC_COMMENT -%token T_OPEN_TAG -%token T_OPEN_TAG_WITH_ECHO -%token T_CLOSE_TAG -%token T_WHITESPACE -%token T_START_HEREDOC -%token T_END_HEREDOC -%token T_DOLLAR_OPEN_CURLY_BRACES -%token T_CURLY_OPEN -%token T_PAAMAYIM_NEKUDOTAYIM - -%% /* Rules */ - -start: - top_statement_list -; - -top_statement_list: - top_statement_list { zend_do_extended_info(TSRMLS_C); } top_statement { HANDLE_INTERACTIVE(); } - | /* empty */ -; - - -top_statement: - statement - | function_declaration_statement { zend_do_early_binding(TSRMLS_C); } - | class_declaration_statement { zend_do_early_binding(TSRMLS_C); } - | T_HALT_COMPILER '(' ')' ';' { REGISTER_MAIN_LONG_CONSTANT("__COMPILER_HALT_OFFSET__", zend_get_scanned_file_offset(TSRMLS_C), CONST_CS); YYACCEPT; } -; - - -inner_statement_list: - inner_statement_list { zend_do_extended_info(TSRMLS_C); } inner_statement { HANDLE_INTERACTIVE(); } - | /* empty */ -; - - -inner_statement: - statement - | function_declaration_statement - | class_declaration_statement - | T_HALT_COMPILER '(' ')' ';' { zend_error(E_COMPILE_ERROR, "__HALT_COMPILER() can only be used from the outermost scope"); } -; - - -statement: - unticked_statement { zend_do_ticks(TSRMLS_C); } -; - -unticked_statement: - '{' inner_statement_list '}' - | T_IF '(' expr ')' { zend_do_if_cond(&$3, &$4 TSRMLS_CC); } statement { zend_do_if_after_statement(&$4, 1 TSRMLS_CC); } elseif_list else_single { zend_do_if_end(TSRMLS_C); } - | T_IF '(' expr ')' ':' { zend_do_if_cond(&$3, &$4 TSRMLS_CC); } inner_statement_list { zend_do_if_after_statement(&$4, 1 TSRMLS_CC); } new_elseif_list new_else_single T_ENDIF ';' { zend_do_if_end(TSRMLS_C); } - | T_WHILE '(' { $1.u.opline_num = get_next_op_number(CG(active_op_array)); } expr ')' { zend_do_while_cond(&$4, &$5 TSRMLS_CC); } while_statement { zend_do_while_end(&$1, &$5 TSRMLS_CC); } - | T_DO { $1.u.opline_num = get_next_op_number(CG(active_op_array)); zend_do_do_while_begin(TSRMLS_C); } statement T_WHILE '(' { $5.u.opline_num = get_next_op_number(CG(active_op_array)); } expr ')' ';' { zend_do_do_while_end(&$1, &$5, &$7 TSRMLS_CC); } - | T_FOR - '(' - for_expr - ';' { zend_do_free(&$3 TSRMLS_CC); $4.u.opline_num = get_next_op_number(CG(active_op_array)); } - for_expr - ';' { zend_do_extended_info(TSRMLS_C); zend_do_for_cond(&$6, &$7 TSRMLS_CC); } - for_expr - ')' { zend_do_free(&$9 TSRMLS_CC); zend_do_for_before_statement(&$4, &$7 TSRMLS_CC); } - for_statement { zend_do_for_end(&$7 TSRMLS_CC); } - | T_SWITCH '(' expr ')' { zend_do_switch_cond(&$3 TSRMLS_CC); } switch_case_list { zend_do_switch_end(&$6 TSRMLS_CC); } - | T_BREAK ';' { zend_do_brk_cont(ZEND_BRK, NULL TSRMLS_CC); } - | T_BREAK expr ';' { zend_do_brk_cont(ZEND_BRK, &$2 TSRMLS_CC); } - | T_CONTINUE ';' { zend_do_brk_cont(ZEND_CONT, NULL TSRMLS_CC); } - | T_CONTINUE expr ';' { zend_do_brk_cont(ZEND_CONT, &$2 TSRMLS_CC); } - | T_RETURN ';' { zend_do_return(NULL, 0 TSRMLS_CC); } - | T_RETURN expr_without_variable ';' { zend_do_return(&$2, 0 TSRMLS_CC); } - | T_RETURN variable ';' { zend_do_return(&$2, 1 TSRMLS_CC); } - | T_GLOBAL global_var_list ';' - | T_STATIC static_var_list ';' - | T_ECHO echo_expr_list ';' - | T_INLINE_HTML { zend_do_echo(&$1 TSRMLS_CC); } - | expr ';' { zend_do_free(&$1 TSRMLS_CC); } - | T_USE use_filename ';' { zend_error(E_COMPILE_ERROR,"use: Not yet supported. Please use include_once() or require_once()"); zval_dtor(&$2.u.constant); } - | T_UNSET '(' unset_variables ')' ';' - | T_FOREACH '(' variable { zend_do_foreach_begin(&$1, &$2, &$3, 1 TSRMLS_CC); } T_AS - { zend_do_foreach_fetch(&$1, &$2, &$5 TSRMLS_CC); } - foreach_variable foreach_optional_arg ')' { zend_do_foreach_cont(&$1, &$5, &$7, &$8 TSRMLS_CC); } - foreach_statement { zend_do_foreach_end(&$1, &$5 TSRMLS_CC); } - | T_FOREACH '(' expr_without_variable { zend_do_foreach_begin(&$1, &$2, &$3, 0 TSRMLS_CC); } T_AS - { zend_do_foreach_fetch(&$1, &$2, &$5 TSRMLS_CC); } - variable foreach_optional_arg ')' { zend_check_writable_variable(&$7); zend_do_foreach_cont(&$1, &$5, &$7, &$8 TSRMLS_CC); } - foreach_statement { zend_do_foreach_end(&$1, &$5 TSRMLS_CC); } - | T_DECLARE { $1.u.opline_num = get_next_op_number(CG(active_op_array)); zend_do_declare_begin(TSRMLS_C); } '(' declare_list ')' declare_statement { zend_do_declare_end(&$1 TSRMLS_CC); } - | ';' /* empty statement */ - | T_TRY { zend_do_try(&$1 TSRMLS_CC); } '{' inner_statement_list '}' - T_CATCH '(' { zend_initialize_try_catch_element(&$1 TSRMLS_CC); } - fully_qualified_class_name { zend_do_first_catch(&$7 TSRMLS_CC); } - T_VARIABLE ')' { zend_do_begin_catch(&$1, &$9, &$11, 1 TSRMLS_CC); } - '{' inner_statement_list '}' { zend_do_end_catch(&$1 TSRMLS_CC); } - additional_catches { zend_do_mark_last_catch(&$7, &$18 TSRMLS_CC); } - | T_THROW expr ';' { zend_do_throw(&$2 TSRMLS_CC); } -; - - -additional_catches: - non_empty_additional_catches { $$ = $1; } - | /* empty */ { $$.u.opline_num = -1; } -; - -non_empty_additional_catches: - additional_catch { $$ = $1; } - | non_empty_additional_catches additional_catch { $$ = $2; } -; - - -additional_catch: - T_CATCH '(' fully_qualified_class_name { $$.u.opline_num = get_next_op_number(CG(active_op_array)); } T_VARIABLE ')' { zend_do_begin_catch(&$1, &$3, &$5, 0 TSRMLS_CC); } '{' inner_statement_list '}' { zend_do_end_catch(&$1 TSRMLS_CC); } -; - - -unset_variables: - unset_variable - | unset_variables ',' unset_variable -; - -unset_variable: - variable { zend_do_end_variable_parse(BP_VAR_UNSET, 0 TSRMLS_CC); zend_do_unset(&$1 TSRMLS_CC); } -; - -use_filename: - T_CONSTANT_ENCAPSED_STRING { $$ = $1; } - | '(' T_CONSTANT_ENCAPSED_STRING ')' { $$ = $2; } -; - - -function_declaration_statement: - unticked_function_declaration_statement { zend_do_ticks(TSRMLS_C); } -; - -class_declaration_statement: - unticked_class_declaration_statement { zend_do_ticks(TSRMLS_C); } -; - - -is_reference: - /* empty */ { $$.op_type = ZEND_RETURN_VAL; } - | '&' { $$.op_type = ZEND_RETURN_REF; } -; - - -unticked_function_declaration_statement: - T_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { zend_do_begin_function_declaration(&$1, &$4, 0, $3.op_type, NULL TSRMLS_CC); } - '(' parameter_list ')' '{' inner_statement_list '}' { zend_do_end_function_declaration(&$1 TSRMLS_CC); } -; - -unticked_class_declaration_statement: - class_entry_type T_STRING extends_from - { zend_do_begin_class_declaration(&$1, &$2, &$3 TSRMLS_CC); } - implements_list - '{' - class_statement_list - '}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); } - | interface_entry T_STRING - { zend_do_begin_class_declaration(&$1, &$2, NULL TSRMLS_CC); } - interface_extends_list - '{' - class_statement_list - '}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); } -; - - -class_entry_type: - T_CLASS { $$.u.opline_num = CG(zend_lineno); $$.u.EA.type = 0; } - | T_ABSTRACT T_CLASS { $$.u.opline_num = CG(zend_lineno); $$.u.EA.type = ZEND_ACC_EXPLICIT_ABSTRACT_CLASS; } - | T_FINAL T_CLASS { $$.u.opline_num = CG(zend_lineno); $$.u.EA.type = ZEND_ACC_FINAL_CLASS; } -; - -extends_from: - /* empty */ { $$.op_type = IS_UNUSED; } - | T_EXTENDS fully_qualified_class_name { $$ = $2; } -; - -interface_entry: - T_INTERFACE { $$.u.opline_num = CG(zend_lineno); $$.u.EA.type = ZEND_ACC_INTERFACE; } -; - -interface_extends_list: - /* empty */ - | T_EXTENDS interface_list -; - -implements_list: - /* empty */ - | T_IMPLEMENTS interface_list -; - -interface_list: - fully_qualified_class_name { zend_do_implements_interface(&$1 TSRMLS_CC); } - | interface_list ',' fully_qualified_class_name { zend_do_implements_interface(&$3 TSRMLS_CC); } -; - -foreach_optional_arg: - /* empty */ { $$.op_type = IS_UNUSED; } - | T_DOUBLE_ARROW foreach_variable { $$ = $2; } -; - - -foreach_variable: - variable { zend_check_writable_variable(&$1); $$ = $1; } - | '&' variable { zend_check_writable_variable(&$2); $$ = $2; $$.u.EA.type |= ZEND_PARSED_REFERENCE_VARIABLE; } -; - -for_statement: - statement - | ':' inner_statement_list T_ENDFOR ';' -; - - -foreach_statement: - statement - | ':' inner_statement_list T_ENDFOREACH ';' -; - - -declare_statement: - statement - | ':' inner_statement_list T_ENDDECLARE ';' -; - - -declare_list: - T_STRING '=' static_scalar { zend_do_declare_stmt(&$1, &$3 TSRMLS_CC); } - | declare_list ',' T_STRING '=' static_scalar { zend_do_declare_stmt(&$3, &$5 TSRMLS_CC); } -; - - -switch_case_list: - '{' case_list '}' { $$ = $2; } - | '{' ';' case_list '}' { $$ = $3; } - | ':' case_list T_ENDSWITCH ';' { $$ = $2; } - | ':' ';' case_list T_ENDSWITCH ';' { $$ = $3; } -; - - -case_list: - /* empty */ { $$.op_type = IS_UNUSED; } - | case_list T_CASE expr case_separator { zend_do_extended_info(TSRMLS_C); zend_do_case_before_statement(&$1, &$2, &$3 TSRMLS_CC); } inner_statement_list { zend_do_case_after_statement(&$$, &$2 TSRMLS_CC); $$.op_type = IS_CONST; } - | case_list T_DEFAULT case_separator { zend_do_extended_info(TSRMLS_C); zend_do_default_before_statement(&$1, &$2 TSRMLS_CC); } inner_statement_list { zend_do_case_after_statement(&$$, &$2 TSRMLS_CC); $$.op_type = IS_CONST; } -; - - -case_separator: - ':' - | ';' -; - - -while_statement: - statement - | ':' inner_statement_list T_ENDWHILE ';' -; - - - -elseif_list: - /* empty */ - | elseif_list T_ELSEIF '(' expr ')' { zend_do_if_cond(&$4, &$5 TSRMLS_CC); } statement { zend_do_if_after_statement(&$5, 0 TSRMLS_CC); } -; - - -new_elseif_list: - /* empty */ - | new_elseif_list T_ELSEIF '(' expr ')' ':' { zend_do_if_cond(&$4, &$5 TSRMLS_CC); } inner_statement_list { zend_do_if_after_statement(&$5, 0 TSRMLS_CC); } -; - - -else_single: - /* empty */ - | T_ELSE statement -; - - -new_else_single: - /* empty */ - | T_ELSE ':' inner_statement_list -; - - -parameter_list: - non_empty_parameter_list - | /* empty */ -; - - -non_empty_parameter_list: - optional_class_type T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 TSRMLS_CC); $$.op_type = IS_CONST; Z_LVAL($$.u.constant)=1; Z_TYPE($$.u.constant)=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, &$1, &$2, 0 TSRMLS_CC); } - | optional_class_type '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$3, 0 TSRMLS_CC); $$.op_type = IS_CONST; Z_LVAL($$.u.constant)=1; Z_TYPE($$.u.constant)=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, &$1, &$3, 1 TSRMLS_CC); } - | optional_class_type '&' T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$3, 0 TSRMLS_CC); $$.op_type = IS_CONST; Z_LVAL($$.u.constant)=1; Z_TYPE($$.u.constant)=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$5, &$1, &$3, 1 TSRMLS_CC); } - | optional_class_type T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$2, 0 TSRMLS_CC); $$.op_type = IS_CONST; Z_LVAL($$.u.constant)=1; Z_TYPE($$.u.constant)=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$4, &$1, &$2, 0 TSRMLS_CC); } - | non_empty_parameter_list ',' optional_class_type T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 TSRMLS_CC); $$=$1; Z_LVAL($$.u.constant)++; zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, &$3, &$4, 0 TSRMLS_CC); } - | non_empty_parameter_list ',' optional_class_type '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$5, 0 TSRMLS_CC); $$=$1; Z_LVAL($$.u.constant)++; zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, &$3, &$5, 1 TSRMLS_CC); } - | non_empty_parameter_list ',' optional_class_type '&' T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$5, 0 TSRMLS_CC); $$=$1; Z_LVAL($$.u.constant)++; zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$7, &$3, &$5, 1 TSRMLS_CC); } - | non_empty_parameter_list ',' optional_class_type T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$4, 0 TSRMLS_CC); $$=$1; Z_LVAL($$.u.constant)++; zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$6, &$3, &$4, 0 TSRMLS_CC); } -; - - -optional_class_type: - /* empty */ { $$.op_type = IS_UNUSED; } - | T_STRING { $$ = $1; } - | T_ARRAY { $$.op_type = IS_CONST; Z_TYPE($$.u.constant)=IS_NULL;} -; - - -function_call_parameter_list: - non_empty_function_call_parameter_list { $$ = $1; } - | /* empty */ { Z_LVAL($$.u.constant) = 0; } -; - - -non_empty_function_call_parameter_list: - expr_without_variable { Z_LVAL($$.u.constant) = 1; zend_do_pass_param(&$1, ZEND_SEND_VAL, Z_LVAL($$.u.constant) TSRMLS_CC); } - | variable { Z_LVAL($$.u.constant) = 1; zend_do_pass_param(&$1, ZEND_SEND_VAR, Z_LVAL($$.u.constant) TSRMLS_CC); } - | '&' w_variable { Z_LVAL($$.u.constant) = 1; zend_do_pass_param(&$2, ZEND_SEND_REF, Z_LVAL($$.u.constant) TSRMLS_CC); } - | non_empty_function_call_parameter_list ',' expr_without_variable { Z_LVAL($$.u.constant)=Z_LVAL($1.u.constant)+1; zend_do_pass_param(&$3, ZEND_SEND_VAL, Z_LVAL($$.u.constant) TSRMLS_CC); } - | non_empty_function_call_parameter_list ',' variable { Z_LVAL($$.u.constant)=Z_LVAL($1.u.constant)+1; zend_do_pass_param(&$3, ZEND_SEND_VAR, Z_LVAL($$.u.constant) TSRMLS_CC); } - | non_empty_function_call_parameter_list ',' '&' w_variable { Z_LVAL($$.u.constant)=Z_LVAL($1.u.constant)+1; zend_do_pass_param(&$4, ZEND_SEND_REF, Z_LVAL($$.u.constant) TSRMLS_CC); } -; - -global_var_list: - global_var_list ',' global_var { zend_do_fetch_global_variable(&$3, NULL, ZEND_FETCH_GLOBAL_LOCK TSRMLS_CC); } - | global_var { zend_do_fetch_global_variable(&$1, NULL, ZEND_FETCH_GLOBAL_LOCK TSRMLS_CC); } -; - - -global_var: - T_VARIABLE { $$ = $1; } - | '$' r_variable { $$ = $2; } - | '$' '{' expr '}' { $$ = $3; } -; - - -static_var_list: - static_var_list ',' T_VARIABLE { zend_do_fetch_static_variable(&$3, NULL, ZEND_FETCH_STATIC TSRMLS_CC); } - | static_var_list ',' T_VARIABLE '=' static_scalar { zend_do_fetch_static_variable(&$3, &$5, ZEND_FETCH_STATIC TSRMLS_CC); } - | T_VARIABLE { zend_do_fetch_static_variable(&$1, NULL, ZEND_FETCH_STATIC TSRMLS_CC); } - | T_VARIABLE '=' static_scalar { zend_do_fetch_static_variable(&$1, &$3, ZEND_FETCH_STATIC TSRMLS_CC); } - -; - - -class_statement_list: - class_statement_list class_statement - | /* empty */ -; - - -class_statement: - variable_modifiers { CG(access_type) = Z_LVAL($1.u.constant); } class_variable_declaration ';' - | class_constant_declaration ';' - | method_modifiers T_FUNCTION { $2.u.opline_num = CG(zend_lineno); } is_reference T_STRING { zend_do_begin_function_declaration(&$2, &$5, 1, $4.op_type, &$1 TSRMLS_CC); } '(' - parameter_list ')' method_body { zend_do_abstract_method(&$5, &$1, &$10 TSRMLS_CC); zend_do_end_function_declaration(&$2 TSRMLS_CC); } -; - - -method_body: - ';' /* abstract method */ { Z_LVAL($$.u.constant) = ZEND_ACC_ABSTRACT; } - | '{' inner_statement_list '}' { Z_LVAL($$.u.constant) = 0; } -; - -variable_modifiers: - non_empty_member_modifiers { $$ = $1; } - | T_VAR { Z_LVAL($$.u.constant) = ZEND_ACC_PUBLIC; } -; - -method_modifiers: - /* empty */ { Z_LVAL($$.u.constant) = ZEND_ACC_PUBLIC; } - | non_empty_member_modifiers { $$ = $1; if (!(Z_LVAL($$.u.constant) & ZEND_ACC_PPP_MASK)) { Z_LVAL($$.u.constant) |= ZEND_ACC_PUBLIC; } } -; - -non_empty_member_modifiers: - member_modifier { $$ = $1; } - | non_empty_member_modifiers member_modifier { Z_LVAL($$.u.constant) = zend_do_verify_access_types(&$1, &$2); } -; - -member_modifier: - T_PUBLIC { Z_LVAL($$.u.constant) = ZEND_ACC_PUBLIC; } - | T_PROTECTED { Z_LVAL($$.u.constant) = ZEND_ACC_PROTECTED; } - | T_PRIVATE { Z_LVAL($$.u.constant) = ZEND_ACC_PRIVATE; } - | T_STATIC { Z_LVAL($$.u.constant) = ZEND_ACC_STATIC; } - | T_ABSTRACT { Z_LVAL($$.u.constant) = ZEND_ACC_ABSTRACT; } - | T_FINAL { Z_LVAL($$.u.constant) = ZEND_ACC_FINAL; } -; - -class_variable_declaration: - class_variable_declaration ',' T_VARIABLE { zend_do_declare_property(&$3, NULL, CG(access_type) TSRMLS_CC); } - | class_variable_declaration ',' T_VARIABLE '=' static_scalar { zend_do_declare_property(&$3, &$5, CG(access_type) TSRMLS_CC); } - | T_VARIABLE { zend_do_declare_property(&$1, NULL, CG(access_type) TSRMLS_CC); } - | T_VARIABLE '=' static_scalar { zend_do_declare_property(&$1, &$3, CG(access_type) TSRMLS_CC); } -; - -class_constant_declaration: - class_constant_declaration ',' T_STRING '=' static_scalar { zend_do_declare_class_constant(&$3, &$5 TSRMLS_CC); } - | T_CONST T_STRING '=' static_scalar { zend_do_declare_class_constant(&$2, &$4 TSRMLS_CC); } -; - -echo_expr_list: - echo_expr_list ',' expr { zend_do_echo(&$3 TSRMLS_CC); } - | expr { zend_do_echo(&$1 TSRMLS_CC); } -; - - -for_expr: - /* empty */ { $$.op_type = IS_CONST; Z_TYPE($$.u.constant) = IS_BOOL; Z_LVAL($$.u.constant) = 1; } - | non_empty_for_expr { $$ = $1; } -; - -non_empty_for_expr: - non_empty_for_expr ',' { zend_do_free(&$1 TSRMLS_CC); } expr { $$ = $4; } - | expr { $$ = $1; } -; - -expr_without_variable: - T_LIST '(' { zend_do_list_init(TSRMLS_C); } assignment_list ')' '=' expr { zend_do_list_end(&$$, &$7 TSRMLS_CC); } - | variable '=' expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); zend_do_assign(&$$, &$1, &$3 TSRMLS_CC); } - | variable '=' '&' variable { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); zend_do_assign_ref(&$$, &$1, &$4 TSRMLS_CC); } - | variable '=' '&' T_NEW class_name_reference { zend_error(E_STRICT, "Assigning the return value of new by reference is deprecated"); zend_check_writable_variable(&$1); zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$4, &$5 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$3, &$4, &$7 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); zend_do_assign_ref(&$$, &$1, &$3 TSRMLS_CC); } - | T_NEW class_name_reference { zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$1, &$2 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$$, &$1, &$4 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);} - | T_CLONE expr { zend_do_clone(&$$, &$2 TSRMLS_CC); } - | variable T_PLUS_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_ADD, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_MINUS_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_SUB, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_MUL_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_MUL, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_DIV_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_DIV, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_CONCAT_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_CONCAT, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_MOD_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_MOD, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_AND_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_BW_AND, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_OR_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_BW_OR, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_XOR_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_BW_XOR, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_SL_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_SL, &$$, &$1, &$3 TSRMLS_CC); } - | variable T_SR_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_SR, &$$, &$1, &$3 TSRMLS_CC); } - | rw_variable T_INC { zend_do_post_incdec(&$$, &$1, ZEND_POST_INC TSRMLS_CC); } - | T_INC rw_variable { zend_do_pre_incdec(&$$, &$2, ZEND_PRE_INC TSRMLS_CC); } - | rw_variable T_DEC { zend_do_post_incdec(&$$, &$1, ZEND_POST_DEC TSRMLS_CC); } - | T_DEC rw_variable { zend_do_pre_incdec(&$$, &$2, ZEND_PRE_DEC TSRMLS_CC); } - | expr T_BOOLEAN_OR { zend_do_boolean_or_begin(&$1, &$2 TSRMLS_CC); } expr { zend_do_boolean_or_end(&$$, &$1, &$4, &$2 TSRMLS_CC); } - | expr T_BOOLEAN_AND { zend_do_boolean_and_begin(&$1, &$2 TSRMLS_CC); } expr { zend_do_boolean_and_end(&$$, &$1, &$4, &$2 TSRMLS_CC); } - | expr T_LOGICAL_OR { zend_do_boolean_or_begin(&$1, &$2 TSRMLS_CC); } expr { zend_do_boolean_or_end(&$$, &$1, &$4, &$2 TSRMLS_CC); } - | expr T_LOGICAL_AND { zend_do_boolean_and_begin(&$1, &$2 TSRMLS_CC); } expr { zend_do_boolean_and_end(&$$, &$1, &$4, &$2 TSRMLS_CC); } - | expr T_LOGICAL_XOR expr { zend_do_binary_op(ZEND_BOOL_XOR, &$$, &$1, &$3 TSRMLS_CC); } - | expr '|' expr { zend_do_binary_op(ZEND_BW_OR, &$$, &$1, &$3 TSRMLS_CC); } - | expr '&' expr { zend_do_binary_op(ZEND_BW_AND, &$$, &$1, &$3 TSRMLS_CC); } - | expr '^' expr { zend_do_binary_op(ZEND_BW_XOR, &$$, &$1, &$3 TSRMLS_CC); } - | expr '.' expr { zend_do_binary_op(ZEND_CONCAT, &$$, &$1, &$3 TSRMLS_CC); } - | expr '+' expr { zend_do_binary_op(ZEND_ADD, &$$, &$1, &$3 TSRMLS_CC); } - | expr '-' expr { zend_do_binary_op(ZEND_SUB, &$$, &$1, &$3 TSRMLS_CC); } - | expr '*' expr { zend_do_binary_op(ZEND_MUL, &$$, &$1, &$3 TSRMLS_CC); } - | expr '/' expr { zend_do_binary_op(ZEND_DIV, &$$, &$1, &$3 TSRMLS_CC); } - | expr '%' expr { zend_do_binary_op(ZEND_MOD, &$$, &$1, &$3 TSRMLS_CC); } - | expr T_SL expr { zend_do_binary_op(ZEND_SL, &$$, &$1, &$3 TSRMLS_CC); } - | expr T_SR expr { zend_do_binary_op(ZEND_SR, &$$, &$1, &$3 TSRMLS_CC); } - | '+' expr { Z_LVAL($1.u.constant)=0; Z_TYPE($1.u.constant)=IS_LONG; $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); zend_do_binary_op(ZEND_ADD, &$$, &$1, &$2 TSRMLS_CC); } - | '-' expr { Z_LVAL($1.u.constant)=0; Z_TYPE($1.u.constant)=IS_LONG; $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); zend_do_binary_op(ZEND_SUB, &$$, &$1, &$2 TSRMLS_CC); } - | '!' expr { zend_do_unary_op(ZEND_BOOL_NOT, &$$, &$2 TSRMLS_CC); } - | '~' expr { zend_do_unary_op(ZEND_BW_NOT, &$$, &$2 TSRMLS_CC); } - | expr T_IS_IDENTICAL expr { zend_do_binary_op(ZEND_IS_IDENTICAL, &$$, &$1, &$3 TSRMLS_CC); } - | expr T_IS_NOT_IDENTICAL expr { zend_do_binary_op(ZEND_IS_NOT_IDENTICAL, &$$, &$1, &$3 TSRMLS_CC); } - | expr T_IS_EQUAL expr { zend_do_binary_op(ZEND_IS_EQUAL, &$$, &$1, &$3 TSRMLS_CC); } - | expr T_IS_NOT_EQUAL expr { zend_do_binary_op(ZEND_IS_NOT_EQUAL, &$$, &$1, &$3 TSRMLS_CC); } - | expr '<' expr { zend_do_binary_op(ZEND_IS_SMALLER, &$$, &$1, &$3 TSRMLS_CC); } - | expr T_IS_SMALLER_OR_EQUAL expr { zend_do_binary_op(ZEND_IS_SMALLER_OR_EQUAL, &$$, &$1, &$3 TSRMLS_CC); } - | expr '>' expr { zend_do_binary_op(ZEND_IS_SMALLER, &$$, &$3, &$1 TSRMLS_CC); } - | expr T_IS_GREATER_OR_EQUAL expr { zend_do_binary_op(ZEND_IS_SMALLER_OR_EQUAL, &$$, &$3, &$1 TSRMLS_CC); } - | expr T_INSTANCEOF class_name_reference { zend_do_instanceof(&$$, &$1, &$3, 0 TSRMLS_CC); } - | '(' expr ')' { $$ = $2; } - | expr '?' { zend_do_begin_qm_op(&$1, &$2 TSRMLS_CC); } - expr ':' { zend_do_qm_true(&$4, &$2, &$5 TSRMLS_CC); } - expr { zend_do_qm_false(&$$, &$7, &$2, &$5 TSRMLS_CC); } - | internal_functions_in_yacc { $$ = $1; } - | T_INT_CAST expr { zend_do_cast(&$$, &$2, IS_LONG TSRMLS_CC); } - | T_DOUBLE_CAST expr { zend_do_cast(&$$, &$2, IS_DOUBLE TSRMLS_CC); } - | T_STRING_CAST expr { zend_do_cast(&$$, &$2, IS_STRING TSRMLS_CC); } - | T_ARRAY_CAST expr { zend_do_cast(&$$, &$2, IS_ARRAY TSRMLS_CC); } - | T_OBJECT_CAST expr { zend_do_cast(&$$, &$2, IS_OBJECT TSRMLS_CC); } - | T_BOOL_CAST expr { zend_do_cast(&$$, &$2, IS_BOOL TSRMLS_CC); } - | T_UNSET_CAST expr { zend_do_cast(&$$, &$2, IS_NULL TSRMLS_CC); } - | T_EXIT exit_expr { zend_do_exit(&$$, &$2 TSRMLS_CC); } - | '@' { zend_do_begin_silence(&$1 TSRMLS_CC); } expr { zend_do_end_silence(&$1 TSRMLS_CC); $$ = $3; } - | scalar { $$ = $1; } - | T_ARRAY '(' array_pair_list ')' { $$ = $3; } - | '`' encaps_list '`' { zend_do_shell_exec(&$$, &$2 TSRMLS_CC); } - | T_PRINT expr { zend_do_print(&$$, &$2 TSRMLS_CC); } -; - -function_call: - T_STRING '(' { $2.u.opline_num = zend_do_begin_function_call(&$1 TSRMLS_CC); } - function_call_parameter_list - ')' { zend_do_end_function_call(&$1, &$$, &$4, 0, $2.u.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); } - | fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING '(' { zend_do_begin_class_member_function_call(&$1, &$3 TSRMLS_CC); } - function_call_parameter_list - ')' { zend_do_end_function_call(NULL, &$$, &$6, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);} - | fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects '(' { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); zend_do_begin_class_member_function_call(&$1, &$3 TSRMLS_CC); } - function_call_parameter_list - ')' { zend_do_end_function_call(NULL, &$$, &$6, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);} - | variable_without_objects '(' { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); zend_do_begin_dynamic_function_call(&$1 TSRMLS_CC); } - function_call_parameter_list ')' - { zend_do_end_function_call(&$1, &$$, &$4, 0, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);} -; - -fully_qualified_class_name: - T_STRING { zend_do_fetch_class(&$$, &$1 TSRMLS_CC); } -; - -class_name_reference: - T_STRING { zend_do_fetch_class(&$$, &$1 TSRMLS_CC); } - | dynamic_class_name_reference { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); zend_do_fetch_class(&$$, &$1 TSRMLS_CC); } -; - - -dynamic_class_name_reference: - base_variable T_OBJECT_OPERATOR { zend_do_push_object(&$1 TSRMLS_CC); } - object_property { zend_do_push_object(&$4 TSRMLS_CC); zend_do_declare_implicit_property(TSRMLS_C); } dynamic_class_name_variable_properties - { zend_do_pop_object(&$$ TSRMLS_CC); $$.u.EA.type = ZEND_PARSED_MEMBER; } - | base_variable { $$ = $1; } -; - - -dynamic_class_name_variable_properties: - dynamic_class_name_variable_properties dynamic_class_name_variable_property - | /* empty */ -; - - -dynamic_class_name_variable_property: - T_OBJECT_OPERATOR object_property { zend_do_push_object(&$2 TSRMLS_CC); zend_do_declare_implicit_property(TSRMLS_C); } -; - -exit_expr: - /* empty */ { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; } - | '(' ')' { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; } - | '(' expr ')' { $$ = $2; } -; - - -ctor_arguments: - /* empty */ { Z_LVAL($$.u.constant)=0; } - | '(' function_call_parameter_list ')' { $$ = $2; } -; - - -common_scalar: - T_LNUMBER { $$ = $1; } - | T_DNUMBER { $$ = $1; } - | T_CONSTANT_ENCAPSED_STRING { $$ = $1; } - | T_LINE { $$ = $1; } - | T_FILE { $$ = $1; } - | T_CLASS_C { $$ = $1; } - | T_METHOD_C { $$ = $1; } - | T_FUNC_C { $$ = $1; } -; - - -static_scalar: /* compile-time evaluated scalars */ - common_scalar { $$ = $1; } - | T_STRING { zend_do_fetch_constant(&$$, NULL, &$1, ZEND_CT TSRMLS_CC); } - | '+' static_scalar { $$ = $2; } - | '-' static_scalar { zval minus_one; Z_TYPE(minus_one) = IS_LONG; Z_LVAL(minus_one) = -1; mul_function(&$2.u.constant, &$2.u.constant, &minus_one TSRMLS_CC); $$ = $2; } - | T_ARRAY '(' static_array_pair_list ')' { $$ = $3; Z_TYPE($$.u.constant) = IS_CONSTANT_ARRAY; } - | static_class_constant { $$ = $1; } -; - -static_class_constant: - T_STRING T_PAAMAYIM_NEKUDOTAYIM T_STRING { zend_do_fetch_constant(&$$, &$1, &$3, ZEND_CT TSRMLS_CC); } -; - -scalar: - T_STRING { zend_do_fetch_constant(&$$, NULL, &$1, ZEND_RT TSRMLS_CC); } - | T_STRING_VARNAME { $$ = $1; } - | class_constant { $$ = $1; } - | common_scalar { $$ = $1; } - | '"' encaps_list '"' { $$ = $2; } - | '\'' encaps_list '\'' { $$ = $2; } - | T_START_HEREDOC encaps_list T_END_HEREDOC { $$ = $2; zend_do_end_heredoc(TSRMLS_C); } -; - - -static_array_pair_list: - /* empty */ { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); } - | non_empty_static_array_pair_list possible_comma { $$ = $1; } -; - -possible_comma: - /* empty */ - | ',' -; - -non_empty_static_array_pair_list: - non_empty_static_array_pair_list ',' static_scalar T_DOUBLE_ARROW static_scalar { zend_do_add_static_array_element(&$$, &$3, &$5); } - | non_empty_static_array_pair_list ',' static_scalar { zend_do_add_static_array_element(&$$, NULL, &$3); } - | static_scalar T_DOUBLE_ARROW static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); zend_do_add_static_array_element(&$$, &$1, &$3); } - | static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); zend_do_add_static_array_element(&$$, NULL, &$1); } -; - -expr: - r_variable { $$ = $1; } - | expr_without_variable { $$ = $1; } -; - - -r_variable: - variable { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); $$ = $1; } -; - - -w_variable: - variable { zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC); $$ = $1; } - { zend_check_writable_variable(&$1); } -; - -rw_variable: - variable { zend_do_end_variable_parse(BP_VAR_RW, 0 TSRMLS_CC); $$ = $1; } - { zend_check_writable_variable(&$1); } -; - -variable: - base_variable_with_function_calls T_OBJECT_OPERATOR { zend_do_push_object(&$1 TSRMLS_CC); } - object_property { zend_do_push_object(&$4 TSRMLS_CC); } method_or_not variable_properties - { zend_do_pop_object(&$$ TSRMLS_CC); $$.u.EA.type = $1.u.EA.type | ($7.u.EA.type ? $7.u.EA.type : $6.u.EA.type); } - | base_variable_with_function_calls { $$ = $1; } -; - -variable_properties: - variable_properties variable_property { $$.u.EA.type = $2.u.EA.type; } - | /* empty */ { $$.u.EA.type = 0; } -; - - -variable_property: - T_OBJECT_OPERATOR object_property { zend_do_push_object(&$2 TSRMLS_CC); } method_or_not { $$.u.EA.type = $4.u.EA.type; } -; - -method_or_not: - '(' { zend_do_pop_object(&$1 TSRMLS_CC); zend_do_begin_method_call(&$1 TSRMLS_CC); } - function_call_parameter_list ')' - { zend_do_end_function_call(&$1, &$$, &$3, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); - zend_do_push_object(&$$ TSRMLS_CC); $$.u.EA.type = ZEND_PARSED_METHOD_CALL; } - | /* empty */ { zend_do_declare_implicit_property(TSRMLS_C); $$.u.EA.type = ZEND_PARSED_MEMBER; } -; - -variable_without_objects: - reference_variable { $$ = $1; } - | simple_indirect_reference reference_variable { zend_do_indirect_references(&$$, &$1, &$2 TSRMLS_CC); } -; - -static_member: - fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects { $$ = $3; zend_do_fetch_static_member(&$$, &$1 TSRMLS_CC); } -; - - -base_variable_with_function_calls: - base_variable { $$ = $1; } - | function_call { zend_do_begin_variable_parse(TSRMLS_C); $$ = $1; $$.u.EA.type = ZEND_PARSED_FUNCTION_CALL; } -; - - -base_variable: - reference_variable { $$ = $1; $$.u.EA.type = ZEND_PARSED_VARIABLE; } - | simple_indirect_reference reference_variable { zend_do_indirect_references(&$$, &$1, &$2 TSRMLS_CC); $$.u.EA.type = ZEND_PARSED_VARIABLE; } - | static_member { $$ = $1; $$.u.EA.type = ZEND_PARSED_STATIC_MEMBER; } -; - -reference_variable: - reference_variable '[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$3 TSRMLS_CC); } - | reference_variable '{' expr '}' { fetch_string_offset(&$$, &$1, &$3 TSRMLS_CC); } - | compound_variable { zend_do_begin_variable_parse(TSRMLS_C); fetch_simple_variable(&$$, &$1, 1 TSRMLS_CC); } -; - - -compound_variable: - T_VARIABLE { $$ = $1; } - | '$' '{' expr '}' { $$ = $3; } -; - -dim_offset: - /* empty */ { $$.op_type = IS_UNUSED; } - | expr { $$ = $1; } -; - - -object_property: - object_dim_list { $$ = $1; } - | variable_without_objects { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); } { znode tmp_znode; zend_do_pop_object(&tmp_znode TSRMLS_CC); zend_do_fetch_property(&$$, &tmp_znode, &$1 TSRMLS_CC);} -; - -object_dim_list: - object_dim_list '[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$3 TSRMLS_CC); } - | object_dim_list '{' expr '}' { fetch_string_offset(&$$, &$1, &$3 TSRMLS_CC); } - | variable_name { znode tmp_znode; zend_do_pop_object(&tmp_znode TSRMLS_CC); zend_do_fetch_property(&$$, &tmp_znode, &$1 TSRMLS_CC);} -; - -variable_name: - T_STRING { $$ = $1; } - | '{' expr '}' { $$ = $2; } -; - -simple_indirect_reference: - '$' { Z_LVAL($$.u.constant) = 1; } - | simple_indirect_reference '$' { Z_LVAL($$.u.constant)++; } -; - -assignment_list: - assignment_list ',' assignment_list_element - | assignment_list_element -; - - -assignment_list_element: - variable { zend_do_add_list_element(&$1 TSRMLS_CC); } - | T_LIST '(' { zend_do_new_list_begin(TSRMLS_C); } assignment_list ')' { zend_do_new_list_end(TSRMLS_C); } - | /* empty */ { zend_do_add_list_element(NULL TSRMLS_CC); } -; - - -array_pair_list: - /* empty */ { zend_do_init_array(&$$, NULL, NULL, 0 TSRMLS_CC); } - | non_empty_array_pair_list possible_comma { $$ = $1; } -; - -non_empty_array_pair_list: - non_empty_array_pair_list ',' expr T_DOUBLE_ARROW expr { zend_do_add_array_element(&$$, &$5, &$3, 0 TSRMLS_CC); } - | non_empty_array_pair_list ',' expr { zend_do_add_array_element(&$$, &$3, NULL, 0 TSRMLS_CC); } - | expr T_DOUBLE_ARROW expr { zend_do_init_array(&$$, &$3, &$1, 0 TSRMLS_CC); } - | expr { zend_do_init_array(&$$, &$1, NULL, 0 TSRMLS_CC); } - | non_empty_array_pair_list ',' expr T_DOUBLE_ARROW '&' w_variable { zend_do_add_array_element(&$$, &$6, &$3, 1 TSRMLS_CC); } - | non_empty_array_pair_list ',' '&' w_variable { zend_do_add_array_element(&$$, &$4, NULL, 1 TSRMLS_CC); } - | expr T_DOUBLE_ARROW '&' w_variable { zend_do_init_array(&$$, &$4, &$1, 1 TSRMLS_CC); } - | '&' w_variable { zend_do_init_array(&$$, &$2, NULL, 1 TSRMLS_CC); } -; - -encaps_list: - encaps_list encaps_var { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); zend_do_add_variable(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list T_STRING { zend_do_add_string(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list T_NUM_STRING { zend_do_add_string(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list T_ENCAPSED_AND_WHITESPACE { zend_do_add_string(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list T_CHARACTER { zend_do_add_char(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list T_BAD_CHARACTER { zend_do_add_string(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list '[' { Z_LVAL($2.u.constant) = (long) '['; zend_do_add_char(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list ']' { Z_LVAL($2.u.constant) = (long) ']'; zend_do_add_char(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list '{' { Z_LVAL($2.u.constant) = (long) '{'; zend_do_add_char(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list '}' { Z_LVAL($2.u.constant) = (long) '}'; zend_do_add_char(&$$, &$1, &$2 TSRMLS_CC); } - | encaps_list T_OBJECT_OPERATOR { znode tmp; Z_LVAL($2.u.constant) = (long) '-'; zend_do_add_char(&tmp, &$1, &$2 TSRMLS_CC); Z_LVAL($2.u.constant) = (long) '>'; zend_do_add_char(&$$, &tmp, &$2 TSRMLS_CC); } - | /* empty */ { zend_do_init_string(&$$ TSRMLS_CC); } - -; - - - -encaps_var: - T_VARIABLE { zend_do_begin_variable_parse(TSRMLS_C); fetch_simple_variable(&$$, &$1, 1 TSRMLS_CC); } - | T_VARIABLE '[' { zend_do_begin_variable_parse(TSRMLS_C); } encaps_var_offset ']' { fetch_array_begin(&$$, &$1, &$4 TSRMLS_CC); } - | T_VARIABLE T_OBJECT_OPERATOR T_STRING { zend_do_begin_variable_parse(TSRMLS_C); fetch_simple_variable(&$2, &$1, 1 TSRMLS_CC); zend_do_fetch_property(&$$, &$2, &$3 TSRMLS_CC); } - | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { zend_do_begin_variable_parse(TSRMLS_C); fetch_simple_variable(&$$, &$2, 1 TSRMLS_CC); } - | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' { zend_do_begin_variable_parse(TSRMLS_C); fetch_array_begin(&$$, &$2, &$4 TSRMLS_CC); } - | T_CURLY_OPEN variable '}' { $$ = $2; } -; - - -encaps_var_offset: - T_STRING { $$ = $1; } - | T_NUM_STRING { $$ = $1; } - | T_VARIABLE { fetch_simple_variable(&$$, &$1, 1 TSRMLS_CC); } -; - - -internal_functions_in_yacc: - T_ISSET '(' isset_variables ')' { $$ = $3; } - | T_EMPTY '(' variable ')' { zend_do_isset_or_isempty(ZEND_ISEMPTY, &$$, &$3 TSRMLS_CC); } - | T_INCLUDE expr { zend_do_include_or_eval(ZEND_INCLUDE, &$$, &$2 TSRMLS_CC); } - | T_INCLUDE_ONCE expr { zend_do_include_or_eval(ZEND_INCLUDE_ONCE, &$$, &$2 TSRMLS_CC); } - | T_EVAL '(' expr ')' { zend_do_include_or_eval(ZEND_EVAL, &$$, &$3 TSRMLS_CC); } - | T_REQUIRE expr { zend_do_include_or_eval(ZEND_REQUIRE, &$$, &$2 TSRMLS_CC); } - | T_REQUIRE_ONCE expr { zend_do_include_or_eval(ZEND_REQUIRE_ONCE, &$$, &$2 TSRMLS_CC); } -; - -isset_variables: - variable { zend_do_isset_or_isempty(ZEND_ISSET, &$$, &$1 TSRMLS_CC); } - | isset_variables ',' { zend_do_boolean_and_begin(&$1, &$2 TSRMLS_CC); } variable { znode tmp; zend_do_isset_or_isempty(ZEND_ISSET, &tmp, &$4 TSRMLS_CC); zend_do_boolean_and_end(&$$, &$1, &tmp, &$2 TSRMLS_CC); } -; - -class_constant: - fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { zend_do_fetch_constant(&$$, &$1, &$3, ZEND_RT TSRMLS_CC); } -; - -%% - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_language_scanner.h b/Zend/zend_language_scanner.h deleted file mode 100644 index 70eca594d1..0000000000 --- a/Zend/zend_language_scanner.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_SCANNER_H -#define ZEND_SCANNER_H - -typedef struct _zend_lex_state { - YY_BUFFER_STATE buffer_state; - int state; - zend_file_handle *in; - uint lineno; - char *filename; - -#ifdef ZEND_MULTIBYTE - /* original (unfiltered) script */ - char *script_org; - int script_org_size; - - /* filtered script */ - char *script_filtered; - int script_filtered_size; - - /* input/ouput filters */ - zend_encoding_filter input_filter; - zend_encoding_filter output_filter; - zend_encoding *script_encoding; - zend_encoding *internal_encoding; -#endif /* ZEND_MULTIBYTE */ -} zend_lex_state; - - -void zend_fatal_scanner_error(char *); -BEGIN_EXTERN_C() -int zend_compare_file_handles(zend_file_handle *fh1, zend_file_handle *fh2); -ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC); -ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC); -ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_DC); - -END_EXTERN_C() - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l deleted file mode 100644 index 57581404f3..0000000000 --- a/Zend/zend_language_scanner.l +++ /dev/null @@ -1,1921 +0,0 @@ -%{ - -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#define yyleng SCNG(yy_leng) -#define yytext SCNG(yy_text) -#define yytext_ptr SCNG(yy_text) -#define yyin SCNG(yy_in) -#define yyout SCNG(yy_out) -#define yy_last_accepting_state SCNG(_yy_last_accepting_state) -#define yy_last_accepting_cpos SCNG(_yy_last_accepting_cpos) -#define yy_more_flag SCNG(_yy_more_flag) -#define yy_more_len SCNG(_yy_more_len) - -%} - -%x ST_IN_SCRIPTING -%x ST_DOUBLE_QUOTES -%x ST_SINGLE_QUOTE -%x ST_BACKQUOTE -%x ST_HEREDOC -%x ST_LOOKING_FOR_PROPERTY -%x ST_LOOKING_FOR_VARNAME -%x ST_COMMENT -%x ST_DOC_COMMENT -%x ST_ONE_LINE_COMMENT -%option stack - -%{ - -#include -#include "zend.h" -#include "zend_alloc.h" -#include -#include "zend_compile.h" -#include "zend_language_scanner.h" -#include "zend_highlight.h" -#include "zend_constants.h" -#include "zend_variables.h" -#include "zend_operators.h" -#include "zend_API.h" -#include "zend_strtod.h" - -#ifdef HAVE_STDARG_H -# include -#endif - -#ifdef HAVE_UNISTD_H -# include -#endif - -#define YY_DECL int lex_scan(zval *zendlval TSRMLS_DC) - -#define ECHO { ZEND_WRITE( yytext, yyleng ); } - -#ifdef ZTS -# define MY_INPUT yyinput -#else -# define MY_INPUT input -#endif - - -/* Globals Macros */ -#define SCNG LANG_SCNG -#ifdef ZTS -ZEND_API ts_rsrc_id language_scanner_globals_id; -#else -ZEND_API zend_scanner_globals language_scanner_globals; -#endif - - -#define YY_FATAL_ERROR zend_fatal_scanner_error - -#define HANDLE_NEWLINES(s, l) \ -do { \ - char *p = (s), *boundary = p+(l); \ - \ - while (p='0' && (c)<='7') -#define ZEND_IS_HEX(c) (((c)>='0' && (c)<='9') || ((c)>='a' && (c)<='f') || ((c)>='A' && (c)<='F')) - - -void zend_fatal_scanner_error(char *message) -{ - zend_error(E_COMPILE_ERROR, "%s", message); -} - -BEGIN_EXTERN_C() -void startup_scanner(TSRMLS_D) -{ - CG(heredoc) = NULL; - CG(heredoc_len) = 0; - CG(doc_comment) = NULL; - CG(doc_comment_len) = 0; - SCNG(yy_start_stack_ptr) = 0; - SCNG(yy_start_stack_depth) = 0; - SCNG(current_buffer) = NULL; -#ifdef ZEND_MULTIBYTE - SCNG(script_org) = NULL; - SCNG(script_org_size) = 0; - SCNG(script_filtered) = NULL; - SCNG(script_filtered_size) = 0; - SCNG(input_filter) = NULL; - SCNG(output_filter) = NULL; - SCNG(script_encoding) = NULL; - SCNG(internal_encoding) = NULL; -#endif /* ZEND_MULTIBYTE */ -} - - -void shutdown_scanner(TSRMLS_D) -{ - if (CG(heredoc)) { - efree(CG(heredoc)); - CG(heredoc_len)=0; - } - if (SCNG(yy_start_stack)) { - yy_flex_free(SCNG(yy_start_stack)); - SCNG(yy_start_stack) = NULL; - } - RESET_DOC_COMMENT(); - -#ifdef ZEND_MULTIBYTE - if (SCNG(script_org)) { - efree(SCNG(script_org)); - SCNG(script_org) = NULL; - } - if (SCNG(script_filtered)) { - efree(SCNG(script_filtered)); - SCNG(script_filtered) = NULL; - } - SCNG(script_org_size) = 0; - SCNG(script_filtered_size) = 0; - SCNG(input_filter) = NULL; - SCNG(output_filter) = NULL; - SCNG(script_encoding) = NULL; - SCNG(internal_encoding) = NULL; -#endif /* ZEND_MULTIBYTE */ -} -END_EXTERN_C() - - -ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state TSRMLS_DC) -{ - memcpy(&lex_state->buffer_state, &YY_CURRENT_BUFFER, sizeof(YY_BUFFER_STATE)); - lex_state->in = SCNG(yy_in); - lex_state->state = YYSTATE; - lex_state->filename = zend_get_compiled_filename(TSRMLS_C); - lex_state->lineno = CG(zend_lineno); - -#ifdef ZEND_MULTIBYTE - lex_state->script_org = SCNG(script_org); - lex_state->script_org_size = SCNG(script_org_size); - lex_state->script_filtered = SCNG(script_filtered); - lex_state->script_filtered_size = SCNG(script_filtered_size); - lex_state->input_filter = SCNG(input_filter); - lex_state->output_filter = SCNG(output_filter); - lex_state->script_encoding = SCNG(script_encoding); - lex_state->internal_encoding = SCNG(internal_encoding); -#endif /* ZEND_MULTIBYTE */ -} - -ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state TSRMLS_DC) -{ - YY_BUFFER_STATE original_buffer_state = YY_CURRENT_BUFFER; - - if (lex_state->buffer_state) { - yy_switch_to_buffer(lex_state->buffer_state TSRMLS_CC); - } else { - YY_CURRENT_BUFFER = NULL; - } - - yy_delete_buffer(original_buffer_state TSRMLS_CC); - SCNG(yy_in) = lex_state->in; - BEGIN(lex_state->state); - CG(zend_lineno) = lex_state->lineno; - zend_restore_compiled_filename(lex_state->filename TSRMLS_CC); - -#ifdef ZEND_MULTIBYTE - if (SCNG(script_org)) { - efree(SCNG(script_org)); - SCNG(script_org) = NULL; - } - if (SCNG(script_filtered)) { - efree(SCNG(script_filtered)); - SCNG(script_filtered) = NULL; - } - SCNG(script_org) = lex_state->script_org; - SCNG(script_org_size) = lex_state->script_org_size; - SCNG(script_filtered) = lex_state->script_filtered; - SCNG(script_filtered_size) = lex_state->script_filtered_size; - SCNG(input_filter) = lex_state->input_filter; - SCNG(output_filter) = lex_state->output_filter; - SCNG(script_encoding) = lex_state->script_encoding; - SCNG(internal_encoding) = lex_state->internal_encoding; -#endif /* ZEND_MULTIBYTE */ -} - - -BEGIN_EXTERN_C() - - -ZEND_API void zend_file_handle_dtor(zend_file_handle *fh) -{ - TSRMLS_FETCH(); - - switch (fh->type) { - case ZEND_HANDLE_FP: - fclose(fh->handle.fp); - break; - case ZEND_HANDLE_STREAM: - if (fh->handle.stream.closer) { - fh->handle.stream.closer(fh->handle.stream.handle TSRMLS_CC); - } - break; - case ZEND_HANDLE_FILENAME: - /* We're only supposed to get here when destructing the used_files hash, - * which doesn't really contain open files, but references to their names/paths - */ - break; - } - if (fh->opened_path) { - efree(fh->opened_path); - fh->opened_path = NULL; - } - if (fh->free_filename && fh->filename) { - efree(fh->filename); - fh->filename = NULL; - } -} - - -int zend_compare_file_handles(zend_file_handle *fh1, zend_file_handle *fh2) -{ - if (fh1->type != fh2->type) { - return 0; - } - switch (fh1->type) { - case ZEND_HANDLE_FP: - return fh1->handle.fp==fh2->handle.fp; - break; - case ZEND_HANDLE_STREAM: - return fh1->handle.stream.handle == fh2->handle.stream.handle; - break; - } - return 0; -} - - -ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle TSRMLS_DC) -{ - zend_llist_del_element(&CG(open_files), file_handle, (int (*)(void *, void *)) zend_compare_file_handles); -} - - -ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC) -{ - char *file_path=NULL; - - if (FAILURE == zend_stream_fixup(file_handle TSRMLS_CC)) { - return FAILURE; - } - - zend_llist_add_element(&CG(open_files), file_handle); - - /* Reset the scanner for scanning the new file */ - SCNG(yy_in) = file_handle; - -#ifdef ZEND_MULTIBYTE - if (file_handle->handle.stream.interactive == 0) { - if (zend_multibyte_read_script(TSRMLS_C) != 0) { - return FAILURE; - } - - /* force flex to use buffer only */ - SCNG(yy_in) = NULL; - SCNG(init) = 0; - SCNG(start) = 1; - - zend_multibyte_set_filter(NULL TSRMLS_CC); - - if (!SCNG(input_filter)) { - SCNG(script_filtered) = (char*)emalloc(SCNG(script_org_size)+1); - memcpy(SCNG(script_filtered), SCNG(script_org), SCNG(script_org_size)+1); - SCNG(script_filtered_size) = SCNG(script_org_size); - } else { - SCNG(input_filter)(&SCNG(script_filtered), &SCNG(script_filtered_size), SCNG(script_org), SCNG(script_org_size) TSRMLS_CC); - } - - /* flex requires doubled null */ - SCNG(script_filtered) = (char*)erealloc(SCNG(script_filtered), SCNG(script_filtered_size)+2); - *(SCNG(script_filtered)+SCNG(script_filtered_size)) = (char)NULL; - *(SCNG(script_filtered)+SCNG(script_filtered_size)+1) = (char)NULL; - yy_scan_buffer(SCNG(script_filtered), SCNG(script_filtered_size)+2 TSRMLS_CC); - } else { - yy_switch_to_buffer(yy_create_buffer(SCNG(yy_in), YY_BUF_SIZE TSRMLS_CC) TSRMLS_CC); - } -#else /* !ZEND_MULTIBYTE */ - yy_switch_to_buffer(yy_create_buffer(SCNG(yy_in), YY_BUF_SIZE TSRMLS_CC) TSRMLS_CC); -#endif /* ZEND_MULTIBYTE */ - - BEGIN(INITIAL); - - if (file_handle->opened_path) { - file_path = file_handle->opened_path; - } else { - file_path = file_handle->filename; - } - - zend_set_compiled_filename(file_path TSRMLS_CC); - - if (CG(start_lineno)) { - CG(zend_lineno) = CG(start_lineno); - CG(start_lineno) = 0; - } else { - CG(zend_lineno) = 1; - } - - CG(increment_lineno) = 0; - return SUCCESS; -} -END_EXTERN_C() - - -ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSRMLS_DC) -{ - zend_lex_state original_lex_state; - zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array)); - zend_op_array *original_active_op_array = CG(active_op_array); - zend_op_array *retval=NULL; - int compiler_result; - zend_bool compilation_successful=0; - znode retval_znode; - zend_bool original_in_compilation = CG(in_compilation); - - retval_znode.op_type = IS_CONST; - retval_znode.u.constant.type = IS_LONG; - retval_znode.u.constant.value.lval = 1; - retval_znode.u.constant.is_ref = 0; - retval_znode.u.constant.refcount = 1; - - zend_save_lexical_state(&original_lex_state TSRMLS_CC); - - retval = op_array; /* success oriented */ - - if (open_file_for_scanning(file_handle TSRMLS_CC)==FAILURE) { - if (type==ZEND_REQUIRE) { - zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename); - zend_bailout(); - } else { - zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename); - } - compilation_successful=0; - } else { - init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE TSRMLS_CC); - CG(in_compilation) = 1; - CG(active_op_array) = op_array; - compiler_result = zendparse(TSRMLS_C); - zend_do_return(&retval_znode, 0 TSRMLS_CC); - zend_do_handle_exception(TSRMLS_C); - CG(in_compilation) = original_in_compilation; - if (compiler_result==1) { /* parser error */ - zend_bailout(); - } - compilation_successful=1; - } - - if (retval) { - CG(active_op_array) = original_active_op_array; - if (compilation_successful) { - pass_two(op_array TSRMLS_CC); - } else { - efree(op_array); - retval = NULL; - } - } - if (compilation_successful) { - zend_restore_lexical_state(&original_lex_state TSRMLS_CC); - } - return retval; -} - - -zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC) -{ - zend_file_handle file_handle; - zval tmp; - zend_op_array *retval; - char *opened_path = NULL; - - if (filename->type != IS_STRING) { - tmp = *filename; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - filename = &tmp; - } - file_handle.filename = filename->value.str.val; - file_handle.free_filename = 0; - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.opened_path = NULL; - file_handle.handle.fp = NULL; - - retval = zend_compile_file(&file_handle, type TSRMLS_CC); - if (retval && file_handle.handle.stream.handle) { - int dummy = 1; - - if (!file_handle.opened_path) { - file_handle.opened_path = opened_path = estrndup(filename->value.str.val, filename->value.str.len); - } - - zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL); - - if (opened_path) { - efree(opened_path); - } - } - zend_destroy_file_handle(&file_handle TSRMLS_CC); - - if (filename==&tmp) { - zval_dtor(&tmp); - } - return retval; -} - -ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_DC) -{ - /* enforce two trailing NULLs for flex... */ - STR_REALLOC(str->value.str.val, str->value.str.len+2); - - str->value.str.val[str->value.str.len+1]=0; - - SCNG(yy_in)=NULL; - -#ifdef ZEND_MULTIBYTE - SCNG(script_org) = estrdup(str->value.str.val); - SCNG(script_org_size) = str->value.str.len; - - zend_multibyte_set_filter(CG(internal_encoding) TSRMLS_CC); - - if (!SCNG(input_filter)) { - SCNG(script_filtered) = (char*)emalloc(SCNG(script_org_size)+1); - memcpy(SCNG(script_filtered), SCNG(script_org), SCNG(script_org_size)+1); - SCNG(script_filtered_size) = SCNG(script_org_size); - } else { - SCNG(input_filter)(&SCNG(script_filtered), &SCNG(script_filtered_size), SCNG(script_org), SCNG(script_org_size) TSRMLS_CC); - } - - /* flex requires doubled null */ - SCNG(script_filtered) = (char*)erealloc(SCNG(script_filtered), SCNG(script_filtered_size)+2); - *(SCNG(script_filtered)+SCNG(script_filtered_size)) = (char)NULL; - *(SCNG(script_filtered)+SCNG(script_filtered_size)+1) = (char)NULL; - yy_scan_buffer(SCNG(script_filtered), SCNG(script_filtered_size)+2 TSRMLS_CC); -#else /* !ZEND_MULTIBYTE */ - yy_scan_buffer(str->value.str.val, str->value.str.len+2 TSRMLS_CC); -#endif /* ZEND_MULTIBYTE */ - - zend_set_compiled_filename(filename TSRMLS_CC); - CG(zend_lineno) = 1; - CG(increment_lineno) = 0; - return SUCCESS; -} - - -ZEND_API int zend_get_scanned_file_offset(TSRMLS_D) -{ - if (yyin) { - int offset_in_buffer = (yy_c_buf_p - (YY_CURRENT_BUFFER)->yy_ch_buf); - int read_bytes = SCNG(yy_n_chars); - int offset_from_the_end = read_bytes - offset_in_buffer; - - return zend_stream_ftell(yyin TSRMLS_CC) - offset_from_the_end; - } else { - /* The entire file is in the buffer; probably zend multibyte - is enabled */ - return (yy_c_buf_p - (YY_CURRENT_BUFFER)->yy_ch_buf); - } -} - - -zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC) -{ - zend_lex_state original_lex_state; - zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array)); - zend_op_array *original_active_op_array = CG(active_op_array); - zend_op_array *retval; - zval tmp; - int compiler_result; - zend_bool original_in_compilation = CG(in_compilation); - - if (source_string->value.str.len==0) { - efree(op_array); - return NULL; - } - - CG(in_compilation) = 1; - - tmp = *source_string; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - source_string = &tmp; - - zend_save_lexical_state(&original_lex_state TSRMLS_CC); - if (zend_prepare_string_for_scanning(source_string, filename TSRMLS_CC)==FAILURE) { - efree(op_array); - retval = NULL; - } else { - init_op_array(op_array, ZEND_EVAL_CODE, INITIAL_OP_ARRAY_SIZE TSRMLS_CC); - CG(active_op_array) = op_array; - BEGIN(ST_IN_SCRIPTING); - compiler_result = zendparse(TSRMLS_C); - -#ifdef ZEND_MULTIBYTE - if (SCNG(script_org)) { - efree(SCNG(script_org)); - SCNG(script_org) = NULL; - } - if (SCNG(script_filtered)) { - efree(SCNG(script_filtered)); - SCNG(script_filtered) = NULL; - } -#endif /* ZEND_MULTIBYTE */ - - if (compiler_result==1) { - CG(active_op_array) = original_active_op_array; - CG(unclean_shutdown)=1; - retval = NULL; - } else { - zend_do_return(NULL, 0 TSRMLS_CC); - zend_do_handle_exception(TSRMLS_C); - CG(active_op_array) = original_active_op_array; - pass_two(op_array TSRMLS_CC); - retval = op_array; - } - zend_restore_lexical_state(&original_lex_state TSRMLS_CC); - } - zval_dtor(&tmp); - CG(in_compilation) = original_in_compilation; - return retval; -} - - -BEGIN_EXTERN_C() -int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC) -{ - zend_lex_state original_lex_state; - zend_file_handle file_handle; - - file_handle.type = ZEND_HANDLE_FILENAME; - file_handle.filename = filename; - file_handle.free_filename = 0; - file_handle.opened_path = NULL; - zend_save_lexical_state(&original_lex_state TSRMLS_CC); - if (open_file_for_scanning(&file_handle TSRMLS_CC)==FAILURE) { - zend_message_dispatcher(ZMSG_FAILED_HIGHLIGHT_FOPEN, filename); - return FAILURE; - } - zend_highlight(syntax_highlighter_ini TSRMLS_CC); -#ifdef ZEND_MULTIBYTE - if (SCNG(script_org)) { - efree(SCNG(script_org)); - SCNG(script_org) = NULL; - } - if (SCNG(script_filtered)) { - efree(SCNG(script_filtered)); - SCNG(script_filtered) = NULL; - } -#endif /* ZEND_MULTIBYTE */ - zend_destroy_file_handle(&file_handle TSRMLS_CC); - zend_restore_lexical_state(&original_lex_state TSRMLS_CC); - return SUCCESS; -} - -int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name TSRMLS_DC) -{ - zend_lex_state original_lex_state; - zval tmp = *str; - - str = &tmp; - zval_copy_ctor(str); - zend_save_lexical_state(&original_lex_state TSRMLS_CC); - if (zend_prepare_string_for_scanning(str, str_name TSRMLS_CC)==FAILURE) { - return FAILURE; - } - BEGIN(INITIAL); - zend_highlight(syntax_highlighter_ini TSRMLS_CC); -#ifdef ZEND_MULTIBYTE - if (SCNG(script_org)) { - efree(SCNG(script_org)); - SCNG(script_org) = NULL; - } - if (SCNG(script_filtered)) { - efree(SCNG(script_filtered)); - SCNG(script_filtered) = NULL; - } -#endif /* ZEND_MULTIBYTE */ - zend_restore_lexical_state(&original_lex_state TSRMLS_CC); - zval_dtor(str); - return SUCCESS; -} -END_EXTERN_C() - -#ifdef ZEND_MULTIBYTE -BEGIN_EXTERN_C() -ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, zend_encoding *old_encoding TSRMLS_DC) -{ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; - int offset, original_offset, length, free_flag; - char *p; - zend_encoding *new_encoding; - - /* calculate current position */ - offset = original_offset = yy_c_buf_p - b->yy_ch_buf; - if (old_input_filter && original_offset > 0) { - new_encoding = SCNG(script_encoding); - SCNG(script_encoding) = old_encoding; - do { - (old_input_filter)(&p, &length, SCNG(script_org), offset TSRMLS_CC); - if (!p) { - SCNG(script_encoding) = new_encoding; - return; - } - efree(p); - if (length > original_offset) { - offset--; - } else if (length < original_offset) { - offset++; - } - } while (original_offset != length); - SCNG(script_encoding) = new_encoding; - } - - /* convert and set */ - if (!SCNG(input_filter)) { - length = SCNG(script_org_size)-offset-1; - p = SCNG(script_org)+offset+1; - free_flag = 0; - } else { - SCNG(input_filter)(&p, &length, SCNG(script_org)+offset+1, SCNG(script_org_size)-offset-1 TSRMLS_CC); - free_flag = 1; - } - if (original_offset+length+1 > (int)b->yy_buf_size) { - b->yy_buf_size = original_offset+length+1; - b->yy_ch_buf = (char*)erealloc(b->yy_ch_buf, b->yy_buf_size+2); - SCNG(script_filtered) = b->yy_ch_buf; - SCNG(script_filtered_size) = b->yy_buf_size; - } - yy_c_buf_p = b->yy_ch_buf + original_offset; - strncpy(yy_c_buf_p+1, p, length); - b->yy_n_chars = original_offset + length + 1; - SCNG(yy_n_chars) = b->yy_n_chars; - b->yy_ch_buf[SCNG(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[SCNG(yy_n_chars)+1] = YY_END_OF_BUFFER_CHAR; - - if (free_flag) { - efree(p); - } -} - - -ZEND_API int zend_multibyte_yyinput(zend_file_handle *file_handle, char *buf, size_t len TSRMLS_DC) -{ - int c = '*', n; - - if (file_handle->handle.stream.interactive == 0) { - return zend_stream_read(file_handle, buf, len TSRMLS_CC); - } - - /* interactive */ - if (SCNG(script_org)) { - efree(SCNG(script_org)); - } - if (SCNG(script_filtered)) { - efree(SCNG(script_filtered)); - } - SCNG(script_org) = NULL; - SCNG(script_org_size) = 0; - - /* TODO: support widechars */ - - for (n = 0; n < sizeof(buf) && (c = zend_stream_getc(yyin TSRMLS_CC)) != EOF && c != '\n'; ++n) { - buf[n] = (char)c; - } - if (c == '\n') { - buf[n++] = (char) c; - } - - SCNG(script_org_size) = n; - SCNG(script_org) = (char*)emalloc(SCNG(script_org_size)+1); - memcpy(SCNG(script_org)+SCNG(script_org_size)-n, buf, n); - - return n; -} - - -ZEND_API int zend_multibyte_read_script(TSRMLS_D) -{ - char buf[8192]; - int n; - - if (SCNG(script_org)) { - efree(SCNG(script_org)); - } - SCNG(script_org) = NULL; - SCNG(script_org_size) = 0; - - for (;;) { - n = zend_stream_read(yyin, buf, sizeof(buf) TSRMLS_CC); - if (n <= 0) { - break; - } - - SCNG(script_org_size) += n; - if (SCNG(script_org)) { - SCNG(script_org) = (char*)erealloc(SCNG(script_org), SCNG(script_org_size)+1); - } else { - SCNG(script_org) = (char*)emalloc(SCNG(script_org_size)+1); - } - memcpy(SCNG(script_org)+SCNG(script_org_size)-n, buf, n); - } - - if (n < 0) { - return -1; - } - - if (!SCNG(script_org)) { - SCNG(script_org) = emalloc(SCNG(script_org_size)+1); - } - *(SCNG(script_org)+SCNG(script_org_size)) = (char)NULL; - - return 0; -} - - -# define zend_copy_value(zendlval, yytext, yyleng) \ - if (SCNG(output_filter)) { \ - SCNG(output_filter)(&(zendlval->value.str.val), &(zendlval->value.str.len), yytext, yyleng TSRMLS_CC); \ - } else { \ - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); \ - zendlval->value.str.len = yyleng; \ - } -#else /* ZEND_MULTIBYTE */ -# define zend_copy_value(zendlval, yytext, yyleng) \ - zendlval->value.str.val = (char *)estrndup(yytext, yyleng); \ - zendlval->value.str.len = yyleng; -#endif /* ZEND_MULTIBYTE */ -%} - -LNUM [0-9]+ -DNUM ([0-9]*[\.][0-9]+)|([0-9]+[\.][0-9]*) -EXPONENT_DNUM (({LNUM}|{DNUM})[eE][+-]?{LNUM}) -HNUM "0x"[0-9a-fA-F]+ -LABEL [a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]* -WHITESPACE [ \n\r\t]+ -TABS_AND_SPACES [ \t]* -TOKENS [;:,.\[\]()|^&+-/*=%!~$<>?@] -ENCAPSED_TOKENS [\[\]{}$] -ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+ -ANY_CHAR (.|[\n]) -NEWLINE ("\r"|"\n"|"\r\n") - -%option noyylineno -%option noyywrap -%% - -"exit" { - return T_EXIT; -} - -"die" { - return T_EXIT; -} - -"function" { - return T_FUNCTION; -} - -"const" { - return T_CONST; -} - -"return" { - return T_RETURN; -} - -"try" { - return T_TRY; -} - -"catch" { - return T_CATCH; -} - -"throw" { - return T_THROW; -} - -"if" { - return T_IF; -} - -"elseif" { - return T_ELSEIF; -} - -"endif" { - return T_ENDIF; -} - -"else" { - return T_ELSE; -} - -"while" { - return T_WHILE; -} - -"endwhile" { - return T_ENDWHILE; -} - -"do" { - return T_DO; -} - -"for" { - return T_FOR; -} - -"endfor" { - return T_ENDFOR; -} - -"foreach" { - return T_FOREACH; -} - -"endforeach" { - return T_ENDFOREACH; -} - -"declare" { - return T_DECLARE; -} - -"enddeclare" { - return T_ENDDECLARE; -} - -"instanceof" { - return T_INSTANCEOF; -} - -"as" { - return T_AS; -} - -"switch" { - return T_SWITCH; -} - -"endswitch" { - return T_ENDSWITCH; -} - -"case" { - return T_CASE; -} - -"default" { - return T_DEFAULT; -} - -"break" { - return T_BREAK; -} - -"continue" { - return T_CONTINUE; -} - -"echo" { - return T_ECHO; -} - -"print" { - return T_PRINT; -} - -"class" { - return T_CLASS; -} - -"interface" { - return T_INTERFACE; -} - -"extends" { - return T_EXTENDS; -} - -"implements" { - return T_IMPLEMENTS; -} - -"->" { - yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC); - return T_OBJECT_OPERATOR; -} - -{LABEL} { - yy_pop_state(TSRMLS_C); - zend_copy_value(zendlval, yytext, yyleng); - zendlval->type = IS_STRING; - return T_STRING; -} - -{ANY_CHAR} { - yyless(0); - yy_pop_state(TSRMLS_C); -} - -"::" { - return T_PAAMAYIM_NEKUDOTAYIM; -} - -"new" { - return T_NEW; -} - -"clone" { - return T_CLONE; -} - -"var" { - return T_VAR; -} - -"("{TABS_AND_SPACES}("int"|"integer"){TABS_AND_SPACES}")" { - return T_INT_CAST; -} - -"("{TABS_AND_SPACES}("real"|"double"|"float"){TABS_AND_SPACES}")" { - return T_DOUBLE_CAST; -} - -"("{TABS_AND_SPACES}"string"{TABS_AND_SPACES}")" { - return T_STRING_CAST; -} - -"("{TABS_AND_SPACES}"array"{TABS_AND_SPACES}")" { - return T_ARRAY_CAST; -} - -"("{TABS_AND_SPACES}"object"{TABS_AND_SPACES}")" { - return T_OBJECT_CAST; -} - -"("{TABS_AND_SPACES}("bool"|"boolean"){TABS_AND_SPACES}")" { - return T_BOOL_CAST; -} - -"("{TABS_AND_SPACES}("unset"){TABS_AND_SPACES}")" { - return T_UNSET_CAST; -} - -"eval" { - return T_EVAL; -} - -"include" { - return T_INCLUDE; -} - -"include_once" { - return T_INCLUDE_ONCE; -} - -"require" { - return T_REQUIRE; -} - -"require_once" { - return T_REQUIRE_ONCE; -} - -"use" { - return T_USE; -} - -"global" { - return T_GLOBAL; -} - -"isset" { - return T_ISSET; -} - -"empty" { - return T_EMPTY; -} - -"__halt_compiler" { - return T_HALT_COMPILER; -} - -"static" { - return T_STATIC; -} - -"abstract" { - return T_ABSTRACT; -} - -"final" { - return T_FINAL; -} - -"private" { - return T_PRIVATE; -} - -"protected" { - return T_PROTECTED; -} - -"public" { - return T_PUBLIC; -} - -"unset" { - return T_UNSET; -} - -"=>" { - return T_DOUBLE_ARROW; -} - -"list" { - return T_LIST; -} - -"array" { - return T_ARRAY; -} - -"++" { - return T_INC; -} - -"--" { - return T_DEC; -} - -"===" { - return T_IS_IDENTICAL; -} - -"!==" { - return T_IS_NOT_IDENTICAL; -} - -"==" { - return T_IS_EQUAL; -} - -"!="|"<>" { - return T_IS_NOT_EQUAL; -} - -"<=" { - return T_IS_SMALLER_OR_EQUAL; -} - -">=" { - return T_IS_GREATER_OR_EQUAL; -} - -"+=" { - return T_PLUS_EQUAL; -} - -"-=" { - return T_MINUS_EQUAL; -} - -"*=" { - return T_MUL_EQUAL; -} - -"/=" { - return T_DIV_EQUAL; -} - -".=" { - return T_CONCAT_EQUAL; -} - -"%=" { - return T_MOD_EQUAL; -} - -"<<=" { - return T_SL_EQUAL; -} - -">>=" { - return T_SR_EQUAL; -} - -"&=" { - return T_AND_EQUAL; -} - -"|=" { - return T_OR_EQUAL; -} - -"^=" { - return T_XOR_EQUAL; -} - -"||" { - return T_BOOLEAN_OR; -} - -"&&" { - return T_BOOLEAN_AND; -} - -"OR" { - return T_LOGICAL_OR; -} - -"AND" { - return T_LOGICAL_AND; -} - -"XOR" { - return T_LOGICAL_XOR; -} - -"<<" { - return T_SL; -} - -">>" { - return T_SR; -} - -{TOKENS} { - return yytext[0]; -} - - -"{" { - yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); - return '{'; -} - - -"${" { - yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC); - return T_DOLLAR_OPEN_CURLY_BRACES; -} - - -"}" { - RESET_DOC_COMMENT(); - /* This is a temporary fix which is dependant on flex and it's implementation */ - if (yy_start_stack_ptr) { - yy_pop_state(TSRMLS_C); - } - return '}'; -} - - -{LABEL} { - zend_copy_value(zendlval, yytext, yyleng); - zendlval->type = IS_STRING; - yy_pop_state(TSRMLS_C); - yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); - return T_STRING_VARNAME; -} - - -{ANY_CHAR} { - yyless(0); - yy_pop_state(TSRMLS_C); - yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); -} - - -{LNUM} { - errno = 0; - zendlval->value.lval = strtol(yytext, NULL, 0); - if (errno == ERANGE) { /* overflow */ - zendlval->value.dval = zend_strtod(yytext, NULL); - zendlval->type = IS_DOUBLE; - return T_DNUMBER; - } else { - zendlval->type = IS_LONG; - return T_LNUMBER; - } -} - -{HNUM} { - errno = 0; - zendlval->value.lval = strtoul(yytext, NULL, 16); - if (errno == ERANGE) { /* overflow */ - /* not trying strtod - it returns trash on 0x-es */ - zendlval->value.lval = LONG_MAX; /* maximal long */ - zend_error(E_NOTICE,"Hex number is too big: %s", yytext); - } else { - if (zendlval->value.lval < 0) { - /* maintain consistency with the old way */ - zendlval->value.dval = (unsigned long) zendlval->value.lval; - zendlval->type = IS_DOUBLE; - return T_DNUMBER; - } - zendlval->type = IS_LONG; - } - zendlval->type = IS_LONG; - return T_LNUMBER; -} - -{LNUM}|{HNUM} { /* treat numbers (almost) as strings inside encapsulated strings */ - zendlval->value.str.val = (char *)estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_NUM_STRING; -} - -{DNUM}|{EXPONENT_DNUM} { - zendlval->value.dval = zend_strtod(yytext, NULL); - zendlval->type = IS_DOUBLE; - return T_DNUMBER; -} - -"__CLASS__" { - char *class_name = NULL; - - if (CG(active_class_entry)) { - class_name = CG(active_class_entry)->name; - } - - if (!class_name) { - class_name = ""; - } - zendlval->value.str.len = strlen(class_name); - zendlval->value.str.val = estrndup(class_name, zendlval->value.str.len); - zendlval->type = IS_STRING; - return T_CLASS_C; -} - -"__FUNCTION__" { - char *func_name = NULL; - - if (CG(active_op_array)) { - func_name = CG(active_op_array)->function_name; - } - - if (!func_name) { - func_name = ""; - } - zendlval->value.str.len = strlen(func_name); - zendlval->value.str.val = estrndup(func_name, zendlval->value.str.len); - zendlval->type = IS_STRING; - return T_FUNC_C; -} - -"__METHOD__" { - char *class_name = CG(active_class_entry) ? CG(active_class_entry)->name : NULL; - char *func_name = CG(active_op_array)? CG(active_op_array)->function_name : NULL; - size_t len = 0; - - if (class_name) { - len += strlen(class_name) + 2; - } - if (func_name) { - len += strlen(func_name); - } - - zendlval->value.str.val = emalloc(len+1); - zendlval->value.str.len = sprintf(zendlval->value.str.val, "%s%s%s", - class_name ? class_name : "", - class_name && func_name ? "::" : "", - func_name ? func_name : "" - ); - zendlval->value.str.len = strlen(zendlval->value.str.val); - zendlval->type = IS_STRING; - return T_METHOD_C; -} - -"__LINE__" { - zendlval->value.lval = CG(zend_lineno); - zendlval->type = IS_LONG; - return T_LINE; -} - -"__FILE__" { - char *filename = zend_get_compiled_filename(TSRMLS_C); - - if (!filename) { - filename = ""; - } - zendlval->value.str.len = strlen(filename); - zendlval->value.str.val = estrndup(filename, zendlval->value.str.len); - zendlval->type = IS_STRING; - return T_FILE; -} - -(([^<]|"<"[^?%s<]){1,400})|"value.str.val), &(zendlval->value.str.len), yytext, yyleng TSRMLS_CC); - if (readsize < yyleng) { - yyless(readsize); - } - } else { - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - } -#else /* !ZEND_MULTIBYTE */ - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; -#endif /* ZEND_MULTIBYTE */ - zendlval->type = IS_STRING; - HANDLE_NEWLINES(yytext, yyleng); - return T_INLINE_HTML; -} - -"" { - HANDLE_NEWLINES(yytext, yyleng); - if (CG(short_tags) || yyleng>2) { /* yyleng>2 means it's not */ - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - BEGIN(ST_IN_SCRIPTING); - return T_OPEN_TAG; - } else { - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_INLINE_HTML; - } -} - - -"<%="|"value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - BEGIN(ST_IN_SCRIPTING); - return T_OPEN_TAG_WITH_ECHO; - } else { - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_INLINE_HTML; - } -} - - -"<%" { - if (CG(asp_tags)) { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - BEGIN(ST_IN_SCRIPTING); - return T_OPEN_TAG; - } else { - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_INLINE_HTML; - } -} - - -"value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - HANDLE_NEWLINE(yytext[yyleng-1]); - BEGIN(ST_IN_SCRIPTING); - return T_OPEN_TAG; -} - -"$"{LABEL} { - zend_copy_value(zendlval, (yytext+1), (yyleng-1)); - zendlval->type = IS_STRING; - return T_VARIABLE; -} - -{LABEL} { - zend_copy_value(zendlval, yytext, yyleng); - zendlval->type = IS_STRING; - return T_STRING; -} - -{LABEL} { - zend_copy_value(zendlval, yytext, yyleng); - zendlval->type = IS_STRING; - return T_STRING; -} - - -{WHITESPACE} { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - HANDLE_NEWLINES(yytext, yyleng); - return T_WHITESPACE; -} - - -"#"|"//" { - BEGIN(ST_ONE_LINE_COMMENT); - yymore(); -} - -"?"|"%"|">" { - yymore(); -} - -[^\n\r?%>]*{ANY_CHAR} { - switch (yytext[yyleng-1]) { - case '?': case '%': case '>': - yyless(yyleng-1); - yymore(); - break; - case '\n': - CG(zend_lineno)++; - /* intentional fall through */ - default: - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - BEGIN(ST_IN_SCRIPTING); - return T_COMMENT; - } -} - -{NEWLINE} { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - BEGIN(ST_IN_SCRIPTING); - CG(zend_lineno)++; - return T_COMMENT; -} - -"?>"|"%>" { - if (CG(asp_tags) || yytext[yyleng-2] != '%') { /* asp comment? */ - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng-2; - zendlval->type = IS_STRING; - yyless(yyleng-2); - BEGIN(ST_IN_SCRIPTING); - return T_COMMENT; - } else { - yymore(); - } -} - -"/**"{WHITESPACE} { - CG(comment_start_line) = CG(zend_lineno); - RESET_DOC_COMMENT(); - BEGIN(ST_DOC_COMMENT); - yymore(); -} - -"/*" { - CG(comment_start_line) = CG(zend_lineno); - BEGIN(ST_COMMENT); - yymore(); -} - - -[^*]+ { - yymore(); -} - -"*/" { - CG(doc_comment) = estrndup(yytext, yyleng); - CG(doc_comment_len) = yyleng; - HANDLE_NEWLINES(yytext, yyleng); - BEGIN(ST_IN_SCRIPTING); - return T_DOC_COMMENT; -} - -"*/" { - HANDLE_NEWLINES(yytext, yyleng); - BEGIN(ST_IN_SCRIPTING); - return T_COMMENT; -} - -"*" { - yymore(); -} - -("?>"|""){NEWLINE}? { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - BEGIN(INITIAL); - return T_CLOSE_TAG; /* implicit ';' at php-end tag */ -} - - -"%>"{NEWLINE}? { - if (CG(asp_tags)) { - BEGIN(INITIAL); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - zendlval->value.str.val = yytext; /* no copying - intentional */ - return T_CLOSE_TAG; /* implicit ';' at php-end tag */ - } else { - yyless(1); - return yytext[0]; - } -} - - -(["]([^$"\\]|("\\".))*["]) { - register char *s, *t; - char *end; - - zendlval->value.str.val = estrndup(yytext+1, yyleng-2); - zendlval->value.str.len = yyleng-2; - zendlval->type = IS_STRING; - HANDLE_NEWLINES(yytext, yyleng); - - /* convert escape sequences */ - s = t = zendlval->value.str.val; - end = s+zendlval->value.str.len; - while (s=end) { - continue; - } - switch(*s) { - case 'n': - *t++ = '\n'; - zendlval->value.str.len--; - break; - case 'r': - *t++ = '\r'; - zendlval->value.str.len--; - break; - case 't': - *t++ = '\t'; - zendlval->value.str.len--; - break; - case '\\': - case '$': - case '"': - *t++ = *s; - zendlval->value.str.len--; - break; - default: - /* check for an octal */ - if (ZEND_IS_OCT(*s)) { - char octal_buf[4] = { 0, 0, 0, 0 }; - - octal_buf[0] = *s; - zendlval->value.str.len--; - if ((s+1)value.str.len--; - if ((s+1)value.str.len--; - } - } - *t++ = (char) strtol(octal_buf, NULL, 8); - } else if (*s=='x' && (s+1)value.str.len--; /* for the 'x' */ - - hex_buf[0] = *(++s); - zendlval->value.str.len--; - if ((s+1)value.str.len--; - } - *t++ = (char) strtol(hex_buf, NULL, 16); - } else { - *t++ = '\\'; - *t++ = *s; - } - break; - } - s++; - } else { - *t++ = *s++; - } - } - *t = 0; - -#ifdef ZEND_MULTIBYTE - if (SCNG(output_filter)) { - s = zendlval->value.str.val; - SCNG(output_filter)(&(zendlval->value.str.val), &(zendlval->value.str.len), s, zendlval->value.str.len TSRMLS_CC); - efree(s); - } -#endif /* ZEND_MULTIBYTE */ - - return T_CONSTANT_ENCAPSED_STRING; -} - - -([']([^'\\]|("\\".))*[']) { - register char *s, *t; - char *end; - - zendlval->value.str.val = estrndup(yytext+1, yyleng-2); - zendlval->value.str.len = yyleng-2; - zendlval->type = IS_STRING; - HANDLE_NEWLINES(yytext, yyleng); - - /* convert escape sequences */ - s = t = zendlval->value.str.val; - end = s+zendlval->value.str.len; - while (s=end) { - continue; - } - switch(*s) { - case '\\': - case '\'': - *t++ = *s; - zendlval->value.str.len--; - break; - default: - *t++ = '\\'; - *t++ = *s; - break; - } - s++; - } else { - *t++ = *s++; - } - } - *t = 0; - -#ifdef ZEND_MULTIBYTE - if (SCNG(output_filter)) { - s = zendlval->value.str.val; - SCNG(output_filter)(&(zendlval->value.str.val), &(zendlval->value.str.len), s, zendlval->value.str.len TSRMLS_CC); - efree(s); - } -#endif /* ZEND_MULTIBYTE */ - - return T_CONSTANT_ENCAPSED_STRING; -} - - -["] { - BEGIN(ST_DOUBLE_QUOTES); - return '\"'; -} - - -"<<<"{TABS_AND_SPACES}{LABEL}{NEWLINE} { - char *s; - CG(zend_lineno)++; - CG(heredoc_len) = yyleng-3-1-(yytext[yyleng-2]=='\r'?1:0); - s = yytext+3; - while ((*s == ' ') || (*s == '\t')) { - s++; - CG(heredoc_len)--; - } - CG(heredoc) = estrndup(s, CG(heredoc_len)); - BEGIN(ST_HEREDOC); - return T_START_HEREDOC; -} - - -[`] { - BEGIN(ST_BACKQUOTE); - return '`'; -} - - -['] { - BEGIN(ST_SINGLE_QUOTE); - return '\''; -} - - -^{LABEL}(";")?{NEWLINE} { - int label_len; - - if (yytext[yyleng-2]=='\r') { - label_len = yyleng-2; - } else { - label_len = yyleng-1; - } - - if (yytext[label_len-1]==';') { - label_len--; - } - - if (label_len==CG(heredoc_len) && !memcmp(yytext, CG(heredoc), label_len)) { - zendlval->value.str.val = estrndup(yytext, label_len); /* unput destroys yytext */ - zendlval->value.str.len = label_len; - yyless(yyleng - (yyleng - label_len)); - efree(CG(heredoc)); - CG(heredoc)=NULL; - CG(heredoc_len)=0; - BEGIN(ST_IN_SCRIPTING); - return T_END_HEREDOC; - } else { - CG(zend_lineno)++; - zend_copy_value(zendlval, yytext, yyleng); - zendlval->type = IS_STRING; - return T_STRING; - } -} - - -{ESCAPED_AND_WHITESPACE} { - HANDLE_NEWLINES(yytext, yyleng); - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_ENCAPSED_AND_WHITESPACE; -} - -([^'\\]|\\[^'\\])+ { - HANDLE_NEWLINES(yytext, yyleng); - zend_copy_value(zendlval, yytext, yyleng); - zendlval->type = IS_STRING; - return T_ENCAPSED_AND_WHITESPACE; -} - - -[`]+ { - zend_copy_value(zendlval, yytext, yyleng); - zendlval->type = IS_STRING; - return T_ENCAPSED_AND_WHITESPACE; -} - - -["]+ { - zend_copy_value(zendlval, yytext, yyleng); - zendlval->type = IS_STRING; - return T_ENCAPSED_AND_WHITESPACE; -} - - -"$"[^a-zA-Z_\x7f-\xff{] { - zendlval->value.lval = (long) yytext[0]; - if (yyleng == 2) { - yyless(1); - } - return T_CHARACTER; -} - - -{ENCAPSED_TOKENS} { - zendlval->value.lval = (long) yytext[0]; - return yytext[0]; -} - -"\\{" { - zendlval->value.str.val = estrndup("\\{", sizeof("\\{") - 1); - zendlval->value.str.len = sizeof("\\{") - 1; - zendlval->type = IS_STRING; - return T_STRING; -} - -"{$" { - zendlval->value.lval = (long) yytext[0]; - yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); - yyless(1); - return T_CURLY_OPEN; -} - - -"\\'" { - zendlval->value.lval = (long) '\''; - return T_CHARACTER; -} - -"\\\\" { - zendlval->value.lval = (long)'\\'; - return T_CHARACTER; -} - -"\\\"" { - zendlval->value.lval = (long) '"'; - return T_CHARACTER; -} - -"\\`" { - zendlval->value.lval = (long) '`'; - return T_CHARACTER; -} - -"\\"[0-7]{1,3} { - zendlval->value.lval = strtol(yytext+1, NULL, 8); - return T_CHARACTER; -} - -"\\x"[0-9A-Fa-f]{1,2} { - zendlval->value.lval = strtol (yytext+2, NULL, 16); - return T_CHARACTER; -} - -"\\"{ANY_CHAR} { - switch (yytext[1]) { - case 'n': - zendlval->value.lval = (long) '\n'; - break; - case 't': - zendlval->value.lval = (long) '\t'; - break; - case 'r': - zendlval->value.lval = (long) '\r'; - break; - case '\\': - zendlval->value.lval = (long) '\\'; - break; - case '$': - zendlval->value.lval = (long) yytext[1]; - break; - default: - zendlval->value.str.val = estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_BAD_CHARACTER; - break; - } - return T_CHARACTER; -} - - -["'`]+ { - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - return T_ENCAPSED_AND_WHITESPACE; -} - - -["] { - BEGIN(ST_IN_SCRIPTING); - return '\"'; -} - - -[`] { - BEGIN(ST_IN_SCRIPTING); - return '`'; -} - - -['] { - BEGIN(ST_IN_SCRIPTING); - return '\''; -} - - -<> { - return 0; -} - -<> { - zend_error(E_COMPILE_WARNING,"Unterminated comment starting line %d", CG(comment_start_line)); - return 0; -} - - - -{ANY_CHAR} { - zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE); -} diff --git a/Zend/zend_list.c b/Zend/zend_list.c deleted file mode 100644 index 9f2f430272..0000000000 --- a/Zend/zend_list.c +++ /dev/null @@ -1,374 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* resource lists */ - -#include "zend.h" -#include "zend_list.h" -#include "zend_API.h" -#include "zend_globals.h" - -ZEND_API int le_index_ptr; - -/* true global */ -static HashTable list_destructors; - - -ZEND_API int zend_list_insert(void *ptr, int type) -{ - int index; - zend_rsrc_list_entry le; - TSRMLS_FETCH(); - - le.ptr=ptr; - le.type=type; - le.refcount=1; - - index = zend_hash_next_free_element(&EG(regular_list)); - - zend_hash_index_update(&EG(regular_list), index, (void *) &le, sizeof(zend_rsrc_list_entry), NULL); - return index; -} - -ZEND_API int _zend_list_delete(int id TSRMLS_DC) -{ - zend_rsrc_list_entry *le; - - if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) { -/* printf("del(%d): %d->%d\n", id, le->refcount, le->refcount-1); */ - if (--le->refcount<=0) { - return zend_hash_index_del(&EG(regular_list), id); - } else { - return SUCCESS; - } - } else { - return FAILURE; - } -} - - -ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC) -{ - zend_rsrc_list_entry *le; - - if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) { - *type = le->type; - return le->ptr; - } else { - *type = -1; - return NULL; - } -} - -ZEND_API int _zend_list_addref(int id TSRMLS_DC) -{ - zend_rsrc_list_entry *le; - - if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) { -/* printf("add(%d): %d->%d\n", id, le->refcount, le->refcount+1); */ - le->refcount++; - return SUCCESS; - } else { - return FAILURE; - } -} - - -ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type) -{ - int rsrc_id; - - rsrc_id = zend_list_insert(rsrc_pointer, rsrc_type); - - if (rsrc_result) { - rsrc_result->value.lval = rsrc_id; - rsrc_result->type = IS_RESOURCE; - } - - return rsrc_id; -} - - -ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...) -{ - int id; - int actual_resource_type; - void *resource; - va_list resource_types; - int i; - char *space; - char *class_name; - - if (default_id==-1) { /* use id */ - if (!passed_id) { - if (resource_type_name) { - class_name = get_active_class_name(&space TSRMLS_CC); - zend_error(E_WARNING, "%s%s%s(): no %s resource supplied", class_name, space, get_active_function_name(TSRMLS_C), resource_type_name); - } - return NULL; - } else if ((*passed_id)->type != IS_RESOURCE) { - if (resource_type_name) { - class_name = get_active_class_name(&space TSRMLS_CC); - zend_error(E_WARNING, "%s%s%s(): supplied argument is not a valid %s resource", class_name, space, get_active_function_name(TSRMLS_C), resource_type_name); - } - return NULL; - } - id = (*passed_id)->value.lval; - } else { - id = default_id; - } - - resource = zend_list_find(id, &actual_resource_type); - if (!resource) { - if (resource_type_name) { - class_name = get_active_class_name(&space TSRMLS_CC); - zend_error(E_WARNING, "%s%s%s(): %d is not a valid %s resource", class_name, space, get_active_function_name(TSRMLS_C), id, resource_type_name); - } - return NULL; - } - - va_start(resource_types, num_resource_types); - for (i=0; itype, (void **) &ld)==SUCCESS) { - switch (ld->type) { - case ZEND_RESOURCE_LIST_TYPE_STD: - if (ld->list_dtor) { - (ld->list_dtor)(le->ptr); - } - break; - case ZEND_RESOURCE_LIST_TYPE_EX: - if (ld->list_dtor_ex) { - ld->list_dtor_ex(le TSRMLS_CC); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } else { - zend_error(E_WARNING,"Unknown list entry type in request shutdown (%d)", le->type); - } -} - - -void plist_entry_destructor(void *ptr) -{ - zend_rsrc_list_entry *le = (zend_rsrc_list_entry *) ptr; - zend_rsrc_list_dtors_entry *ld; - TSRMLS_FETCH(); - - if (zend_hash_index_find(&list_destructors, le->type, (void **) &ld)==SUCCESS) { - switch (ld->type) { - case ZEND_RESOURCE_LIST_TYPE_STD: - if (ld->plist_dtor) { - (ld->plist_dtor)(le->ptr); - } - break; - case ZEND_RESOURCE_LIST_TYPE_EX: - if (ld->plist_dtor_ex) { - ld->plist_dtor_ex(le TSRMLS_CC); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } else { - zend_error(E_WARNING,"Unknown persistent list entry type in module shutdown (%d)", le->type); - } -} - - -int zend_init_rsrc_list(TSRMLS_D) -{ - if (zend_hash_init(&EG(regular_list), 0, NULL, list_entry_destructor, 0)==SUCCESS) { - EG(regular_list).nNextFreeElement=1; /* we don't want resource id 0 */ - return SUCCESS; - } else { - return FAILURE; - } -} - - -int zend_init_rsrc_plist(TSRMLS_D) -{ - return zend_hash_init_ex(&EG(persistent_list), 0, NULL, plist_entry_destructor, 1, 0); -} - - -void zend_destroy_rsrc_list(HashTable *ht TSRMLS_DC) -{ - zend_hash_graceful_reverse_destroy(ht); -} - -static int clean_module_resource(zend_rsrc_list_entry *le, int *resource_id TSRMLS_DC) -{ - if (le->type == *resource_id) { - return 1; - } else { - return 0; - } -} - - -static int zend_clean_module_rsrc_dtors_cb(zend_rsrc_list_dtors_entry *ld, int *module_number TSRMLS_DC) -{ - if (ld->module_number == *module_number) { - zend_hash_apply_with_argument(&EG(regular_list), (apply_func_arg_t) clean_module_resource, (void *) &(ld->resource_id) TSRMLS_CC); - zend_hash_apply_with_argument(&EG(persistent_list), (apply_func_arg_t) clean_module_resource, (void *) &(ld->resource_id) TSRMLS_CC); - return 1; - } else { - return 0; - } -} - - -void zend_clean_module_rsrc_dtors(int module_number TSRMLS_DC) -{ - zend_hash_apply_with_argument(&list_destructors, (apply_func_arg_t) zend_clean_module_rsrc_dtors_cb, (void *) &module_number TSRMLS_CC); -} - - -ZEND_API int zend_register_list_destructors(void (*ld)(void *), void (*pld)(void *), int module_number) -{ - zend_rsrc_list_dtors_entry lde; - -#if 0 - printf("Registering destructors %d for module %d\n", list_destructors.nNextFreeElement, module_number); -#endif - - lde.list_dtor=(void (*)(void *)) ld; - lde.plist_dtor=(void (*)(void *)) pld; - lde.list_dtor_ex = lde.plist_dtor_ex = NULL; - lde.module_number = module_number; - lde.resource_id = list_destructors.nNextFreeElement; - lde.type = ZEND_RESOURCE_LIST_TYPE_STD; - lde.type_name = NULL; - - if (zend_hash_next_index_insert(&list_destructors, (void *) &lde, sizeof(zend_rsrc_list_dtors_entry), NULL)==FAILURE) { - return FAILURE; - } - return list_destructors.nNextFreeElement-1; -} - - -ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, char *type_name, int module_number) -{ - zend_rsrc_list_dtors_entry lde; - -#if 0 - printf("Registering destructors %d for module %d\n", list_destructors.nNextFreeElement, module_number); -#endif - - lde.list_dtor = NULL; - lde.plist_dtor = NULL; - lde.list_dtor_ex = ld; - lde.plist_dtor_ex = pld; - lde.module_number = module_number; - lde.resource_id = list_destructors.nNextFreeElement; - lde.type = ZEND_RESOURCE_LIST_TYPE_EX; - lde.type_name = type_name; - - if (zend_hash_next_index_insert(&list_destructors, (void *) &lde, sizeof(zend_rsrc_list_dtors_entry), NULL)==FAILURE) { - return FAILURE; - } - return list_destructors.nNextFreeElement-1; -} - -ZEND_API int zend_fetch_list_dtor_id(char *type_name) -{ - zend_rsrc_list_dtors_entry *lde; - HashPosition pos; - - zend_hash_internal_pointer_reset_ex(&list_destructors, &pos); - while (zend_hash_get_current_data_ex(&list_destructors, (void **)&lde, &pos) == SUCCESS) { - if (lde->type_name && (strcmp(type_name, lde->type_name) == 0)) { -#if 0 - printf("Found resource id %d for resource type %s\n", (*lde).resource_id, type_name); -#endif - return lde->resource_id; - } - zend_hash_move_forward_ex(&list_destructors, &pos); - } - - return 0; -} - -int zend_init_rsrc_list_dtors(void) -{ - int retval; - - retval = zend_hash_init(&list_destructors, 50, NULL, NULL, 1); - list_destructors.nNextFreeElement=1; /* we don't want resource type 0 */ - - return retval; -} - - -void zend_destroy_rsrc_list_dtors(void) -{ - zend_hash_destroy(&list_destructors); -} - - -char *zend_rsrc_list_get_rsrc_type(int resource TSRMLS_DC) -{ - zend_rsrc_list_dtors_entry *lde; - int rsrc_type; - - if (!zend_list_find(resource, &rsrc_type)) - return NULL; - - if (zend_hash_index_find(&list_destructors, rsrc_type, (void **) &lde)==SUCCESS) { - return lde->type_name; - } else { - return NULL; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_list.h b/Zend/zend_list.h deleted file mode 100644 index 434197bbbb..0000000000 --- a/Zend/zend_list.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_LIST_H -#define ZEND_LIST_H - -#include "zend_hash.h" -#include "zend_globals.h" - -BEGIN_EXTERN_C() - -#define ZEND_RESOURCE_LIST_TYPE_STD 1 -#define ZEND_RESOURCE_LIST_TYPE_EX 2 - -typedef struct _zend_rsrc_list_entry { - void *ptr; - int type; - int refcount; -} zend_rsrc_list_entry; - -typedef void (*rsrc_dtor_func_t)(zend_rsrc_list_entry *rsrc TSRMLS_DC); -#define ZEND_RSRC_DTOR_FUNC(name) void name(zend_rsrc_list_entry *rsrc TSRMLS_DC) - -typedef struct _zend_rsrc_list_dtors_entry { - /* old style destructors */ - void (*list_dtor)(void *); - void (*plist_dtor)(void *); - - /* new style destructors */ - rsrc_dtor_func_t list_dtor_ex; - rsrc_dtor_func_t plist_dtor_ex; - - char *type_name; - - int module_number; - int resource_id; - unsigned char type; -} zend_rsrc_list_dtors_entry; - - -#define register_list_destructors(ld, pld) zend_register_list_destructors((void (*)(void *))ld, (void (*)(void *))pld, module_number); -ZEND_API int zend_register_list_destructors(void (*ld)(void *), void (*pld)(void *), int module_number); -ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, char *type_name, int module_number); - -void list_entry_destructor(void *ptr); -void plist_entry_destructor(void *ptr); - -void zend_clean_module_rsrc_dtors(int module_number TSRMLS_DC); -int zend_init_rsrc_list(TSRMLS_D); -int zend_init_rsrc_plist(TSRMLS_D); -void zend_destroy_rsrc_list(HashTable *ht TSRMLS_DC); -int zend_init_rsrc_list_dtors(void); -void zend_destroy_rsrc_list_dtors(void); - -ZEND_API int zend_list_insert(void *ptr, int type); -ZEND_API int _zend_list_addref(int id TSRMLS_DC); -ZEND_API int _zend_list_delete(int id TSRMLS_DC); -ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC); - -#define zend_list_addref(id) _zend_list_addref(id TSRMLS_CC) -#define zend_list_delete(id) _zend_list_delete(id TSRMLS_CC) -#define zend_list_find(id, type) _zend_list_find(id, type TSRMLS_CC) - -ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type); -ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...); - -ZEND_API char *zend_rsrc_list_get_rsrc_type(int resource TSRMLS_DC); -ZEND_API int zend_fetch_list_dtor_id(char *type_name); - -extern ZEND_API int le_index_ptr; /* list entry type for index pointers */ - -#define ZEND_VERIFY_RESOURCE(rsrc) \ - if (!rsrc) { \ - RETURN_FALSE; \ - } - -#define ZEND_FETCH_RESOURCE(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type) \ - rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 1, resource_type); \ - ZEND_VERIFY_RESOURCE(rsrc); - -#define ZEND_FETCH_RESOURCE2(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type1, resource_type2) \ - rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 2, resource_type1, resource_type2); \ - ZEND_VERIFY_RESOURCE(rsrc); - -#define ZEND_REGISTER_RESOURCE(rsrc_result, rsrc_pointer, rsrc_type) \ - zend_register_resource(rsrc_result, rsrc_pointer, rsrc_type); - -#define ZEND_GET_RESOURCE_TYPE_ID(le_id, le_type_name) \ - if (le_id == 0) { \ - le_id = zend_fetch_list_dtor_id(le_type_name); \ - } -END_EXTERN_C() - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_llist.c b/Zend/zend_llist.c deleted file mode 100644 index 395821c186..0000000000 --- a/Zend/zend_llist.c +++ /dev/null @@ -1,317 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_llist.h" -#include "zend_qsort.h" - -ZEND_API void zend_llist_init(zend_llist *l, size_t size, llist_dtor_func_t dtor, unsigned char persistent) -{ - l->head = NULL; - l->tail = NULL; - l->count = 0; - l->size = size; - l->dtor = dtor; - l->persistent = persistent; -} - - -ZEND_API void zend_llist_add_element(zend_llist *l, void *element) -{ - zend_llist_element *tmp = pemalloc(sizeof(zend_llist_element)+l->size-1, l->persistent); - - tmp->prev = l->tail; - tmp->next = NULL; - if (l->tail) { - l->tail->next = tmp; - } else { - l->head = tmp; - } - l->tail = tmp; - memcpy(tmp->data, element, l->size); - - ++l->count; -} - - -ZEND_API void zend_llist_prepend_element(zend_llist *l, void *element) -{ - zend_llist_element *tmp = pemalloc(sizeof(zend_llist_element)+l->size-1, l->persistent); - - tmp->next = l->head; - tmp->prev = NULL; - if (l->head) { - l->head->prev = tmp; - } else { - l->tail = tmp; - } - l->head = tmp; - memcpy(tmp->data, element, l->size); - - ++l->count; -} - - -#define DEL_LLIST_ELEMENT(current, l) \ - if ((current)->prev) {\ - (current)->prev->next = (current)->next;\ - } else {\ - (l)->head = (current)->next;\ - }\ - if ((current)->next) {\ - (current)->next->prev = (current)->prev;\ - } else {\ - (l)->tail = (current)->prev;\ - }\ - if ((l)->dtor) {\ - (l)->dtor((current)->data);\ - }\ - pefree((current), (l)->persistent);\ - --l->count; - - -ZEND_API void zend_llist_del_element(zend_llist *l, void *element, int (*compare)(void *element1, void *element2)) -{ - zend_llist_element *current=l->head; - zend_llist_element *next; - - while (current) { - next = current->next; - if (compare(current->data, element)) { - DEL_LLIST_ELEMENT(current, l); - break; - } - current = next; - } -} - - -ZEND_API void zend_llist_destroy(zend_llist *l) -{ - zend_llist_element *current=l->head, *next; - - while (current) { - next = current->next; - if (l->dtor) { - l->dtor(current->data); - } - pefree(current, l->persistent); - current = next; - } - - l->count = 0; -} - - -ZEND_API void zend_llist_clean(zend_llist *l) -{ - zend_llist_destroy(l); - l->head = l->tail = NULL; -} - - -ZEND_API void *zend_llist_remove_tail(zend_llist *l) -{ - zend_llist_element *old_tail; - void *data; - - if ((old_tail = l->tail)) { - if (l->tail->prev) { - l->tail->prev->next = NULL; - } - - data = old_tail->data; - - l->tail = l->tail->prev; - if (l->dtor) { - l->dtor(data); - } - pefree(old_tail, l->persistent); - - --l->count; - - return data; - } - - return NULL; -} - - -ZEND_API void zend_llist_copy(zend_llist *dst, zend_llist *src) -{ - zend_llist_element *ptr; - - zend_llist_init(dst, src->size, src->dtor, src->persistent); - ptr = src->head; - while (ptr) { - zend_llist_add_element(dst, ptr->data); - ptr = ptr->next; - } -} - - -ZEND_API void zend_llist_apply_with_del(zend_llist *l, int (*func)(void *data)) -{ - zend_llist_element *element, *next; - - element=l->head; - while (element) { - next = element->next; - if (func(element->data)) { - DEL_LLIST_ELEMENT(element, l); - } - element = next; - } -} - - -ZEND_API void zend_llist_apply(zend_llist *l, llist_apply_func_t func TSRMLS_DC) -{ - zend_llist_element *element; - - for (element=l->head; element; element=element->next) { - func(element->data TSRMLS_CC); - } -} - -ZEND_API void zend_llist_sort(zend_llist *l, llist_compare_func_t comp_func TSRMLS_DC) -{ - size_t i; - - zend_llist_element **elements; - zend_llist_element *element, **ptr; - - if (l->count <= 0) { - return; - } - - elements = (zend_llist_element **) emalloc(l->count * sizeof(zend_llist_element *)); - - ptr = &elements[0]; - - for (element=l->head; element; element=element->next) { - *ptr++ = element; - } - - zend_qsort(elements, l->count, sizeof(zend_llist_element *), (compare_func_t) comp_func TSRMLS_CC); - - l->head = elements[0]; - elements[0]->prev = NULL; - - for (i = 1; i < l->count; i++) { - elements[i]->prev = elements[i-1]; - elements[i-1]->next = elements[i]; - } - elements[i-1]->next = NULL; - l->tail = elements[i-1]; - efree(elements); -} - - -ZEND_API void zend_llist_apply_with_argument(zend_llist *l, llist_apply_with_arg_func_t func, void *arg TSRMLS_DC) -{ - zend_llist_element *element; - - for (element=l->head; element; element=element->next) { - func(element->data, arg TSRMLS_CC); - } -} - - -ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func TSRMLS_DC, int num_args, ...) -{ - zend_llist_element *element; - va_list args; - - va_start(args, num_args); - for (element=l->head; element; element=element->next) { - func(element->data, num_args, args TSRMLS_CC); - } - va_end(args); -} - - -ZEND_API int zend_llist_count(zend_llist *l) -{ - return l->count; -} - - -ZEND_API void *zend_llist_get_first_ex(zend_llist *l, zend_llist_position *pos) -{ - zend_llist_position *current = pos ? pos : &l->traverse_ptr; - - *current = l->head; - if (*current) { - return (*current)->data; - } else { - return NULL; - } -} - - -ZEND_API void *zend_llist_get_last_ex(zend_llist *l, zend_llist_position *pos) -{ - zend_llist_position *current = pos ? pos : &l->traverse_ptr; - - *current = l->tail; - if (*current) { - return (*current)->data; - } else { - return NULL; - } -} - - -ZEND_API void *zend_llist_get_next_ex(zend_llist *l, zend_llist_position *pos) -{ - zend_llist_position *current = pos ? pos : &l->traverse_ptr; - - if (*current) { - *current = (*current)->next; - if (*current) { - return (*current)->data; - } - } - return NULL; -} - - -ZEND_API void *zend_llist_get_prev_ex(zend_llist *l, zend_llist_position *pos) -{ - zend_llist_position *current = pos ? pos : &l->traverse_ptr; - - if (*current) { - *current = (*current)->prev; - if (*current) { - return (*current)->data; - } - } - return NULL; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_llist.h b/Zend/zend_llist.h deleted file mode 100644 index 1182bf0ce3..0000000000 --- a/Zend/zend_llist.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_LLIST_H -#define ZEND_LLIST_H - -typedef struct _zend_llist_element { - struct _zend_llist_element *next; - struct _zend_llist_element *prev; - char data[1]; /* Needs to always be last in the struct */ -} zend_llist_element; - -typedef void (*llist_dtor_func_t)(void *); -typedef int (*llist_compare_func_t)(const zend_llist_element **, const zend_llist_element ** TSRMLS_DC); -typedef void (*llist_apply_with_args_func_t)(void *data, int num_args, va_list args TSRMLS_DC); -typedef void (*llist_apply_with_arg_func_t)(void *data, void *arg TSRMLS_DC); -typedef void (*llist_apply_func_t)(void * TSRMLS_DC); - -typedef struct _zend_llist { - zend_llist_element *head; - zend_llist_element *tail; - size_t count; - size_t size; - llist_dtor_func_t dtor; - unsigned char persistent; - zend_llist_element *traverse_ptr; -} zend_llist; - -typedef zend_llist_element* zend_llist_position; - -BEGIN_EXTERN_C() -ZEND_API void zend_llist_init(zend_llist *l, size_t size, llist_dtor_func_t dtor, unsigned char persistent); -ZEND_API void zend_llist_add_element(zend_llist *l, void *element); -ZEND_API void zend_llist_prepend_element(zend_llist *l, void *element); -ZEND_API void zend_llist_del_element(zend_llist *l, void *element, int (*compare)(void *element1, void *element2)); -ZEND_API void zend_llist_destroy(zend_llist *l); -ZEND_API void zend_llist_clean(zend_llist *l); -ZEND_API void *zend_llist_remove_tail(zend_llist *l); -ZEND_API void zend_llist_copy(zend_llist *dst, zend_llist *src); -ZEND_API void zend_llist_apply(zend_llist *l, llist_apply_func_t func TSRMLS_DC); -ZEND_API void zend_llist_apply_with_del(zend_llist *l, int (*func)(void *data)); -ZEND_API void zend_llist_apply_with_argument(zend_llist *l, llist_apply_with_arg_func_t func, void *arg TSRMLS_DC); -ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func TSRMLS_DC, int num_args, ...); -ZEND_API int zend_llist_count(zend_llist *l); -ZEND_API void zend_llist_sort(zend_llist *l, llist_compare_func_t comp_func TSRMLS_DC); - -/* traversal */ -ZEND_API void *zend_llist_get_first_ex(zend_llist *l, zend_llist_position *pos); -ZEND_API void *zend_llist_get_last_ex(zend_llist *l, zend_llist_position *pos); -ZEND_API void *zend_llist_get_next_ex(zend_llist *l, zend_llist_position *pos); -ZEND_API void *zend_llist_get_prev_ex(zend_llist *l, zend_llist_position *pos); - -#define zend_llist_get_first(l) zend_llist_get_first_ex(l, NULL) -#define zend_llist_get_last(l) zend_llist_get_last_ex(l, NULL) -#define zend_llist_get_next(l) zend_llist_get_next_ex(l, NULL) -#define zend_llist_get_prev(l) zend_llist_get_prev_ex(l, NULL) - -END_EXTERN_C() - -#endif /* ZEND_LLIST_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_mm.c b/Zend/zend_mm.c deleted file mode 100644 index 85a13265c2..0000000000 --- a/Zend/zend_mm.c +++ /dev/null @@ -1,475 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ -#if 0 -#include "zend.h" -#include "zend_mm.h" - -#if WIN32|WINNT -# ifndef inline -# define inline __inline -# endif -#endif - -#define ZEND_MM_FREE_BLOCK 0 -#define ZEND_MM_USED_BLOCK 1 - -#ifndef MAX -#define MAX(a, b) (((a)>(b))?(a):(b)) -#endif - -#ifndef ZEND_MM_ALIGNMENT -#define ZEND_MM_ALIGNMENT 8 -#define ZEND_MM_ALIGNMENT_LOG2 3 -#endif - -#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT-1) - -#define ZEND_MM_BUCKET_INDEX(true_size) (true_size >> ZEND_MM_ALIGNMENT_LOG2) - -/* Aligned header size */ -#define ZEND_MM_ALIGNED_SIZE(size) ((size + ZEND_MM_ALIGNMENT - 1) & ZEND_MM_ALIGNMENT_MASK) -#define ZEND_MM_ALIGNED_HEADER_SIZE ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_block)) -#define ZEND_MM_ALIGNED_FREE_HEADER_SIZE ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_free_block)) -#define ZEND_MM_ALIGNED_SEGMENT_SIZE ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_segment)) - -/* Memory calculations */ -#define ZEND_MM_BLOCK_AT(blk, offset) ((zend_mm_block *) (((char *) (blk))+(offset))) -#define ZEND_MM_DATA_OF(p) ((void *) (((char *) (p))+ZEND_MM_ALIGNED_HEADER_SIZE)) -#define ZEND_MM_HEADER_OF(blk) ZEND_MM_BLOCK_AT(blk, -(int)ZEND_MM_ALIGNED_HEADER_SIZE) - -/* Debug output */ -#define ZEND_MM_DEBUG(stmt) - - -/* Start Heap Code */ - -static int left_child[ZEND_HEAP_MAX_BUCKETS]; -static int left_child_of_right_brother[ZEND_HEAP_MAX_BUCKETS]; - -static inline void zend_heap_init(zend_heap heap) -{ - int i; - - for (i=0; i>1; /* (i-1)/2 */ - if (heap[i] < node) { - heap[i] = node; - } else { - break; - } - } while (i > 0); -} - -static inline void zend_heap_deactivate_leaf(zend_heap heap, int node) -{ - int i = node + ZEND_HEAP_MAX_BUCKETS-1; - - heap[i] = 0; - - do { - i = (i-1)>>1; /* (i-1)/2 */ - if (heap[i] == node) { - heap[i] = MAX(heap[2*i+1], heap[2*i+2]); - } else { - break; - } - } while (i > 0); -} - -static inline int zend_heap_search_leaf(zend_heap heap, int value) -{ - int i = 1; - - if (heap[0] < value) { - return 0; - } - - - while (i < ZEND_HEAP_MAX_BUCKETS) { - if (heap[i] >= value) { - /* Go to left child */ - i = left_child[i]; - } else { - /* Go to left child of right brother */ - i = left_child_of_right_brother[i]; - } - } - if (heap[i] >= value) { - return heap[i]; - } else { - return heap[i+1]; - } -} - -/* End Heap Code */ - -static inline void zend_mm_add_to_free_list(zend_mm_heap *heap, zend_mm_free_block *mm_block) -{ - zend_mm_free_block **free_list_bucket; - size_t index = ZEND_MM_BUCKET_INDEX(mm_block->size); - - if (index < ZEND_MM_NUM_BUCKETS) { - free_list_bucket = &heap->free_buckets[index]; - if (*free_list_bucket == NULL) { - zend_heap_activate_leaf(heap->heap, index); - } - } else { - free_list_bucket = &heap->free_buckets[0]; - } - mm_block->next_free_block = *free_list_bucket; - if (*free_list_bucket != NULL) { - mm_block->next_free_block->prev_free_block = mm_block; - } - *free_list_bucket = mm_block; - mm_block->prev_free_block = NULL; -} - - -static inline void zend_mm_remove_from_free_list(zend_mm_heap *heap, zend_mm_free_block *mm_block) -{ - if (mm_block->prev_free_block) { - mm_block->prev_free_block->next_free_block = mm_block->next_free_block; - } else { - zend_mm_free_block **free_list_bucket; - size_t index = ZEND_MM_BUCKET_INDEX(mm_block->size); - - if (index < ZEND_MM_NUM_BUCKETS) { - free_list_bucket = &heap->free_buckets[index]; - *free_list_bucket = mm_block->next_free_block; - if (*free_list_bucket == NULL) { - zend_heap_deactivate_leaf(heap->heap, index); - } - } else { - free_list_bucket = &heap->free_buckets[0]; - *free_list_bucket = mm_block->next_free_block; - } - } - - if (mm_block->next_free_block) { - mm_block->next_free_block->prev_free_block = mm_block->prev_free_block; - } -} - -static inline void zend_mm_create_new_free_block(zend_mm_heap *heap, zend_mm_block *mm_block, size_t true_size) -{ - int remaining_size; - zend_mm_free_block *new_free_block; - - /* calculate sizes */ - remaining_size = mm_block->size - true_size; - - if (remaining_size < ZEND_MM_ALIGNED_FREE_HEADER_SIZE) { - /* keep best_fit->size as is, it'll include this extra space */ - return; - } - - /* prepare new free block */ - mm_block->size = true_size; - new_free_block = (zend_mm_free_block *) ZEND_MM_BLOCK_AT(mm_block, mm_block->size); - - new_free_block->type = ZEND_MM_FREE_BLOCK; - new_free_block->size = remaining_size; - new_free_block->prev_size = true_size; - - /* update the next block's prev_size */ - ZEND_MM_BLOCK_AT(new_free_block, new_free_block->size)->prev_size = new_free_block->size; - - /* add the new free block to the free list */ - zend_mm_add_to_free_list(heap, new_free_block); -} - -zend_bool zend_mm_add_memory_block(zend_mm_heap *heap, size_t block_size) -{ - /* We need to make sure that block_size is big enough for the minimum segment size */ - zend_mm_free_block *mm_block; - zend_mm_block *guard_block; - zend_mm_segment *segment; - - /* align block size downwards */ - block_size = block_size & ZEND_MM_ALIGNMENT_MASK; - - segment = (zend_mm_segment *) malloc(block_size); - if (!segment) { - return 1; - } -/* fprintf(stderr, "Allocating segment %X\n", segment); */ - segment->next_segment = heap->segments_list; - heap->segments_list = segment; - - block_size -= ZEND_MM_ALIGNED_SEGMENT_SIZE; - mm_block = (zend_mm_free_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE); - - mm_block->size = block_size - ZEND_MM_ALIGNED_HEADER_SIZE; /* keep one guard block in the end */ - mm_block->type = ZEND_MM_FREE_BLOCK; - mm_block->prev_size = 0; /* Size is always at least ZEND_MM_ALIGNED_HEADER_SIZE big (>0) so 0 is OK */ - - /* setup guard block */ - guard_block = ZEND_MM_BLOCK_AT(mm_block, mm_block->size); - guard_block->type = ZEND_MM_USED_BLOCK; - guard_block->size = ZEND_MM_ALIGNED_HEADER_SIZE; - guard_block->guard_block = 1; - guard_block->prev_size = mm_block->size; - ZEND_MM_DEBUG(("Setup guard block at 0x%0.8X\n", guard_block)); - - zend_mm_add_to_free_list(heap, mm_block); - - return 0; -} - -/* Notes: - * - This function may alter the block_sizes values to match platform alignment - * - This function does *not* perform sanity checks on the arguments - */ -zend_bool zend_mm_startup(zend_mm_heap *heap, size_t block_size) -{ - heap->block_size = block_size; - heap->segments_list = NULL; - memset(heap->free_buckets, 0, sizeof(heap->free_buckets)); - zend_heap_init(heap->heap); - return zend_mm_add_memory_block(heap, block_size); -} - - -void zend_mm_shutdown(zend_mm_heap *heap) -{ - zend_mm_segment *segment = heap->segments_list; - zend_mm_segment *prev; - - while (segment) { - prev = segment; - segment = segment->next_segment; -/* fprintf(stderr, "Freeing segment %X\n", prev);*/ - free(prev); - } - heap->segments_list = NULL; -} - -void *zend_mm_alloc(zend_mm_heap *heap, size_t size) -{ - size_t true_size; - zend_mm_free_block *p, *best_fit=NULL; - zend_mm_free_block **free_list_bucket; - size_t index; - - /* The max() can probably be optimized with an if () which checks more specific cases */ - true_size = MAX(ZEND_MM_ALIGNED_SIZE(size)+ZEND_MM_ALIGNED_HEADER_SIZE, ZEND_MM_ALIGNED_FREE_HEADER_SIZE); - - index = ZEND_MM_BUCKET_INDEX(true_size); - - if (index < ZEND_MM_NUM_BUCKETS) { - free_list_bucket = &heap->free_buckets[index]; - if (*free_list_bucket) { - best_fit = *free_list_bucket; - goto zend_mm_finished_searching_for_block; - } else { - int leaf; - - leaf = zend_heap_search_leaf(heap->heap, index); - if (leaf != 0) { - best_fit = heap->free_buckets[leaf]; - goto zend_mm_finished_searching_for_block; - } - } - } - - for (p = heap->free_buckets[0]; p; p = p->next_free_block) { - if (p->size == true_size) { - best_fit = p; - break; - } - if ((p->size > true_size) && (!best_fit || (best_fit->size > p->size))) { /* better fit */ - best_fit = p; - } - } - -zend_mm_finished_searching_for_block: - if (!best_fit) { - if (true_size > (heap->block_size - ZEND_MM_ALIGNED_SEGMENT_SIZE - ZEND_MM_ALIGNED_HEADER_SIZE)) { - /* Make sure we add a memory block which is big enough */ - if (zend_mm_add_memory_block(heap, true_size + ZEND_MM_ALIGNED_SEGMENT_SIZE + ZEND_MM_ALIGNED_HEADER_SIZE)) { - zend_error(E_ERROR, "Out of memory: cannot allocate %zd bytes!", true_size); - return NULL; - } - } else { - if (zend_mm_add_memory_block(heap, heap->block_size)) { - zend_error(E_ERROR, "Out of memory: cannot allocate %zd bytes!", heap->block_size); - return NULL; - } - } - return zend_mm_alloc(heap, size); - } - - /* mark as used */ - best_fit->type = ZEND_MM_USED_BLOCK; - ((zend_mm_block *) best_fit)->guard_block = 0; - - /* remove from free list */ - zend_mm_remove_from_free_list(heap, best_fit); - - zend_mm_create_new_free_block(heap, (zend_mm_block *) best_fit, true_size); - - return ZEND_MM_DATA_OF(best_fit); -} - - -void zend_mm_free(zend_mm_heap *heap, void *p) -{ - zend_mm_block *mm_block = ZEND_MM_HEADER_OF(p); - zend_mm_block *prev_block, *next_block; - - if (mm_block->type != ZEND_MM_USED_BLOCK) { - /* error */ - return; - } - - next_block = ZEND_MM_BLOCK_AT(mm_block, mm_block->size); - - /* merge with previous block if empty */ - if (mm_block->prev_size != 0 - && (prev_block=ZEND_MM_BLOCK_AT(mm_block, -(int)mm_block->prev_size))->type == ZEND_MM_FREE_BLOCK) { - zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) prev_block); - prev_block->size += mm_block->size; - mm_block = prev_block; - next_block->prev_size = mm_block->size; - } - - /* merge with the next block if empty */ - if (next_block->type == ZEND_MM_FREE_BLOCK) { - mm_block->size += next_block->size; - zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) next_block); - next_block = ZEND_MM_BLOCK_AT(mm_block, mm_block->size); /* recalculate */ - next_block->prev_size = mm_block->size; - } - - mm_block->type = ZEND_MM_FREE_BLOCK; - zend_mm_add_to_free_list(heap, (zend_mm_free_block *) mm_block); -} - -void *zend_mm_realloc(zend_mm_heap *heap, void *p, size_t size) -{ - zend_mm_block *mm_block = ZEND_MM_HEADER_OF(p); - zend_mm_block *next_block; - size_t true_size = MAX(ZEND_MM_ALIGNED_SIZE(size)+ZEND_MM_ALIGNED_HEADER_SIZE, ZEND_MM_ALIGNED_FREE_HEADER_SIZE); - - next_block = ZEND_MM_BLOCK_AT(mm_block, mm_block->size); - - if (true_size <= mm_block->size) { - zend_mm_create_new_free_block(heap, mm_block, true_size); - - if (next_block->type == ZEND_MM_FREE_BLOCK) { - zend_mm_block *new_next_block; - - new_next_block = ZEND_MM_BLOCK_AT(mm_block, mm_block->size); - if (new_next_block != next_block) { /* A new free block was created */ - zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) new_next_block); - zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) next_block); - new_next_block->size += next_block->size; - /* update the next block's prev_size */ - ZEND_MM_BLOCK_AT(new_next_block, new_next_block->size)->prev_size = new_next_block->size; - zend_mm_add_to_free_list(heap, (zend_mm_free_block *) new_next_block); - } - } - return p; - } - - if ((mm_block->prev_size == 0) && (next_block->type == ZEND_MM_USED_BLOCK) && - (next_block->guard_block)) { - zend_mm_segment *segment = (zend_mm_segment *) ((char *)mm_block - ZEND_MM_ALIGNED_SEGMENT_SIZE); - zend_mm_segment *segment_copy = segment; - zend_mm_block *guard_block; - size_t realloc_to_size; - - /* segment size, size of block and size of guard block */ - realloc_to_size = ZEND_MM_ALIGNED_SEGMENT_SIZE+true_size+ZEND_MM_ALIGNED_HEADER_SIZE; - segment = realloc(segment, realloc_to_size); - if (!segment) { - return NULL; - } - - if (segment != segment_copy) { - if (heap->segments_list == segment_copy) { - heap->segments_list = segment; - } else { - zend_mm_segment *seg = heap->segments_list; - - while (seg) { - if (seg->next_segment == segment_copy) { - seg->next_segment = segment; - break; - } - seg = seg->next_segment; - } - } - mm_block = (zend_mm_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE); - } - - mm_block->size = true_size; - - /* setup guard block */ - guard_block = ZEND_MM_BLOCK_AT(mm_block, mm_block->size); - guard_block->type = ZEND_MM_USED_BLOCK; - guard_block->size = ZEND_MM_ALIGNED_HEADER_SIZE; - guard_block->guard_block = 1; - guard_block->prev_size = mm_block->size; - - return ZEND_MM_DATA_OF(mm_block); - } - - if (next_block->type != ZEND_MM_FREE_BLOCK || (mm_block->size + next_block->size < true_size)) { - void *ptr; - - ptr = zend_mm_alloc(heap, size); - memcpy(ptr, p, mm_block->size - ZEND_MM_ALIGNED_HEADER_SIZE); - zend_mm_free(heap, p); - return ptr; - } - - zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) next_block); - mm_block->size += next_block->size; - /* update the next block's prev_size */ - ZEND_MM_BLOCK_AT(mm_block, mm_block->size)->prev_size = mm_block->size; - - zend_mm_create_new_free_block(heap, mm_block, true_size); - - return p; -} -#endif -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_mm.h b/Zend/zend_mm.h deleted file mode 100644 index 11dcae4827..0000000000 --- a/Zend/zend_mm.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ -#if 0 -#ifndef _ZEND_MM_H -#define _ZEND_MM_H - -#include - -#include "zend.h" -#include "zend_types.h" - - -#ifdef ZEND_WIN32 -#undef ZEND_MM -#else -/* #define ZEND_MM */ -#undef ZEND_MM -#endif - -/* mm block type */ -typedef struct _zend_mm_block { - unsigned int size : 31; - unsigned int type : 1; - size_t prev_size; - unsigned int guard_block : 1; -} zend_mm_block; - -typedef struct _zend_mm_free_block { - unsigned int size : 31; - unsigned int type : 1; - size_t prev_size; - struct _zend_mm_free_block *prev_free_block; - struct _zend_mm_free_block *next_free_block; -} zend_mm_free_block; - -typedef struct _zend_mm_segment { - struct _zend_mm_segment *next_segment; -} zend_mm_segment; - -#define ZEND_MM_NUM_BUCKETS 16 - -#define ZEND_HEAP_MAX_BUCKETS ZEND_MM_NUM_BUCKETS - -typedef int zend_heap[2*ZEND_HEAP_MAX_BUCKETS-1]; - -typedef struct _zend_mm_heap { - zend_mm_segment *segments_list; - size_t block_size; - zend_mm_free_block *free_buckets[ZEND_MM_NUM_BUCKETS]; - zend_heap heap; -} zend_mm_heap; - -zend_bool zend_mm_startup(zend_mm_heap *heap, size_t block_size); -void zend_mm_shutdown(zend_mm_heap *heap); -void *zend_mm_alloc(zend_mm_heap *heap, size_t size); -void zend_mm_free(zend_mm_heap *heap, void *p); -void *zend_mm_realloc(zend_mm_heap *heap, void *p, size_t size); - -#endif /* _ZEND_MM_H */ -#endif -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_modules.h b/Zend/zend_modules.h deleted file mode 100644 index fd7a2def71..0000000000 --- a/Zend/zend_modules.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef MODULES_H -#define MODULES_H - -#include "zend.h" -#include "zend_compile.h" - -#define INIT_FUNC_ARGS int type, int module_number TSRMLS_DC -#define INIT_FUNC_ARGS_PASSTHRU type, module_number TSRMLS_CC -#define SHUTDOWN_FUNC_ARGS int type, int module_number TSRMLS_DC -#define SHUTDOWN_FUNC_ARGS_PASSTHRU type, module_number TSRMLS_CC -#define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module TSRMLS_DC -#define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module TSRMLS_CC - -extern struct _zend_arg_info first_arg_force_ref[2]; -extern struct _zend_arg_info second_arg_force_ref[3]; -extern struct _zend_arg_info third_arg_force_ref[4]; -extern struct _zend_arg_info fourth_arg_force_ref[5]; -extern struct _zend_arg_info fifth_arg_force_ref[6]; -extern struct _zend_arg_info all_args_by_ref[1]; - -#define ZEND_MODULE_API_NO 20060613 -#ifdef ZTS -#define USING_ZTS 1 -#else -#define USING_ZTS 0 -#endif - -#define STANDARD_MODULE_HEADER_EX sizeof(zend_module_entry), ZEND_MODULE_API_NO, ZEND_DEBUG, USING_ZTS -#define STANDARD_MODULE_HEADER \ - STANDARD_MODULE_HEADER_EX, NULL, NULL -#define ZE2_STANDARD_MODULE_HEADER \ - STANDARD_MODULE_HEADER_EX, ini_entries, NULL - -#define STANDARD_MODULE_PROPERTIES_EX 0, 0, NULL, 0 - -#define NO_MODULE_GLOBALS 0, NULL, NULL, NULL - -#ifdef ZTS -# define ZEND_MODULE_GLOBALS(module_name) sizeof(zend_##module_name##_globals), &module_name##_globals_id -#else -# define ZEND_MODULE_GLOBALS(module_name) sizeof(zend_##module_name##_globals), &module_name##_globals -#endif - -#define STANDARD_MODULE_PROPERTIES \ - NO_MODULE_GLOBALS, NULL, STANDARD_MODULE_PROPERTIES_EX - -#define NO_VERSION_YET NULL - -#define MODULE_PERSISTENT 1 -#define MODULE_TEMPORARY 2 - -struct _zend_ini_entry; -typedef struct _zend_module_entry zend_module_entry; -typedef struct _zend_module_dep zend_module_dep; - -struct _zend_module_entry { - unsigned short size; - unsigned int zend_api; - unsigned char zend_debug; - unsigned char zts; - struct _zend_ini_entry *ini_entry; - struct _zend_module_dep *deps; - char *name; - struct _zend_function_entry *functions; - int (*module_startup_func)(INIT_FUNC_ARGS); - int (*module_shutdown_func)(SHUTDOWN_FUNC_ARGS); - int (*request_startup_func)(INIT_FUNC_ARGS); - int (*request_shutdown_func)(SHUTDOWN_FUNC_ARGS); - void (*info_func)(ZEND_MODULE_INFO_FUNC_ARGS); - char *version; - size_t globals_size; -#ifdef ZTS - ts_rsrc_id* globals_id_ptr; -#else - void* globals_ptr; -#endif - void (*globals_ctor)(void *global TSRMLS_DC); - void (*globals_dtor)(void *global TSRMLS_DC); - int (*post_deactivate_func)(void); - int module_started; - unsigned char type; - void *handle; - int module_number; -}; - -#define MODULE_DEP_REQUIRED 1 -#define MODULE_DEP_CONFLICTS 2 -#define MODULE_DEP_OPTIONAL 3 - -#define ZEND_MOD_REQUIRED_EX(name, rel, ver) { name, rel, ver, MODULE_DEP_REQUIRED }, -#define ZEND_MOD_CONFLICTS_EX(name, rel, ver) { name, rel, ver, MODULE_DEP_CONFLICTS }, -#define ZEND_MOD_OPTIONAL_EX(name, rel, ver) { name, rel, ver, MODULE_DEP_OPTIONAL }, - -#define ZEND_MOD_REQUIRED(name) ZEND_MOD_REQUIRED_EX(name, NULL, NULL) -#define ZEND_MOD_CONFLICTS(name) ZEND_MOD_CONFLICTS_EX(name, NULL, NULL) -#define ZEND_MOD_OPTIONAL(name) ZEND_MOD_OPTIONAL_EX(name, NULL, NULL) - -struct _zend_module_dep { - char *name; /* module name */ - char *rel; /* version relationship: NULL (exists), lt|le|eq|ge|gt (to given version) */ - char *version; /* version */ - unsigned char type; /* dependency type */ -}; - -extern ZEND_API HashTable module_registry; - -void module_destructor(zend_module_entry *module); -int module_registry_cleanup(zend_module_entry *module TSRMLS_DC); -int module_registry_request_startup(zend_module_entry *module TSRMLS_DC); -int module_registry_unload_temp(zend_module_entry *module TSRMLS_DC); - -#define ZEND_MODULE_DTOR (void (*)(void *)) module_destructor -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_multibyte.c b/Zend/zend_multibyte.c deleted file mode 100644 index 1be0992b13..0000000000 --- a/Zend/zend_multibyte.c +++ /dev/null @@ -1,1135 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Masaki Fujimoto | - | Rui Hirokawa | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_compile.h" -#include "zend_operators.h" -#include "zend_multibyte.h" - -#ifdef ZEND_MULTIBYTE -static int zend_multibyte_encoding_filter(char **to, int *to_length, const char *to_encoding, const char *from, int from_length, const char *from_encoding TSRMLS_DC); -int sjis_input_filter(char **buf, int *length, const char *sjis, int sjis_length TSRMLS_DC); -int sjis_output_filter(char **buf, int *length, const char *sjis, int sjis_length TSRMLS_DC); -static char* zend_multibyte_assemble_encoding_list(zend_encoding **encoding_list, int encoding_list_size); -static int zend_multibyte_parse_encoding_list(const char *encoding_list, int encoding_list_size, zend_encoding ***result, int *result_size); -static zend_encoding* zend_multibyte_find_script_encoding(zend_encoding *onetime_encoding TSRMLS_DC); -static zend_encoding* zend_multibyte_detect_unicode(TSRMLS_D); -static zend_encoding* zend_multibyte_detect_utf_encoding(char *script, int script_size TSRMLS_DC); - -/* - * encodings - */ -const char *ucs2_aliases[] = {"ISO-10646-UCS-2", "UCS2" , "UNICODE", NULL}; -zend_encoding encoding_ucs2 = { - NULL, - NULL, - "UCS-2", - (const char *(*)[])&ucs2_aliases, - 0 -}; - -zend_encoding encoding_ucs2be = { - NULL, - NULL, - "UCS-2BE", - NULL, - 0 -}; - -zend_encoding encoding_ucs2le = { - NULL, - NULL, - "UCS-2LE", - NULL, - 0 -}; - -const char *ucs4_aliases[] = {"ISO-10646-UCS-4", "UCS4", NULL}; -zend_encoding encoding_ucs4 = { - NULL, - NULL, - "UCS-4", - (const char *(*)[])&ucs4_aliases, - 0 -}; - -zend_encoding encoding_ucs4be = { - NULL, - NULL, - "UCS-4BE", - NULL, - 0 -}; - -zend_encoding encoding_ucs4le = { - NULL, - NULL, - "UCS-4LE", - NULL, - 0 -}; - -const char *utf32_aliases[] = {"utf32", NULL}; -zend_encoding encoding_utf32 = { - NULL, - NULL, - "UTF-32", - (const char *(*)[])&utf32_aliases, - 0 -}; - -zend_encoding encoding_utf32be = { - NULL, - NULL, - "UTF-32BE", - NULL, - 0 -}; - -zend_encoding encoding_utf32le = { - NULL, - NULL, - "UTF-32LE", - NULL, - 0 -}; - -const char *utf16_aliases[] = {"utf16", NULL}; -zend_encoding encoding_utf16 = { - NULL, - NULL, - "UTF-16", - (const char *(*)[])&utf16_aliases, - 0 -}; - -zend_encoding encoding_utf16be = { - NULL, - NULL, - "UTF-16BE", - NULL, - 0 -}; - -zend_encoding encoding_utf16le = { - NULL, - NULL, - "UTF-16LE", - NULL, - 0 -}; - -const char *utf8_aliases[] = {"utf8", NULL}; -zend_encoding encoding_utf8 = { - NULL, - NULL, - "UTF-8", - (const char *(*)[])&utf8_aliases, - 1 -}; - -const char *ascii_aliases[] = {"ANSI_X3.4-1968", "iso-ir-6", "ANSI_X3.4-1986", "ISO_646.irv:1991", "US-ASCII", "ISO646-US", "us", "IBM367", "cp367", "csASCII", NULL}; -zend_encoding encoding_ascii = { - NULL, - NULL, - "ASCII", - (const char *(*)[])&ascii_aliases, - 1 -}; - -const char *euc_jp_aliases[] = {"EUC", "EUC_JP", "eucJP", "x-euc-jp", NULL}; -zend_encoding encoding_euc_jp = { - NULL, - NULL, - "EUC-JP", - (const char *(*)[])&euc_jp_aliases, - 1 -}; - -const char *sjis_aliases[] = {"x-sjis", "SJIS", "SHIFT-JIS", NULL}; -zend_encoding encoding_sjis = { - sjis_input_filter, - sjis_output_filter, - "Shift_JIS", - (const char *(*)[])&sjis_aliases, - 0 -}; - -const char *eucjp_win_aliases[] = {"eucJP-open", NULL}; -zend_encoding encoding_eucjp_win = { - NULL, - NULL, - "eucJP-win", - (const char *(*)[])&eucjp_win_aliases, - 1 -}; - -const char *sjis_win_aliases[] = {"SJIS-open", "MS_Kanji", "Windows-31J", "CP932", NULL}; -zend_encoding encoding_sjis_win = { - /* sjis-filters does not care about diffs of Shift_JIS and CP932 */ - sjis_input_filter, - sjis_output_filter, - "SJIS-win", - (const char *(*)[])&sjis_win_aliases, - 0 -}; - -const char *jis_aliases[] = {"ISO-2022-JP", NULL}; -zend_encoding encoding_jis = { - NULL, - NULL, - "JIS", - (const char *(*)[])&jis_aliases, - 0 -}; - -const char *euc_cn_aliases[] = {"CN-GB", "EUC_CN", "eucCN", "x-euc-cn", "gb2312", NULL}; -zend_encoding encoding_euc_cn = { - NULL, - NULL, - "EUC-CN", - (const char *(*)[])&euc_cn_aliases, - 1 -}; - -const char *cp936_aliases[] = {"CP-936", NULL}; -zend_encoding encoding_cp936 = { - NULL, - NULL, - "CP936", - (const char *(*)[])&cp936_aliases, - 0 -}; - -const char *hz_aliases[] = {"HZ-GB-2312", NULL}; -zend_encoding encoding_hz = { - NULL, - NULL, - "HZ", - (const char *(*)[])&hz_aliases, - 0 -}; - -const char *euc_tw_aliases[] = {"EUC_TW", "eucTW", "x-euc-tw", NULL}; -zend_encoding encoding_euc_tw = { - NULL, - NULL, - "EUC-TW", - (const char *(*)[])&euc_tw_aliases, - 1 -}; - -const char *big5_aliases[] = {"BIG5", "CN-BIG5", "BIG-FIVE", "BIGFIVE", "CP950", NULL}; -zend_encoding encoding_big5 = { - NULL, - NULL, - "BIG-5", - (const char *(*)[])&big5_aliases, - 0 -}; - -const char *euc_kr_aliases[] = {"EUC_KR", "eucKR", "x-euc-kr", NULL}; -zend_encoding encoding_euc_kr = { - NULL, - NULL, - "EUC-KR", - (const char *(*)[])&euc_kr_aliases, - 1 -}; - -const char *uhc_aliases[] = {"CP949", NULL}; -zend_encoding encoding_uhc = { - NULL, - NULL, - "UHC", - (const char *(*)[])&uhc_aliases, - 1 -}; - -zend_encoding encoding_2022kr = { - NULL, - NULL, - "ISO-2022-KR", - NULL, - 0 -}; - -const char *cp1252_aliases[] = {"cp1252", NULL}; -zend_encoding encoding_cp1252 = { - NULL, - NULL, - "Windows-1252", - (const char *(*)[])&cp1252_aliases, - 1 -}; - -const char *iso_8859_1_aliases[] = {"ISO_8859-1", "latin1", NULL}; -zend_encoding encoding_8859_1 = { - NULL, - NULL, - "ISO-8859-1", - (const char *(*)[])&iso_8859_1_aliases, - 1 -}; - -const char *iso_8859_2_aliases[] = {"ISO_8859-2", "latin2", NULL}; -zend_encoding encoding_8859_2 = { - NULL, - NULL, - "ISO-8859-2", - (const char *(*)[])&iso_8859_2_aliases, - 1 -}; - -const char *iso_8859_3_aliases[] = {"ISO_8859-3", "latin3", NULL}; -zend_encoding encoding_8859_3 = { - NULL, - NULL, - "ISO-8859-3", - (const char *(*)[])&iso_8859_3_aliases, - 1 -}; - -const char *iso_8859_4_aliases[] = {"ISO_8859-4", "latin4", NULL}; -zend_encoding encoding_8859_4 = { - NULL, - NULL, - "ISO-8859-4", - (const char *(*)[])&iso_8859_4_aliases, - 1 -}; - -const char *iso_8859_5_aliases[] = {"ISO_8859-5", "cyrillic", NULL}; -zend_encoding encoding_8859_5 = { - NULL, - NULL, - "ISO-8859-5", - (const char *(*)[])&iso_8859_5_aliases, - 1 -}; - -const char *iso_8859_6_aliases[] = {"ISO_8859-6", "arabic", NULL}; -zend_encoding encoding_8859_6 = { - NULL, - NULL, - "ISO-8859-6", - (const char *(*)[])&iso_8859_6_aliases, - 1 -}; - -const char *iso_8859_7_aliases[] = {"ISO_8859-7", "greek", NULL}; -zend_encoding encoding_8859_7 = { - NULL, - NULL, - "ISO-8859-7", - (const char *(*)[])&iso_8859_7_aliases, - 1 -}; - -const char *iso_8859_8_aliases[] = {"ISO_8859-8", "hebrew", NULL}; -zend_encoding encoding_8859_8 = { - NULL, - NULL, - "ISO-8859-8", - (const char *(*)[])&iso_8859_8_aliases, - 1 -}; - -const char *iso_8859_9_aliases[] = {"ISO_8859-9", "latin5", NULL}; -zend_encoding encoding_8859_9 = { - NULL, - NULL, - "ISO-8859-9", - (const char *(*)[])&iso_8859_9_aliases, - 1 -}; - -const char *iso_8859_10_aliases[] = {"ISO_8859-10", "latin6", NULL}; -zend_encoding encoding_8859_10 = { - NULL, - NULL, - "ISO-8859-10", - (const char *(*)[])&iso_8859_10_aliases, - 1 -}; - -const char *iso_8859_13_aliases[] = {"ISO_8859-13", NULL}; -zend_encoding encoding_8859_13 = { - NULL, - NULL, - "ISO-8859-13", - (const char *(*)[])&iso_8859_13_aliases, - 1 -}; - -const char *iso_8859_14_aliases[] = {"ISO_8859-14", "latin8", NULL}; -zend_encoding encoding_8859_14 = { - NULL, - NULL, - "ISO-8859-14", - (const char *(*)[])&iso_8859_14_aliases, - 1 -}; - -const char *iso_8859_15_aliases[] = {"ISO_8859-15", NULL}; -zend_encoding encoding_8859_15 = { - NULL, - NULL, - "ISO-8859-15", - (const char *(*)[])&iso_8859_15_aliases, - 1 -}; - -const char *cp1251_aliases[] = {"CP1251", "CP-1251", "WINDOWS-1251", NULL}; -zend_encoding encoding_cp1251 = { - NULL, - NULL, - "Windows-1251", - (const char *(*)[])&cp1251_aliases, - 1 -}; - -const char *cp866_aliases[] = {"CP866", "CP-866", "IBM-866", NULL}; -zend_encoding encoding_cp866 = { - NULL, - NULL, - "CP866", - (const char *(*)[])&cp866_aliases, - 1 -}; - -const char *koi8r_aliases[] = {"KOI8-R", "KOI8R", NULL}; -zend_encoding encoding_koi8r = { - NULL, - NULL, - "KOI8-R", - (const char *(*)[])&koi8r_aliases, - 1 -}; - -zend_encoding *zend_encoding_table[] = { - &encoding_ucs4, - &encoding_ucs4be, - &encoding_ucs4le, - &encoding_ucs2, - &encoding_ucs2be, - &encoding_ucs2le, - &encoding_utf32, - &encoding_utf32be, - &encoding_utf32le, - &encoding_utf16, - &encoding_utf16be, - &encoding_utf16le, - &encoding_utf8, - &encoding_ascii, - &encoding_euc_jp, - &encoding_sjis, - &encoding_eucjp_win, - &encoding_sjis_win, - &encoding_jis, - &encoding_cp1252, - &encoding_8859_1, - &encoding_8859_2, - &encoding_8859_3, - &encoding_8859_4, - &encoding_8859_5, - &encoding_8859_6, - &encoding_8859_7, - &encoding_8859_8, - &encoding_8859_9, - &encoding_8859_10, - &encoding_8859_13, - &encoding_8859_14, - &encoding_8859_15, - &encoding_euc_cn, - &encoding_cp936, - &encoding_hz, - &encoding_euc_tw, - &encoding_big5, - &encoding_euc_kr, - &encoding_uhc, - &encoding_2022kr, - &encoding_cp1251, - &encoding_cp866, - &encoding_koi8r, - NULL -}; - - - -ZEND_API int zend_multibyte_set_script_encoding(char *encoding_list, int encoding_list_size TSRMLS_DC) -{ - if (CG(script_encoding_list)) { - efree(CG(script_encoding_list)); - CG(script_encoding_list) = NULL; - } - CG(script_encoding_list_size) = 0; - - if (!encoding_list) { - return 0; - } - - zend_multibyte_parse_encoding_list(encoding_list, encoding_list_size, &(CG(script_encoding_list)), &(CG(script_encoding_list_size))); - - return 0; -} - - -ZEND_API int zend_multibyte_set_internal_encoding(char *encoding_name, int encoding_name_size TSRMLS_DC) -{ - CG(internal_encoding) = zend_multibyte_fetch_encoding(encoding_name); - return 0; -} - -ZEND_API int zend_multibyte_set_functions(zend_encoding_detector encoding_detector, zend_encoding_converter encoding_converter, zend_encoding_oddlen encoding_oddlen TSRMLS_DC) -{ - CG(encoding_detector) = encoding_detector; - CG(encoding_converter) = encoding_converter; - CG(encoding_oddlen) = encoding_oddlen; - return 0; -} - - -ZEND_API int zend_multibyte_set_filter(zend_encoding *onetime_encoding TSRMLS_DC) -{ - LANG_SCNG(script_encoding) = zend_multibyte_find_script_encoding(onetime_encoding TSRMLS_CC); - LANG_SCNG(internal_encoding) = CG(internal_encoding); - - /* judge input/output filter */ - LANG_SCNG(input_filter) = NULL; - LANG_SCNG(output_filter) = NULL; - - if (!LANG_SCNG(script_encoding)) { - return 0; - } - - if (!LANG_SCNG(internal_encoding) || LANG_SCNG(script_encoding) == LANG_SCNG(internal_encoding)) { - /* if encoding specfic filters exist, use them */ - if (LANG_SCNG(script_encoding)->input_filter && LANG_SCNG(script_encoding)->output_filter) { - LANG_SCNG(input_filter) = LANG_SCNG(script_encoding)->input_filter; - LANG_SCNG(output_filter) = LANG_SCNG(script_encoding)->output_filter; - return 0; - } - - if (!LANG_SCNG(script_encoding)->compatible) { - /* and if not, work around w/ script_encoding -> utf-8 -> script_encoding conversion */ - LANG_SCNG(internal_encoding) = LANG_SCNG(script_encoding); - LANG_SCNG(input_filter) = zend_multibyte_script_encoding_filter; - LANG_SCNG(output_filter) = zend_multibyte_internal_encoding_filter; - return 0; - } else { - /* nothing to do in this case */ - return 0; - } - } - - /* LANG_SCNG(internal_encoding) cannot be NULL here */ - if (LANG_SCNG(internal_encoding)->compatible) { - LANG_SCNG(input_filter) = zend_multibyte_script_encoding_filter; - return 0; - } else if (LANG_SCNG(script_encoding)->compatible) { - LANG_SCNG(output_filter) = zend_multibyte_internal_encoding_filter; - return 0; - } - - /* both script and internal encodings are incompatible w/ flex */ - LANG_SCNG(input_filter) = zend_multibyte_script_encoding_filter; - LANG_SCNG(output_filter) = zend_multibyte_internal_encoding_filter; - - return 0; -} - - -ZEND_API zend_encoding* zend_multibyte_fetch_encoding(char *encoding_name) -{ - int i, j; - zend_encoding *encoding; - - if (!encoding_name) { - return NULL; - } - - for (i = 0; (encoding = zend_encoding_table[i]) != NULL; i++) { - if (zend_binary_strcasecmp((char*)encoding->name, strlen(encoding->name), encoding_name, strlen(encoding_name)) == 0) { - return encoding; - } - } - - for (i = 0; (encoding = zend_encoding_table[i]) != NULL; i++) { - if (encoding->aliases != NULL) { - for (j = 0; (*encoding->aliases)[j] != NULL; j++) { - if (zend_binary_strcasecmp((char*)(*encoding->aliases)[j], strlen((*encoding->aliases)[j]), encoding_name, strlen(encoding_name)) == 0) { - return encoding; - } - } - } - } - - return NULL; -} - - -ZEND_API int zend_multibyte_script_encoding_filter(char **to, int *to_length, const char *from, int from_length TSRMLS_DC) -{ - const char *name; - - if (LANG_SCNG(internal_encoding) == NULL || LANG_SCNG(internal_encoding)->compatible == 0) { - name = "UTF-8"; - } else { - name = LANG_SCNG(internal_encoding)->name; - } - - return zend_multibyte_encoding_filter(to, to_length, name, from, from_length, LANG_SCNG(script_encoding)->name TSRMLS_CC); -} - -ZEND_API int zend_multibyte_internal_encoding_filter(char **to, int *to_length, const char *from, int from_length TSRMLS_DC) -{ - const char *name; - - if (LANG_SCNG(script_encoding)->compatible == 0) { - name = "UTF-8"; - } else { - name = LANG_SCNG(script_encoding)->name; - } - - return zend_multibyte_encoding_filter(to, to_length, LANG_SCNG(internal_encoding)->name, from, from_length, name TSRMLS_CC); -} - -static int zend_multibyte_encoding_filter(char **to, int *to_length, const char *to_encoding, const char *from, int from_length, const char *from_encoding TSRMLS_DC) -{ - int oddlen; - - if (!CG(encoding_converter)) { - return 0; - } - - if (CG(encoding_oddlen)) { - oddlen = CG(encoding_oddlen)(from, from_length, from_encoding TSRMLS_CC); - if (oddlen > 0) { - from_length -= oddlen; - } - } - - if (CG(encoding_converter)(to, to_length, from, from_length, to_encoding, from_encoding TSRMLS_CC) != 0) { - return 0; - } - - return from_length; -} - - -/* - * Shift_JIS Input/Output Filter - */ -static const unsigned char table_sjis[] = { /* 0x80-0x9f,0xE0-0xEF */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 0, 0, 0 -}; - -int sjis_input_filter(char **buf, int *length, const char *sjis, int sjis_length TSRMLS_DC) -{ - unsigned char *p, *q; - unsigned char c1, c2; - - *buf = (char*)emalloc(sjis_length*3/2+1); - if (!*buf) - return 0; - *length = 0; - - p = (unsigned char*)sjis; - q = (unsigned char*)*buf; - - /* convert [SJIS -> EUC-JP] (for lex scan) -- some other better ways? */ - while (*p && (p-(unsigned char*)sjis) < sjis_length) { - if (!(*p & 0x80)) { - *q++ = *p++; - continue; - } - - /* handling 8 bit code */ - if (table_sjis[*p] == 1) { - /* 1 byte kana */ - *q++ = 0x8e; - *q++ = *p++; - continue; - } - - if (!*(p+1)) { - *q++ = *p++; - break; - } - - if (table_sjis[*p] == 2) { - /* 2 byte kanji code */ - c1 = *p++; - if (!*p || (p-(unsigned char*)sjis) >= sjis_length) { - break; - } - c2 = *p++; - c1 -= (c1 <= 0x9f) ? 0x71 : 0xb1; - c1 = (c1 << 1) + 1; - if (c2 >= 0x9e) { - c2 -= 0x7e; - c1++; - } else if (c2 > 0x7f) { - c2 -= 0x20; - } else { - c2 -= 0x1f; - } - - c1 |= 0x80; - c2 |= 0x80; - - *q++ = c1; - *q++ = c2; - } else { - /* - * for user defined chars (ATTENTION) - * - * THESE ARE NOT CODE FOR CONVERSION! :-P - * (using *ILLEGALLY* 3byte EUC-JP space) - * - * we cannot perfectly (== 1 to 1) convert these chars to EUC-JP. - * so, these code are for perfect RESTORING in sjis_output_filter() - */ - c1 = *p++; - if (!*p || (p-(unsigned char*)sjis) >= sjis_length) { - break; - } - c2 = *p++; - *q++ = (char)0x8f; - /* - * MAP TO (EUC-JP): - * type A: 0xeba1 - 0xf4fe - * type B: 0xf5a1 - 0xfefe - * type C: 0xa1a1 - 0xa6fe - */ - c1 -= (c1 > 0xf9) ? (0x79+0x71) : (0x0a+0xb1); - c1 = (c1 << 1) + 1; - if (c2 >= 0x9e) { - c2 -= 0x7e; - c1++; - } else if (c2 > 0x7f) { - c2 -= 0x20; - } else { - c2 -= 0x1f; - } - - c1 |= 0x80; - c2 |= 0x80; - - *q++ = c1; - *q++ = c2; - } - } - *q = (char)NULL; - *length = (char*)q - *buf; - - return *length; -} - -static const unsigned char table_eucjp[] = { /* 0xA1-0xFE */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 -}; - -int sjis_output_filter(char **sjis, int *sjis_length, const char *buf, int length TSRMLS_DC) -{ - unsigned char c1, c2; - char *p; - const char *q; - - if (!sjis || !sjis_length) { - return 0; - } - - /* always Shift_JIS <= EUC-JP */ - *sjis = (char*)emalloc(length+1); - if (!sjis) { - return 0; - } - p = *sjis; - q = buf; - - /* restore converted strings [EUC-JP -> Shift_JIS] */ - while (*q) { - if (!(*q & 0x80)) { - *p++ = *q++; - continue; - } - - /* hankaku kana */ - if (*q == (char)0x8e) { - q++; - if (*q) { - *p++ = *q++; - } - continue; - } - - /* 2 byte kanji code */ - if (table_eucjp[(unsigned char)*q] == 2) { - c1 = (*q++ & ~0x80) & 0xff; - if (*q) { - c2 = (*q++ & ~0x80) & 0xff; - } else { - q--; - break; - } - - c2 += (c1 & 0x01) ? 0x1f : 0x7d; - if (c2 >= 0x7f) { - c2++; - } - c1 = ((c1 - 0x21) >> 1) + 0x81; - if (c1 > 0x9f) { - c1 += 0x40; - } - - *p++ = c1; - *p++ = c2; - continue; - } - - if (*q == (char)0x8f) { - q++; - if (*q) { - c1 = (*q++ & ~0x80) & 0xff; - } else { - q--; - break; - } - if (*q) { - c2 = (*q++ & ~0x80) & 0xff; - } else { - q -= 2; - break; - } - - c2 += (c1 & 0x01) ? 0x1f : 0x7d; - if (c2 >= 0x7f) { - c2++; - } - c1 = ((c1 - 0x21) >> 1) + 0x81; - if (c1 > 0x9f) { - c1 += 0x40; - } - - if (c1 >= 0x81 && c1 <= 0x9f) { - c1 += 0x79; - } else { - c1 += 0x0a; - } - - *p++ = c1; - *p++ = c2; - continue; - } - - /* some other chars (may not happen) */ - *p++ = *q++; - } - *p = '\0'; - *sjis_length = p - *sjis; - - return q-buf; /* return length we actually read */ -} - - -static char* zend_multibyte_assemble_encoding_list(zend_encoding **encoding_list, int encoding_list_size) -{ - int i, list_size = 0; - const char *name; - char *list = NULL; - - if (!encoding_list || !encoding_list_size) { - return NULL; - } - - for (i = 0; i < encoding_list_size; i++) { - name = (*(encoding_list+i))->name; - if (name) { - list_size += strlen(name) + 1; - if (!list) { - list = (char*)emalloc(list_size); - if (!list) { - return NULL; - } - *list = (char)NULL; - } else { - list = (char*)erealloc(list, list_size); - if (!list) { - return NULL; - } - strcat(list, ","); - } - strcat(list, name); - } - } - return list; -} - - -static int zend_multibyte_parse_encoding_list(const char *encoding_list, int encoding_list_size, zend_encoding ***result, int *result_size) -{ - int n, size; - char *p, *p1, *p2, *endp, *tmpstr; - zend_encoding **list, **entry, *encoding; - - list = NULL; - if (encoding_list == NULL || encoding_list_size <= 0) { - return -1; - } else { - /* copy the encoding_list string for work */ - tmpstr = (char *)estrndup(encoding_list, encoding_list_size); - if (tmpstr == NULL) { - return -1; - } - /* count the number of listed encoding names */ - endp = tmpstr + encoding_list_size; - n = 1; - p1 = tmpstr; - while ((p2 = zend_memnstr(p1, ",", 1, endp)) != NULL) { - p1 = p2 + 1; - n++; - } - size = n; - /* make list */ - list = (zend_encoding**)ecalloc(size, sizeof(zend_encoding*)); - if (list != NULL) { - entry = list; - n = 0; - p1 = tmpstr; - do { - p2 = p = zend_memnstr(p1, ",", 1, endp); - if (p == NULL) { - p = endp; - } - *p = '\0'; - /* trim spaces */ - while (p1 < p && (*p1 == ' ' || *p1 == '\t')) { - p1++; - } - p--; - while (p > p1 && (*p == ' ' || *p == '\t')) { - *p = '\0'; - p--; - } - /* convert to the encoding number and check encoding */ - encoding = zend_multibyte_fetch_encoding(p1); - if (encoding) - { - *entry++ = encoding; - n++; - } - p1 = p2 + 1; - } while (n < size && p2 != NULL); - *result = list; - *result_size = n; - } - efree(tmpstr); - } - - if (list == NULL) { - return -1; - } - - return 0; -} - - -static zend_encoding* zend_multibyte_find_script_encoding(zend_encoding *onetime_encoding TSRMLS_DC) -{ - zend_encoding *script_encoding; - char *name, *list; - - /* onetime_encoding is prior to everything */ - if (onetime_encoding != NULL) { - return onetime_encoding; - } - - if (CG(detect_unicode)) { - /* check out bom(byte order mark) and see if containing wchars */ - script_encoding = zend_multibyte_detect_unicode(TSRMLS_C); - if (script_encoding != NULL) { - /* bom or wchar detection is prior to 'script_encoding' option */ - return script_encoding; - } - } - - /* if no script_encoding specified, just leave alone */ - if (!CG(script_encoding_list) || !CG(script_encoding_list_size)) { - return NULL; - } - - /* if multiple encodings specified, detect automagically */ - if (CG(script_encoding_list_size) > 1 && CG(encoding_detector)) { - list = zend_multibyte_assemble_encoding_list(CG(script_encoding_list), - CG(script_encoding_list_size)); - name = CG(encoding_detector)(LANG_SCNG(script_org), - LANG_SCNG(script_org_size), list TSRMLS_CC); - if (list) { - efree(list); - } - if (name) { - script_encoding = zend_multibyte_fetch_encoding(name); - efree(name); - } else { - script_encoding = NULL; - } - return script_encoding; - } - - return *(CG(script_encoding_list)); -} - - -static zend_encoding* zend_multibyte_detect_unicode(TSRMLS_D) -{ - zend_encoding *script_encoding = NULL; - int bom_size; - char *script; - - if (LANG_SCNG(script_org_size) < sizeof(BOM_UTF32_LE)-1) { - return NULL; - } - - /* check out BOM */ - if (!memcmp(LANG_SCNG(script_org), BOM_UTF32_BE, sizeof(BOM_UTF32_BE)-1)) { - script_encoding = &encoding_utf32be; - bom_size = sizeof(BOM_UTF32_BE)-1; - } else if (!memcmp(LANG_SCNG(script_org), BOM_UTF32_LE, sizeof(BOM_UTF32_LE)-1)) { - script_encoding = &encoding_utf32le; - bom_size = sizeof(BOM_UTF32_LE)-1; - } else if (!memcmp(LANG_SCNG(script_org), BOM_UTF16_BE, sizeof(BOM_UTF16_BE)-1)) { - script_encoding = &encoding_utf16be; - bom_size = sizeof(BOM_UTF16_BE)-1; - } else if (!memcmp(LANG_SCNG(script_org), BOM_UTF16_LE, sizeof(BOM_UTF16_LE)-1)) { - script_encoding = &encoding_utf16le; - bom_size = sizeof(BOM_UTF16_LE)-1; - } else if (!memcmp(LANG_SCNG(script_org), BOM_UTF8, sizeof(BOM_UTF8)-1)) { - script_encoding = &encoding_utf8; - bom_size = sizeof(BOM_UTF8)-1; - } - - if (script_encoding) { - /* remove BOM */ - script = (char*)emalloc(LANG_SCNG(script_org_size)+1-bom_size); - memcpy(script, LANG_SCNG(script_org)+bom_size, LANG_SCNG(script_org_size)+1-bom_size); - efree(LANG_SCNG(script_org)); - LANG_SCNG(script_org) = script; - LANG_SCNG(script_org_size) -= bom_size; - - return script_encoding; - } - - /* script contains NULL bytes -> auto-detection */ - if (memchr(LANG_SCNG(script_org), 0, LANG_SCNG(script_org_size))) { - /* make best effort if BOM is missing */ - return zend_multibyte_detect_utf_encoding(LANG_SCNG(script_org), LANG_SCNG(script_org_size) TSRMLS_CC); - } - - return NULL; -} - -static zend_encoding* zend_multibyte_detect_utf_encoding(char *script, int script_size TSRMLS_DC) -{ - char *p; - int wchar_size = 2; - int le = 0; - - /* utf-16 or utf-32? */ - p = script; - while ((p-script) < script_size) { - p = memchr(p, 0, script_size-(p-script)-2); - if (!p) { - break; - } - if (*(p+1) == (char)NULL && *(p+2) == (char)NULL) { - wchar_size = 4; - break; - } - - /* searching for UTF-32 specific byte orders, so this will do */ - p += 4; - } - - /* BE or LE? */ - p = script; - while ((p-script) < script_size) { - if (*p == (char)NULL && *(p+wchar_size-1) != (char)NULL) { - /* BE */ - le = 0; - break; - } else if (*p != (char)NULL && *(p+wchar_size-1) == (char)NULL) { - /* LE* */ - le = 1; - break; - } - p += wchar_size; - } - - if (wchar_size == 2) { - return le ? &encoding_utf16le : &encoding_utf16be; - } else { - return le ? &encoding_utf32le : &encoding_utf32be; - } - - return NULL; -} -#endif /* ZEND_MULTIBYTE */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 tw=78 - * vim<600: sw=4 ts=4 tw=78 - */ diff --git a/Zend/zend_multibyte.h b/Zend/zend_multibyte.h deleted file mode 100644 index 1d7c79f25d..0000000000 --- a/Zend/zend_multibyte.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Masaki Fujimoto | - | Rui Hirokawa | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_MULTIBYTE_H -#define ZEND_MULTIBYTE_H - -#ifdef ZEND_MULTIBYTE - -#define BOM_UTF32_BE "\x00\x00\xfe\xff" -#define BOM_UTF32_LE "\xff\xfe\x00\x00" -#define BOM_UTF16_BE "\xfe\xff" -#define BOM_UTF16_LE "\xff\xfe" -#define BOM_UTF8 "\xef\xbb\xbf" - -typedef int (*zend_encoding_filter)(char **str, int *str_length, const char *buf, int length TSRMLS_DC); - -typedef char* (*zend_encoding_detector)(const char *string, int length, char *list TSRMLS_DC); - -typedef int (*zend_encoding_converter)(char **to, int *to_length, const char *from, int from_length, const char *encoding_to, const char *encoding_from TSRMLS_DC); - -typedef int (*zend_encoding_oddlen)(const char *string, int length, const char *encoding TSRMLS_DC); - -typedef struct _zend_encoding { - zend_encoding_filter input_filter; /* escape input filter */ - zend_encoding_filter output_filter; /* escape output filter */ - const char *name; /* encoding name */ - const char *(*aliases)[]; /* encoding name aliases */ - int compatible; /* flex compatible or not */ -} zend_encoding; - - -/* - * zend multibyte APIs - */ -BEGIN_EXTERN_C() -ZEND_API int zend_multibyte_set_script_encoding(char *encoding_list, int encoding_list_size TSRMLS_DC); -ZEND_API int zend_multibyte_set_internal_encoding(char *encoding_name, int encoding_name_size TSRMLS_DC); -ZEND_API int zend_multibyte_set_functions(zend_encoding_detector encoding_detector, zend_encoding_converter encoding_converter, zend_encoding_oddlen encoding_oddlen TSRMLS_DC); -ZEND_API int zend_multibyte_set_filter(zend_encoding *onetime_encoding TSRMLS_DC); -ZEND_API zend_encoding* zend_multibyte_fetch_encoding(char *encoding_name); -ZEND_API int zend_multibyte_script_encoding_filter(char **to, int *to_length, const char *from, int from_length TSRMLS_DC); -ZEND_API int zend_multibyte_internal_encoding_filter(char **to, int *to_length, const char *from, int from_length TSRMLS_DC); - -/* in zend_language_scanner.l */ -ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter, zend_encoding *old_encoding TSRMLS_DC); -ZEND_API int zend_multibyte_yyinput(zend_file_handle *file_handle, char *buf, size_t len TSRMLS_DC); -ZEND_API int zend_multibyte_read_script(TSRMLS_D); -END_EXTERN_C() - -#endif /* ZEND_MULTIBYTE */ - -#endif /* ZEND_MULTIBYTE_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 tw=78 - * vim<600: sw=4 ts=4 tw=78 - */ diff --git a/Zend/zend_multiply.h b/Zend/zend_multiply.h deleted file mode 100644 index f79ec7d4b6..0000000000 --- a/Zend/zend_multiply.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Sascha Schumann | - | Ard Biesheuvel | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#if defined(__i386__) && defined(__GNUC__) - -#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \ - long __tmpvar; \ - __asm__ ("imul %3,%0\n" \ - "adc $0,%1" \ - : "=r"(__tmpvar),"=r"(usedval) \ - : "0"(a), "r"(b), "1"(0)); \ - if (usedval) (dval) = (double) (a) * (double) (b); \ - else (lval) = __tmpvar; \ -} while (0) - -#else - -#define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \ - long __lres = (a) * (b); \ - double __dres = (double)(a) * (double)(b); \ - double __delta = (double) __lres - __dres; \ - if ( ((usedval) = (( __dres + __delta ) != __dres))) { \ - (dval) = __dres; \ - } else { \ - (lval) = __lres; \ - } \ -} while (0) - -#endif diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c deleted file mode 100644 index 32521f68d2..0000000000 --- a/Zend/zend_object_handlers.c +++ /dev/null @@ -1,1153 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_globals.h" -#include "zend_variables.h" -#include "zend_API.h" -#include "zend_objects.h" -#include "zend_objects_API.h" -#include "zend_object_handlers.h" -#include "zend_interfaces.h" - -#define DEBUG_OBJECT_HANDLERS 0 - -#define Z_OBJ_P(zval_p) zend_objects_get_address(zval_p TSRMLS_CC) - -/* - __X accessors explanation: - - if we have __get and property that is not part of the properties array is - requested, we call __get handler. If it fails, we return uninitialized. - - if we have __set and property that is not part of the properties array is - set, we call __set handler. If it fails, we do not change the array. - - for both handlers above, when we are inside __get/__set, no further calls for - __get/__set for these objects will be made, to prevent endless recursion and - enable accessors to change properties array. - - if we have __call and method which is not part of the class function table is - called, we cal __call handler. -*/ - -static HashTable *zend_std_get_properties(zval *object TSRMLS_DC) -{ - zend_object *zobj; - zobj = Z_OBJ_P(object); - return zobj->properties; -} - -static zval *zend_std_call_getter(zval *object, zval *member TSRMLS_DC) -{ - zval *retval = NULL; - zend_class_entry *ce = Z_OBJCE_P(object); - - /* __get handler is called with one argument: - property name - - it should return whether the call was successfull or not - */ - - SEPARATE_ARG_IF_REF(member); - - zend_call_method_with_1_params(&object, ce, &ce->__get, ZEND_GET_FUNC_NAME, &retval, member); - - zval_ptr_dtor(&member); - - if (retval) { - retval->refcount--; - } - - return retval; -} - -static int zend_std_call_setter(zval *object, zval *member, zval *value TSRMLS_DC) -{ - zval *retval = NULL; - int result; - zend_class_entry *ce = Z_OBJCE_P(object); - - SEPARATE_ARG_IF_REF(member); - value->refcount++; - - /* __set handler is called with two arguments: - property name - value to be set - - it should return whether the call was successfull or not - */ - zend_call_method_with_2_params(&object, ce, &ce->__set, ZEND_SET_FUNC_NAME, &retval, member, value); - - zval_ptr_dtor(&member); - zval_ptr_dtor(&value); - - if (retval) { - result = i_zend_is_true(retval) ? SUCCESS : FAILURE; - zval_ptr_dtor(&retval); - return result; - } else { - return FAILURE; - } -} - -static void zend_std_call_unsetter(zval *object, zval *member TSRMLS_DC) -{ - zend_class_entry *ce = Z_OBJCE_P(object); - - /* __unset handler is called with one argument: - property name - */ - - SEPARATE_ARG_IF_REF(member); - - zend_call_method_with_1_params(&object, ce, &ce->__unset, ZEND_UNSET_FUNC_NAME, NULL, member); - - zval_ptr_dtor(&member); -} - -static zval *zend_std_call_issetter(zval *object, zval *member TSRMLS_DC) -{ - zval *retval = NULL; - zend_class_entry *ce = Z_OBJCE_P(object); - - /* __isset handler is called with one argument: - property name - - it should return whether the property is set or not - */ - - SEPARATE_ARG_IF_REF(member); - - zend_call_method_with_1_params(&object, ce, &ce->__isset, ZEND_ISSET_FUNC_NAME, &retval, member); - - zval_ptr_dtor(&member); - - return retval; -} - -static int zend_verify_property_access(zend_property_info *property_info, zend_class_entry *ce TSRMLS_DC) -{ - switch (property_info->flags & ZEND_ACC_PPP_MASK) { - case ZEND_ACC_PUBLIC: - return 1; - case ZEND_ACC_PROTECTED: - return zend_check_protected(property_info->ce, EG(scope)); - case ZEND_ACC_PRIVATE: - if (ce==EG(scope) && EG(scope)) { - return 1; - } else { - return 0; - } - break; - } - return 0; -} - -static inline zend_bool is_derived_class(zend_class_entry *child_class, zend_class_entry *parent_class) -{ - child_class = child_class->parent; - while (child_class) { - if (child_class == parent_class) { - return 1; - } - child_class = child_class->parent; - } - - return 0; -} - -ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zval *member, int silent TSRMLS_DC) -{ - zend_property_info *property_info = NULL; - zend_property_info *scope_property_info; - zend_bool denied_access = 0; - ulong h; - - if (Z_STRVAL_P(member)[0] == '\0') { - if (!silent) { - if (Z_STRLEN_P(member) == 0) { - zend_error(E_ERROR, "Cannot access empty property"); - } else { - zend_error(E_ERROR, "Cannot access property started with '\\0'"); - } - } - return NULL; - } - h = zend_get_hash_value(Z_STRVAL_P(member), Z_STRLEN_P(member) + 1); - if (zend_hash_quick_find(&ce->properties_info, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, h, (void **) &property_info)==SUCCESS) { - if(property_info->flags & ZEND_ACC_SHADOW) { - /* if it's a shadow - go to access it's private */ - property_info = NULL; - } else { - if (zend_verify_property_access(property_info, ce TSRMLS_CC)) { - if (property_info->flags & ZEND_ACC_CHANGED - && !(property_info->flags & ZEND_ACC_PRIVATE)) { - /* We still need to make sure that we're not in a context - * where the right property is a different 'statically linked' private - * continue checking below... - */ - } else { - if (!silent && (property_info->flags & ZEND_ACC_STATIC)) { - zend_error(E_STRICT, "Accessing static property %s::$%s as non static", ce->name, Z_STRVAL_P(member)); - } - return property_info; - } - } else { - /* Try to look in the scope instead */ - denied_access = 1; - } - } - } - if (EG(scope) != ce - && is_derived_class(ce, EG(scope)) - && EG(scope) - && zend_hash_quick_find(&EG(scope)->properties_info, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, h, (void **) &scope_property_info)==SUCCESS - && scope_property_info->flags & ZEND_ACC_PRIVATE) { - return scope_property_info; - } else if (property_info) { - if (denied_access) { - /* Information was available, but we were denied access. Error out. */ - if (silent) { - return NULL; - } - zend_error(E_ERROR, "Cannot access %s property %s::$%s", zend_visibility_string(property_info->flags), ce->name, Z_STRVAL_P(member)); - } else { - /* fall through, return property_info... */ - } - } else { - EG(std_property_info).flags = ZEND_ACC_PUBLIC; - EG(std_property_info).name = Z_STRVAL_P(member); - EG(std_property_info).name_length = Z_STRLEN_P(member); - EG(std_property_info).h = h; - EG(std_property_info).ce = ce; - property_info = &EG(std_property_info); - } - return property_info; -} - - -ZEND_API int zend_check_property_access(zend_object *zobj, char *prop_info_name, int prop_info_name_len TSRMLS_DC) -{ - zend_property_info *property_info; - char *class_name, *prop_name; - zval member; - - zend_unmangle_property_name(prop_info_name, prop_info_name_len, &class_name, &prop_name); - ZVAL_STRING(&member, prop_name, 0); - property_info = zend_get_property_info(zobj->ce, &member, 1 TSRMLS_CC); - if (!property_info) { - return FAILURE; - } - if (prop_info_name[0] == '\0' && prop_info_name[1] != '*') { - if (!(property_info->flags & ZEND_ACC_PRIVATE)) { - /* we we're looking for a private prop but found a non private one of the same name */ - return FAILURE; - } else if (strcmp(prop_info_name+1, property_info->name+1)) { - /* we we're looking for a private prop but found a private one of the same name but another class */ - return FAILURE; - } - } - return zend_verify_property_access(property_info, zobj->ce TSRMLS_CC) ? SUCCESS : FAILURE; -} - -static int zend_get_property_guard(zend_object *zobj, zend_property_info *property_info, zval *member, zend_guard **pguard) -{ - zend_property_info info; - zend_guard stub; - - if (!property_info) { - property_info = &info; - info.name = Z_STRVAL_P(member); - info.name_length = Z_STRLEN_P(member); - info.h = zend_get_hash_value(Z_STRVAL_P(member), Z_STRLEN_P(member) + 1); - } - if (!zobj->guards) { - ALLOC_HASHTABLE(zobj->guards); - zend_hash_init(zobj->guards, 0, NULL, NULL, 0); - } else if (zend_hash_quick_find(zobj->guards, property_info->name, property_info->name_length+1, property_info->h, (void **) pguard) == SUCCESS) { - return SUCCESS; - } - stub.in_get = 0; - stub.in_set = 0; - stub.in_unset = 0; - stub.in_isset = 0; - return zend_hash_quick_add(zobj->guards, property_info->name, property_info->name_length+1, property_info->h, (void**)&stub, sizeof(stub), (void**) pguard); -} - -zval *zend_std_read_property(zval *object, zval *member, int type TSRMLS_DC) -{ - zend_object *zobj; - zval *tmp_member = NULL; - zval **retval; - zval *rv = NULL; - zend_property_info *property_info; - int silent; - - silent = (type == BP_VAR_IS); - zobj = Z_OBJ_P(object); - - if (member->type != IS_STRING) { - ALLOC_ZVAL(tmp_member); - *tmp_member = *member; - INIT_PZVAL(tmp_member); - zval_copy_ctor(tmp_member); - convert_to_string(tmp_member); - member = tmp_member; - } - -#if DEBUG_OBJECT_HANDLERS - fprintf(stderr, "Read object #%d property: %s\n", Z_OBJ_HANDLE_P(object), Z_STRVAL_P(member)); -#endif - - /* make zend_get_property_info silent if we have getter - we may want to use it */ - property_info = zend_get_property_info(zobj->ce, member, (zobj->ce->__get != NULL) TSRMLS_CC); - - if (!property_info || zend_hash_quick_find(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, (void **) &retval) == FAILURE) { - zend_guard *guard; - - if (zobj->ce->__get && - zend_get_property_guard(zobj, property_info, member, &guard) == SUCCESS && - !guard->in_get) { - /* have getter - try with it! */ - guard->in_get = 1; /* prevent circular getting */ - rv = zend_std_call_getter(object, member TSRMLS_CC); - guard->in_get = 0; - - if (rv) { - retval = &rv; - if ((type == BP_VAR_W || type == BP_VAR_RW || type == BP_VAR_UNSET) && rv->refcount > 0) { - zval *tmp = rv; - - ALLOC_ZVAL(rv); - *rv = *tmp; - zval_copy_ctor(rv); - rv->is_ref = 0; - rv->refcount = 0; - if (Z_TYPE_P(rv) != IS_OBJECT) { - zend_error(E_NOTICE, "Indirect modification of overloaded property %s::$%s has no effect", zobj->ce->name, Z_STRVAL_P(member)); - } - } - } else { - retval = &EG(uninitialized_zval_ptr); - } - } else { - if (!silent) { - zend_error(E_NOTICE,"Undefined property: %s::$%s", zobj->ce->name, Z_STRVAL_P(member)); - } - retval = &EG(uninitialized_zval_ptr); - } - } - if (tmp_member) { - (*retval)->refcount++; - zval_ptr_dtor(&tmp_member); - (*retval)->refcount--; - } - return *retval; -} - - -static void zend_std_write_property(zval *object, zval *member, zval *value TSRMLS_DC) -{ - zend_object *zobj; - zval *tmp_member = NULL; - zval **variable_ptr; - zend_property_info *property_info; - - zobj = Z_OBJ_P(object); - - if (member->type != IS_STRING) { - ALLOC_ZVAL(tmp_member); - *tmp_member = *member; - INIT_PZVAL(tmp_member); - zval_copy_ctor(tmp_member); - convert_to_string(tmp_member); - member = tmp_member; - } - - property_info = zend_get_property_info(zobj->ce, member, (zobj->ce->__set != NULL) TSRMLS_CC); - - if (property_info && zend_hash_quick_find(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, (void **) &variable_ptr) == SUCCESS) { - /* if we already have this value there, we don't actually need to do anything */ - if (*variable_ptr != value) { - /* if we are assigning reference, we shouldn't move it, but instead assign variable - to the same pointer */ - if (PZVAL_IS_REF(*variable_ptr)) { - zval garbage = **variable_ptr; /* old value should be destroyed */ - - /* To check: can't *variable_ptr be some system variable like error_zval here? */ - (*variable_ptr)->type = value->type; - (*variable_ptr)->value = value->value; - if (value->refcount>0) { - zval_copy_ctor(*variable_ptr); - } - zval_dtor(&garbage); - } else { - zval *garbage = *variable_ptr; - - /* if we assign referenced variable, we should separate it */ - value->refcount++; - if (PZVAL_IS_REF(value)) { - SEPARATE_ZVAL(&value); - } - *variable_ptr = value; - zval_ptr_dtor(&garbage); - } - } - } else { - int setter_done = 0; - zend_guard *guard; - - if (zobj->ce->__set && - zend_get_property_guard(zobj, property_info, member, &guard) == SUCCESS && - !guard->in_set) { - guard->in_set = 1; /* prevent circular setting */ - if (zend_std_call_setter(object, member, value TSRMLS_CC) != SUCCESS) { - /* for now, just ignore it - __set should take care of warnings, etc. */ - } - setter_done = 1; - guard->in_set = 0; - } - if (!setter_done && property_info) { - zval **foo; - - /* if we assign referenced variable, we should separate it */ - value->refcount++; - if (PZVAL_IS_REF(value)) { - SEPARATE_ZVAL(&value); - } - zend_hash_quick_update(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, &value, sizeof(zval *), (void **) &foo); - } - } - - if (tmp_member) { - zval_ptr_dtor(&tmp_member); - } -} - -zval *zend_std_read_dimension(zval *object, zval *offset, int type TSRMLS_DC) -{ - zend_class_entry *ce = Z_OBJCE_P(object); - zval *retval; - - if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) { - if(offset == NULL) { - /* [] construct */ - ALLOC_INIT_ZVAL(offset); - } else { - SEPARATE_ARG_IF_REF(offset); - } - zend_call_method_with_1_params(&object, ce, NULL, "offsetget", &retval, offset); - - zval_ptr_dtor(&offset); - - if (!retval) { - if (!EG(exception)) { - zend_error(E_ERROR, "Undefined offset for object of type %s used as array", ce->name); - } - return 0; - } - - /* Undo PZVAL_LOCK() */ - retval->refcount--; - - return retval; - } else { - zend_error(E_ERROR, "Cannot use object of type %s as array", ce->name); - return 0; - } -} - - -static void zend_std_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC) -{ - zend_class_entry *ce = Z_OBJCE_P(object); - - if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) { - if (!offset) { - ALLOC_INIT_ZVAL(offset); - } else { - SEPARATE_ARG_IF_REF(offset); - } - zend_call_method_with_2_params(&object, ce, NULL, "offsetset", NULL, offset, value); - zval_ptr_dtor(&offset); - } else { - zend_error(E_ERROR, "Cannot use object of type %s as array", ce->name); - } -} - - -static int zend_std_has_dimension(zval *object, zval *offset, int check_empty TSRMLS_DC) -{ - zend_class_entry *ce = Z_OBJCE_P(object); - zval *retval; - int result; - - if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) { - SEPARATE_ARG_IF_REF(offset); - zend_call_method_with_1_params(&object, ce, NULL, "offsetexists", &retval, offset); - if (retval) { - result = i_zend_is_true(retval); - zval_ptr_dtor(&retval); - if (check_empty && result && !EG(exception)) { - zend_call_method_with_1_params(&object, ce, NULL, "offsetget", &retval, offset); - if (retval) { - result = i_zend_is_true(retval); - zval_ptr_dtor(&retval); - } - } - } else { - result = 0; - } - zval_ptr_dtor(&offset); - } else { - zend_error(E_ERROR, "Cannot use object of type %s as array", ce->name); - return 0; - } - return result; -} - - -static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC) -{ - zend_object *zobj; - zval tmp_member; - zval **retval; - zend_property_info *property_info; - - zobj = Z_OBJ_P(object); - - if (member->type != IS_STRING) { - tmp_member = *member; - zval_copy_ctor(&tmp_member); - convert_to_string(&tmp_member); - member = &tmp_member; - } - -#if DEBUG_OBJECT_HANDLERS - fprintf(stderr, "Ptr object #%d property: %s\n", Z_OBJ_HANDLE_P(object), Z_STRVAL_P(member)); -#endif - - property_info = zend_get_property_info(zobj->ce, member, (zobj->ce->__get != NULL) TSRMLS_CC); - - if (!property_info || zend_hash_quick_find(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, (void **) &retval) == FAILURE) { - zval *new_zval; - zend_guard *guard; - - if (!zobj->ce->__get || - zend_get_property_guard(zobj, property_info, member, &guard) != SUCCESS || - guard->in_get) { - /* we don't have access controls - will just add it */ - new_zval = &EG(uninitialized_zval); - -/* zend_error(E_NOTICE, "Undefined property: %s", Z_STRVAL_P(member)); */ - new_zval->refcount++; - zend_hash_quick_update(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, &new_zval, sizeof(zval *), (void **) &retval); - } else { - /* we do have getter - fail and let it try again with usual get/set */ - retval = NULL; - } - } - if (member == &tmp_member) { - zval_dtor(member); - } - return retval; -} - - -static void zend_std_unset_property(zval *object, zval *member TSRMLS_DC) -{ - zend_object *zobj; - zval *tmp_member = NULL; - zend_property_info *property_info; - - zobj = Z_OBJ_P(object); - - if (member->type != IS_STRING) { - ALLOC_ZVAL(tmp_member); - *tmp_member = *member; - INIT_PZVAL(tmp_member); - zval_copy_ctor(tmp_member); - convert_to_string(tmp_member); - member = tmp_member; - } - - property_info = zend_get_property_info(zobj->ce, member, (zobj->ce->__unset != NULL) TSRMLS_CC); - - if (!property_info || zend_hash_del(zobj->properties, property_info->name, property_info->name_length+1) == FAILURE) { - zend_guard *guard; - - if (zobj->ce->__unset && - zend_get_property_guard(zobj, property_info, member, &guard) == SUCCESS && - !guard->in_unset) { - /* have unseter - try with it! */ - guard->in_unset = 1; /* prevent circular unsetting */ - zend_std_call_unsetter(object, member TSRMLS_CC); - guard->in_unset = 0; - } - } - - if (tmp_member) { - zval_ptr_dtor(&tmp_member); - } -} - - -static void zend_std_unset_dimension(zval *object, zval *offset TSRMLS_DC) -{ - zend_class_entry *ce = Z_OBJCE_P(object); - - if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) { - SEPARATE_ARG_IF_REF(offset); - zend_call_method_with_1_params(&object, ce, NULL, "offsetunset", NULL, offset); - zval_ptr_dtor(&offset); - } else { - zend_error(E_ERROR, "Cannot use object of type %s as array", ce->name); - } -} - - -ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS) -{ - zend_internal_function *func = (zend_internal_function *)EG(function_state_ptr)->function; - zval *method_name_ptr, *method_args_ptr; - zval *method_result_ptr = NULL; - zend_class_entry *ce = Z_OBJCE_P(this_ptr); - - ALLOC_ZVAL(method_args_ptr); - INIT_PZVAL(method_args_ptr); - array_init(method_args_ptr); - - if (zend_copy_parameters_array(ZEND_NUM_ARGS(), method_args_ptr TSRMLS_CC) == FAILURE) { - zval_dtor(method_args_ptr); - zend_error(E_ERROR, "Cannot get arguments for __call"); - RETURN_FALSE; - } - - ALLOC_ZVAL(method_name_ptr); - INIT_PZVAL(method_name_ptr); - ZVAL_STRING(method_name_ptr, func->function_name, 0); /* no dup - it's a copy */ - - /* __call handler is called with two arguments: - method name - array of method parameters - - */ - zend_call_method_with_2_params(&this_ptr, ce, &ce->__call, ZEND_CALL_FUNC_NAME, &method_result_ptr, method_name_ptr, method_args_ptr); - - if (method_result_ptr) { - if (method_result_ptr->is_ref || method_result_ptr->refcount > 1) { - RETVAL_ZVAL(method_result_ptr, 1, 1); - } else { - RETVAL_ZVAL(method_result_ptr, 0, 1); - } - } - - /* now destruct all auxiliaries */ - zval_ptr_dtor(&method_args_ptr); - zval_ptr_dtor(&method_name_ptr); - - /* destruct the function also, then - we have allocated it in get_method */ - efree(func); -} - -/* Ensures that we're allowed to call a private method. - * Returns the function address that should be called, or NULL - * if no such function exists. - */ -static inline zend_function *zend_check_private_int(zend_function *fbc, zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC) -{ - if (!ce) { - return 0; - } - - /* We may call a private function if: - * 1. The class of our object is the same as the scope, and the private - * function (EX(fbc)) has the same scope. - * 2. One of our parent classes are the same as the scope, and it contains - * a private function with the same name that has the same scope. - */ - if (fbc->common.scope == ce && EG(scope) == ce) { - /* rule #1 checks out ok, allow the function call */ - return fbc; - } - - - /* Check rule #2 */ - ce = ce->parent; - while (ce) { - if (ce == EG(scope)) { - if (zend_hash_find(&ce->function_table, function_name_strval, function_name_strlen+1, (void **) &fbc)==SUCCESS - && fbc->op_array.fn_flags & ZEND_ACC_PRIVATE - && fbc->common.scope == EG(scope)) { - return fbc; - } - break; - } - ce = ce->parent; - } - return NULL; -} - - -ZEND_API int zend_check_private(zend_function *fbc, zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC) -{ - return zend_check_private_int(fbc, ce, function_name_strval, function_name_strlen TSRMLS_CC) != NULL; -} - - -/* Ensures that we're allowed to call a protected method. - */ -ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope) -{ - zend_class_entry *fbc_scope = ce; - - /* Is the context that's calling the function, the same as one of - * the function's parents? - */ - while (fbc_scope) { - if (fbc_scope==scope) { - return 1; - } - fbc_scope = fbc_scope->parent; - } - - /* Is the function's scope the same as our current object context, - * or any of the parents of our context? - */ - while (scope) { - if (scope==ce) { - return 1; - } - scope = scope->parent; - } - return 0; -} - - -static inline zend_class_entry * zend_get_function_root_class(zend_function *fbc) -{ - return fbc->common.prototype ? fbc->common.prototype->common.scope : fbc->common.scope; -} - - -static union _zend_function *zend_std_get_method(zval **object_ptr, char *method_name, int method_len TSRMLS_DC) -{ - zend_object *zobj; - zend_function *fbc; - char *lc_method_name; - zval *object = *object_ptr; - - lc_method_name = do_alloca(method_len+1); - /* Create a zend_copy_str_tolower(dest, src, src_length); */ - zend_str_tolower_copy(lc_method_name, method_name, method_len); - - zobj = Z_OBJ_P(object); - if (zend_hash_find(&zobj->ce->function_table, lc_method_name, method_len+1, (void **)&fbc) == FAILURE) { - free_alloca(lc_method_name); - if (zobj->ce->__call) { - zend_internal_function *call_user_call = emalloc(sizeof(zend_internal_function)); - call_user_call->type = ZEND_INTERNAL_FUNCTION; - call_user_call->module = zobj->ce->module; - call_user_call->handler = zend_std_call_user_call; - call_user_call->arg_info = NULL; - call_user_call->num_args = 0; - call_user_call->scope = zobj->ce; - call_user_call->fn_flags = 0; - call_user_call->function_name = estrndup(method_name, method_len); - call_user_call->pass_rest_by_reference = 0; - call_user_call->return_reference = ZEND_RETURN_VALUE; - - return (union _zend_function *)call_user_call; - } else { - return NULL; - } - } - - /* Check access level */ - if (fbc->op_array.fn_flags & ZEND_ACC_PRIVATE) { - zend_function *updated_fbc; - - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - updated_fbc = zend_check_private_int(fbc, Z_OBJ_HANDLER_P(object, get_class_entry)(object TSRMLS_CC), lc_method_name, method_len TSRMLS_CC); - if (!updated_fbc) { - zend_error(E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), method_name, EG(scope) ? EG(scope)->name : ""); - } - fbc = updated_fbc; - } else { - /* Ensure that we haven't overridden a private function and end up calling - * the overriding public function... - */ - if (EG(scope) && fbc->op_array.fn_flags & ZEND_ACC_CHANGED) { - zend_function *priv_fbc; - - if (zend_hash_find(&EG(scope)->function_table, lc_method_name, method_len+1, (void **) &priv_fbc)==SUCCESS - && priv_fbc->common.fn_flags & ZEND_ACC_PRIVATE - && priv_fbc->common.scope == EG(scope)) { - fbc = priv_fbc; - } - } - if ((fbc->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(zend_get_function_root_class(fbc), EG(scope))) { - zend_error(E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), method_name, EG(scope) ? EG(scope)->name : ""); - } - } - } - - free_alloca(lc_method_name); - return fbc; -} - - -/* This is not (yet?) in the API, but it belongs in the built-in objects callbacks */ -ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC) -{ - zend_function *fbc; - - if (zend_hash_find(&ce->function_table, function_name_strval, function_name_strlen+1, (void **) &fbc)==FAILURE) { - char *class_name = ce->name; - - if (!class_name) { - class_name = ""; - } - zend_error(E_ERROR, "Call to undefined method %s::%s()", class_name, function_name_strval); - } - if (fbc->op_array.fn_flags & ZEND_ACC_PUBLIC) { - /* No further checks necessary, most common case */ - } else if (fbc->op_array.fn_flags & ZEND_ACC_PRIVATE) { - zend_function *updated_fbc; - - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - updated_fbc = zend_check_private_int(fbc, EG(scope), function_name_strval, function_name_strlen TSRMLS_CC); - if (!updated_fbc) { - zend_error(E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), function_name_strval, EG(scope) ? EG(scope)->name : ""); - } - fbc = updated_fbc; - } else if ((fbc->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(zend_get_function_root_class(fbc), EG(scope))) { - zend_error(E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), function_name_strval, EG(scope) ? EG(scope)->name : ""); - } - } - - return fbc; -} - - -ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, char *property_name, int property_name_len, zend_bool silent TSRMLS_DC) -{ - zval **retval = NULL; - zend_class_entry *tmp_ce = ce; - zend_property_info *property_info; - zend_property_info std_property_info; - - if (zend_hash_find(&ce->properties_info, property_name, property_name_len+1, (void **) &property_info)==FAILURE || (property_info->flags & ZEND_ACC_SHADOW)) { - std_property_info.flags = ZEND_ACC_PUBLIC; - std_property_info.name = property_name; - std_property_info.name_length = property_name_len; - std_property_info.h = zend_get_hash_value(std_property_info.name, std_property_info.name_length+1); - std_property_info.ce = ce; - property_info = &std_property_info; - } - -#if DEBUG_OBJECT_HANDLERS - zend_printf("Access type for %s::%s is %s\n", ce->name, property_name, zend_visibility_string(property_info->flags)); -#endif - - if (!zend_verify_property_access(property_info, ce TSRMLS_CC)) { - if (!silent) { - zend_error(E_ERROR, "Cannot access %s property %s::$%s", zend_visibility_string(property_info->flags), ce->name, property_name); - } - return NULL; - } - - zend_update_class_constants(tmp_ce TSRMLS_CC); - - zend_hash_quick_find(CE_STATIC_MEMBERS(tmp_ce), property_info->name, property_info->name_length+1, property_info->h, (void **) &retval); - - if (!retval) { - if (silent) { - return NULL; - } else { - zend_error(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name, property_name); - } - } - - return retval; -} - - -ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, char *property_name, int property_name_len TSRMLS_DC) -{ - zend_error(E_ERROR, "Attempt to unset static property %s::$%s", ce->name, property_name); - return 0; -} - - -ZEND_API union _zend_function *zend_std_get_constructor(zval *object TSRMLS_DC) -{ - zend_object *zobj = Z_OBJ_P(object); - zend_function *constructor = zobj->ce->constructor; - - if (constructor) { - if (constructor->op_array.fn_flags & ZEND_ACC_PUBLIC) { - /* No further checks necessary */ - } else if (constructor->op_array.fn_flags & ZEND_ACC_PRIVATE) { - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - if (Z_OBJ_HANDLER_P(object, get_class_entry)(object TSRMLS_CC) != EG(scope)) { - if (EG(scope)) { - zend_error(E_ERROR, "Call to private %s::%s() from context '%s'", constructor->common.scope->name, constructor->common.function_name, EG(scope)->name); - } else { - zend_error(E_ERROR, "Call to private %s::%s() from invalid context", constructor->common.scope->name, constructor->common.function_name); - } - } - } else if ((constructor->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(zend_get_function_root_class(constructor), EG(scope))) { - if (EG(scope)) { - zend_error(E_ERROR, "Call to protected %s::%s() from context '%s'", constructor->common.scope->name, constructor->common.function_name, EG(scope)->name); - } else { - zend_error(E_ERROR, "Call to protected %s::%s() from invalid context", constructor->common.scope->name, constructor->common.function_name); - } - } - } - } - - return constructor; -} - - -int zend_compare_symbol_tables_i(HashTable *ht1, HashTable *ht2 TSRMLS_DC); - - -static int zend_std_compare_objects(zval *o1, zval *o2 TSRMLS_DC) -{ - zend_object *zobj1, *zobj2; - - zobj1 = Z_OBJ_P(o1); - zobj2 = Z_OBJ_P(o2); - - if (zobj1->ce != zobj2->ce) { - return 1; /* different classes */ - } - return zend_compare_symbol_tables_i(zobj1->properties, zobj2->properties TSRMLS_CC); -} - -static int zend_std_has_property(zval *object, zval *member, int has_set_exists TSRMLS_DC) -{ - zend_object *zobj; - int result; - zval **value; - zval *tmp_member = NULL; - zend_property_info *property_info; - - zobj = Z_OBJ_P(object); - - if (member->type != IS_STRING) { - ALLOC_ZVAL(tmp_member); - *tmp_member = *member; - INIT_PZVAL(tmp_member); - zval_copy_ctor(tmp_member); - convert_to_string(tmp_member); - member = tmp_member; - } - -#if DEBUG_OBJECT_HANDLERS - fprintf(stderr, "Read object #%d property: %s\n", Z_OBJ_HANDLE_P(object), Z_STRVAL_P(member)); -#endif - - property_info = zend_get_property_info(zobj->ce, member, 1 TSRMLS_CC); - - if (!property_info || zend_hash_quick_find(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, (void **) &value) == FAILURE) { - zend_guard *guard; - - result = 0; - if ((has_set_exists != 2) && - zobj->ce->__isset && - zend_get_property_guard(zobj, property_info, member, &guard) == SUCCESS && - !guard->in_isset) { - zval *rv; - - /* have issetter - try with it! */ - guard->in_isset = 1; /* prevent circular getting */ - rv = zend_std_call_issetter(object, member TSRMLS_CC); - if (rv) { - result = zend_is_true(rv); - zval_ptr_dtor(&rv); - if (has_set_exists && result && !EG(exception) && zobj->ce->__get && !guard->in_get) { - guard->in_get = 1; - rv = zend_std_call_getter(object, member TSRMLS_CC); - guard->in_get = 0; - if (rv) { - rv->refcount++; - result = i_zend_is_true(rv); - zval_ptr_dtor(&rv); - } - } - } - guard->in_isset = 0; - } - } else { - switch (has_set_exists) { - case 0: - result = (Z_TYPE_PP(value) != IS_NULL); - break; - default: - result = zend_is_true(*value); - break; - case 2: - result = 1; - break; - } - } - - if (tmp_member) { - zval_ptr_dtor(&tmp_member); - } - return result; -} - - -zend_class_entry *zend_std_object_get_class(zval *object TSRMLS_DC) -{ - zend_object *zobj; - zobj = Z_OBJ_P(object); - - return zobj->ce; -} - -int zend_std_object_get_class_name(zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC) -{ - zend_object *zobj; - zend_class_entry *ce; - zobj = Z_OBJ_P(object); - - if (parent) { - if (!zobj->ce->parent) { - return FAILURE; - } - ce = zobj->ce->parent; - } else { - ce = zobj->ce; - } - - *class_name_len = ce->name_length; - *class_name = estrndup(ce->name, ce->name_length); - return SUCCESS; -} - -ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int type TSRMLS_DC) -{ - zval *retval; - zend_class_entry *ce; - - switch (type) { - case IS_STRING: - ce = Z_OBJCE_P(readobj); - if (ce->__tostring && - (zend_call_method_with_0_params(&readobj, ce, &ce->__tostring, "__tostring", &retval) || EG(exception))) { - if (EG(exception)) { - if (retval) { - zval_ptr_dtor(&retval); - } - zend_error(E_ERROR, "Method %s::__toString() must not throw an exception", ce->name); - return FAILURE; - } - if (Z_TYPE_P(retval) == IS_STRING) { - INIT_PZVAL(writeobj); - ZVAL_ZVAL(writeobj, retval, 1, 1); - if (Z_TYPE_P(writeobj) != type) { - convert_to_explicit_type(writeobj, type); - } - return SUCCESS; - } else { - zval_ptr_dtor(&retval); - INIT_PZVAL(writeobj); - ZVAL_EMPTY_STRING(writeobj); - zend_error(E_RECOVERABLE_ERROR, "Method %s::__toString() must return a string value", ce->name); - return SUCCESS; - } - } - return FAILURE; - case IS_BOOL: - INIT_PZVAL(writeobj); - ZVAL_BOOL(writeobj, 1); - return SUCCESS; - case IS_LONG: - ce = Z_OBJCE_P(readobj); - zend_error(E_NOTICE, "Object of class %s could not be converted to int", ce->name); - INIT_PZVAL(writeobj); - ZVAL_LONG(writeobj, 1); - return SUCCESS; - case IS_DOUBLE: - ce = Z_OBJCE_P(readobj); - zend_error(E_NOTICE, "Object of class %s could not be converted to double", ce->name); - INIT_PZVAL(writeobj); - ZVAL_DOUBLE(writeobj, 1); - return SUCCESS; - default: - break; - } - return FAILURE; -} - - -ZEND_API zend_object_handlers std_object_handlers = { - zend_objects_store_add_ref, /* add_ref */ - zend_objects_store_del_ref, /* del_ref */ - zend_objects_clone_obj, /* clone_obj */ - - zend_std_read_property, /* read_property */ - zend_std_write_property, /* write_property */ - zend_std_read_dimension, /* read_dimension */ - zend_std_write_dimension, /* write_dimension */ - zend_std_get_property_ptr_ptr, /* get_property_ptr_ptr */ - NULL, /* get */ - NULL, /* set */ - zend_std_has_property, /* has_property */ - zend_std_unset_property, /* unset_property */ - zend_std_has_dimension, /* has_dimension */ - zend_std_unset_dimension, /* unset_dimension */ - zend_std_get_properties, /* get_properties */ - zend_std_get_method, /* get_method */ - NULL, /* call_method */ - zend_std_get_constructor, /* get_constructor */ - zend_std_object_get_class, /* get_class_entry */ - zend_std_object_get_class_name, /* get_class_name */ - zend_std_compare_objects, /* compare_objects */ - zend_std_cast_object_tostring, /* cast_object */ - NULL, /* count_elements */ -}; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h deleted file mode 100644 index 1d196e2e3c..0000000000 --- a/Zend/zend_object_handlers.h +++ /dev/null @@ -1,169 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_OBJECT_HANDLERS_H -#define ZEND_OBJECT_HANDLERS_H - -union _zend_function; -struct _zend_property_info; - -/* The following rule applies to read_property() and read_dimension() implementations: - If you return a zval which is not otherwise referenced by the extension or the engine's - symbol table, its reference count should be 0. -*/ -/* Used to fetch property from the object, read-only */ -typedef zval *(*zend_object_read_property_t)(zval *object, zval *member, int type TSRMLS_DC); - -/* Used to fetch dimension from the object, read-only */ -typedef zval *(*zend_object_read_dimension_t)(zval *object, zval *offset, int type TSRMLS_DC); - - -/* The following rule applies to write_property() and write_dimension() implementations: - If you receive a value zval in write_property/write_dimension, you may only modify it if - its reference count is 1. Otherwise, you must create a copy of that zval before making - any changes. You should NOT modify the reference count of the value passed to you. -*/ -/* Used to set property of the object */ -typedef void (*zend_object_write_property_t)(zval *object, zval *member, zval *value TSRMLS_DC); - -/* Used to set dimension of the object */ -typedef void (*zend_object_write_dimension_t)(zval *object, zval *offset, zval *value TSRMLS_DC); - - -/* Used to create pointer to the property of the object, for future direct r/w access */ -typedef zval **(*zend_object_get_property_ptr_ptr_t)(zval *object, zval *member TSRMLS_DC); - -/* Used to set object value. Can be used to override assignments and scalar - write ops (like ++, +=) on the object */ -typedef void (*zend_object_set_t)(zval **object, zval *value TSRMLS_DC); - -/* Used to get object value. Can be used when converting object value to - * one of the basic types and when using scalar ops (like ++, +=) on the object - */ -typedef zval* (*zend_object_get_t)(zval *object TSRMLS_DC); - -/* Used to check if a property of the object exists */ -/* param has_set_exists: - * 0 (has) whether property exists and is not NULL - * 1 (set) whether property exists and is true - * 2 (exists) whether property exists - */ -typedef int (*zend_object_has_property_t)(zval *object, zval *member, int has_set_exists TSRMLS_DC); - -/* Used to check if a dimension of the object exists */ -typedef int (*zend_object_has_dimension_t)(zval *object, zval *member, int check_empty TSRMLS_DC); - -/* Used to remove a property of the object */ -typedef void (*zend_object_unset_property_t)(zval *object, zval *member TSRMLS_DC); - -/* Used to remove a dimension of the object */ -typedef void (*zend_object_unset_dimension_t)(zval *object, zval *offset TSRMLS_DC); - -/* Used to get hash of the properties of the object, as hash of zval's */ -typedef HashTable *(*zend_object_get_properties_t)(zval *object TSRMLS_DC); - -/* Used to call methods */ -/* args on stack! */ -/* Andi - EX(fbc) (function being called) needs to be initialized already in the INIT fcall opcode so that the parameters can be parsed the right way. We need to add another callback for this. - */ -typedef int (*zend_object_call_method_t)(char *method, INTERNAL_FUNCTION_PARAMETERS); -typedef union _zend_function *(*zend_object_get_method_t)(zval **object_ptr, char *method, int method_len TSRMLS_DC); -typedef union _zend_function *(*zend_object_get_constructor_t)(zval *object TSRMLS_DC); - -/* Object maintenance/destruction */ -typedef void (*zend_object_add_ref_t)(zval *object TSRMLS_DC); -typedef void (*zend_object_del_ref_t)(zval *object TSRMLS_DC); -typedef void (*zend_object_delete_obj_t)(zval *object TSRMLS_DC); -typedef zend_object_value (*zend_object_clone_obj_t)(zval *object TSRMLS_DC); - -typedef zend_class_entry *(*zend_object_get_class_entry_t)(zval *object TSRMLS_DC); -typedef int (*zend_object_get_class_name_t)(zval *object, char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC); -typedef int (*zend_object_compare_t)(zval *object1, zval *object2 TSRMLS_DC); - -/* Cast an object to some other type - */ -typedef int (*zend_object_cast_t)(zval *readobj, zval *retval, int type TSRMLS_DC); - -/* updates *count to hold the number of elements present and returns SUCCESS. - * Returns FAILURE if the object does not have any sense of overloaded dimensions */ -typedef int (*zend_object_count_elements_t)(zval *object, long *count TSRMLS_DC); - -struct _zend_object_handlers { - /* general object functions */ - zend_object_add_ref_t add_ref; - zend_object_del_ref_t del_ref; - zend_object_clone_obj_t clone_obj; - /* individual object functions */ - zend_object_read_property_t read_property; - zend_object_write_property_t write_property; - zend_object_read_dimension_t read_dimension; - zend_object_write_dimension_t write_dimension; - zend_object_get_property_ptr_ptr_t get_property_ptr_ptr; - zend_object_get_t get; - zend_object_set_t set; - zend_object_has_property_t has_property; - zend_object_unset_property_t unset_property; - zend_object_has_dimension_t has_dimension; - zend_object_unset_dimension_t unset_dimension; - zend_object_get_properties_t get_properties; - zend_object_get_method_t get_method; - zend_object_call_method_t call_method; - zend_object_get_constructor_t get_constructor; - zend_object_get_class_entry_t get_class_entry; - zend_object_get_class_name_t get_class_name; - zend_object_compare_t compare_objects; - zend_object_cast_t cast_object; - zend_object_count_elements_t count_elements; -}; - -extern ZEND_API zend_object_handlers std_object_handlers; - -BEGIN_EXTERN_C() -ZEND_API union _zend_function *zend_std_get_static_method(zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC); -ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, char *property_name, int property_name_len, zend_bool silent TSRMLS_DC); -ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, char *property_name, int property_name_len TSRMLS_DC); -ZEND_API union _zend_function *zend_std_get_constructor(zval *object TSRMLS_DC); -ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce, zval *member, int silent TSRMLS_DC); - -ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int type TSRMLS_DC); - - -#define IS_ZEND_STD_OBJECT(z) (Z_TYPE(z) == IS_OBJECT && (Z_OBJ_HT((z))->get_class_entry != NULL)) -#define HAS_CLASS_ENTRY(z) (Z_OBJ_HT(z)->get_class_entry != NULL) - -ZEND_API int zend_check_private(union _zend_function *fbc, zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC); - -ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope); - -ZEND_API int zend_check_property_access(zend_object *zobj, char *prop_info_name, int prop_info_name_len TSRMLS_DC); - -ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS); -END_EXTERN_C() - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c deleted file mode 100644 index bb713680d6..0000000000 --- a/Zend/zend_objects.c +++ /dev/null @@ -1,210 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_globals.h" -#include "zend_variables.h" -#include "zend_API.h" -#include "zend_interfaces.h" -#include "zend_exceptions.h" - -ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce TSRMLS_DC) -{ - ALLOC_HASHTABLE(object->properties); - zend_hash_init(object->properties, 0, NULL, ZVAL_PTR_DTOR, 0); - - object->ce = ce; - object->guards = NULL; -} - -ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC) -{ - if (object->guards) { - zend_hash_destroy(object->guards); - FREE_HASHTABLE(object->guards); - } - if (object->properties) { - zend_hash_destroy(object->properties); - FREE_HASHTABLE(object->properties); - } -} - -ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handle handle TSRMLS_DC) -{ - zend_function *destructor = object->ce->destructor; - - if (destructor) { - zval *obj; - zval *old_exception; - - if (destructor->op_array.fn_flags & (ZEND_ACC_PRIVATE|ZEND_ACC_PROTECTED)) { - if (destructor->op_array.fn_flags & ZEND_ACC_PRIVATE) { - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - if (object->ce != EG(scope)) { - zend_class_entry *ce = object->ce; - - zend_error(EG(in_execution) ? E_ERROR : E_WARNING, - "Call to private %s::__destruct() from context '%s'%s", - ce->name, - EG(scope) ? EG(scope)->name : "", - EG(in_execution) ? "" : " during shutdown ignored"); - return; - } - } else { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(destructor->common.scope, EG(scope))) { - zend_class_entry *ce = object->ce; - - zend_error(EG(in_execution) ? E_ERROR : E_WARNING, - "Call to protected %s::__destruct() from context '%s'%s", - ce->name, - EG(scope) ? EG(scope)->name : "", - EG(in_execution) ? "" : " during shutdown ignored"); - return; - } - } - } - - MAKE_STD_ZVAL(obj); - Z_TYPE_P(obj) = IS_OBJECT; - Z_OBJ_HANDLE_P(obj) = handle; - /* TODO: We cannot set proper handlers. */ - Z_OBJ_HT_P(obj) = &std_object_handlers; - zval_copy_ctor(obj); - - /* Make sure that destructors are protected from previously thrown exceptions. - * For example, if an exception was thrown in a function and when the function's - * local variable destruction results in a destructor being called. - */ - old_exception = EG(exception); - EG(exception) = NULL; - zend_call_method_with_0_params(&obj, object->ce, &destructor, ZEND_DESTRUCTOR_FUNC_NAME, NULL); - if (old_exception) { - if (EG(exception)) { - zend_class_entry *default_exception_ce = zend_exception_get_default(TSRMLS_C); - zval *file = zend_read_property(default_exception_ce, old_exception, "file", sizeof("file")-1, 1 TSRMLS_CC); - zval *line = zend_read_property(default_exception_ce, old_exception, "line", sizeof("line")-1, 1 TSRMLS_CC); - - zval_ptr_dtor(&obj); - zval_ptr_dtor(&EG(exception)); - EG(exception) = old_exception; - zend_error(E_ERROR, "Ignoring exception from %s::__destruct() while an exception is already active (Uncaught %s in %s on line %ld)", - object->ce->name, Z_OBJCE_P(old_exception)->name, Z_STRVAL_P(file), Z_LVAL_P(line)); - } - EG(exception) = old_exception; - } - zval_ptr_dtor(&obj); - } -} - -ZEND_API void zend_objects_free_object_storage(zend_object *object TSRMLS_DC) -{ - zend_object_std_dtor(object TSRMLS_CC); - efree(object); -} - -ZEND_API zend_object_value zend_objects_new(zend_object **object, zend_class_entry *class_type TSRMLS_DC) -{ - zend_object_value retval; - - *object = emalloc(sizeof(zend_object)); - (*object)->ce = class_type; - retval.handle = zend_objects_store_put(*object, (zend_objects_store_dtor_t) zend_objects_destroy_object, (zend_objects_free_object_storage_t) zend_objects_free_object_storage, NULL TSRMLS_CC); - retval.handlers = &std_object_handlers; - (*object)->guards = NULL; - return retval; -} - -ZEND_API zend_object *zend_objects_get_address(zval *zobject TSRMLS_DC) -{ - return (zend_object *)zend_object_store_get_object(zobject TSRMLS_CC); -} - -static void zval_add_ref_or_clone(zval **p) -{ - if (Z_TYPE_PP(p) == IS_OBJECT && !PZVAL_IS_REF(*p)) { - TSRMLS_FETCH(); - - if (Z_OBJ_HANDLER_PP(p, clone_obj) == NULL) { - zend_error(E_ERROR, "Trying to clone an uncloneable object of class %s", Z_OBJCE_PP(p)->name); - } else { - zval *orig = *p; - - ALLOC_ZVAL(*p); - **p = *orig; - INIT_PZVAL(*p); - (*p)->value.obj = Z_OBJ_HT_PP(p)->clone_obj(orig TSRMLS_CC); - } - } else { - (*p)->refcount++; - } -} - -ZEND_API void zend_objects_clone_members(zend_object *new_object, zend_object_value new_obj_val, zend_object *old_object, zend_object_handle handle TSRMLS_DC) -{ - if (EG(ze1_compatibility_mode)) { - zend_hash_copy(new_object->properties, old_object->properties, (copy_ctor_func_t) zval_add_ref_or_clone, (void *) NULL /* Not used anymore */, sizeof(zval *)); - } else { - zend_hash_copy(new_object->properties, old_object->properties, (copy_ctor_func_t) zval_add_ref, (void *) NULL /* Not used anymore */, sizeof(zval *)); - } - if (old_object->ce->clone) { - zval *new_obj; - - MAKE_STD_ZVAL(new_obj); - new_obj->type = IS_OBJECT; - new_obj->value.obj = new_obj_val; - zval_copy_ctor(new_obj); - - zend_call_method_with_0_params(&new_obj, old_object->ce, &old_object->ce->clone, ZEND_CLONE_FUNC_NAME, NULL); - - zval_ptr_dtor(&new_obj); - } -} - -ZEND_API zend_object_value zend_objects_clone_obj(zval *zobject TSRMLS_DC) -{ - zend_object_value new_obj_val; - zend_object *old_object; - zend_object *new_object; - zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); - - /* assume that create isn't overwritten, so when clone depends on the - * overwritten one then it must itself be overwritten */ - old_object = zend_objects_get_address(zobject TSRMLS_CC); - new_obj_val = zend_objects_new(&new_object, old_object->ce TSRMLS_CC); - - ALLOC_HASHTABLE(new_object->properties); - zend_hash_init(new_object->properties, 0, NULL, ZVAL_PTR_DTOR, 0); - - zend_objects_clone_members(new_object, new_obj_val, old_object, handle TSRMLS_CC); - - return new_obj_val; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_objects.h b/Zend/zend_objects.h deleted file mode 100644 index a90ed2123d..0000000000 --- a/Zend/zend_objects.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_OBJECTS_H -#define ZEND_OBJECTS_H - -#include "zend.h" - -BEGIN_EXTERN_C() -ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce TSRMLS_DC); -ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC); -ZEND_API zend_object_value zend_objects_new(zend_object **object, zend_class_entry *class_type TSRMLS_DC); -ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handle handle TSRMLS_DC); -ZEND_API zend_object *zend_objects_get_address(zval *object TSRMLS_DC); -ZEND_API void zend_objects_clone_members(zend_object *new_object, zend_object_value new_obj_val, zend_object *old_object, zend_object_handle handle TSRMLS_DC); -ZEND_API zend_object_value zend_objects_clone_obj(zval *object TSRMLS_DC); -ZEND_API void zend_objects_free_object_storage(zend_object *object TSRMLS_DC); -END_EXTERN_C() - -#endif /* ZEND_OBJECTS_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_objects_API.c b/Zend/zend_objects_API.c deleted file mode 100644 index d5845de612..0000000000 --- a/Zend/zend_objects_API.c +++ /dev/null @@ -1,390 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_globals.h" -#include "zend_variables.h" -#include "zend_API.h" -#include "zend_objects_API.h" - -#define ZEND_DEBUG_OBJECTS 0 - -ZEND_API void zend_objects_store_init(zend_objects_store *objects, zend_uint init_size) -{ - objects->object_buckets = (zend_object_store_bucket *) emalloc(init_size * sizeof(zend_object_store_bucket)); - objects->top = 1; /* Skip 0 so that handles are true */ - objects->size = init_size; - objects->free_list_head = -1; - memset(&objects->object_buckets[0], 0, sizeof(zend_object_store_bucket)); -} - -ZEND_API void zend_objects_store_destroy(zend_objects_store *objects) -{ - efree(objects->object_buckets); - objects->object_buckets = NULL; -} - -ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TSRMLS_DC) -{ - zend_uint i = 1; - - for (i = 1; i < objects->top ; i++) { - if (objects->object_buckets[i].valid) { - struct _store_object *obj = &objects->object_buckets[i].bucket.obj; - - if (!objects->object_buckets[i].destructor_called) { - objects->object_buckets[i].destructor_called = 1; - if (obj->dtor && obj->object) { - obj->refcount++; - obj->dtor(obj->object, i TSRMLS_CC); - obj->refcount--; - } - } - } - } -} - -ZEND_API void zend_objects_store_mark_destructed(zend_objects_store *objects TSRMLS_DC) -{ - zend_uint i = 1; - - for (i = 1; i < objects->top ; i++) { - if (objects->object_buckets[i].valid) { - objects->object_buckets[i].destructor_called = 1; - } - } -} - -ZEND_API void zend_objects_store_free_object_storage(zend_objects_store *objects TSRMLS_DC) -{ - zend_uint i = 1; - - for (i = 1; i < objects->top ; i++) { - if (objects->object_buckets[i].valid) { - struct _store_object *obj = &objects->object_buckets[i].bucket.obj; - - objects->object_buckets[i].valid = 0; - if (obj->free_storage) { - obj->free_storage(obj->object TSRMLS_CC); - } - /* Not adding to free list as we are shutting down anyway */ - } - } -} - - -/* Store objects API */ - -ZEND_API zend_object_handle zend_objects_store_put(void *object, zend_objects_store_dtor_t dtor, zend_objects_free_object_storage_t free_storage, zend_objects_store_clone_t clone TSRMLS_DC) -{ - zend_object_handle handle; - struct _store_object *obj; - - if (EG(objects_store).free_list_head != -1) { - handle = EG(objects_store).free_list_head; - EG(objects_store).free_list_head = EG(objects_store).object_buckets[handle].bucket.free_list.next; - } else { - if (EG(objects_store).top == EG(objects_store).size) { - EG(objects_store).size <<= 1; - EG(objects_store).object_buckets = (zend_object_store_bucket *) erealloc(EG(objects_store).object_buckets, EG(objects_store).size * sizeof(zend_object_store_bucket)); - } - handle = EG(objects_store).top++; - } - obj = &EG(objects_store).object_buckets[handle].bucket.obj; - EG(objects_store).object_buckets[handle].destructor_called = 0; - EG(objects_store).object_buckets[handle].valid = 1; - - obj->refcount = 1; - obj->object = object; - obj->dtor = dtor?dtor:(zend_objects_store_dtor_t)zend_objects_destroy_object; - obj->free_storage = free_storage; - - obj->clone = clone; - -#if ZEND_DEBUG_OBJECTS - fprintf(stderr, "Allocated object id #%d\n", handle); -#endif - return handle; -} - -ZEND_API zend_uint zend_objects_store_get_refcount(zval *object TSRMLS_DC) -{ - zend_object_handle handle = Z_OBJ_HANDLE_P(object); - - return EG(objects_store).object_buckets[handle].bucket.obj.refcount; -} - -ZEND_API void zend_objects_store_add_ref(zval *object TSRMLS_DC) -{ - zend_object_handle handle = Z_OBJ_HANDLE_P(object); - - EG(objects_store).object_buckets[handle].bucket.obj.refcount++; -#if ZEND_DEBUG_OBJECTS - fprintf(stderr, "Increased refcount of object id #%d\n", handle); -#endif -} - -/* - * Add a reference to an objects store entry given the object handle. - */ -ZEND_API void zend_objects_store_add_ref_by_handle(zend_object_handle handle TSRMLS_DC) -{ - EG(objects_store).object_buckets[handle].bucket.obj.refcount++; -} - -#define ZEND_OBJECTS_STORE_ADD_TO_FREE_LIST() \ - EG(objects_store).object_buckets[handle].bucket.free_list.next = EG(objects_store).free_list_head; \ - EG(objects_store).free_list_head = handle; \ - EG(objects_store).object_buckets[handle].valid = 0; - -ZEND_API void zend_objects_store_del_ref(zval *zobject TSRMLS_DC) -{ - zend_object_handle handle; - - handle = Z_OBJ_HANDLE_P(zobject); - - zobject->refcount++; - zend_objects_store_del_ref_by_handle(handle TSRMLS_CC); - zobject->refcount--; -} - -/* - * Delete a reference to an objects store entry given the object handle. - */ -ZEND_API void zend_objects_store_del_ref_by_handle(zend_object_handle handle TSRMLS_DC) -{ - struct _store_object *obj; - int failure = 0; - - if (!EG(objects_store).object_buckets) { - return; - } - - obj = &EG(objects_store).object_buckets[handle].bucket.obj; - - /* Make sure we hold a reference count during the destructor call - otherwise, when the destructor ends the storage might be freed - when the refcount reaches 0 a second time - */ - if (EG(objects_store).object_buckets[handle].valid) { - if (obj->refcount == 1) { - if (!EG(objects_store).object_buckets[handle].destructor_called) { - EG(objects_store).object_buckets[handle].destructor_called = 1; - - if (obj->dtor) { - zend_try { - obj->dtor(obj->object, handle TSRMLS_CC); - } zend_catch { - failure = 1; - } zend_end_try(); - } - } - if (obj->refcount == 1) { - if (obj->free_storage) { - zend_try { - obj->free_storage(obj->object TSRMLS_CC); - } zend_catch { - failure = 1; - } zend_end_try(); - } - ZEND_OBJECTS_STORE_ADD_TO_FREE_LIST(); - } - } - } - - obj->refcount--; - -#if ZEND_DEBUG_OBJECTS - if (obj->refcount == 0) { - fprintf(stderr, "Deallocated object id #%d\n", handle); - } else { - fprintf(stderr, "Decreased refcount of object id #%d\n", handle); - } -#endif - if (failure) { - zend_bailout(); - } -} - -ZEND_API zend_object_value zend_objects_store_clone_obj(zval *zobject TSRMLS_DC) -{ - zend_object_value retval; - void *new_object; - struct _store_object *obj; - zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); - - obj = &EG(objects_store).object_buckets[handle].bucket.obj; - - if (obj->clone == NULL) { - zend_error(E_CORE_ERROR, "Trying to clone uncloneable object of class %s", Z_OBJCE_P(zobject)->name); - } - - obj->clone(obj->object, &new_object TSRMLS_CC); - - retval.handle = zend_objects_store_put(new_object, obj->dtor, obj->free_storage, obj->clone TSRMLS_CC); - retval.handlers = Z_OBJ_HT_P(zobject); - - return retval; -} - -ZEND_API void *zend_object_store_get_object(zval *zobject TSRMLS_DC) -{ - zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); - - return EG(objects_store).object_buckets[handle].bucket.obj.object; -} - -/* - * Retrieve an entry from the objects store given the object handle. - */ -ZEND_API void *zend_object_store_get_object_by_handle(zend_object_handle handle TSRMLS_DC) -{ - return EG(objects_store).object_buckets[handle].bucket.obj.object; -} - -/* zend_object_store_set_object: - * It is ONLY valid to call this function from within the constructor of an - * overloaded object. Its purpose is to set the object pointer for the object - * when you can't possibly know its value until you have parsed the arguments - * from the constructor function. You MUST NOT use this function for any other - * weird games, or call it at any other time after the object is constructed. - * */ -ZEND_API void zend_object_store_set_object(zval *zobject, void *object TSRMLS_DC) -{ - zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); - - EG(objects_store).object_buckets[handle].bucket.obj.object = object; -} - - -/* Called when the ctor was terminated by an exception */ -ZEND_API void zend_object_store_ctor_failed(zval *zobject TSRMLS_DC) -{ - zend_object_handle handle = Z_OBJ_HANDLE_P(zobject); - - EG(objects_store).object_buckets[handle].destructor_called = 1; -} - - -/* Proxy objects workings */ -typedef struct _zend_proxy_object { - zval *object; - zval *property; -} zend_proxy_object; - -static zend_object_handlers zend_object_proxy_handlers; - -ZEND_API void zend_objects_proxy_free_storage(zend_proxy_object *object TSRMLS_DC) -{ - zval_ptr_dtor(&object->object); - zval_ptr_dtor(&object->property); - efree(object); -} - -ZEND_API void zend_objects_proxy_clone(zend_proxy_object *object, zend_proxy_object **object_clone TSRMLS_DC) -{ - *object_clone = emalloc(sizeof(zend_proxy_object)); - (*object_clone)->object = object->object; - (*object_clone)->property = object->property; - zval_add_ref(&(*object_clone)->property); - zval_add_ref(&(*object_clone)->object); -} - -ZEND_API zval *zend_object_create_proxy(zval *object, zval *member TSRMLS_DC) -{ - zend_proxy_object *pobj = emalloc(sizeof(zend_proxy_object)); - zval *retval; - - pobj->object = object; - pobj->property = member; - zval_add_ref(&pobj->property); - zval_add_ref(&pobj->object); - - MAKE_STD_ZVAL(retval); - Z_TYPE_P(retval) = IS_OBJECT; - Z_OBJ_HANDLE_P(retval) = zend_objects_store_put(pobj, NULL, (zend_objects_free_object_storage_t) zend_objects_proxy_free_storage, (zend_objects_store_clone_t) zend_objects_proxy_clone TSRMLS_CC); - Z_OBJ_HT_P(retval) = &zend_object_proxy_handlers; - - return retval; -} - -ZEND_API void zend_object_proxy_set(zval **property, zval *value TSRMLS_DC) -{ - zend_proxy_object *probj = zend_object_store_get_object(*property TSRMLS_CC); - - if (Z_OBJ_HT_P(probj->object) && Z_OBJ_HT_P(probj->object)->write_property) { - Z_OBJ_HT_P(probj->object)->write_property(probj->object, probj->property, value TSRMLS_CC); - } else { - zend_error(E_WARNING, "Cannot write property of object - no write handler defined"); - } -} - -ZEND_API zval* zend_object_proxy_get(zval *property TSRMLS_DC) -{ - zend_proxy_object *probj = zend_object_store_get_object(property TSRMLS_CC); - - if (Z_OBJ_HT_P(probj->object) && Z_OBJ_HT_P(probj->object)->read_property) { - return Z_OBJ_HT_P(probj->object)->read_property(probj->object, probj->property, BP_VAR_R TSRMLS_CC); - } else { - zend_error(E_WARNING, "Cannot read property of object - no read handler defined"); - } - - return NULL; -} - -ZEND_API zend_object_handlers *zend_get_std_object_handlers() -{ - return &std_object_handlers; -} - -static zend_object_handlers zend_object_proxy_handlers = { - ZEND_OBJECTS_STORE_HANDLERS, - - NULL, /* read_property */ - NULL, /* write_property */ - NULL, /* read dimension */ - NULL, /* write_dimension */ - NULL, /* get_property_ptr_ptr */ - zend_object_proxy_get, /* get */ - zend_object_proxy_set, /* set */ - NULL, /* has_property */ - NULL, /* unset_property */ - NULL, /* has_dimension */ - NULL, /* unset_dimension */ - NULL, /* get_properties */ - NULL, /* get_method */ - NULL, /* call_method */ - NULL, /* get_constructor */ - NULL, /* get_class_entry */ - NULL, /* get_class_name */ - NULL, /* compare_objects */ - NULL, /* cast_object */ - NULL, /* count_elements */ -}; - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_objects_API.h b/Zend/zend_objects_API.h deleted file mode 100644 index 1bfe3353fc..0000000000 --- a/Zend/zend_objects_API.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_OBJECTS_API_H -#define ZEND_OBJECTS_API_H - -#include "zend.h" - -typedef void (*zend_objects_store_dtor_t)(void *object, zend_object_handle handle TSRMLS_DC); -typedef void (*zend_objects_free_object_storage_t)(void *object TSRMLS_DC); -typedef void (*zend_objects_store_clone_t)(void *object, void **object_clone TSRMLS_DC); - -typedef struct _zend_object_store_bucket { - zend_bool destructor_called; - zend_bool valid; - union _store_bucket { - struct _store_object { - void *object; - zend_objects_store_dtor_t dtor; - zend_objects_free_object_storage_t free_storage; - zend_objects_store_clone_t clone; - zend_uint refcount; - } obj; - struct { - int next; - } free_list; - } bucket; -} zend_object_store_bucket; - -typedef struct _zend_objects_store { - zend_object_store_bucket *object_buckets; - zend_uint top; - zend_uint size; - int free_list_head; -} zend_objects_store; - -/* Global store handling functions */ -BEGIN_EXTERN_C() -ZEND_API void zend_objects_store_init(zend_objects_store *objects, zend_uint init_size); -ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TSRMLS_DC); -ZEND_API void zend_objects_store_mark_destructed(zend_objects_store *objects TSRMLS_DC); -ZEND_API void zend_objects_store_destroy(zend_objects_store *objects); - -/* Store API functions */ -ZEND_API zend_object_handle zend_objects_store_put(void *object, zend_objects_store_dtor_t dtor, zend_objects_free_object_storage_t storage, zend_objects_store_clone_t clone TSRMLS_DC); - -ZEND_API void zend_objects_store_add_ref(zval *object TSRMLS_DC); -ZEND_API void zend_objects_store_del_ref(zval *object TSRMLS_DC); -ZEND_API void zend_objects_store_add_ref_by_handle(zend_object_handle handle TSRMLS_DC); -ZEND_API void zend_objects_store_del_ref_by_handle(zend_object_handle handle TSRMLS_DC); -ZEND_API zend_uint zend_objects_store_get_refcount(zval *object TSRMLS_DC); -ZEND_API zend_object_value zend_objects_store_clone_obj(zval *object TSRMLS_DC); -ZEND_API void *zend_object_store_get_object(zval *object TSRMLS_DC); -ZEND_API void *zend_object_store_get_object_by_handle(zend_object_handle handle TSRMLS_DC); -/* See comment in zend_objects_API.c before you use this */ -ZEND_API void zend_object_store_set_object(zval *zobject, void *object TSRMLS_DC); -ZEND_API void zend_object_store_ctor_failed(zval *zobject TSRMLS_DC); - -ZEND_API void zend_objects_store_free_object_storage(zend_objects_store *objects TSRMLS_DC); - -#define ZEND_OBJECTS_STORE_HANDLERS zend_objects_store_add_ref, zend_objects_store_del_ref, zend_objects_store_clone_obj - -ZEND_API zval *zend_object_create_proxy(zval *object, zval *member TSRMLS_DC); - -ZEND_API zend_object_handlers *zend_get_std_object_handlers(); -END_EXTERN_C() - -#endif /* ZEND_OBJECTS_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c deleted file mode 100644 index 466dfbd2b5..0000000000 --- a/Zend/zend_opcode.c +++ /dev/null @@ -1,505 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include - -#include "zend.h" -#include "zend_alloc.h" -#include "zend_compile.h" -#include "zend_extensions.h" -#include "zend_API.h" - -#include "zend_vm.h" - -static void zend_extension_op_array_ctor_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC) -{ - if (extension->op_array_ctor) { - extension->op_array_ctor(op_array); - } -} - -static void zend_extension_op_array_dtor_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC) -{ - if (extension->op_array_dtor) { - extension->op_array_dtor(op_array); - } -} - -static void op_array_alloc_ops(zend_op_array *op_array) -{ - op_array->opcodes = erealloc(op_array->opcodes, (op_array->size)*sizeof(zend_op)); -} - -void init_op_array(zend_op_array *op_array, zend_uchar type, int initial_ops_size TSRMLS_DC) -{ - op_array->type = type; - - op_array->backpatch_count = 0; - if (CG(interactive)) { - /* We must avoid a realloc() on the op_array in interactive mode, since pointers to constants - * will become invalid - */ - initial_ops_size = 8192; - } - - op_array->refcount = (zend_uint *) emalloc(sizeof(zend_uint)); - *op_array->refcount = 1; - op_array->size = initial_ops_size; - op_array->last = 0; - op_array->opcodes = NULL; - op_array_alloc_ops(op_array); - - op_array->size_var = 0; /* FIXME:??? */ - op_array->last_var = 0; - op_array->vars = NULL; - - op_array->T = 0; - - op_array->function_name = NULL; - op_array->filename = zend_get_compiled_filename(TSRMLS_C); - op_array->doc_comment = NULL; - op_array->doc_comment_len = 0; - - op_array->arg_info = NULL; - op_array->num_args = 0; - op_array->required_num_args = 0; - - op_array->scope = NULL; - - op_array->brk_cont_array = NULL; - op_array->try_catch_array = NULL; - op_array->last_brk_cont = 0; - op_array->current_brk_cont = -1; - - op_array->static_variables = NULL; - op_array->last_try_catch = 0; - - op_array->return_reference = 0; - op_array->done_pass_two = 0; - - op_array->uses_this = 0; - - op_array->start_op = NULL; - - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_ctor_handler, op_array TSRMLS_CC); -} - -ZEND_API void destroy_zend_function(zend_function *function TSRMLS_DC) -{ - switch (function->type) { - case ZEND_USER_FUNCTION: - destroy_op_array((zend_op_array *) function TSRMLS_CC); - break; - case ZEND_INTERNAL_FUNCTION: - /* do nothing */ - break; - } -} - -ZEND_API void zend_function_dtor(zend_function *function) -{ - TSRMLS_FETCH(); - - destroy_zend_function(function TSRMLS_CC); -} - -static void zend_cleanup_op_array_data(zend_op_array *op_array) -{ - if (op_array->static_variables) { - zend_hash_clean(op_array->static_variables); - } -} - -ZEND_API int zend_cleanup_function_data(zend_function *function TSRMLS_DC) -{ - if (function->type == ZEND_USER_FUNCTION) { - zend_cleanup_op_array_data((zend_op_array *) function); - return ZEND_HASH_APPLY_KEEP; - } else { - return ZEND_HASH_APPLY_STOP; - } -} - -ZEND_API int zend_cleanup_function_data_full(zend_function *function TSRMLS_DC) -{ - if (function->type == ZEND_USER_FUNCTION) { - zend_cleanup_op_array_data((zend_op_array *) function); - } - return 0; -} - -ZEND_API int zend_cleanup_class_data(zend_class_entry **pce TSRMLS_DC) -{ - if ((*pce)->type == ZEND_USER_CLASS) { - /* Clean all parts that can contain run-time data */ - /* Note that only run-time accessed data need to be cleaned up, pre-defined data can - not contain objects and thus are not probelmatic */ - zend_hash_apply(&(*pce)->function_table, (apply_func_t) zend_cleanup_function_data_full TSRMLS_CC); - (*pce)->static_members = NULL; - } else if (CE_STATIC_MEMBERS(*pce)) { - zend_hash_destroy(CE_STATIC_MEMBERS(*pce)); - FREE_HASHTABLE(CE_STATIC_MEMBERS(*pce)); -#ifdef ZTS - CG(static_members)[(long)((*pce)->static_members)] = NULL; -#else - (*pce)->static_members = NULL; -#endif - } - return 0; -} - -ZEND_API void destroy_zend_class(zend_class_entry **pce) -{ - zend_class_entry *ce = *pce; - - if (--ce->refcount > 0) { - return; - } - switch (ce->type) { - case ZEND_USER_CLASS: - zend_hash_destroy(&ce->default_properties); - zend_hash_destroy(&ce->properties_info); - zend_hash_destroy(&ce->default_static_members); - efree(ce->name); - zend_hash_destroy(&ce->function_table); - zend_hash_destroy(&ce->constants_table); - if (ce->num_interfaces > 0 && ce->interfaces) { - efree(ce->interfaces); - } - if (ce->doc_comment) { - efree(ce->doc_comment); - } - efree(ce); - break; - case ZEND_INTERNAL_CLASS: - zend_hash_destroy(&ce->default_properties); - zend_hash_destroy(&ce->properties_info); - zend_hash_destroy(&ce->default_static_members); - free(ce->name); - zend_hash_destroy(&ce->function_table); - zend_hash_destroy(&ce->constants_table); - if (ce->num_interfaces > 0) { - free(ce->interfaces); - } - if (ce->doc_comment) { - free(ce->doc_comment); - } - free(ce); - break; - } -} - -void zend_class_add_ref(zend_class_entry **ce) -{ - (*ce)->refcount++; -} - -ZEND_API void destroy_op_array(zend_op_array *op_array TSRMLS_DC) -{ - zend_op *opline = op_array->opcodes; - zend_op *end = op_array->opcodes+op_array->last; - zend_uint i; - - if (op_array->static_variables) { - zend_hash_destroy(op_array->static_variables); - FREE_HASHTABLE(op_array->static_variables); - } - - if (--(*op_array->refcount)>0) { - return; - } - - efree(op_array->refcount); - - if (op_array->vars) { - i = op_array->last_var; - while (i > 0) { - i--; - efree(op_array->vars[i].name); - } - efree(op_array->vars); - } - - while (oplineop1.op_type==IS_CONST) { -#if DEBUG_ZEND>2 - printf("Reducing refcount for %x 1=>0 (destroying)\n", &opline->op1.u.constant); -#endif - zval_dtor(&opline->op1.u.constant); - } - if (opline->op2.op_type==IS_CONST) { -#if DEBUG_ZEND>2 - printf("Reducing refcount for %x 1=>0 (destroying)\n", &opline->op2.u.constant); -#endif - zval_dtor(&opline->op2.u.constant); - } - opline++; - } - efree(op_array->opcodes); - - if (op_array->function_name) { - efree(op_array->function_name); - } - if (op_array->doc_comment) { - efree(op_array->doc_comment); - } - if (op_array->brk_cont_array) { - efree(op_array->brk_cont_array); - } - if (op_array->try_catch_array) { - efree(op_array->try_catch_array); - } - if (op_array->done_pass_two) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_dtor_handler, op_array TSRMLS_CC); - } - if (op_array->arg_info) { - for (i=0; inum_args; i++) { - efree(op_array->arg_info[i].name); - if (op_array->arg_info[i].class_name) { - efree(op_array->arg_info[i].class_name); - } - } - efree(op_array->arg_info); - } -} - -void init_op(zend_op *op TSRMLS_DC) -{ - memset(op, 0, sizeof(zend_op)); - op->lineno = CG(zend_lineno); - SET_UNUSED(op->result); -} - -zend_op *get_next_op(zend_op_array *op_array TSRMLS_DC) -{ - zend_uint next_op_num = op_array->last++; - zend_op *next_op; - - if (next_op_num >= op_array->size) { - if (CG(interactive)) { - /* we messed up */ - zend_printf("Ran out of opcode space!\n" - "You should probably consider writing this huge script into a file!\n"); - zend_bailout(); - } - op_array->size *= 4; - op_array_alloc_ops(op_array); - } - - next_op = &(op_array->opcodes[next_op_num]); - - init_op(next_op TSRMLS_CC); - - return next_op; -} - -int get_next_op_number(zend_op_array *op_array) -{ - return op_array->last; -} - -zend_brk_cont_element *get_next_brk_cont_element(zend_op_array *op_array) -{ - op_array->last_brk_cont++; - op_array->brk_cont_array = erealloc(op_array->brk_cont_array, sizeof(zend_brk_cont_element)*op_array->last_brk_cont); - return &op_array->brk_cont_array[op_array->last_brk_cont-1]; -} - -static void zend_update_extended_info(zend_op_array *op_array TSRMLS_DC) -{ - zend_op *opline = op_array->opcodes, *end=opline+op_array->last; - - while (oplineopcode == ZEND_EXT_STMT) { - if (opline+1opcode == ZEND_EXT_STMT) { - opline->opcode = ZEND_NOP; - opline++; - continue; - } - if (opline+1lineno = (opline+1)->lineno; - } - } else { - opline->opcode = ZEND_NOP; - } - } - opline++; - } -} - -static void zend_extension_op_array_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC) -{ - if (extension->op_array_handler) { - extension->op_array_handler(op_array); - } -} - -int pass_two(zend_op_array *op_array TSRMLS_DC) -{ - zend_op *opline, *end; - - if (op_array->type!=ZEND_USER_FUNCTION && op_array->type!=ZEND_EVAL_CODE) { - return 0; - } - if (CG(extended_info)) { - zend_update_extended_info(op_array TSRMLS_CC); - } - if (CG(handle_op_arrays)) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_handler, op_array TSRMLS_CC); - } - - if (!CG(interactive) && op_array->size != op_array->last) { - op_array->opcodes = (zend_op *) erealloc(op_array->opcodes, sizeof(zend_op)*op_array->last); - op_array->size = op_array->last; - } - - opline = op_array->opcodes; - end = opline + op_array->last; - while (opline < end) { - if (opline->op1.op_type == IS_CONST) { - opline->op1.u.constant.is_ref = 1; - opline->op1.u.constant.refcount = 2; /* Make sure is_ref won't be reset */ - } - if (opline->op2.op_type == IS_CONST) { - opline->op2.u.constant.is_ref = 1; - opline->op2.u.constant.refcount = 2; - } - switch (opline->opcode) { - case ZEND_JMP: - opline->op1.u.jmp_addr = &op_array->opcodes[opline->op1.u.opline_num]; - break; - case ZEND_JMPZ: - case ZEND_JMPNZ: - case ZEND_JMPZ_EX: - case ZEND_JMPNZ_EX: - opline->op2.u.jmp_addr = &op_array->opcodes[opline->op2.u.opline_num]; - break; - } - ZEND_VM_SET_OPCODE_HANDLER(opline); - opline++; - } - - op_array->done_pass_two = 1; - return 0; -} - -int print_class(zend_class_entry *class_entry TSRMLS_DC) -{ - printf("Class %s:\n", class_entry->name); - zend_hash_apply(&class_entry->function_table, (apply_func_t) pass_two TSRMLS_CC); - printf("End of class %s.\n\n", class_entry->name); - return 0; -} - -ZEND_API unary_op_type get_unary_op(int opcode) -{ - switch (opcode) { - case ZEND_BW_NOT: - return (unary_op_type) bitwise_not_function; - break; - case ZEND_BOOL_NOT: - return (unary_op_type) boolean_not_function; - break; - default: - return (unary_op_type) NULL; - break; - } -} - -ZEND_API void *get_binary_op(int opcode) -{ - switch (opcode) { - case ZEND_ADD: - case ZEND_ASSIGN_ADD: - return (void *) add_function; - break; - case ZEND_SUB: - case ZEND_ASSIGN_SUB: - return (void *) sub_function; - break; - case ZEND_MUL: - case ZEND_ASSIGN_MUL: - return (void *) mul_function; - break; - case ZEND_DIV: - case ZEND_ASSIGN_DIV: - return (void *) div_function; - break; - case ZEND_MOD: - case ZEND_ASSIGN_MOD: - return (void *) mod_function; - break; - case ZEND_SL: - case ZEND_ASSIGN_SL: - return (void *) shift_left_function; - break; - case ZEND_SR: - case ZEND_ASSIGN_SR: - return (void *) shift_right_function; - break; - case ZEND_CONCAT: - case ZEND_ASSIGN_CONCAT: - return (void *) concat_function; - break; - case ZEND_IS_IDENTICAL: - return (void *) is_identical_function; - break; - case ZEND_IS_NOT_IDENTICAL: - return (void *) is_not_identical_function; - break; - case ZEND_IS_EQUAL: - return (void *) is_equal_function; - break; - case ZEND_IS_NOT_EQUAL: - return (void *) is_not_equal_function; - break; - case ZEND_IS_SMALLER: - return (void *) is_smaller_function; - break; - case ZEND_IS_SMALLER_OR_EQUAL: - return (void *) is_smaller_or_equal_function; - break; - case ZEND_BW_OR: - case ZEND_ASSIGN_BW_OR: - return (void *) bitwise_or_function; - break; - case ZEND_BW_AND: - case ZEND_ASSIGN_BW_AND: - return (void *) bitwise_and_function; - break; - case ZEND_BW_XOR: - case ZEND_ASSIGN_BW_XOR: - return (void *) bitwise_xor_function; - break; - default: - return (void *) NULL; - break; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c deleted file mode 100644 index 12a3adfed5..0000000000 --- a/Zend/zend_operators.c +++ /dev/null @@ -1,2025 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include - -#include "zend.h" -#include "zend_operators.h" -#include "zend_variables.h" -#include "zend_globals.h" -#include "zend_list.h" -#include "zend_API.h" -#include "zend_multiply.h" -#include "zend_strtod.h" - -#define LONG_SIGN_MASK (1L << (8*sizeof(long)-1)) - -ZEND_API int zend_atoi(const char *str, int str_len) -{ - int retval; - - if (!str_len) { - str_len = strlen(str); - } - retval = strtol(str, NULL, 0); - if (str_len>0) { - switch (str[str_len-1]) { - case 'g': - case 'G': - retval *= 1024; - /* break intentionally missing */ - case 'm': - case 'M': - retval *= 1024; - /* break intentionally missing */ - case 'k': - case 'K': - retval *= 1024; - break; - } - } - return retval; -} - - -ZEND_API double zend_string_to_double(const char *number, zend_uint length) -{ - double divisor = 10.0; - double result = 0.0; - double exponent; - const char *end = number+length; - const char *digit = number; - - if (!length) { - return result; - } - - while (digit < end) { - if ((*digit <= '9' && *digit >= '0')) { - result *= 10; - result += *digit - '0'; - } else if (*digit == '.') { - digit++; - break; - } else if (toupper(*digit) == 'E') { - exponent = (double) atoi(digit+1); - result *= pow(10.0, exponent); - return result; - } else { - return result; - } - digit++; - } - - while (digit < end) { - if ((*digit <= '9' && *digit >= '0')) { - result += (*digit - '0') / divisor; - divisor *= 10; - } else if (toupper(*digit) == 'E') { - exponent = (double) atoi(digit+1); - result *= pow(10.0, exponent); - return result; - } else { - return result; - } - digit++; - } - return result; -} - - -ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC) -{ - switch (op->type) { - case IS_STRING: - { - char *strval; - - strval = op->value.str.val; - switch ((op->type=is_numeric_string(strval, op->value.str.len, &op->value.lval, &op->value.dval, 1))) { - case IS_DOUBLE: - case IS_LONG: - break; - default: - op->value.lval = strtol(op->value.str.val, NULL, 10); - op->type = IS_LONG; - break; - } - STR_FREE(strval); - break; - } - case IS_BOOL: - op->type = IS_LONG; - break; - case IS_RESOURCE: - zend_list_delete(op->value.lval); - op->type = IS_LONG; - break; - case IS_OBJECT: - convert_to_long_base(op, 10); - break; - case IS_NULL: - op->type = IS_LONG; - op->value.lval = 0; - break; - } -} - -#define zendi_convert_scalar_to_number(op, holder, result) \ - if (op==result) { \ - if (op->type != IS_LONG) { \ - convert_scalar_to_number(op TSRMLS_CC); \ - } \ - } else { \ - switch ((op)->type) { \ - case IS_STRING: \ - { \ - switch (((holder).type=is_numeric_string((op)->value.str.val, (op)->value.str.len, &(holder).value.lval, &(holder).value.dval, 1))) { \ - case IS_DOUBLE: \ - case IS_LONG: \ - break; \ - default: \ - (holder).value.lval = strtol((op)->value.str.val, NULL, 10); \ - (holder).type = IS_LONG; \ - break; \ - } \ - (op) = &(holder); \ - break; \ - } \ - case IS_BOOL: \ - case IS_RESOURCE: \ - (holder).value.lval = (op)->value.lval; \ - (holder).type = IS_LONG; \ - (op) = &(holder); \ - break; \ - case IS_NULL: \ - (holder).value.lval = 0; \ - (holder).type = IS_LONG; \ - (op) = &(holder); \ - break; \ - case IS_OBJECT: \ - (holder) = (*(op)); \ - zval_copy_ctor(&(holder)); \ - convert_to_long_base(&(holder), 10); \ - if ((holder).type == IS_LONG) { \ - (op) = &(holder); \ - } \ - break; \ - } \ - } - -#define DVAL_TO_LVAL(d, l) \ - if ((d) > LONG_MAX) { \ - (l) = (unsigned long) (d); \ - } else { \ - (l) = (long) (d); \ - } - - -#define zendi_convert_to_long(op, holder, result) \ - if (op == result) { \ - convert_to_long(op); \ - } else if ((op)->type != IS_LONG) { \ - switch ((op)->type) { \ - case IS_NULL: \ - (holder).value.lval = 0; \ - break; \ - case IS_DOUBLE: \ - DVAL_TO_LVAL((op)->value.dval, (holder).value.lval); \ - break; \ - case IS_STRING: \ - (holder).value.lval = strtol((op)->value.str.val, NULL, 10); \ - break; \ - case IS_ARRAY: \ - (holder).value.lval = (zend_hash_num_elements((op)->value.ht)?1:0); \ - break; \ - case IS_OBJECT: \ - (holder) = (*(op)); \ - zval_copy_ctor(&(holder)); \ - convert_to_long_base(&(holder), 10); \ - break; \ - case IS_BOOL: \ - case IS_RESOURCE: \ - (holder).value.lval = (op)->value.lval; \ - break; \ - default: \ - zend_error(E_WARNING, "Cannot convert to ordinal value"); \ - (holder).value.lval = 0; \ - break; \ - } \ - (holder).type = IS_LONG; \ - (op) = &(holder); \ - } - - -#define zendi_convert_to_boolean(op, holder, result) \ - if (op==result) { \ - convert_to_boolean(op); \ - } else if ((op)->type != IS_BOOL) { \ - switch ((op)->type) { \ - case IS_NULL: \ - (holder).value.lval = 0; \ - break; \ - case IS_RESOURCE: \ - case IS_LONG: \ - (holder).value.lval = ((op)->value.lval ? 1 : 0); \ - break; \ - case IS_DOUBLE: \ - (holder).value.lval = ((op)->value.dval ? 1 : 0); \ - break; \ - case IS_STRING: \ - if ((op)->value.str.len == 0 \ - || ((op)->value.str.len==1 && (op)->value.str.val[0]=='0')) { \ - (holder).value.lval = 0; \ - } else { \ - (holder).value.lval = 1; \ - } \ - break; \ - case IS_ARRAY: \ - (holder).value.lval = (zend_hash_num_elements((op)->value.ht)?1:0); \ - break; \ - case IS_OBJECT: \ - (holder) = (*(op)); \ - zval_copy_ctor(&(holder)); \ - convert_to_boolean(&(holder)); \ - break; \ - default: \ - (holder).value.lval = 0; \ - break; \ - } \ - (holder).type = IS_BOOL; \ - (op) = &(holder); \ - } - - -#define convert_object_to_type(op, ctype, conv_func) \ - if (Z_OBJ_HT_P(op)->cast_object) { \ - zval dst; \ - if (Z_OBJ_HT_P(op)->cast_object(op, &dst, ctype TSRMLS_CC) == FAILURE) { \ - zend_error(E_RECOVERABLE_ERROR, \ - "Object of class %s could not be converted to %s", Z_OBJCE_P(op)->name, \ - zend_get_type_by_const(ctype)); \ - } else { \ - zval_dtor(op); \ - Z_TYPE_P(op) = ctype; \ - op->value = dst.value; \ - } \ - } else { \ - if(Z_OBJ_HT_P(op)->get) { \ - zval *newop = Z_OBJ_HT_P(op)->get(op TSRMLS_CC); \ - if(Z_TYPE_P(newop) != IS_OBJECT) { \ - /* for safety - avoid loop */ \ - zval_dtor(op); \ - *op = *newop; \ - FREE_ZVAL(newop); \ - conv_func(op); \ - } \ - } \ - } - - -ZEND_API void convert_to_long(zval *op) -{ - convert_to_long_base(op, 10); -} - - -ZEND_API void convert_to_long_base(zval *op, int base) -{ - char *strval; - long tmp; - - switch (op->type) { - case IS_NULL: - op->value.lval = 0; - break; - case IS_RESOURCE: { - TSRMLS_FETCH(); - - zend_list_delete(op->value.lval); - } - /* break missing intentionally */ - case IS_BOOL: - case IS_LONG: - break; - case IS_DOUBLE: - DVAL_TO_LVAL(op->value.dval, op->value.lval); - break; - case IS_STRING: - strval = op->value.str.val; - op->value.lval = strtol(strval, NULL, base); - STR_FREE(strval); - break; - case IS_ARRAY: - tmp = (zend_hash_num_elements(op->value.ht)?1:0); - zval_dtor(op); - op->value.lval = tmp; - break; - case IS_OBJECT: - { - int retval = 1; - TSRMLS_FETCH(); - - convert_object_to_type(op, IS_LONG, convert_to_long); - - if (op->type == IS_LONG) { - return; - } - - if (EG(ze1_compatibility_mode)) { - HashTable *ht = Z_OBJPROP_P(op); - if (ht) { - retval = (zend_hash_num_elements(ht)?1:0); - } - } else { - zend_error(E_NOTICE, "Object of class %s could not be converted to int", Z_OBJCE_P(op)->name); - } - zval_dtor(op); - ZVAL_LONG(op, retval); - return; - } - default: - zend_error(E_WARNING, "Cannot convert to ordinal value"); - zval_dtor(op); - op->value.lval = 0; - break; - } - - op->type = IS_LONG; -} - - -ZEND_API void convert_to_double(zval *op) -{ - char *strval; - double tmp; - - switch (op->type) { - case IS_NULL: - op->value.dval = 0.0; - break; - case IS_RESOURCE: { - TSRMLS_FETCH(); - - zend_list_delete(op->value.lval); - } - /* break missing intentionally */ - case IS_BOOL: - case IS_LONG: - op->value.dval = (double) op->value.lval; - break; - case IS_DOUBLE: - break; - case IS_STRING: - strval = op->value.str.val; - - op->value.dval = zend_strtod(strval, NULL); - STR_FREE(strval); - break; - case IS_ARRAY: - tmp = (zend_hash_num_elements(op->value.ht)?1:0); - zval_dtor(op); - op->value.dval = tmp; - break; - case IS_OBJECT: - { - double retval = 1.0; - TSRMLS_FETCH(); - - convert_object_to_type(op, IS_DOUBLE, convert_to_double); - - if (op->type == IS_DOUBLE) { - return; - } - - if (EG(ze1_compatibility_mode)) { - HashTable *ht = Z_OBJPROP_P(op); - if (ht) { - retval = (zend_hash_num_elements(ht)?1.0:0.0); - } - } else { - zend_error(E_NOTICE, "Object of class %s could not be converted to double", Z_OBJCE_P(op)->name); - } - - zval_dtor(op); - ZVAL_DOUBLE(op, retval); - break; - } - default: - zend_error(E_WARNING, "Cannot convert to real value (type=%d)", op->type); - zval_dtor(op); - op->value.dval = 0; - break; - } - op->type = IS_DOUBLE; -} - - -ZEND_API void convert_to_null(zval *op) -{ - if (Z_TYPE_P(op) == IS_OBJECT) { - if (Z_OBJ_HT_P(op)->cast_object) { - zval *org; - TSRMLS_FETCH(); - - ALLOC_ZVAL(org); - *org = *op; - if (Z_OBJ_HT_P(op)->cast_object(org, op, IS_NULL TSRMLS_CC) == SUCCESS) { - zval_dtor(org); - return; - } - *op = *org; - } - } - - zval_dtor(op); - Z_TYPE_P(op) = IS_NULL; -} - - -ZEND_API void convert_to_boolean(zval *op) -{ - char *strval; - int tmp; - - switch (op->type) { - case IS_BOOL: - break; - case IS_NULL: - op->value.lval = 0; - break; - case IS_RESOURCE: { - TSRMLS_FETCH(); - - zend_list_delete(op->value.lval); - } - /* break missing intentionally */ - case IS_LONG: - op->value.lval = (op->value.lval ? 1 : 0); - break; - case IS_DOUBLE: - op->value.lval = (op->value.dval ? 1 : 0); - break; - case IS_STRING: - strval = op->value.str.val; - - if (op->value.str.len == 0 - || (op->value.str.len==1 && op->value.str.val[0]=='0')) { - op->value.lval = 0; - } else { - op->value.lval = 1; - } - STR_FREE(strval); - break; - case IS_ARRAY: - tmp = (zend_hash_num_elements(op->value.ht)?1:0); - zval_dtor(op); - op->value.lval = tmp; - break; - case IS_OBJECT: - { - zend_bool retval = 1; - TSRMLS_FETCH(); - - convert_object_to_type(op, IS_BOOL, convert_to_boolean); - - if (op->type == IS_BOOL) { - return; - } - - if (EG(ze1_compatibility_mode)) { - HashTable *ht = Z_OBJPROP_P(op); - if (ht) { - retval = (zend_hash_num_elements(ht)?1:0); - } - } - - zval_dtor(op); - ZVAL_BOOL(op, retval); - break; - } - default: - zval_dtor(op); - op->value.lval = 0; - break; - } - op->type = IS_BOOL; -} - -ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC) -{ - long lval; - double dval; - - switch (op->type) { - case IS_NULL: - op->value.str.val = STR_EMPTY_ALLOC(); - op->value.str.len = 0; - break; - case IS_STRING: - break; - case IS_BOOL: - if (op->value.lval) { - op->value.str.val = estrndup_rel("1", 1); - op->value.str.len = 1; - } else { - op->value.str.val = STR_EMPTY_ALLOC(); - op->value.str.len = 0; - } - break; - case IS_RESOURCE: { - long tmp = op->value.lval; - TSRMLS_FETCH(); - - zend_list_delete(op->value.lval); - op->value.str.val = (char *) emalloc(sizeof("Resource id #")-1 + MAX_LENGTH_OF_LONG); - op->value.str.len = sprintf(op->value.str.val, "Resource id #%ld", tmp); - break; - } - case IS_LONG: - lval = op->value.lval; - - op->value.str.val = (char *) emalloc_rel(MAX_LENGTH_OF_LONG + 1); - op->value.str.len = zend_sprintf(op->value.str.val, "%ld", lval); /* SAFE */ - break; - case IS_DOUBLE: { - TSRMLS_FETCH(); - dval = op->value.dval; - op->value.str.val = (char *) emalloc_rel(MAX_LENGTH_OF_DOUBLE + EG(precision) + 1); - op->value.str.len = zend_sprintf(op->value.str.val, "%.*G", (int) EG(precision), dval); /* SAFE */ - /* %G already handles removing trailing zeros from the fractional part, yay */ - break; - } - case IS_ARRAY: - zend_error(E_NOTICE, "Array to string conversion"); - zval_dtor(op); - op->value.str.val = estrndup_rel("Array", sizeof("Array")-1); - op->value.str.len = sizeof("Array")-1; - break; - case IS_OBJECT: { - TSRMLS_FETCH(); - - convert_object_to_type(op, IS_STRING, convert_to_string); - - if (op->type == IS_STRING) { - return; - } - - zend_error(E_NOTICE, "Object of class %s to string conversion", Z_OBJCE_P(op)->name); - zval_dtor(op); - op->value.str.val = estrndup_rel("Object", sizeof("Object")-1); - op->value.str.len = sizeof("Object")-1; - break; - } - default: - zval_dtor(op); - ZVAL_BOOL(op, 0); - break; - } - op->type = IS_STRING; -} - - -static void convert_scalar_to_array(zval *op, int type) -{ - zval *entry; - - ALLOC_ZVAL(entry); - *entry = *op; - INIT_PZVAL(entry); - - switch (type) { - case IS_ARRAY: - ALLOC_HASHTABLE(op->value.ht); - zend_hash_init(op->value.ht, 0, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_index_update(op->value.ht, 0, (void *) &entry, sizeof(zval *), NULL); - op->type = IS_ARRAY; - break; - case IS_OBJECT: - { - /* OBJECTS_OPTIMIZE */ - TSRMLS_FETCH(); - - object_init(op); - zend_hash_update(Z_OBJPROP_P(op), "scalar", sizeof("scalar"), (void *) &entry, sizeof(zval *), NULL); - } - break; - } -} - - -ZEND_API void convert_to_array(zval *op) -{ - TSRMLS_FETCH(); - - switch (op->type) { - case IS_ARRAY: - return; - break; -/* OBJECTS_OPTIMIZE */ - case IS_OBJECT: - { - zval *tmp; - HashTable *ht; - - ALLOC_HASHTABLE(ht); - zend_hash_init(ht, 0, NULL, ZVAL_PTR_DTOR, 0); - if (Z_OBJ_HT_P(op)->get_properties) { - HashTable *obj_ht = Z_OBJ_HT_P(op)->get_properties(op TSRMLS_CC); - if(obj_ht) { - zend_hash_copy(ht, obj_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - } - } else { - convert_object_to_type(op, IS_ARRAY, convert_to_array); - - if (op->type == IS_ARRAY) { - return; - } - } - zval_dtor(op); - op->type = IS_ARRAY; - op->value.ht = ht; - } - return; - case IS_NULL: - ALLOC_HASHTABLE(op->value.ht); - zend_hash_init(op->value.ht, 0, NULL, ZVAL_PTR_DTOR, 0); - op->type = IS_ARRAY; - break; - default: - convert_scalar_to_array(op, IS_ARRAY); - break; - } -} - - -ZEND_API void convert_to_object(zval *op) -{ - switch (op->type) { - case IS_ARRAY: - { - /* OBJECTS_OPTIMIZE */ - TSRMLS_FETCH(); - - object_and_properties_init(op, zend_standard_class_def, op->value.ht); - return; - break; - } - case IS_OBJECT: - return; - case IS_NULL: - { - /* OBJECTS_OPTIMIZE */ - TSRMLS_FETCH(); - - object_init(op); - break; - } - default: - convert_scalar_to_array(op, IS_OBJECT); - break; - } -} - -ZEND_API void multi_convert_to_long_ex(int argc, ...) -{ - zval **arg; - va_list ap; - - va_start(ap, argc); - - while (argc--) { - arg = va_arg(ap, zval **); - convert_to_long_ex(arg); - } - - va_end(ap); -} - -ZEND_API void multi_convert_to_double_ex(int argc, ...) -{ - zval **arg; - va_list ap; - - va_start(ap, argc); - - while (argc--) { - arg = va_arg(ap, zval **); - convert_to_double_ex(arg); - } - - va_end(ap); -} - -ZEND_API void multi_convert_to_string_ex(int argc, ...) -{ - zval **arg; - va_list ap; - - va_start(ap, argc); - - while (argc--) { - arg = va_arg(ap, zval **); - convert_to_string_ex(arg); - } - - va_end(ap); -} - -ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - if (op1->type == IS_ARRAY && op2->type == IS_ARRAY) { - zval *tmp; - - if ((result == op1) && (result == op2)) { - /* $a += $a */ - return SUCCESS; - } - if (result != op1) { - *result = *op1; - zval_copy_ctor(result); - } - zend_hash_merge(result->value.ht, op2->value.ht, (void (*)(void *pData)) zval_add_ref, (void *) &tmp, sizeof(zval *), 0); - return SUCCESS; - } - zendi_convert_scalar_to_number(op1, op1_copy, result); - zendi_convert_scalar_to_number(op2, op2_copy, result); - - - if (op1->type == IS_LONG && op2->type == IS_LONG) { - long lval = op1->value.lval + op2->value.lval; - - /* check for overflow by comparing sign bits */ - if ( (op1->value.lval & LONG_SIGN_MASK) == (op2->value.lval & LONG_SIGN_MASK) - && (op1->value.lval & LONG_SIGN_MASK) != (lval & LONG_SIGN_MASK)) { - - result->value.dval = (double) op1->value.lval + (double) op2->value.lval; - result->type = IS_DOUBLE; - } else { - result->value.lval = lval; - result->type = IS_LONG; - } - return SUCCESS; - } - if ((op1->type == IS_DOUBLE && op2->type == IS_LONG) - || (op1->type == IS_LONG && op2->type == IS_DOUBLE)) { - result->value.dval = (op1->type == IS_LONG ? - (((double) op1->value.lval) + op2->value.dval) : - (op1->value.dval + ((double) op2->value.lval))); - result->type = IS_DOUBLE; - return SUCCESS; - } - if (op1->type == IS_DOUBLE && op2->type == IS_DOUBLE) { - result->type = IS_DOUBLE; - result->value.dval = op1->value.dval + op2->value.dval; - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; /* unknown datatype */ -} - - -ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - zendi_convert_scalar_to_number(op1, op1_copy, result); - zendi_convert_scalar_to_number(op2, op2_copy, result); - - if (op1->type == IS_LONG && op2->type == IS_LONG) { - long lval = op1->value.lval - op2->value.lval; - - /* check for overflow by comparing sign bits */ - if ( (op1->value.lval & LONG_SIGN_MASK) != (op2->value.lval & LONG_SIGN_MASK) - && (op1->value.lval & LONG_SIGN_MASK) != (lval & LONG_SIGN_MASK)) { - - result->value.dval = (double) op1->value.lval - (double) op2->value.lval; - result->type = IS_DOUBLE; - } else { - result->value.lval = lval; - result->type = IS_LONG; - } - return SUCCESS; - } - if ((op1->type == IS_DOUBLE && op2->type == IS_LONG) - || (op1->type == IS_LONG && op2->type == IS_DOUBLE)) { - result->value.dval = (op1->type == IS_LONG ? - (((double) op1->value.lval) - op2->value.dval) : - (op1->value.dval - ((double) op2->value.lval))); - result->type = IS_DOUBLE; - return SUCCESS; - } - if (op1->type == IS_DOUBLE && op2->type == IS_DOUBLE) { - result->type = IS_DOUBLE; - result->value.dval = op1->value.dval - op2->value.dval; - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; /* unknown datatype */ -} - - -ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - zendi_convert_scalar_to_number(op1, op1_copy, result); - zendi_convert_scalar_to_number(op2, op2_copy, result); - - if (op1->type == IS_LONG && op2->type == IS_LONG) { - long overflow; - - ZEND_SIGNED_MULTIPLY_LONG(op1->value.lval,op2->value.lval, result->value.lval,result->value.dval,overflow); - result->type = overflow ? IS_DOUBLE : IS_LONG; - return SUCCESS; - } - if ((op1->type == IS_DOUBLE && op2->type == IS_LONG) - || (op1->type == IS_LONG && op2->type == IS_DOUBLE)) { - result->value.dval = (op1->type == IS_LONG ? - (((double) op1->value.lval) * op2->value.dval) : - (op1->value.dval * ((double) op2->value.lval))); - result->type = IS_DOUBLE; - return SUCCESS; - } - if (op1->type == IS_DOUBLE && op2->type == IS_DOUBLE) { - result->type = IS_DOUBLE; - result->value.dval = op1->value.dval * op2->value.dval; - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; /* unknown datatype */ -} - -ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - zendi_convert_scalar_to_number(op1, op1_copy, result); - zendi_convert_scalar_to_number(op2, op2_copy, result); - - if ((op2->type == IS_LONG && op2->value.lval == 0) || (op2->type == IS_DOUBLE && op2->value.dval == 0.0)) { - zend_error(E_WARNING, "Division by zero"); - ZVAL_BOOL(result, 0); - return FAILURE; /* division by zero */ - } - if (op1->type == IS_LONG && op2->type == IS_LONG) { - if (op1->value.lval % op2->value.lval == 0) { /* integer */ - result->type = IS_LONG; - result->value.lval = op1->value.lval / op2->value.lval; - } else { - result->type = IS_DOUBLE; - result->value.dval = ((double) op1->value.lval) / op2->value.lval; - } - return SUCCESS; - } - if ((op1->type == IS_DOUBLE && op2->type == IS_LONG) - || (op1->type == IS_LONG && op2->type == IS_DOUBLE)) { - result->value.dval = (op1->type == IS_LONG ? - (((double) op1->value.lval) / op2->value.dval) : - (op1->value.dval / ((double) op2->value.lval))); - result->type = IS_DOUBLE; - return SUCCESS; - } - if (op1->type == IS_DOUBLE && op2->type == IS_DOUBLE) { - result->type = IS_DOUBLE; - result->value.dval = op1->value.dval / op2->value.dval; - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; /* unknown datatype */ -} - - -ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - zendi_convert_to_long(op1, op1_copy, result); - zendi_convert_to_long(op2, op2_copy, result); - - if (op2->value.lval == 0) { - zend_error(E_WARNING, "Division by zero"); - ZVAL_BOOL(result, 0); - return FAILURE; /* modulus by zero */ - } - - if (abs(op2->value.lval) == 1) { - ZVAL_LONG(result, 0); - return SUCCESS; - } - - result->type = IS_LONG; - result->value.lval = op1->value.lval % op2->value.lval; - return SUCCESS; -} - - - -ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - result->type = IS_BOOL; - - zendi_convert_to_boolean(op1, op1_copy, result); - zendi_convert_to_boolean(op2, op2_copy, result); - result->value.lval = op1->value.lval ^ op2->value.lval; - return SUCCESS; -} - - -ZEND_API int boolean_not_function(zval *result, zval *op1 TSRMLS_DC) -{ - zval op1_copy; - - zendi_convert_to_boolean(op1, op1_copy, result); - - result->type = IS_BOOL; - result->value.lval = !op1->value.lval; - return SUCCESS; -} - - -ZEND_API int bitwise_not_function(zval *result, zval *op1 TSRMLS_DC) -{ - zval op1_copy = *op1; - - op1 = &op1_copy; - - if (op1->type == IS_DOUBLE) { - op1->value.lval = (long) op1->value.dval; - op1->type = IS_LONG; - } - if (op1->type == IS_LONG) { - result->value.lval = ~op1->value.lval; - result->type = IS_LONG; - return SUCCESS; - } - if (op1->type == IS_STRING) { - int i; - - result->type = IS_STRING; - result->value.str.val = estrndup(op1->value.str.val, op1->value.str.len); - result->value.str.len = op1->value.str.len; - for (i = 0; i < op1->value.str.len; i++) { - result->value.str.val[i] = ~op1->value.str.val[i]; - } - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; /* unknown datatype */ -} - - -ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - if (op1->type == IS_STRING && op2->type == IS_STRING) { - zval *longer, *shorter; - char *result_str; - int i, result_len; - - if (op1->value.str.len >= op2->value.str.len) { - longer = op1; - shorter = op2; - } else { - longer = op2; - shorter = op1; - } - - result->type = IS_STRING; - result_len = longer->value.str.len; - result_str = estrndup(longer->value.str.val, longer->value.str.len); - for (i = 0; i < shorter->value.str.len; i++) { - result_str[i] |= shorter->value.str.val[i]; - } - if (result==op1) { - STR_FREE(result->value.str.val); - } - result->value.str.val = result_str; - result->value.str.len = result_len; - return SUCCESS; - } - zendi_convert_to_long(op1, op1_copy, result); - zendi_convert_to_long(op2, op2_copy, result); - - result->type = IS_LONG; - result->value.lval = op1->value.lval | op2->value.lval; - return SUCCESS; -} - - -ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - if (op1->type == IS_STRING && op2->type == IS_STRING) { - zval *longer, *shorter; - char *result_str; - int i, result_len; - - if (op1->value.str.len >= op2->value.str.len) { - longer = op1; - shorter = op2; - } else { - longer = op2; - shorter = op1; - } - - result->type = IS_STRING; - result_len = shorter->value.str.len; - result_str = estrndup(shorter->value.str.val, shorter->value.str.len); - for (i = 0; i < shorter->value.str.len; i++) { - result_str[i] &= longer->value.str.val[i]; - } - if (result==op1) { - STR_FREE(result->value.str.val); - } - result->value.str.val = result_str; - result->value.str.len = result_len; - return SUCCESS; - } - - - zendi_convert_to_long(op1, op1_copy, result); - zendi_convert_to_long(op2, op2_copy, result); - - result->type = IS_LONG; - result->value.lval = op1->value.lval & op2->value.lval; - return SUCCESS; -} - - -ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - if (op1->type == IS_STRING && op2->type == IS_STRING) { - zval *longer, *shorter; - char *result_str; - int i, result_len; - - if (op1->value.str.len >= op2->value.str.len) { - longer = op1; - shorter = op2; - } else { - longer = op2; - shorter = op1; - } - - result->type = IS_STRING; - result_len = shorter->value.str.len; - result_str = estrndup(shorter->value.str.val, shorter->value.str.len); - for (i = 0; i < shorter->value.str.len; i++) { - result_str[i] ^= longer->value.str.val[i]; - } - if (result==op1) { - STR_FREE(result->value.str.val); - } - result->value.str.val = result_str; - result->value.str.len = result_len; - return SUCCESS; - } - - zendi_convert_to_long(op1, op1_copy, result); - zendi_convert_to_long(op2, op2_copy, result); - - result->type = IS_LONG; - result->value.lval = op1->value.lval ^ op2->value.lval; - return SUCCESS; -} - - -ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - zendi_convert_to_long(op1, op1_copy, result); - zendi_convert_to_long(op2, op2_copy, result); - result->value.lval = op1->value.lval << op2->value.lval; - result->type = IS_LONG; - return SUCCESS; -} - - -ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - zendi_convert_to_long(op1, op1_copy, result); - zendi_convert_to_long(op2, op2_copy, result); - result->value.lval = op1->value.lval >> op2->value.lval; - result->type = IS_LONG; - return SUCCESS; -} - - - -/* must support result==op1 */ -ZEND_API int add_char_to_string(zval *result, zval *op1, zval *op2) -{ - result->value.str.len = op1->value.str.len + 1; - result->value.str.val = (char *) erealloc(op1->value.str.val, result->value.str.len+1); - result->value.str.val[result->value.str.len - 1] = (char) op2->value.lval; - result->value.str.val[result->value.str.len] = 0; - result->type = IS_STRING; - return SUCCESS; -} - - -/* must support result==op1 */ -ZEND_API int add_string_to_string(zval *result, zval *op1, zval *op2) -{ - int length = op1->value.str.len + op2->value.str.len; - - result->value.str.val = (char *) erealloc(op1->value.str.val, length+1); - memcpy(result->value.str.val+op1->value.str.len, op2->value.str.val, op2->value.str.len); - result->value.str.val[length] = 0; - result->value.str.len = length; - result->type = IS_STRING; - return SUCCESS; -} - - -ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - int use_copy1, use_copy2; - - - zend_make_printable_zval(op1, &op1_copy, &use_copy1); - zend_make_printable_zval(op2, &op2_copy, &use_copy2); - - if (use_copy1) { - /* We have created a converted copy of op1. Therefore, op1 won't become the result so - * we have to free it. - */ - if (result == op1) { - zval_dtor(op1); - } - op1 = &op1_copy; - } - if (use_copy2) { - op2 = &op2_copy; - } - if (result==op1) { /* special case, perform operations on result */ - uint res_len = op1->value.str.len + op2->value.str.len; - - result->value.str.val = erealloc(result->value.str.val, res_len+1); - - memcpy(result->value.str.val+result->value.str.len, op2->value.str.val, op2->value.str.len); - result->value.str.val[res_len]=0; - result->value.str.len = res_len; - } else { - result->value.str.len = op1->value.str.len + op2->value.str.len; - result->value.str.val = (char *) emalloc(result->value.str.len + 1); - memcpy(result->value.str.val, op1->value.str.val, op1->value.str.len); - memcpy(result->value.str.val+op1->value.str.len, op2->value.str.val, op2->value.str.len); - result->value.str.val[result->value.str.len] = 0; - result->type = IS_STRING; - } - if (use_copy1) { - zval_dtor(op1); - } - if (use_copy2) { - zval_dtor(op2); - } - return SUCCESS; -} - - -ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - int use_copy1, use_copy2; - - zend_make_printable_zval(op1, &op1_copy, &use_copy1); - zend_make_printable_zval(op2, &op2_copy, &use_copy2); - - if (use_copy1) { - op1 = &op1_copy; - } - if (use_copy2) { - op2 = &op2_copy; - } - - result->value.lval = zend_binary_zval_strcmp(op1, op2); - result->type = IS_LONG; - - if (use_copy1) { - zval_dtor(op1); - } - if (use_copy2) { - zval_dtor(op2); - } - return SUCCESS; -} - -#if HAVE_STRCOLL -ZEND_API int string_locale_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - int use_copy1, use_copy2; - - zend_make_printable_zval(op1, &op1_copy, &use_copy1); - zend_make_printable_zval(op2, &op2_copy, &use_copy2); - - if (use_copy1) { - op1 = &op1_copy; - } - if (use_copy2) { - op2 = &op2_copy; - } - - result->value.lval = strcoll(op1->value.str.val, op2->value.str.val); - result->type = IS_LONG; - - if (use_copy1) { - zval_dtor(op1); - } - if (use_copy2) { - zval_dtor(op2); - } - return SUCCESS; -} -#endif - -ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - - op1_copy = *op1; - zval_copy_ctor(&op1_copy); - - op2_copy = *op2; - zval_copy_ctor(&op2_copy); - - convert_to_double(&op1_copy); - convert_to_double(&op2_copy); - - ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_DVAL(op1_copy)-Z_DVAL(op2_copy))); - - return SUCCESS; -} - - -static inline void zend_free_obj_get_result(zval *op) -{ - if (op) { - if (op->refcount == 0) { - zval_dtor(op); - FREE_ZVAL(op); - } else { - zval_ptr_dtor(&op); - } - } -} - -#define COMPARE_RETURN_AND_FREE(retval) \ - zend_free_obj_get_result(op1_free); \ - zend_free_obj_get_result(op2_free); \ - return retval; - -ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - zval op1_copy, op2_copy; - zval *op1_free, *op2_free; - int op1_obj = Z_TYPE_P(op1) == IS_OBJECT; - int op2_obj = Z_TYPE_P(op2) == IS_OBJECT; - int eq_comp = op1_obj && op2_obj && (Z_OBJ_HANDLER_P(op1,compare_objects) - == Z_OBJ_HANDLER_P(op2,compare_objects)); - - if (op1_obj && !eq_comp) { - if (Z_TYPE_P(op2) == IS_NULL) { - ZVAL_LONG(result, 1); - return SUCCESS; - } else if (Z_OBJ_HT_P(op1)->get) { - op1 = op1_free = Z_OBJ_HT_P(op1)->get(op1 TSRMLS_CC); - } else if (!op2_obj && Z_OBJ_HT_P(op1)->cast_object) { - ALLOC_INIT_ZVAL(op1_free); - if (Z_OBJ_HT_P(op1)->cast_object(op1, op1_free, Z_TYPE_P(op2) TSRMLS_CC) == FAILURE) { - op2_free = NULL; - ZVAL_LONG(result, 1); - COMPARE_RETURN_AND_FREE(SUCCESS); - } - op1 = op1_free; - } else { - op1_free = NULL; - } - op1_obj = Z_TYPE_P(op1) == IS_OBJECT; - eq_comp = op1_obj && op2_obj && (Z_OBJ_HANDLER_P(op1,compare_objects) - == Z_OBJ_HANDLER_P(op2,compare_objects)); - } else { - op1_free = NULL; - } - if (op2_obj && !eq_comp) { - if (Z_TYPE_P(op1) == IS_NULL) { - op2_free = NULL; - ZVAL_LONG(result, -1); - COMPARE_RETURN_AND_FREE(SUCCESS); - } else if (Z_OBJ_HT_P(op2)->get) { - op2 = op2_free = Z_OBJ_HT_P(op2)->get(op2 TSRMLS_CC); - } else if (!op1_obj && Z_OBJ_HT_P(op2)->cast_object) { - ALLOC_INIT_ZVAL(op2_free); - if (Z_OBJ_HT_P(op2)->cast_object(op2, op2_free, Z_TYPE_P(op1) TSRMLS_CC) == FAILURE) { - ZVAL_LONG(result, -1); - COMPARE_RETURN_AND_FREE(SUCCESS); - } - op2 = op2_free; - } else { - op2_free = NULL; - } - op2_obj = Z_TYPE_P(op2) == IS_OBJECT; - eq_comp = op1_obj && op2_obj && (Z_OBJ_HANDLER_P(op1,compare_objects) - == Z_OBJ_HANDLER_P(op2,compare_objects)); - } else { - op2_free = NULL; - } - - if ((Z_TYPE_P(op1) == IS_NULL && Z_TYPE_P(op2) == IS_STRING) - || (Z_TYPE_P(op2) == IS_NULL && Z_TYPE_P(op1) == IS_STRING)) { - if (Z_TYPE_P(op1) == IS_NULL) { - ZVAL_LONG(result, zend_binary_strcmp("", 0, Z_STRVAL_P(op2), Z_STRLEN_P(op2))); - COMPARE_RETURN_AND_FREE(SUCCESS); - } else { - ZVAL_LONG(result, zend_binary_strcmp(Z_STRVAL_P(op1), Z_STRLEN_P(op1), "", 0)); - COMPARE_RETURN_AND_FREE(SUCCESS); - } - } - - if (op1->type == IS_STRING && op2->type == IS_STRING) { - zendi_smart_strcmp(result, op1, op2); - COMPARE_RETURN_AND_FREE(SUCCESS); - } - - if (Z_TYPE_P(op1) == IS_BOOL || Z_TYPE_P(op2) == IS_BOOL - || Z_TYPE_P(op1) == IS_NULL || Z_TYPE_P(op2) == IS_NULL) { - zendi_convert_to_boolean(op1, op1_copy, result); - zendi_convert_to_boolean(op2, op2_copy, result); - ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_LVAL_P(op1) - Z_LVAL_P(op2))); - COMPARE_RETURN_AND_FREE(SUCCESS); - } - - /* If both are objects sharing the same comparision handler then use is */ - if (eq_comp) { - ZVAL_LONG(result, Z_OBJ_HT_P(op1)->compare_objects(op1, op2 TSRMLS_CC)); - COMPARE_RETURN_AND_FREE(SUCCESS); - } - - zendi_convert_scalar_to_number(op1, op1_copy, result); - zendi_convert_scalar_to_number(op2, op2_copy, result); - - if (Z_TYPE_P(op1) == IS_LONG && Z_TYPE_P(op2) == IS_LONG) { - ZVAL_LONG(result, Z_LVAL_P(op1)>Z_LVAL_P(op2)?1:(Z_LVAL_P(op1)type = IS_BOOL; - if (op1->type != op2->type) { - result->value.lval = 0; - return SUCCESS; - } - switch (op1->type) { - case IS_NULL: - result->value.lval = (op2->type==IS_NULL); - break; - case IS_BOOL: - case IS_LONG: - case IS_RESOURCE: - result->value.lval = (op1->value.lval == op2->value.lval); - break; - case IS_DOUBLE: - result->value.lval = (op1->value.dval == op2->value.dval); - break; - case IS_STRING: - if ((op1->value.str.len == op2->value.str.len) - && (!memcmp(op1->value.str.val, op2->value.str.val, op1->value.str.len))) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - break; - case IS_ARRAY: - if (zend_hash_compare(op1->value.ht, op2->value.ht, (compare_func_t) hash_zval_identical_function, 1 TSRMLS_CC)==0) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - break; - case IS_OBJECT: - if (Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2)) { - if (EG(ze1_compatibility_mode)) { - zend_compare_objects(result, op1, op2 TSRMLS_CC); - /* comparison returns 0 in case of equality and - * 1 in case of ineqaulity, we need to reverse it - */ - result->value.lval = !result->value.lval; - } else { - result->value.lval = (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2)); - } - } else { - result->value.lval = 0; - } - break; - default: - ZVAL_BOOL(result, 0); - return FAILURE; - } - return SUCCESS; -} - - -ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - result->type = IS_BOOL; - if (is_identical_function(result, op1, op2 TSRMLS_CC) == FAILURE) { - return FAILURE; - } - result->value.lval = !result->value.lval; - return SUCCESS; -} - - -ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { - return FAILURE; - } - convert_to_boolean(result); - if (result->value.lval == 0) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - return SUCCESS; -} - - -ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { - return FAILURE; - } - convert_to_boolean(result); - if (result->value.lval) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - return SUCCESS; -} - - -ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { - return FAILURE; - } - if (result->type == IS_LONG) { - result->type = IS_BOOL; - if (result->value.lval < 0) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - return SUCCESS; - } - if (result->type == IS_DOUBLE) { - result->type = IS_BOOL; - if (result->value.dval < 0) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; -} - - -ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) -{ - if (compare_function(result, op1, op2 TSRMLS_CC) == FAILURE) { - return FAILURE; - } - if (result->type == IS_LONG) { - result->type = IS_BOOL; - if (result->value.lval <= 0) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - return SUCCESS; - } - if (result->type == IS_DOUBLE) { - result->type = IS_BOOL; - if (result->value.dval <= 0) { - result->value.lval = 1; - } else { - result->value.lval = 0; - } - return SUCCESS; - } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; -} - - -ZEND_API zend_bool instanceof_function_ex(zend_class_entry *instance_ce, zend_class_entry *ce, zend_bool interfaces_only TSRMLS_DC) -{ - zend_uint i; - - for (i=0; inum_interfaces; i++) { - if (instanceof_function(instance_ce->interfaces[i], ce TSRMLS_CC)) { - return 1; - } - } - if (!interfaces_only) { - while (instance_ce) { - if (instance_ce == ce) { - return 1; - } - instance_ce = instance_ce->parent; - } - } - - return 0; -} - -ZEND_API zend_bool instanceof_function(zend_class_entry *instance_ce, zend_class_entry *ce TSRMLS_DC) -{ - return instanceof_function_ex(instance_ce, ce, 0 TSRMLS_CC); -} - -#define LOWER_CASE 1 -#define UPPER_CASE 2 -#define NUMERIC 3 - - -static void increment_string(zval *str) -{ - int carry=0; - int pos=str->value.str.len-1; - char *s=str->value.str.val; - char *t; - int last=0; /* Shut up the compiler warning */ - int ch; - - if (str->value.str.len == 0) { - STR_FREE(str->value.str.val); - str->value.str.val = estrndup("1", sizeof("1")-1); - str->value.str.len = 1; - return; - } - - while (pos >= 0) { - ch = s[pos]; - if (ch >= 'a' && ch <= 'z') { - if (ch == 'z') { - s[pos] = 'a'; - carry=1; - } else { - s[pos]++; - carry=0; - } - last=LOWER_CASE; - } else if (ch >= 'A' && ch <= 'Z') { - if (ch == 'Z') { - s[pos] = 'A'; - carry=1; - } else { - s[pos]++; - carry=0; - } - last=UPPER_CASE; - } else if (ch >= '0' && ch <= '9') { - if (ch == '9') { - s[pos] = '0'; - carry=1; - } else { - s[pos]++; - carry=0; - } - last = NUMERIC; - } else { - carry=0; - break; - } - if (carry == 0) { - break; - } - pos--; - } - - if (carry) { - t = (char *) emalloc(str->value.str.len+1+1); - memcpy(t+1, str->value.str.val, str->value.str.len); - str->value.str.len++; - t[str->value.str.len] = '\0'; - switch (last) { - case NUMERIC: - t[0] = '1'; - break; - case UPPER_CASE: - t[0] = 'A'; - break; - case LOWER_CASE: - t[0] = 'a'; - break; - } - STR_FREE(str->value.str.val); - str->value.str.val = t; - } -} - - -ZEND_API int increment_function(zval *op1) -{ - switch (op1->type) { - case IS_LONG: - if (op1->value.lval == LONG_MAX) { - /* switch to double */ - double d = (double)op1->value.lval; - ZVAL_DOUBLE(op1, d+1); - } else { - op1->value.lval++; - } - break; - case IS_DOUBLE: - op1->value.dval = op1->value.dval + 1; - break; - case IS_NULL: - op1->value.lval = 1; - op1->type = IS_LONG; - break; - case IS_STRING: { - long lval; - double dval; - char *strval = op1->value.str.val; - - switch (is_numeric_string(strval, op1->value.str.len, &lval, &dval, 0)) { - case IS_LONG: - if (lval == LONG_MAX) { - /* switch to double */ - double d = (double)lval; - ZVAL_DOUBLE(op1, d+1); - } else { - op1->value.lval = lval+1; - op1->type = IS_LONG; - } - efree(strval); /* should never be empty_string */ - break; - case IS_DOUBLE: - op1->value.dval = dval+1; - op1->type = IS_DOUBLE; - efree(strval); /* should never be empty_string */ - break; - default: - /* Perl style string increment */ - increment_string(op1); - break; - } - } - break; - default: - return FAILURE; - } - return SUCCESS; -} - - -ZEND_API int decrement_function(zval *op1) -{ - long lval; - double dval; - - switch (op1->type) { - case IS_LONG: - if (op1->value.lval == LONG_MIN) { - double d = (double)op1->value.lval; - ZVAL_DOUBLE(op1, d-1); - } else { - op1->value.lval--; - } - break; - case IS_DOUBLE: - op1->value.dval = op1->value.dval - 1; - break; - case IS_STRING: /* Like perl we only support string increment */ - if (op1->value.str.len == 0) { /* consider as 0 */ - STR_FREE(op1->value.str.val); - op1->value.lval = -1; - op1->type = IS_LONG; - break; - } - switch (is_numeric_string(op1->value.str.val, op1->value.str.len, &lval, &dval, 0)) { - case IS_LONG: - STR_FREE(op1->value.str.val); - if (lval == LONG_MIN) { - double d = (double)lval; - ZVAL_DOUBLE(op1, d-1); - } else { - op1->value.lval = lval-1; - op1->type = IS_LONG; - } - break; - case IS_DOUBLE: - STR_FREE(op1->value.str.val); - op1->value.dval = dval - 1; - op1->type = IS_DOUBLE; - break; - } - break; - default: - return FAILURE; - } - - return SUCCESS; -} - - -ZEND_API int zval_is_true(zval *op) -{ - convert_to_boolean(op); - return (op->value.lval ? 1 : 0); -} - -ZEND_API char *zend_str_tolower_copy(char *dest, const char *source, unsigned int length) -{ - register unsigned char *str = (unsigned char*)source; - register unsigned char *result = (unsigned char*)dest; - register unsigned char *end = str + length; - - while (str < end) { - *result++ = tolower((int)*str++); - } - *result = '\0'; - - return dest; -} - -ZEND_API void zend_str_tolower(char *str, unsigned int length) -{ - register unsigned char *p = (unsigned char*)str; - register unsigned char *end = p + length; - - while (p < end) { - *p = tolower((int)*p); - p++; - } -} - -ZEND_API int zend_binary_strcmp(char *s1, uint len1, char *s2, uint len2) -{ - int retval; - - retval = memcmp(s1, s2, MIN(len1, len2)); - if (!retval) { - return (len1 - len2); - } else { - return retval; - } -} - -ZEND_API int zend_binary_strncmp(char *s1, uint len1, char *s2, uint len2, uint length) -{ - int retval; - - retval = memcmp(s1, s2, MIN(length, MIN(len1, len2))); - if (!retval) { - return (MIN(length, len1) - MIN(length, len2)); - } else { - return retval; - } -} - - -ZEND_API int zend_binary_strcasecmp(char *s1, uint len1, char *s2, uint len2) -{ - int len; - int c1, c2; - - len = MIN(len1, len2); - - while (len--) { - c1 = tolower((int)*(unsigned char *)s1++); - c2 = tolower((int)*(unsigned char *)s2++); - if (c1 != c2) { - return c1 - c2; - } - } - - return len1 - len2; -} - - -ZEND_API int zend_binary_strncasecmp(char *s1, uint len1, char *s2, uint len2, uint length) -{ - int len; - int c1, c2; - - len = MIN(length, MIN(len1, len2)); - - while (len--) { - c1 = tolower((int)*(unsigned char *)s1++); - c2 = tolower((int)*(unsigned char *)s2++); - if (c1 != c2) { - return c1 - c2; - } - } - - return MIN(length, len1) - MIN(length, len2); -} - - -ZEND_API int zend_binary_zval_strcmp(zval *s1, zval *s2) -{ - return zend_binary_strcmp(s1->value.str.val, s1->value.str.len, s2->value.str.val, s2->value.str.len); -} - -ZEND_API int zend_binary_zval_strncmp(zval *s1, zval *s2, zval *s3) -{ - return zend_binary_strncmp(s1->value.str.val, s1->value.str.len, s2->value.str.val, s2->value.str.len, s3->value.lval); -} - - -ZEND_API int zend_binary_zval_strcasecmp(zval *s1, zval *s2) -{ - return zend_binary_strcasecmp(s1->value.str.val, s1->value.str.len, s2->value.str.val, s2->value.str.len); -} - - -ZEND_API int zend_binary_zval_strncasecmp(zval *s1, zval *s2, zval *s3) -{ - return zend_binary_strncasecmp(s1->value.str.val, s1->value.str.len, s2->value.str.val, s2->value.str.len, s3->value.lval); -} - - -ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2) -{ - int ret1, ret2; - long lval1, lval2; - double dval1, dval2; - - if ((ret1=is_numeric_string(s1->value.str.val, s1->value.str.len, &lval1, &dval1, 0)) && - (ret2=is_numeric_string(s2->value.str.val, s2->value.str.len, &lval2, &dval2, 0))) { - if ((ret1==IS_DOUBLE) || (ret2==IS_DOUBLE)) { - if (ret1!=IS_DOUBLE) { - dval1 = zend_strtod(s1->value.str.val, NULL); - } else if (ret2!=IS_DOUBLE) { - dval2 = zend_strtod(s2->value.str.val, NULL); - } - result->value.dval = dval1 - dval2; - result->value.lval = ZEND_NORMALIZE_BOOL(result->value.dval); - result->type = IS_LONG; - } else { /* they both have to be long's */ - result->value.lval = lval1 - lval2; - result->value.lval = ZEND_NORMALIZE_BOOL(result->value.lval); - result->type = IS_LONG; - } - } else { - result->value.lval = zend_binary_zval_strcmp(s1, s2); - result->value.lval = ZEND_NORMALIZE_BOOL(result->value.lval); - result->type = IS_LONG; - } - return; -} - - -static int hash_zval_compare_function(const zval **z1, const zval **z2 TSRMLS_DC) -{ - zval result; - - if (compare_function(&result, (zval *) *z1, (zval *) *z2 TSRMLS_CC)==FAILURE) { - return 1; - } - return result.value.lval; -} - -ZEND_API int zend_compare_symbol_tables_i(HashTable *ht1, HashTable *ht2 TSRMLS_DC) -{ - return zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC); -} - - - -ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2 TSRMLS_DC) -{ - result->type = IS_LONG; - result->value.lval = zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC); -} - - -ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2 TSRMLS_DC) -{ - zend_compare_symbol_tables(result, a1->value.ht, a2->value.ht TSRMLS_CC); -} - - -ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2 TSRMLS_DC) -{ - result->type = IS_LONG; - - if (Z_OBJ_HANDLE_P(o1) == Z_OBJ_HANDLE_P(o2)) { - result->value.lval = 0; - return; - } - - if (Z_OBJ_HT_P(o1)->compare_objects == NULL) { - result->value.lval = 1; - } else { - result->value.lval = Z_OBJ_HT_P(o1)->compare_objects(o1, o2 TSRMLS_CC); - } -} - -ZEND_API void zend_locale_sprintf_double(zval *op ZEND_FILE_LINE_DC) -{ - double dval = op->value.dval; - - TSRMLS_FETCH(); - - op->value.str.val = (char *) emalloc_rel(MAX_LENGTH_OF_DOUBLE + EG(precision) + 1); - sprintf(op->value.str.val, "%.*G", (int) EG(precision), dval); - op->value.str.len = strlen(op->value.str.val); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h deleted file mode 100644 index c7c3991d57..0000000000 --- a/Zend/zend_operators.h +++ /dev/null @@ -1,357 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_OPERATORS_H -#define ZEND_OPERATORS_H - -#include -#include -#include - -#ifdef HAVE_IEEEFP_H -#include -#endif - -#include "zend_strtod.h" - -#if 0&&HAVE_BCMATH -#include "ext/bcmath/libbcmath/src/bcmath.h" -#endif - -#define MAX_LENGTH_OF_LONG 20 -#define MAX_LENGTH_OF_DOUBLE 32 - -BEGIN_EXTERN_C() -ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int boolean_not_function(zval *result, zval *op1 TSRMLS_DC); -ZEND_API int bitwise_not_function(zval *result, zval *op1 TSRMLS_DC); -ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); - -ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); - -ZEND_API zend_bool instanceof_function_ex(zend_class_entry *instance_ce, zend_class_entry *ce, zend_bool interfaces_only TSRMLS_DC); -ZEND_API zend_bool instanceof_function(zend_class_entry *instance_ce, zend_class_entry *ce TSRMLS_DC); -END_EXTERN_C() - -/** - * Checks whether the string "str" with the length "length" is a numeric string. - * - * The function returns 0 if the string did not contain a string; IS_LONG if - * the string contained a number that fits in the integer range and IS_DOUBLE - * in case it did not. The long value is returned into the pointer *lval if - * that pointer was not NULL or into the pointer *dval if that pointer was not - * NULL. - */ -static inline zend_bool is_numeric_string(char *str, int length, long *lval, double *dval, int allow_errors) -{ - long local_lval; - double local_dval; - char *end_ptr_long, *end_ptr_double; - int conv_base=10; - - if (!length) { - return 0; - } - - /* handle hex numbers */ - if (length>=2 && str[0]=='0' && (str[1]=='x' || str[1]=='X')) { - conv_base=16; - } - errno=0; - local_lval = strtol(str, &end_ptr_long, conv_base); - if (errno!=ERANGE) { - if (end_ptr_long == str+length) { /* integer string */ - if (lval) { - *lval = local_lval; - } - return IS_LONG; - } else if (end_ptr_long == str && *end_ptr_long != '\0' && *str != '.' && *str != '-') { /* ignore partial string matches */ - return 0; - } - } else { - end_ptr_long=NULL; - } - - if (conv_base==16) { /* hex string, under UNIX strtod() messes it up */ - return 0; - } - - errno=0; - local_dval = zend_strtod(str, &end_ptr_double); - if (errno != ERANGE) { - if (end_ptr_double == str+length) { /* floating point string */ - if (!zend_finite(local_dval)) { - /* "inf","nan" and maybe other weird ones */ - return 0; - } - - if (dval) { - *dval = local_dval; - } - return IS_DOUBLE; - } - } else { - end_ptr_double=NULL; - } - - if (!allow_errors) { - return 0; - } - if (allow_errors == -1) { - zend_error(E_NOTICE, "A non well formed numeric value encountered"); - } - - if (end_ptr_double>end_ptr_long && dval) { - *dval = local_dval; - return IS_DOUBLE; - } else if (end_ptr_long && lval) { - *lval = local_lval; - return IS_LONG; - } - return 0; -} - -static inline char * -zend_memnstr(char *haystack, char *needle, int needle_len, char *end) -{ - char *p = haystack; - char ne = needle[needle_len-1]; - - end -= needle_len; - - while (p <= end) { - if ((p = (char *)memchr(p, *needle, (end-p+1))) && ne == p[needle_len-1]) { - if (!memcmp(needle, p, needle_len-1)) { - return p; - } - } - - if (p == NULL) { - return NULL; - } - - p++; - } - - return NULL; -} - -static inline void *zend_memrchr(const void *s, int c, size_t n) -{ - register unsigned char *e = (unsigned char *)s + n; - - for (e--; e >= (unsigned char *)s; e--) { - if (*e == (unsigned char)c) { - return (void *)e; - } - } - - return NULL; -} - -BEGIN_EXTERN_C() -ZEND_API int increment_function(zval *op1); -ZEND_API int decrement_function(zval *op2); - -ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC); -ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC); -ZEND_API void convert_to_long(zval *op); -ZEND_API void convert_to_double(zval *op); -ZEND_API void convert_to_long_base(zval *op, int base); -ZEND_API void convert_to_null(zval *op); -ZEND_API void convert_to_boolean(zval *op); -ZEND_API void convert_to_array(zval *op); -ZEND_API void convert_to_object(zval *op); -ZEND_API void multi_convert_to_long_ex(int argc, ...); -ZEND_API void multi_convert_to_double_ex(int argc, ...); -ZEND_API void multi_convert_to_string_ex(int argc, ...); -ZEND_API int add_char_to_string(zval *result, zval *op1, zval *op2); -ZEND_API int add_string_to_string(zval *result, zval *op1, zval *op2); -#define convert_to_string(op) _convert_to_string((op) ZEND_FILE_LINE_CC) - -ZEND_API double zend_string_to_double(const char *number, zend_uint length); - -ZEND_API int zval_is_true(zval *op); -ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -#if HAVE_STRCOLL -ZEND_API int string_locale_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -#endif - -ZEND_API void zend_str_tolower(char *str, unsigned int length); -ZEND_API char *zend_str_tolower_copy(char *dest, const char *source, unsigned int length); -END_EXTERN_C() - -static inline char * -zend_str_tolower_dup(const char *source, unsigned int length) -{ - return zend_str_tolower_copy((char *)emalloc(length+1), source, length); -} - -BEGIN_EXTERN_C() -ZEND_API int zend_binary_zval_strcmp(zval *s1, zval *s2); -ZEND_API int zend_binary_zval_strncmp(zval *s1, zval *s2, zval *s3); -ZEND_API int zend_binary_zval_strcasecmp(zval *s1, zval *s2); -ZEND_API int zend_binary_zval_strncasecmp(zval *s1, zval *s2, zval *s3); -ZEND_API int zend_binary_strcmp(char *s1, uint len1, char *s2, uint len2); -ZEND_API int zend_binary_strncmp(char *s1, uint len1, char *s2, uint len2, uint length); -ZEND_API int zend_binary_strcasecmp(char *s1, uint len1, char *s2, uint len2); -ZEND_API int zend_binary_strncasecmp(char *s1, uint len1, char *s2, uint len2, uint length); - -ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2); -ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2 TSRMLS_DC); -ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2 TSRMLS_DC); -ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2 TSRMLS_DC); - -ZEND_API int zend_atoi(const char *str, int str_len); - -ZEND_API void zend_locale_sprintf_double(zval *op ZEND_FILE_LINE_DC); -END_EXTERN_C() -#define convert_to_ex_master(ppzv, lower_type, upper_type) \ - if ((*ppzv)->type!=IS_##upper_type) { \ - SEPARATE_ZVAL_IF_NOT_REF(ppzv); \ - convert_to_##lower_type(*ppzv); \ - } - -#define convert_to_explicit_type(pzv, type) \ - do { \ - switch (type) { \ - case IS_NULL: \ - convert_to_null(pzv); \ - break; \ - case IS_LONG: \ - convert_to_long(pzv); \ - break; \ - case IS_DOUBLE: \ - convert_to_double(pzv); \ - break; \ - case IS_BOOL: \ - convert_to_boolean(pzv); \ - break; \ - case IS_ARRAY: \ - convert_to_array(pzv); \ - break; \ - case IS_OBJECT: \ - convert_to_object(pzv); \ - break; \ - case IS_STRING: \ - convert_to_string(pzv); \ - break; \ - default: \ - assert(0); \ - break; \ - } \ - } while (0); \ - -#define convert_to_explicit_type_ex(ppzv, str_type) \ - if (Z_TYPE_PP(ppzv) != str_type) { \ - SEPARATE_ZVAL_IF_NOT_REF(ppzv); \ - convert_to_explicit_type(*ppzv, str_type); \ - } - -#define convert_to_boolean_ex(ppzv) convert_to_ex_master(ppzv, boolean, BOOL) -#define convert_to_long_ex(ppzv) convert_to_ex_master(ppzv, long, LONG) -#define convert_to_double_ex(ppzv) convert_to_ex_master(ppzv, double, DOUBLE) -#define convert_to_string_ex(ppzv) convert_to_ex_master(ppzv, string, STRING) -#define convert_to_array_ex(ppzv) convert_to_ex_master(ppzv, array, ARRAY) -#define convert_to_object_ex(ppzv) convert_to_ex_master(ppzv, object, OBJECT) -#define convert_to_null_ex(ppzv) convert_to_ex_master(ppzv, null, NULL) - -#define convert_scalar_to_number_ex(ppzv) \ - if (Z_TYPE_PP(ppzv)!=IS_LONG && Z_TYPE_PP(ppzv)!=IS_DOUBLE) { \ - if (!(*ppzv)->is_ref) { \ - SEPARATE_ZVAL(ppzv); \ - } \ - convert_scalar_to_number(*ppzv TSRMLS_CC); \ - } - - -#define Z_LVAL(zval) (zval).value.lval -#define Z_BVAL(zval) ((zend_bool)(zval).value.lval) -#define Z_DVAL(zval) (zval).value.dval -#define Z_STRVAL(zval) (zval).value.str.val -#define Z_STRLEN(zval) (zval).value.str.len -#define Z_ARRVAL(zval) (zval).value.ht -#define Z_OBJVAL(zval) (zval).value.obj -#define Z_OBJ_HANDLE(zval) Z_OBJVAL(zval).handle -#define Z_OBJ_HT(zval) Z_OBJVAL(zval).handlers -#define Z_OBJCE(zval) zend_get_class_entry(&(zval) TSRMLS_CC) -#define Z_OBJPROP(zval) Z_OBJ_HT((zval))->get_properties(&(zval) TSRMLS_CC) -#define Z_OBJ_HANDLER(zval, hf) Z_OBJ_HT((zval))->hf -#define Z_RESVAL(zval) (zval).value.lval - -#define Z_LVAL_P(zval_p) Z_LVAL(*zval_p) -#define Z_BVAL_P(zval_p) Z_BVAL(*zval_p) -#define Z_DVAL_P(zval_p) Z_DVAL(*zval_p) -#define Z_STRVAL_P(zval_p) Z_STRVAL(*zval_p) -#define Z_STRLEN_P(zval_p) Z_STRLEN(*zval_p) -#define Z_ARRVAL_P(zval_p) Z_ARRVAL(*zval_p) -#define Z_OBJPROP_P(zval_p) Z_OBJPROP(*zval_p) -#define Z_OBJCE_P(zval_p) Z_OBJCE(*zval_p) -#define Z_RESVAL_P(zval_p) Z_RESVAL(*zval_p) -#define Z_OBJVAL_P(zval_p) Z_OBJVAL(*zval_p) -#define Z_OBJ_HANDLE_P(zval_p) Z_OBJ_HANDLE(*zval_p) -#define Z_OBJ_HT_P(zval_p) Z_OBJ_HT(*zval_p) -#define Z_OBJ_HANDLER_P(zval_p, h) Z_OBJ_HANDLER(*zval_p, h) - -#define Z_LVAL_PP(zval_pp) Z_LVAL(**zval_pp) -#define Z_BVAL_PP(zval_pp) Z_BVAL(**zval_pp) -#define Z_DVAL_PP(zval_pp) Z_DVAL(**zval_pp) -#define Z_STRVAL_PP(zval_pp) Z_STRVAL(**zval_pp) -#define Z_STRLEN_PP(zval_pp) Z_STRLEN(**zval_pp) -#define Z_ARRVAL_PP(zval_pp) Z_ARRVAL(**zval_pp) -#define Z_OBJPROP_PP(zval_pp) Z_OBJPROP(**zval_pp) -#define Z_OBJCE_PP(zval_pp) Z_OBJCE(**zval_pp) -#define Z_RESVAL_PP(zval_pp) Z_RESVAL(**zval_pp) -#define Z_OBJVAL_PP(zval_pp) Z_OBJVAL(**zval_pp) -#define Z_OBJ_HANDLE_PP(zval_p) Z_OBJ_HANDLE(**zval_p) -#define Z_OBJ_HT_PP(zval_p) Z_OBJ_HT(**zval_p) -#define Z_OBJ_HANDLER_PP(zval_p, h) Z_OBJ_HANDLER(**zval_p, h) - -#define Z_TYPE(zval) (zval).type -#define Z_TYPE_P(zval_p) Z_TYPE(*zval_p) -#define Z_TYPE_PP(zval_pp) Z_TYPE(**zval_pp) - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_ptr_stack.c b/Zend/zend_ptr_stack.c deleted file mode 100644 index 420a6eb211..0000000000 --- a/Zend/zend_ptr_stack.c +++ /dev/null @@ -1,115 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_ptr_stack.h" -#ifdef HAVE_STDARG_H -# include -#endif - -ZEND_API void zend_ptr_stack_init(zend_ptr_stack *stack) -{ - stack->top_element = stack->elements = (void **) emalloc(sizeof(void *)*PTR_STACK_BLOCK_SIZE); - stack->max = PTR_STACK_BLOCK_SIZE; - stack->top = 0; -} - - -ZEND_API void zend_ptr_stack_n_push(zend_ptr_stack *stack, int count, ...) -{ - va_list ptr; - void *elem; - - ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, count) - - va_start(ptr, count); - while (count>0) { - elem = va_arg(ptr, void *); - stack->top++; - *(stack->top_element++) = elem; - count--; - } - va_end(ptr); -} - - -ZEND_API void zend_ptr_stack_n_pop(zend_ptr_stack *stack, int count, ...) -{ - va_list ptr; - void **elem; - - va_start(ptr, count); - while (count>0) { - elem = va_arg(ptr, void **); - *elem = *(--stack->top_element); - stack->top--; - count--; - } - va_end(ptr); -} - - - -ZEND_API void zend_ptr_stack_destroy(zend_ptr_stack *stack) -{ - if (stack->elements) { - efree(stack->elements); - } -} - - -ZEND_API void zend_ptr_stack_apply(zend_ptr_stack *stack, void (*func)(void *)) -{ - int i = stack->top; - - while (--i >= 0) { - func(stack->elements[i]); - } -} - - -ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *), zend_bool free_elements) -{ - zend_ptr_stack_apply(stack, func); - if (free_elements) { - int i = stack->top; - - while (--i >= 0) { - efree(stack->elements[i]); - } - } - stack->top = 0; - stack->top_element = stack->elements; -} - - -ZEND_API int zend_ptr_stack_num_elements(zend_ptr_stack *stack) -{ - return stack->top; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_ptr_stack.h b/Zend/zend_ptr_stack.h deleted file mode 100644 index 8a0d739a6f..0000000000 --- a/Zend/zend_ptr_stack.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_PTR_STACK_H -#define ZEND_PTR_STACK_H - -typedef struct _zend_ptr_stack { - int top, max; - void **elements; - void **top_element; -} zend_ptr_stack; - - -#define PTR_STACK_BLOCK_SIZE 64 - -BEGIN_EXTERN_C() -ZEND_API void zend_ptr_stack_init(zend_ptr_stack *stack); -ZEND_API void zend_ptr_stack_n_push(zend_ptr_stack *stack, int count, ...); -ZEND_API void zend_ptr_stack_n_pop(zend_ptr_stack *stack, int count, ...); -ZEND_API void zend_ptr_stack_destroy(zend_ptr_stack *stack); -ZEND_API void zend_ptr_stack_apply(zend_ptr_stack *stack, void (*func)(void *)); -ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *), zend_bool free_elements); -ZEND_API int zend_ptr_stack_num_elements(zend_ptr_stack *stack); -END_EXTERN_C() - -#define ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, count) \ - if (stack->top+count > stack->max) { \ - /* we need to allocate more memory */ \ - stack->max *= 2; \ - stack->max += count; \ - stack->elements = (void **) erealloc(stack->elements, (sizeof(void *) * (stack->max))); \ - stack->top_element = stack->elements+stack->top; \ - } - -/* Not doing this with a macro because of the loop unrolling in the element assignment. - Just using a macro for 3 in the body for readability sake. */ -static inline void zend_ptr_stack_3_push(zend_ptr_stack *stack, void *a, void *b, void *c) -{ -#define ZEND_PTR_STACK_NUM_ARGS 3 - - ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, ZEND_PTR_STACK_NUM_ARGS) - - stack->top += ZEND_PTR_STACK_NUM_ARGS; - *(stack->top_element++) = a; - *(stack->top_element++) = b; - *(stack->top_element++) = c; - -#undef ZEND_PTR_STACK_NUM_ARGS -} - -static inline void zend_ptr_stack_2_push(zend_ptr_stack *stack, void *a, void *b) -{ -#define ZEND_PTR_STACK_NUM_ARGS 2 - - ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, ZEND_PTR_STACK_NUM_ARGS) - - stack->top += ZEND_PTR_STACK_NUM_ARGS; - *(stack->top_element++) = a; - *(stack->top_element++) = b; - -#undef ZEND_PTR_STACK_NUM_ARGS -} - -static inline void zend_ptr_stack_3_pop(zend_ptr_stack *stack, void **a, void **b, void **c) -{ - *a = *(--stack->top_element); - *b = *(--stack->top_element); - *c = *(--stack->top_element); - stack->top -= 3; -} - -static inline void zend_ptr_stack_2_pop(zend_ptr_stack *stack, void **a, void **b) -{ - *a = *(--stack->top_element); - *b = *(--stack->top_element); - stack->top -= 2; -} - -static inline void zend_ptr_stack_push(zend_ptr_stack *stack, void *ptr) -{ - ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, 1) - - stack->top++; - *(stack->top_element++) = ptr; -} - -static inline void *zend_ptr_stack_pop(zend_ptr_stack *stack) -{ - stack->top--; - return *(--stack->top_element); -} - -#endif /* ZEND_PTR_STACK_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_qsort.c b/Zend/zend_qsort.c deleted file mode 100644 index 23e4468fb0..0000000000 --- a/Zend/zend_qsort.c +++ /dev/null @@ -1,127 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" - -#include - -#define QSORT_STACK_SIZE (sizeof(size_t) * CHAR_BIT) - -static void _zend_qsort_swap(void *a, void *b, size_t siz) -{ - register char *tmp_a_char; - register char *tmp_b_char; - register int *tmp_a_int; - register int *tmp_b_int; - register size_t i; - int t_i; - char t_c; - - tmp_a_int = (int *) a; - tmp_b_int = (int *) b; - - for (i = sizeof(int); i <= siz; i += sizeof(int)) { - t_i = *tmp_a_int; - *tmp_a_int++ = *tmp_b_int; - *tmp_b_int++ = t_i; - } - - tmp_a_char = (char *) tmp_a_int; - tmp_b_char = (char *) tmp_b_int; - - for (i = i - sizeof(int) + 1; i <= siz; ++i) { - t_c = *tmp_a_char; - *tmp_a_char++ = *tmp_b_char; - *tmp_b_char++ = t_c; - } -} - -ZEND_API void zend_qsort(void *base, size_t nmemb, size_t siz, compare_func_t compare TSRMLS_DC) -{ - void *begin_stack[QSORT_STACK_SIZE]; - void *end_stack[QSORT_STACK_SIZE]; - register char *begin; - register char *end; - register char *seg1; - register char *seg2; - register char *seg2p; - register int loop; - uint offset; - - begin_stack[0] = (char *) base; - end_stack[0] = (char *) base + ((nmemb - 1) * siz); - - for (loop = 0; loop >= 0; --loop) { - begin = begin_stack[loop]; - end = end_stack[loop]; - - while (begin < end) { - offset = (end - begin) >> 1; - _zend_qsort_swap(begin, begin + (offset - (offset % siz)), siz); - - seg1 = begin + siz; - seg2 = end; - - while (1) { - for (; seg1 < seg2 && compare(begin, seg1 TSRMLS_CC) > 0; - seg1 += siz); - - for (; seg2 >= seg1 && compare(seg2, begin TSRMLS_CC) > 0; - seg2 -= siz); - - if (seg1 >= seg2) - break; - - _zend_qsort_swap(seg1, seg2, siz); - - seg1 += siz; - seg2 -= siz; - } - - _zend_qsort_swap(begin, seg2, siz); - - seg2p = seg2; - - if ((seg2p - begin) <= (end - seg2p)) { - if ((seg2p + siz) < end) { - begin_stack[loop] = seg2p + siz; - end_stack[loop++] = end; - } - end = seg2p - siz; - } - else { - if ((seg2p - siz) > begin) { - begin_stack[loop] = begin; - end_stack[loop++] = seg2p - siz; - } - begin = seg2p + siz; - } - } - } -} - -/* - * Local Variables: - * c-basic-offset: 4 - * tab-width: 4 - * End: - * vim600: fdm=marker - * vim: noet sw=4 ts=4 - */ diff --git a/Zend/zend_qsort.h b/Zend/zend_qsort.h deleted file mode 100644 index ae71520567..0000000000 --- a/Zend/zend_qsort.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Sterling Hughes | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_QSORT_H -#define ZEND_QSORT_H - -BEGIN_EXTERN_C() -ZEND_API void zend_qsort(void *base, size_t nmemb, size_t siz, compare_func_t compare TSRMLS_DC); -END_EXTERN_C() - -#endif /* ZEND_QSORT_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_sprintf.c b/Zend/zend_sprintf.c deleted file mode 100644 index 746c01fbb4..0000000000 --- a/Zend/zend_sprintf.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include - -#include "zend.h" - -#ifdef HAVE_STDARG_H -# include -#endif - -#if ZEND_BROKEN_SPRINTF -int zend_sprintf(char *buffer, const char *format, ...) -{ - va_list args; - - va_start(args, format); - vsprintf(buffer, format, args); - va_end(args); - - return strlen(buffer); -} -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_stack.c b/Zend/zend_stack.c deleted file mode 100644 index 0badedc48f..0000000000 --- a/Zend/zend_stack.c +++ /dev/null @@ -1,173 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_stack.h" - -ZEND_API int zend_stack_init(zend_stack *stack) -{ - stack->top = 0; - stack->elements = (void **) emalloc(sizeof(void **) * STACK_BLOCK_SIZE); - if (!stack->elements) { - return FAILURE; - } else { - stack->max = STACK_BLOCK_SIZE; - return SUCCESS; - } -} - -ZEND_API int zend_stack_push(zend_stack *stack, void *element, int size) -{ - if (stack->top >= stack->max) { /* we need to allocate more memory */ - stack->elements = (void **) erealloc(stack->elements, - (sizeof(void **) * (stack->max += STACK_BLOCK_SIZE))); - if (!stack->elements) { - return FAILURE; - } - } - stack->elements[stack->top] = (void *) emalloc(size); - memcpy(stack->elements[stack->top], element, size); - return stack->top++; -} - - -ZEND_API int zend_stack_top(zend_stack *stack, void **element) -{ - if (stack->top > 0) { - *element = stack->elements[stack->top - 1]; - return SUCCESS; - } else { - *element = NULL; - return FAILURE; - } -} - - -ZEND_API int zend_stack_del_top(zend_stack *stack) -{ - if (stack->top > 0) { - efree(stack->elements[--stack->top]); - } - return SUCCESS; -} - - -ZEND_API int zend_stack_int_top(zend_stack *stack) -{ - int *e; - - if (zend_stack_top(stack, (void **) &e) == FAILURE) { - return FAILURE; /* this must be a negative number, since negative numbers can't be address numbers */ - } else { - return *e; - } -} - - -ZEND_API int zend_stack_is_empty(zend_stack *stack) -{ - if (stack->top == 0) { - return 1; - } else { - return 0; - } -} - - -ZEND_API int zend_stack_destroy(zend_stack *stack) -{ - register int i; - - for (i = 0; i < stack->top; i++) { - efree(stack->elements[i]); - } - - if (stack->elements) { - efree(stack->elements); - } - return SUCCESS; -} - - -ZEND_API void **zend_stack_base(zend_stack *stack) -{ - return stack->elements; -} - - -ZEND_API int zend_stack_count(zend_stack *stack) -{ - return stack->top; -} - - -ZEND_API void zend_stack_apply(zend_stack *stack, int type, int (*apply_function)(void *element)) -{ - int i; - - switch (type) { - case ZEND_STACK_APPLY_TOPDOWN: - for (i=stack->top-1; i>=0; i--) { - if (apply_function(stack->elements[i])) { - break; - } - } - break; - case ZEND_STACK_APPLY_BOTTOMUP: - for (i=0; itop; i++) { - if (apply_function(stack->elements[i])) { - break; - } - } - break; - } -} - - -ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int type, int (*apply_function)(void *element, void *arg), void *arg) -{ - int i; - - switch (type) { - case ZEND_STACK_APPLY_TOPDOWN: - for (i=stack->top-1; i>=0; i--) { - if (apply_function(stack->elements[i], arg)) { - break; - } - } - break; - case ZEND_STACK_APPLY_BOTTOMUP: - for (i=0; itop; i++) { - if (apply_function(stack->elements[i], arg)) { - break; - } - } - break; - } -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_stack.h b/Zend/zend_stack.h deleted file mode 100644 index 766796b7be..0000000000 --- a/Zend/zend_stack.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_STACK_H -#define ZEND_STACK_H - -typedef struct _zend_stack { - int top, max; - void **elements; -} zend_stack; - - -#define STACK_BLOCK_SIZE 64 - -BEGIN_EXTERN_C() -ZEND_API int zend_stack_init(zend_stack *stack); -ZEND_API int zend_stack_push(zend_stack *stack, void *element, int size); -ZEND_API int zend_stack_top(zend_stack *stack, void **element); -ZEND_API int zend_stack_del_top(zend_stack *stack); -ZEND_API int zend_stack_int_top(zend_stack *stack); -ZEND_API int zend_stack_is_empty(zend_stack *stack); -ZEND_API int zend_stack_destroy(zend_stack *stack); -ZEND_API void **zend_stack_base(zend_stack *stack); -ZEND_API int zend_stack_count(zend_stack *stack); -ZEND_API void zend_stack_apply(zend_stack *stack, int type, int (*apply_function)(void *element)); -ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int type, int (*apply_function)(void *element, void *arg), void *arg); -END_EXTERN_C() - -#define ZEND_STACK_APPLY_TOPDOWN 1 -#define ZEND_STACK_APPLY_BOTTOMUP 2 - -#endif /* ZEND_STACK_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_static_allocator.c b/Zend/zend_static_allocator.c deleted file mode 100644 index 515b0983b6..0000000000 --- a/Zend/zend_static_allocator.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend_static_allocator.h" - -/* Not checking emalloc() and erealloc() return values as they are supposed to bailout */ - -inline static void block_init(Block *block, zend_uint block_size) -{ - block->pos = block->bp = (char *) emalloc(block_size); - block->end = block->bp + block_size; -} - -inline static char *block_allocate(Block *block, zend_uint size) -{ - char *retval = block->pos; - if ((block->pos += size) >= block->end) { - return (char *)NULL; - } - return retval; -} - -inline static void block_destroy(Block *block) -{ - efree(block->bp); -} - -void static_allocator_init(StaticAllocator *sa) -{ - sa->Blocks = (Block *) emalloc(sizeof(Block)); - block_init(sa->Blocks, ALLOCATOR_BLOCK_SIZE); - sa->num_blocks = 1; - sa->current_block = 0; -} - -char *static_allocator_allocate(StaticAllocator *sa, zend_uint size) -{ - char *retval; - - retval = block_allocate(&sa->Blocks[sa->current_block], size); - if (retval) { - return retval; - } - sa->Blocks = (Block *) erealloc(sa->Blocks, ++sa->num_blocks); - sa->current_block++; - block_init(&sa->Blocks[sa->current_block], (size > ALLOCATOR_BLOCK_SIZE) ? size : ALLOCATOR_BLOCK_SIZE); - retval = block_allocate(&sa->Blocks[sa->current_block], size); - return retval; -} - -void static_allocator_destroy(StaticAllocator *sa) -{ - zend_uint i; - - for (i=0; inum_blocks; i++) { - block_free(&sa->Blocks[i]); - } - efree(sa->Blocks); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_static_allocator.h b/Zend/zend_static_allocator.h deleted file mode 100644 index 02ea1187ff..0000000000 --- a/Zend/zend_static_allocator.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_STATIC_ALLOCATOR_H -#define ZEND_STATIC_ALLOCATOR_H - -#define ALLOCATOR_BLOCK_SIZE 400000 - -/* Temporary */ -typedef unsigned int zend_uint; -#define emalloc(s) malloc(s) -#define efree(p) free(p) - -typedef struct _Block { - char *bp; - char *pos; - char *end; -} Block; - -typedef struct _StaticAllocator { - Block *Blocks; - zend_uint num_blocks; - zend_uint current_block; -} StaticAllocator; - -void static_allocator_init(StaticAllocator *sa); -char *static_allocator_allocate(StaticAllocator *sa, zend_uint size); -void static_allocator_destroy(StaticAllocator *sa); - -#endif /* ZEND_STATIC_ALLOCATOR_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_stream.c b/Zend/zend_stream.c deleted file mode 100644 index d8467bd8cd..0000000000 --- a/Zend/zend_stream.c +++ /dev/null @@ -1,142 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - - -#include "zend.h" -#include "zend_compile.h" - -ZEND_DLIMPORT int isatty(int fd); - -static size_t zend_stream_stdio_reader(void *handle, char *buf, size_t len TSRMLS_DC) -{ - return fread(buf, 1, len, (FILE*)handle); -} - -static void zend_stream_stdio_closer(void *handle TSRMLS_DC) -{ - if ((FILE*)handle != stdin) - fclose((FILE*)handle); -} - -static long zend_stream_stdio_fteller(void *handle TSRMLS_DC) -{ - return ftell((FILE*) handle); -} - - -ZEND_API int zend_stream_open(const char *filename, zend_file_handle *handle TSRMLS_DC) -{ - if (zend_stream_open_function) { - return zend_stream_open_function(filename, handle TSRMLS_CC); - } - handle->type = ZEND_HANDLE_FP; - handle->opened_path = NULL; - handle->handle.fp = zend_fopen(filename, &handle->opened_path); - handle->filename = (char *)filename; - handle->free_filename = 0; - - return (handle->handle.fp) ? SUCCESS : FAILURE; -} - -ZEND_API int zend_stream_fixup(zend_file_handle *file_handle TSRMLS_DC) -{ - switch (file_handle->type) { - case ZEND_HANDLE_FILENAME: - if (FAILURE == zend_stream_open(file_handle->filename, file_handle TSRMLS_CC)) { - return FAILURE; - } - break; - - case ZEND_HANDLE_FD: - file_handle->handle.fp = fdopen(file_handle->handle.fd, "rb"); - file_handle->type = ZEND_HANDLE_FP; - break; - - case ZEND_HANDLE_FP: - file_handle->handle.fp = file_handle->handle.fp; - break; - - case ZEND_HANDLE_STREAM: - /* nothing to do */ - return SUCCESS; - - default: - return FAILURE; - } - if (file_handle->type == ZEND_HANDLE_FP) { - if (!file_handle->handle.fp) { - return FAILURE; - } - - /* make compatible with stream */ - file_handle->handle.stream.handle = file_handle->handle.fp; - file_handle->handle.stream.reader = zend_stream_stdio_reader; - file_handle->handle.stream.closer = zend_stream_stdio_closer; - file_handle->handle.stream.fteller = zend_stream_stdio_fteller; - - file_handle->handle.stream.interactive = isatty(fileno((FILE *)file_handle->handle.stream.handle)); - } - return SUCCESS; -} - -ZEND_API size_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_t len TSRMLS_DC) -{ - if (file_handle->handle.stream.interactive) { - int c = '*'; - size_t n; - -#ifdef NETWARE - /* - c != 4 check is there as fread of a character in NetWare LibC gives 4 upon ^D character. - Ascii value 4 is actually EOT character which is not defined anywhere in the LibC - or else we can use instead of hardcoded 4. - */ - for ( n = 0; n < len && (c = zend_stream_getc( file_handle TSRMLS_CC)) != EOF && c != 4 && c != '\n'; ++n ) -#else - for ( n = 0; n < len && (c = zend_stream_getc( file_handle TSRMLS_CC)) != EOF && c != '\n'; ++n ) -#endif - buf[n] = (char) c; - if ( c == '\n' ) - buf[n++] = (char) c; - - return n; - } - return file_handle->handle.stream.reader(file_handle->handle.stream.handle, buf, len TSRMLS_CC); -} - -ZEND_API int zend_stream_getc(zend_file_handle *file_handle TSRMLS_DC) -{ - char buf; - - if (file_handle->handle.stream.reader(file_handle->handle.stream.handle, &buf, sizeof(buf) TSRMLS_CC)) { - return (int)buf; - } - return EOF; -} - -ZEND_API int zend_stream_ferror(zend_file_handle *file_handle TSRMLS_DC) -{ - return 0; -} - -ZEND_API long zend_stream_ftell(zend_file_handle *file_handle TSRMLS_DC) -{ - return file_handle->handle.stream.fteller(file_handle->handle.stream.handle TSRMLS_CC); -} diff --git a/Zend/zend_stream.h b/Zend/zend_stream.h deleted file mode 100644 index 81df585abe..0000000000 --- a/Zend/zend_stream.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Wez Furlong | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_STREAM_H -#define ZEND_STREAM_H - -/* Lightweight stream implementation for the ZE scanners. - * These functions are private to the engine. - * */ - -typedef size_t (*zend_stream_reader_t)(void *handle, char *buf, size_t len TSRMLS_DC); -typedef void (*zend_stream_closer_t)(void *handle TSRMLS_DC); -typedef long (*zend_stream_fteller_t)(void *handle TSRMLS_DC); - -typedef struct _zend_stream { - void *handle; - zend_stream_reader_t reader; - zend_stream_closer_t closer; - zend_stream_fteller_t fteller; - int interactive; -} zend_stream; - -typedef struct _zend_file_handle { - zend_uchar type; - char *filename; - char *opened_path; - union { - int fd; - FILE *fp; - zend_stream stream; - } handle; - zend_bool free_filename; -} zend_file_handle; - -BEGIN_EXTERN_C() -ZEND_API int zend_stream_open(const char *filename, zend_file_handle *handle TSRMLS_DC); -ZEND_API int zend_stream_ferror(zend_file_handle *file_handle TSRMLS_DC); -ZEND_API int zend_stream_getc(zend_file_handle *file_handle TSRMLS_DC); -ZEND_API size_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_t len TSRMLS_DC); -ZEND_API long zend_stream_ftell(zend_file_handle *file_handle TSRMLS_DC); -ZEND_API int zend_stream_fixup(zend_file_handle *file_handle TSRMLS_DC); -END_EXTERN_C() - -#define zend_stream_close(handle) zend_file_handle_dtor((handle)) - -#endif - diff --git a/Zend/zend_strtod.c b/Zend/zend_strtod.c deleted file mode 100644 index 3a469fd59c..0000000000 --- a/Zend/zend_strtod.c +++ /dev/null @@ -1,1797 +0,0 @@ -/**************************************************************** - * - * The author of this software is David M. Gay. - * - * Copyright (c) 1991 by AT&T. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose without fee is hereby granted, provided that this entire notice - * is included in all copies of any software which is or includes a copy - * or modification of this software and in all copies of the supporting - * documentation for such software. - * - * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY - * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY - * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. - * - ***************************************************************/ - -/* Please send bug reports to - David M. Gay - AT&T Bell Laboratories, Room 2C-463 - 600 Mountain Avenue - Murray Hill, NJ 07974-2070 - U.S.A. - dmg@research.att.com or research!dmg - */ - -/* strtod for IEEE-, VAX-, and IBM-arithmetic machines. - * - * This strtod returns a nearest machine number to the input decimal - * string (or sets errno to ERANGE). With IEEE arithmetic, ties are - * broken by the IEEE round-even rule. Otherwise ties are broken by - * biased rounding (add half and chop). - * - * Inspired loosely by William D. Clinger's paper "How to Read Floating - * Point Numbers Accurately" [Proc. ACM SIGPLAN '90, pp. 92-101]. - * - * Modifications: - * - * 1. We only require IEEE, IBM, or VAX double-precision - * arithmetic (not IEEE double-extended). - * 2. We get by with floating-point arithmetic in a case that - * Clinger missed -- when we're computing d * 10^n - * for a small integer d and the integer n is not too - * much larger than 22 (the maximum integer k for which - * we can represent 10^k exactly), we may be able to - * compute (d*10^k) * 10^(e-k) with just one roundoff. - * 3. Rather than a bit-at-a-time adjustment of the binary - * result in the hard case, we use floating-point - * arithmetic to determine the adjustment to within - * one bit; only in really hard cases do we need to - * compute a second residual. - * 4. Because of 3., we don't need a large table of powers of 10 - * for ten-to-e (just some small tables, e.g. of 10^k - * for 0 <= k <= 22). - */ - -/* - * #define IEEE_LITTLE_ENDIAN for IEEE-arithmetic machines where the least - * significant byte has the lowest address. - * #define IEEE_BIG_ENDIAN for IEEE-arithmetic machines where the most - * significant byte has the lowest address. - * #define Long int on machines with 32-bit ints and 64-bit longs. - * #define Sudden_Underflow for IEEE-format machines without gradual - * underflow (i.e., that flush to zero on underflow). - * #define IBM for IBM mainframe-style floating-point arithmetic. - * #define VAX for VAX-style floating-point arithmetic. - * #define Unsigned_Shifts if >> does treats its left operand as unsigned. - * #define No_leftright to omit left-right logic in fast floating-point - * computation of dtoa. - * #define Check_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3. - * #define RND_PRODQUOT to use rnd_prod and rnd_quot (assembly routines - * that use extended-precision instructions to compute rounded - * products and quotients) with IBM. - * #define ROUND_BIASED for IEEE-format with biased rounding. - * #define Inaccurate_Divide for IEEE-format with correctly rounded - * products but inaccurate quotients, e.g., for Intel i860. - * #define Just_16 to store 16 bits per 32-bit Long when doing high-precision - * integer arithmetic. Whether this speeds things up or slows things - * down depends on the machine and the number being converted. - * #define KR_headers for old-style C function headers. - * #define Bad_float_h if your system lacks a float.h or if it does not - * define some or all of DBL_DIG, DBL_MAX_10_EXP, DBL_MAX_EXP, - * FLT_RADIX, FLT_ROUNDS, and DBL_MAX. - * #define MALLOC your_malloc, where your_malloc(n) acts like malloc(n) - * if memory is available and otherwise does something you deem - * appropriate. If MALLOC is undefined, malloc will be invoked - * directly -- and assumed always to succeed. - */ - -#include - -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#if defined(HAVE_INTTYPES_H) -#include -#elif defined(HAVE_STDINT_H) -#include -#endif - -#ifndef HAVE_INT32_T -# if SIZEOF_INT == 4 -typedef int int32_t; -# elif SIZEOF_LONG == 4 -typedef long int int32_t; -# endif -#endif - -#ifndef HAVE_UINT32_T -# if SIZEOF_INT == 4 -typedef unsigned int uint32_t; -# elif SIZEOF_LONG == 4 -typedef unsigned long int uint32_t; -# endif -#endif - -#ifdef WORDS_BIGENDIAN -#define IEEE_BIG_ENDIAN -#else -#define IEEE_LITTLE_ENDIAN -#endif - -#if defined(__arm__) && !defined(__VFP_FP__) -/* - * Although the CPU is little endian the FP has different - * byte and word endianness. The byte order is still little endian - * but the word order is big endian. - */ -#define IEEE_BIG_ENDIAN -#undef IEEE_LITTLE_ENDIAN -#endif - -#ifdef __vax__ -#define VAX -#endif - -#if defined(_MSC_VER) -#define int32_t __int32 -#define uint32_t unsigned __int32 -#define IEEE_LITTLE_ENDIAN -#endif - -#define Long int32_t -#define ULong uint32_t - -#ifdef __cplusplus -#include "malloc.h" -#include "memory.h" -#else -#ifndef KR_headers -#include "stdlib.h" -#include "string.h" -#include "locale.h" -#else -#include "malloc.h" -#include "memory.h" -#endif -#endif - -#ifdef MALLOC -#ifdef KR_headers -extern char *MALLOC(); -#else -extern void *MALLOC(size_t); -#endif -#else -#define MALLOC malloc -#endif - -#include "ctype.h" -#include "errno.h" - -#ifdef Bad_float_h -#ifdef IEEE_BIG_ENDIAN -#define IEEE_ARITHMETIC -#endif -#ifdef IEEE_LITTLE_ENDIAN -#define IEEE_ARITHMETIC -#endif - -#ifdef IEEE_ARITHMETIC -#define DBL_DIG 15 -#define DBL_MAX_10_EXP 308 -#define DBL_MAX_EXP 1024 -#define FLT_RADIX 2 -#define FLT_ROUNDS 1 -#define DBL_MAX 1.7976931348623157e+308 -#endif - -#ifdef IBM -#define DBL_DIG 16 -#define DBL_MAX_10_EXP 75 -#define DBL_MAX_EXP 63 -#define FLT_RADIX 16 -#define FLT_ROUNDS 0 -#define DBL_MAX 7.2370055773322621e+75 -#endif - -#ifdef VAX -#define DBL_DIG 16 -#define DBL_MAX_10_EXP 38 -#define DBL_MAX_EXP 127 -#define FLT_RADIX 2 -#define FLT_ROUNDS 1 -#define DBL_MAX 1.7014118346046923e+38 -#endif - -#ifndef LONG_MAX -#define LONG_MAX 2147483647 -#endif -#else -#include "float.h" -#endif -#ifndef __MATH_H__ -#include "math.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef CONST -#ifdef KR_headers -#define CONST /* blank */ -#else -#define CONST const -#endif -#endif - -#ifdef Unsigned_Shifts -#define Sign_Extend(a,b) if (b < 0) a |= 0xffff0000; -#else -#define Sign_Extend(a,b) /*no-op*/ -#endif - -#if defined(IEEE_LITTLE_ENDIAN) + defined(IEEE_BIG_ENDIAN) + defined(VAX) + \ - defined(IBM) != 1 -Exactly one of IEEE_LITTLE_ENDIAN IEEE_BIG_ENDIAN, VAX, or -IBM should be defined. -#endif - -typedef union { - double d; - ULong ul[2]; -} _double; -#define value(x) ((x).d) -#ifdef IEEE_LITTLE_ENDIAN -#define word0(x) ((x).ul[1]) -#define word1(x) ((x).ul[0]) -#else -#define word0(x) ((x).ul[0]) -#define word1(x) ((x).ul[1]) -#endif - -/* The following definition of Storeinc is appropriate for MIPS processors. - * An alternative that might be better on some machines is - * #define Storeinc(a,b,c) (*a++ = b << 16 | c & 0xffff) - */ -#if defined(IEEE_LITTLE_ENDIAN) + defined(VAX) + defined(__arm__) -#define Storeinc(a,b,c) (((unsigned short *)a)[1] = (unsigned short)b, \ -((unsigned short *)a)[0] = (unsigned short)c, a++) -#else -#define Storeinc(a,b,c) (((unsigned short *)a)[0] = (unsigned short)b, \ -((unsigned short *)a)[1] = (unsigned short)c, a++) -#endif - -/* #define P DBL_MANT_DIG */ -/* Ten_pmax = floor(P*log(2)/log(5)) */ -/* Bletch = (highest power of 2 < DBL_MAX_10_EXP) / 16 */ -/* Quick_max = floor((P-1)*log(FLT_RADIX)/log(10) - 1) */ -/* Int_max = floor(P*log(FLT_RADIX)/log(10) - 1) */ - -#if defined(IEEE_LITTLE_ENDIAN) + defined(IEEE_BIG_ENDIAN) -#define Exp_shift 20 -#define Exp_shift1 20 -#define Exp_msk1 0x100000 -#define Exp_msk11 0x100000 -#define Exp_mask 0x7ff00000 -#define P 53 -#define Bias 1023 -#define IEEE_Arith -#define Emin (-1022) -#define Exp_1 0x3ff00000 -#define Exp_11 0x3ff00000 -#define Ebits 11 -#define Frac_mask 0xfffff -#define Frac_mask1 0xfffff -#define Ten_pmax 22 -#define Bletch 0x10 -#define Bndry_mask 0xfffff -#define Bndry_mask1 0xfffff -#define LSB 1 -#define Sign_bit 0x80000000 -#define Log2P 1 -#define Tiny0 0 -#define Tiny1 1 -#define Quick_max 14 -#define Int_max 14 -#define Infinite(x) (word0(x) == 0x7ff00000) /* sufficient test for here */ -#else -#undef Sudden_Underflow -#define Sudden_Underflow -#ifdef IBM -#define Exp_shift 24 -#define Exp_shift1 24 -#define Exp_msk1 0x1000000 -#define Exp_msk11 0x1000000 -#define Exp_mask 0x7f000000 -#define P 14 -#define Bias 65 -#define Exp_1 0x41000000 -#define Exp_11 0x41000000 -#define Ebits 8 /* exponent has 7 bits, but 8 is the right value in b2d */ -#define Frac_mask 0xffffff -#define Frac_mask1 0xffffff -#define Bletch 4 -#define Ten_pmax 22 -#define Bndry_mask 0xefffff -#define Bndry_mask1 0xffffff -#define LSB 1 -#define Sign_bit 0x80000000 -#define Log2P 4 -#define Tiny0 0x100000 -#define Tiny1 0 -#define Quick_max 14 -#define Int_max 15 -#else /* VAX */ -#define Exp_shift 23 -#define Exp_shift1 7 -#define Exp_msk1 0x80 -#define Exp_msk11 0x800000 -#define Exp_mask 0x7f80 -#define P 56 -#define Bias 129 -#define Exp_1 0x40800000 -#define Exp_11 0x4080 -#define Ebits 8 -#define Frac_mask 0x7fffff -#define Frac_mask1 0xffff007f -#define Ten_pmax 24 -#define Bletch 2 -#define Bndry_mask 0xffff007f -#define Bndry_mask1 0xffff007f -#define LSB 0x10000 -#define Sign_bit 0x8000 -#define Log2P 1 -#define Tiny0 0x80 -#define Tiny1 0 -#define Quick_max 15 -#define Int_max 15 -#endif -#endif - -#ifndef IEEE_Arith -#define ROUND_BIASED -#endif - -#ifdef RND_PRODQUOT -#define rounded_product(a,b) a = rnd_prod(a, b) -#define rounded_quotient(a,b) a = rnd_quot(a, b) -#ifdef KR_headers -extern double rnd_prod(), rnd_quot(); -#else -extern double rnd_prod(double, double), rnd_quot(double, double); -#endif -#else -#define rounded_product(a,b) a *= b -#define rounded_quotient(a,b) a /= b -#endif - -#define Big0 (Frac_mask1 | Exp_msk1*(DBL_MAX_EXP+Bias-1)) -#define Big1 0xffffffff - -#ifndef Just_16 -/* When Pack_32 is not defined, we store 16 bits per 32-bit Long. - * This makes some inner loops simpler and sometimes saves work - * during multiplications, but it often seems to make things slightly - * slower. Hence the default is now to store 32 bits per Long. - */ -#ifndef Pack_32 -#define Pack_32 -#endif -#endif - -#define Kmax 15 - - struct -Bigint { - struct Bigint *next; - int k, maxwds, sign, wds; - ULong x[1]; - }; - - typedef struct Bigint Bigint; - - static Bigint *freelist[Kmax+1]; - - static Bigint * -Balloc -#ifdef KR_headers - (k) int k; -#else - (int k) -#endif -{ - int x; - Bigint *rv; - - if ((rv = freelist[k])) { - freelist[k] = rv->next; - } - else { - x = 1 << k; - rv = (Bigint *)MALLOC(sizeof(Bigint) + (x-1)*sizeof(Long)); - rv->k = k; - rv->maxwds = x; - } - rv->sign = rv->wds = 0; - return rv; - } - - static void -Bfree -#ifdef KR_headers - (v) Bigint *v; -#else - (Bigint *v) -#endif -{ - if (v) { - v->next = freelist[v->k]; - freelist[v->k] = v; - } - } - -#define Bcopy(x,y) memcpy((char *)&x->sign, (char *)&y->sign, \ -y->wds*sizeof(Long) + 2*sizeof(int)) - - static Bigint * -multadd -#ifdef KR_headers - (b, m, a) Bigint *b; int m, a; -#else - (Bigint *b, int m, int a) /* multiply by m and add a */ -#endif -{ - int i, wds; - ULong *x, y; -#ifdef Pack_32 - ULong xi, z; -#endif - Bigint *b1; - - wds = b->wds; - x = b->x; - i = 0; - do { -#ifdef Pack_32 - xi = *x; - y = (xi & 0xffff) * m + a; - z = (xi >> 16) * m + (y >> 16); - a = (int)(z >> 16); - *x++ = (z << 16) + (y & 0xffff); -#else - y = *x * m + a; - a = (int)(y >> 16); - *x++ = y & 0xffff; -#endif - } - while(++i < wds); - if (a) { - if (wds >= b->maxwds) { - b1 = Balloc(b->k+1); - Bcopy(b1, b); - Bfree(b); - b = b1; - } - b->x[wds++] = a; - b->wds = wds; - } - return b; - } - - static Bigint * -s2b -#ifdef KR_headers - (s, nd0, nd, y9) CONST char *s; int nd0, nd; ULong y9; -#else - (CONST char *s, int nd0, int nd, ULong y9) -#endif -{ - Bigint *b; - int i, k; - Long x, y; - - x = (nd + 8) / 9; - for(k = 0, y = 1; x > y; y <<= 1, k++) ; -#ifdef Pack_32 - b = Balloc(k); - b->x[0] = y9; - b->wds = 1; -#else - b = Balloc(k+1); - b->x[0] = y9 & 0xffff; - b->wds = (b->x[1] = y9 >> 16) ? 2 : 1; -#endif - - i = 9; - if (9 < nd0) { - s += 9; - do b = multadd(b, 10, *s++ - '0'); - while(++i < nd0); - s++; - } - else - s += 10; - for(; i < nd; i++) - b = multadd(b, 10, *s++ - '0'); - return b; - } - - static int -hi0bits -#ifdef KR_headers - (x) register ULong x; -#else - (register ULong x) -#endif -{ - register int k = 0; - - if (!(x & 0xffff0000)) { - k = 16; - x <<= 16; - } - if (!(x & 0xff000000)) { - k += 8; - x <<= 8; - } - if (!(x & 0xf0000000)) { - k += 4; - x <<= 4; - } - if (!(x & 0xc0000000)) { - k += 2; - x <<= 2; - } - if (!(x & 0x80000000)) { - k++; - if (!(x & 0x40000000)) - return 32; - } - return k; - } - - static int -lo0bits -#ifdef KR_headers - (y) ULong *y; -#else - (ULong *y) -#endif -{ - register int k; - register ULong x = *y; - - if (x & 7) { - if (x & 1) - return 0; - if (x & 2) { - *y = x >> 1; - return 1; - } - *y = x >> 2; - return 2; - } - k = 0; - if (!(x & 0xffff)) { - k = 16; - x >>= 16; - } - if (!(x & 0xff)) { - k += 8; - x >>= 8; - } - if (!(x & 0xf)) { - k += 4; - x >>= 4; - } - if (!(x & 0x3)) { - k += 2; - x >>= 2; - } - if (!(x & 1)) { - k++; - x >>= 1; - if (!x & 1) - return 32; - } - *y = x; - return k; - } - - static Bigint * -i2b -#ifdef KR_headers - (i) int i; -#else - (int i) -#endif -{ - Bigint *b; - - b = Balloc(1); - b->x[0] = i; - b->wds = 1; - return b; - } - - static Bigint * -mult -#ifdef KR_headers - (a, b) Bigint *a, *b; -#else - (Bigint *a, Bigint *b) -#endif -{ - Bigint *c; - int k, wa, wb, wc; - ULong carry, y, z; - ULong *x, *xa, *xae, *xb, *xbe, *xc, *xc0; -#ifdef Pack_32 - ULong z2; -#endif - - if (a->wds < b->wds) { - c = a; - a = b; - b = c; - } - k = a->k; - wa = a->wds; - wb = b->wds; - wc = wa + wb; - if (wc > a->maxwds) - k++; - c = Balloc(k); - for(x = c->x, xa = x + wc; x < xa; x++) - *x = 0; - xa = a->x; - xae = xa + wa; - xb = b->x; - xbe = xb + wb; - xc0 = c->x; -#ifdef Pack_32 - for(; xb < xbe; xb++, xc0++) { - if ((y = *xb & 0xffff)) { - x = xa; - xc = xc0; - carry = 0; - do { - z = (*x & 0xffff) * y + (*xc & 0xffff) + carry; - carry = z >> 16; - z2 = (*x++ >> 16) * y + (*xc >> 16) + carry; - carry = z2 >> 16; - Storeinc(xc, z2, z); - } - while(x < xae); - *xc = carry; - } - if ((y = *xb >> 16)) { - x = xa; - xc = xc0; - carry = 0; - z2 = *xc; - do { - z = (*x & 0xffff) * y + (*xc >> 16) + carry; - carry = z >> 16; - Storeinc(xc, z, z2); - z2 = (*x++ >> 16) * y + (*xc & 0xffff) + carry; - carry = z2 >> 16; - } - while(x < xae); - *xc = z2; - } - } -#else - for(; xb < xbe; xc0++) { - if (y = *xb++) { - x = xa; - xc = xc0; - carry = 0; - do { - z = *x++ * y + *xc + carry; - carry = z >> 16; - *xc++ = z & 0xffff; - } - while(x < xae); - *xc = carry; - } - } -#endif - for(xc0 = c->x, xc = xc0 + wc; wc > 0 && !*--xc; --wc) ; - c->wds = wc; - return c; - } - - static Bigint *p5s; - - static Bigint * -pow5mult -#ifdef KR_headers - (b, k) Bigint *b; int k; -#else - (Bigint *b, int k) -#endif -{ - Bigint *b1, *p5, *p51; - int i; - static int p05[3] = { 5, 25, 125 }; - - if ((i = k & 3)) - b = multadd(b, p05[i-1], 0); - - if (!(k >>= 2)) - return b; - if (!(p5 = p5s)) { - /* first time */ - p5 = p5s = i2b(625); - p5->next = 0; - } - for(;;) { - if (k & 1) { - b1 = mult(b, p5); - Bfree(b); - b = b1; - } - if (!(k >>= 1)) - break; - if (!(p51 = p5->next)) { - p51 = p5->next = mult(p5,p5); - p51->next = 0; - } - p5 = p51; - } - return b; - } - - static Bigint * -lshift -#ifdef KR_headers - (b, k) Bigint *b; int k; -#else - (Bigint *b, int k) -#endif -{ - int i, k1, n, n1; - Bigint *b1; - ULong *x, *x1, *xe, z; - -#ifdef Pack_32 - n = k >> 5; -#else - n = k >> 4; -#endif - k1 = b->k; - n1 = n + b->wds + 1; - for(i = b->maxwds; n1 > i; i <<= 1) - k1++; - b1 = Balloc(k1); - x1 = b1->x; - for(i = 0; i < n; i++) - *x1++ = 0; - x = b->x; - xe = x + b->wds; -#ifdef Pack_32 - if (k &= 0x1f) { - k1 = 32 - k; - z = 0; - do { - *x1++ = *x << k | z; - z = *x++ >> k1; - } - while(x < xe); - if ((*x1 = z)) - ++n1; - } -#else - if (k &= 0xf) { - k1 = 16 - k; - z = 0; - do { - *x1++ = *x << k & 0xffff | z; - z = *x++ >> k1; - } - while(x < xe); - if (*x1 = z) - ++n1; - } -#endif - else do - *x1++ = *x++; - while(x < xe); - b1->wds = n1 - 1; - Bfree(b); - return b1; - } - - static int -cmp -#ifdef KR_headers - (a, b) Bigint *a, *b; -#else - (Bigint *a, Bigint *b) -#endif -{ - ULong *xa, *xa0, *xb, *xb0; - int i, j; - - i = a->wds; - j = b->wds; -#ifdef DEBUG - if (i > 1 && !a->x[i-1]) - Bug("cmp called with a->x[a->wds-1] == 0"); - if (j > 1 && !b->x[j-1]) - Bug("cmp called with b->x[b->wds-1] == 0"); -#endif - if (i -= j) - return i; - xa0 = a->x; - xa = xa0 + j; - xb0 = b->x; - xb = xb0 + j; - for(;;) { - if (*--xa != *--xb) - return *xa < *xb ? -1 : 1; - if (xa <= xa0) - break; - } - return 0; - } - - static Bigint * -diff -#ifdef KR_headers - (a, b) Bigint *a, *b; -#else - (Bigint *a, Bigint *b) -#endif -{ - Bigint *c; - int i, wa, wb; - Long borrow, y; /* We need signed shifts here. */ - ULong *xa, *xae, *xb, *xbe, *xc; -#ifdef Pack_32 - Long z; -#endif - - i = cmp(a,b); - if (!i) { - c = Balloc(0); - c->wds = 1; - c->x[0] = 0; - return c; - } - if (i < 0) { - c = a; - a = b; - b = c; - i = 1; - } - else - i = 0; - c = Balloc(a->k); - c->sign = i; - wa = a->wds; - xa = a->x; - xae = xa + wa; - wb = b->wds; - xb = b->x; - xbe = xb + wb; - xc = c->x; - borrow = 0; -#ifdef Pack_32 - do { - y = (*xa & 0xffff) - (*xb & 0xffff) + borrow; - borrow = y >> 16; - Sign_Extend(borrow, y); - z = (*xa++ >> 16) - (*xb++ >> 16) + borrow; - borrow = z >> 16; - Sign_Extend(borrow, z); - Storeinc(xc, z, y); - } - while(xb < xbe); - while(xa < xae) { - y = (*xa & 0xffff) + borrow; - borrow = y >> 16; - Sign_Extend(borrow, y); - z = (*xa++ >> 16) + borrow; - borrow = z >> 16; - Sign_Extend(borrow, z); - Storeinc(xc, z, y); - } -#else - do { - y = *xa++ - *xb++ + borrow; - borrow = y >> 16; - Sign_Extend(borrow, y); - *xc++ = y & 0xffff; - } - while(xb < xbe); - while(xa < xae) { - y = *xa++ + borrow; - borrow = y >> 16; - Sign_Extend(borrow, y); - *xc++ = y & 0xffff; - } -#endif - while(!*--xc) - wa--; - c->wds = wa; - return c; - } - - static double -ulp -#ifdef KR_headers - (_x) double _x; -#else - (double _x) -#endif -{ - _double x; - register Long L; - _double a; - - value(x) = _x; - L = (word0(x) & Exp_mask) - (P-1)*Exp_msk1; -#ifndef Sudden_Underflow - if (L > 0) { -#endif -#ifdef IBM - L |= Exp_msk1 >> 4; -#endif - word0(a) = L; - word1(a) = 0; -#ifndef Sudden_Underflow - } - else { - L = -L >> Exp_shift; - if (L < Exp_shift) { - word0(a) = 0x80000 >> L; - word1(a) = 0; - } - else { - word0(a) = 0; - L -= Exp_shift; - word1(a) = L >= 31 ? 1 : 1 << (31 - L); - } - } -#endif - return value(a); - } - - static double -b2d -#ifdef KR_headers - (a, e) Bigint *a; int *e; -#else - (Bigint *a, int *e) -#endif -{ - ULong *xa, *xa0, w, y, z; - int k; - _double d; -#ifdef VAX - ULong d0, d1; -#else -#define d0 word0(d) -#define d1 word1(d) -#endif - - xa0 = a->x; - xa = xa0 + a->wds; - y = *--xa; -#ifdef DEBUG - if (!y) Bug("zero y in b2d"); -#endif - k = hi0bits(y); - *e = 32 - k; -#ifdef Pack_32 - if (k < Ebits) { - d0 = Exp_1 | y >> (Ebits - k); - w = xa > xa0 ? *--xa : 0; - d1 = y << ((32-Ebits) + k) | w >> (Ebits - k); - goto ret_d; - } - z = xa > xa0 ? *--xa : 0; - if (k -= Ebits) { - d0 = Exp_1 | y << k | z >> (32 - k); - y = xa > xa0 ? *--xa : 0; - d1 = z << k | y >> (32 - k); - } - else { - d0 = Exp_1 | y; - d1 = z; - } -#else - if (k < Ebits + 16) { - z = xa > xa0 ? *--xa : 0; - d0 = Exp_1 | y << k - Ebits | z >> Ebits + 16 - k; - w = xa > xa0 ? *--xa : 0; - y = xa > xa0 ? *--xa : 0; - d1 = z << k + 16 - Ebits | w << k - Ebits | y >> 16 + Ebits - k; - goto ret_d; - } - z = xa > xa0 ? *--xa : 0; - w = xa > xa0 ? *--xa : 0; - k -= Ebits + 16; - d0 = Exp_1 | y << k + 16 | z << k | w >> 16 - k; - y = xa > xa0 ? *--xa : 0; - d1 = w << k + 16 | y << k; -#endif - ret_d: -#ifdef VAX - word0(d) = d0 >> 16 | d0 << 16; - word1(d) = d1 >> 16 | d1 << 16; -#else -#undef d0 -#undef d1 -#endif - return value(d); - } - - static Bigint * -d2b -#ifdef KR_headers - (_d, e, bits) double d; int *e, *bits; -#else - (double _d, int *e, int *bits) -#endif -{ - Bigint *b; - int de, i, k; - ULong *x, y, z; - _double d; -#ifdef VAX - ULong d0, d1; -#endif - - value(d) = _d; -#ifdef VAX - d0 = word0(d) >> 16 | word0(d) << 16; - d1 = word1(d) >> 16 | word1(d) << 16; -#else -#define d0 word0(d) -#define d1 word1(d) -#endif - -#ifdef Pack_32 - b = Balloc(1); -#else - b = Balloc(2); -#endif - x = b->x; - - z = d0 & Frac_mask; - d0 &= 0x7fffffff; /* clear sign bit, which we ignore */ -#ifdef Sudden_Underflow - de = (int)(d0 >> Exp_shift); -#ifndef IBM - z |= Exp_msk11; -#endif -#else - if ((de = (int)(d0 >> Exp_shift))) - z |= Exp_msk1; -#endif -#ifdef Pack_32 - if ((y = d1)) { - if ((k = lo0bits(&y))) { - x[0] = y | z << (32 - k); - z >>= k; - } - else - x[0] = y; - i = b->wds = (x[1] = z) ? 2 : 1; - } - else { -#ifdef DEBUG - if (!z) - Bug("Zero passed to d2b"); -#endif - k = lo0bits(&z); - x[0] = z; - i = b->wds = 1; - k += 32; - } -#else - if (y = d1) { - if (k = lo0bits(&y)) - if (k >= 16) { - x[0] = y | z << 32 - k & 0xffff; - x[1] = z >> k - 16 & 0xffff; - x[2] = z >> k; - i = 2; - } - else { - x[0] = y & 0xffff; - x[1] = y >> 16 | z << 16 - k & 0xffff; - x[2] = z >> k & 0xffff; - x[3] = z >> k+16; - i = 3; - } - else { - x[0] = y & 0xffff; - x[1] = y >> 16; - x[2] = z & 0xffff; - x[3] = z >> 16; - i = 3; - } - } - else { -#ifdef DEBUG - if (!z) - Bug("Zero passed to d2b"); -#endif - k = lo0bits(&z); - if (k >= 16) { - x[0] = z; - i = 0; - } - else { - x[0] = z & 0xffff; - x[1] = z >> 16; - i = 1; - } - k += 32; - } - while(!x[i]) - --i; - b->wds = i + 1; -#endif -#ifndef Sudden_Underflow - if (de) { -#endif -#ifdef IBM - *e = (de - Bias - (P-1) << 2) + k; - *bits = 4*P + 8 - k - hi0bits(word0(d) & Frac_mask); -#else - *e = de - Bias - (P-1) + k; - *bits = P - k; -#endif -#ifndef Sudden_Underflow - } - else { - *e = de - Bias - (P-1) + 1 + k; -#ifdef Pack_32 - *bits = 32*i - hi0bits(x[i-1]); -#else - *bits = (i+2)*16 - hi0bits(x[i]); -#endif - } -#endif - return b; - } -#undef d0 -#undef d1 - - static double -ratio -#ifdef KR_headers - (a, b) Bigint *a, *b; -#else - (Bigint *a, Bigint *b) -#endif -{ - _double da, db; - int k, ka, kb; - - value(da) = b2d(a, &ka); - value(db) = b2d(b, &kb); -#ifdef Pack_32 - k = ka - kb + 32*(a->wds - b->wds); -#else - k = ka - kb + 16*(a->wds - b->wds); -#endif -#ifdef IBM - if (k > 0) { - word0(da) += (k >> 2)*Exp_msk1; - if (k &= 3) - da *= 1 << k; - } - else { - k = -k; - word0(db) += (k >> 2)*Exp_msk1; - if (k &= 3) - db *= 1 << k; - } -#else - if (k > 0) - word0(da) += k*Exp_msk1; - else { - k = -k; - word0(db) += k*Exp_msk1; - } -#endif - return value(da) / value(db); - } - -static CONST double -tens[] = { - 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, - 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, - 1e20, 1e21, 1e22 -#ifdef VAX - , 1e23, 1e24 -#endif - }; - -#ifdef IEEE_Arith -static CONST double bigtens[] = { 1e16, 1e32, 1e64, 1e128, 1e256 }; -static CONST double tinytens[] = { 1e-16, 1e-32, 1e-64, 1e-128, 1e-256 }; -#define n_bigtens 5 -#else -#ifdef IBM -static CONST double bigtens[] = { 1e16, 1e32, 1e64 }; -static CONST double tinytens[] = { 1e-16, 1e-32, 1e-64 }; -#define n_bigtens 3 -#else -static CONST double bigtens[] = { 1e16, 1e32 }; -static CONST double tinytens[] = { 1e-16, 1e-32 }; -#define n_bigtens 2 -#endif -#endif - -ZEND_API double -zend_strtod -#ifdef KR_headers - (s00, se) CONST char *s00; char **se; -#else - (CONST char *s00, char **se) -#endif -{ - int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign, - e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign; - CONST char *s, *s0, *s1; - double aadj, aadj1, adj; - _double rv, rv0; - Long L; - ULong y, z; - Bigint *bb, *bb1, *bd, *bd0, *bs, *delta, *tmp; - double result; - - CONST char decimal_point = '.'; - - sign = nz0 = nz = 0; - value(rv) = 0.; - - - for(s = s00; isspace((unsigned char) *s); s++) - ; - - if (*s == '-') { - sign = 1; - s++; - } else if (*s == '+') { - s++; - } - - if (*s == '\0') { - s = s00; - goto ret; - } - - if (*s == '0') { - nz0 = 1; - while(*++s == '0') ; - if (!*s) - goto ret; - } - s0 = s; - y = z = 0; - for(nd = nf = 0; (c = *s) >= '0' && c <= '9'; nd++, s++) - if (nd < 9) - y = 10*y + c - '0'; - else if (nd < 16) - z = 10*z + c - '0'; - nd0 = nd; - if (c == decimal_point) { - c = *++s; - if (!nd) { - for(; c == '0'; c = *++s) - nz++; - if (c > '0' && c <= '9') { - s0 = s; - nf += nz; - nz = 0; - goto have_dig; - } - goto dig_done; - } - for(; c >= '0' && c <= '9'; c = *++s) { - have_dig: - nz++; - if (c -= '0') { - nf += nz; - for(i = 1; i < nz; i++) - if (nd++ < 9) - y *= 10; - else if (nd <= DBL_DIG + 1) - z *= 10; - if (nd++ < 9) - y = 10*y + c; - else if (nd <= DBL_DIG + 1) - z = 10*z + c; - nz = 0; - } - } - } - dig_done: - e = 0; - if (c == 'e' || c == 'E') { - if (!nd && !nz && !nz0) { - s = s00; - goto ret; - } - s00 = s; - esign = 0; - switch(c = *++s) { - case '-': - esign = 1; - case '+': - c = *++s; - } - if (c >= '0' && c <= '9') { - while(c == '0') - c = *++s; - if (c > '0' && c <= '9') { - L = c - '0'; - s1 = s; - while((c = *++s) >= '0' && c <= '9') - L = 10*L + c - '0'; - if (s - s1 > 8 || L > 19999) - /* Avoid confusion from exponents - * so large that e might overflow. - */ - e = 19999; /* safe for 16 bit ints */ - else - e = (int)L; - if (esign) - e = -e; - } - else - e = 0; - } - else - s = s00; - } - if (!nd) { - if (!nz && !nz0) - s = s00; - goto ret; - } - e1 = e -= nf; - - /* Now we have nd0 digits, starting at s0, followed by a - * decimal point, followed by nd-nd0 digits. The number we're - * after is the integer represented by those digits times - * 10**e */ - - if (!nd0) - nd0 = nd; - k = nd < DBL_DIG + 1 ? nd : DBL_DIG + 1; - value(rv) = y; - if (k > 9) - value(rv) = tens[k - 9] * value(rv) + z; - bd0 = 0; - if (nd <= DBL_DIG -#ifndef RND_PRODQUOT - && FLT_ROUNDS == 1 -#endif - ) { - if (!e) - goto ret; - if (e > 0) { - if (e <= Ten_pmax) { -#ifdef VAX - goto vax_ovfl_check; -#else - /* value(rv) = */ rounded_product(value(rv), - tens[e]); - goto ret; -#endif - } - i = DBL_DIG - nd; - if (e <= Ten_pmax + i) { - /* A fancier test would sometimes let us do - * this for larger i values. - */ - e -= i; - value(rv) *= tens[i]; -#ifdef VAX - /* VAX exponent range is so narrow we must - * worry about overflow here... - */ - vax_ovfl_check: - word0(rv) -= P*Exp_msk1; - /* value(rv) = */ rounded_product(value(rv), - tens[e]); - if ((word0(rv) & Exp_mask) - > Exp_msk1*(DBL_MAX_EXP+Bias-1-P)) - goto ovfl; - word0(rv) += P*Exp_msk1; -#else - /* value(rv) = */ rounded_product(value(rv), - tens[e]); -#endif - goto ret; - } - } -#ifndef Inaccurate_Divide - else if (e >= -Ten_pmax) { - /* value(rv) = */ rounded_quotient(value(rv), - tens[-e]); - goto ret; - } -#endif - } - e1 += nd - k; - - /* Get starting approximation = rv * 10**e1 */ - - if (e1 > 0) { - if ((i = e1 & 15)) - value(rv) *= tens[i]; - if (e1 &= ~15) { - if (e1 > DBL_MAX_10_EXP) { - ovfl: - errno = ERANGE; -#ifndef Bad_float_h - value(rv) = HUGE_VAL; -#else - /* Can't trust HUGE_VAL */ -#ifdef IEEE_Arith - word0(rv) = Exp_mask; - word1(rv) = 0; -#else - word0(rv) = Big0; - word1(rv) = Big1; -#endif -#endif - if (bd0) - goto retfree; - goto ret; - } - if (e1 >>= 4) { - for(j = 0; e1 > 1; j++, e1 >>= 1) - if (e1 & 1) - value(rv) *= bigtens[j]; - /* The last multiplication could overflow. */ - word0(rv) -= P*Exp_msk1; - value(rv) *= bigtens[j]; - if ((z = word0(rv) & Exp_mask) - > Exp_msk1*(DBL_MAX_EXP+Bias-P)) - goto ovfl; - if (z > Exp_msk1*(DBL_MAX_EXP+Bias-1-P)) { - /* set to largest number */ - /* (Can't trust DBL_MAX) */ - word0(rv) = Big0; - word1(rv) = Big1; - } - else - word0(rv) += P*Exp_msk1; - } - - } - } - else if (e1 < 0) { - e1 = -e1; - if ((i = e1 & 15)) - value(rv) /= tens[i]; - if (e1 &= ~15) { - e1 >>= 4; - if (e1 >= 1 << n_bigtens) - goto undfl; - for(j = 0; e1 > 1; j++, e1 >>= 1) - if (e1 & 1) - value(rv) *= tinytens[j]; - /* The last multiplication could underflow. */ - value(rv0) = value(rv); - value(rv) *= tinytens[j]; - if (!value(rv)) { - value(rv) = 2.*value(rv0); - value(rv) *= tinytens[j]; - if (!value(rv)) { - undfl: - value(rv) = 0.; - errno = ERANGE; - if (bd0) - goto retfree; - goto ret; - } - word0(rv) = Tiny0; - word1(rv) = Tiny1; - /* The refinement below will clean - * this approximation up. - */ - } - } - } - - /* Now the hard part -- adjusting rv to the correct value.*/ - - /* Put digits into bd: true value = bd * 10^e */ - - bd0 = s2b(s0, nd0, nd, y); - - for(;;) { - bd = Balloc(bd0->k); - Bcopy(bd, bd0); - bb = d2b(value(rv), &bbe, &bbbits); /* rv = bb * 2^bbe */ - bs = i2b(1); - - if (e >= 0) { - bb2 = bb5 = 0; - bd2 = bd5 = e; - } - else { - bb2 = bb5 = -e; - bd2 = bd5 = 0; - } - if (bbe >= 0) - bb2 += bbe; - else - bd2 -= bbe; - bs2 = bb2; -#ifdef Sudden_Underflow -#ifdef IBM - j = 1 + 4*P - 3 - bbbits + ((bbe + bbbits - 1) & 3); -#else - j = P + 1 - bbbits; -#endif -#else - i = bbe + bbbits - 1; /* logb(rv) */ - if (i < Emin) /* denormal */ - j = bbe + (P-Emin); - else - j = P + 1 - bbbits; -#endif - bb2 += j; - bd2 += j; - i = bb2 < bd2 ? bb2 : bd2; - if (i > bs2) - i = bs2; - if (i > 0) { - bb2 -= i; - bd2 -= i; - bs2 -= i; - } - if (bb5 > 0) { - bs = pow5mult(bs, bb5); - bb1 = mult(bs, bb); - Bfree(bb); - bb = bb1; - } - if (bb2 > 0) - bb = lshift(bb, bb2); - if (bd5 > 0) - bd = pow5mult(bd, bd5); - if (bd2 > 0) - bd = lshift(bd, bd2); - if (bs2 > 0) - bs = lshift(bs, bs2); - delta = diff(bb, bd); - dsign = delta->sign; - delta->sign = 0; - i = cmp(delta, bs); - if (i < 0) { - /* Error is less than half an ulp -- check for - * special case of mantissa a power of two. - */ - if (dsign || word1(rv) || word0(rv) & Bndry_mask) - break; - delta = lshift(delta,Log2P); - if (cmp(delta, bs) > 0) - goto drop_down; - break; - } - if (i == 0) { - /* exactly half-way between */ - if (dsign) { - if ((word0(rv) & Bndry_mask1) == Bndry_mask1 - && word1(rv) == 0xffffffff) { - /*boundary case -- increment exponent*/ - word0(rv) = (word0(rv) & Exp_mask) - + Exp_msk1 -#ifdef IBM - | Exp_msk1 >> 4 -#endif - ; - word1(rv) = 0; - break; - } - } - else if (!(word0(rv) & Bndry_mask) && !word1(rv)) { - drop_down: - /* boundary case -- decrement exponent */ -#ifdef Sudden_Underflow - L = word0(rv) & Exp_mask; -#ifdef IBM - if (L < Exp_msk1) -#else - if (L <= Exp_msk1) -#endif - goto undfl; - L -= Exp_msk1; -#else - L = (word0(rv) & Exp_mask) - Exp_msk1; -#endif - word0(rv) = L | Bndry_mask1; - word1(rv) = 0xffffffff; -#ifdef IBM - goto cont; -#else - break; -#endif - } -#ifndef ROUND_BIASED - if (!(word1(rv) & LSB)) - break; -#endif - if (dsign) - value(rv) += ulp(value(rv)); -#ifndef ROUND_BIASED - else { - value(rv) -= ulp(value(rv)); -#ifndef Sudden_Underflow - if (!value(rv)) - goto undfl; -#endif - } -#endif - break; - } - if ((aadj = ratio(delta, bs)) <= 2.) { - if (dsign) - aadj = aadj1 = 1.; - else if (word1(rv) || word0(rv) & Bndry_mask) { -#ifndef Sudden_Underflow - if (word1(rv) == Tiny1 && !word0(rv)) - goto undfl; -#endif - aadj = 1.; - aadj1 = -1.; - } - else { - /* special case -- power of FLT_RADIX to be */ - /* rounded down... */ - - if (aadj < 2./FLT_RADIX) - aadj = 1./FLT_RADIX; - else - aadj *= 0.5; - aadj1 = -aadj; - } - } - else { - aadj *= 0.5; - aadj1 = dsign ? aadj : -aadj; -#ifdef Check_FLT_ROUNDS - switch(FLT_ROUNDS) { - case 2: /* towards +infinity */ - aadj1 -= 0.5; - break; - case 0: /* towards 0 */ - case 3: /* towards -infinity */ - aadj1 += 0.5; - } -#else - if (FLT_ROUNDS == 0) - aadj1 += 0.5; -#endif - } - y = word0(rv) & Exp_mask; - - /* Check for overflow */ - - if (y == Exp_msk1*(DBL_MAX_EXP+Bias-1)) { - value(rv0) = value(rv); - word0(rv) -= P*Exp_msk1; - adj = aadj1 * ulp(value(rv)); - value(rv) += adj; - if ((word0(rv) & Exp_mask) >= - Exp_msk1*(DBL_MAX_EXP+Bias-P)) { - if (word0(rv0) == Big0 && word1(rv0) == Big1) - goto ovfl; - word0(rv) = Big0; - word1(rv) = Big1; - goto cont; - } - else - word0(rv) += P*Exp_msk1; - } - else { -#ifdef Sudden_Underflow - if ((word0(rv) & Exp_mask) <= P*Exp_msk1) { - value(rv0) = value(rv); - word0(rv) += P*Exp_msk1; - adj = aadj1 * ulp(value(rv)); - value(rv) += adj; -#ifdef IBM - if ((word0(rv) & Exp_mask) < P*Exp_msk1) -#else - if ((word0(rv) & Exp_mask) <= P*Exp_msk1) -#endif - { - if (word0(rv0) == Tiny0 - && word1(rv0) == Tiny1) - goto undfl; - word0(rv) = Tiny0; - word1(rv) = Tiny1; - goto cont; - } - else - word0(rv) -= P*Exp_msk1; - } - else { - adj = aadj1 * ulp(value(rv)); - value(rv) += adj; - } -#else - /* Compute adj so that the IEEE rounding rules will - * correctly round rv + adj in some half-way cases. - * If rv * ulp(rv) is denormalized (i.e., - * y <= (P-1)*Exp_msk1), we must adjust aadj to avoid - * trouble from bits lost to denormalization; - * example: 1.2e-307 . - */ - if (y <= (P-1)*Exp_msk1 && aadj >= 1.) { - aadj1 = (double)(int)(aadj + 0.5); - if (!dsign) - aadj1 = -aadj1; - } - adj = aadj1 * ulp(value(rv)); - value(rv) += adj; -#endif - } - z = word0(rv) & Exp_mask; - if (y == z) { - /* Can we stop now? */ - L = aadj; - aadj -= L; - /* The tolerances below are conservative. */ - if (dsign || word1(rv) || word0(rv) & Bndry_mask) { - if (aadj < .4999999 || aadj > .5000001) - break; - } - else if (aadj < .4999999/FLT_RADIX) - break; - } - cont: - Bfree(bb); - Bfree(bd); - Bfree(bs); - Bfree(delta); - } - retfree: - Bfree(bb); - Bfree(bd); - Bfree(bs); - Bfree(bd0); - Bfree(delta); - ret: - if (se) - *se = (char *)s; - result = sign ? -value(rv) : value(rv); - - for (i = 0; i <= Kmax; i++) { - Bigint **listp = &freelist[i]; - while ((tmp = *listp) != NULL) { - *listp = tmp->next; - free(tmp); - } - freelist[i] = NULL; - } - - while (p5s) { - tmp = p5s; - p5s = p5s->next; - free(tmp); - } - - return result; - } diff --git a/Zend/zend_strtod.h b/Zend/zend_strtod.h deleted file mode 100644 index c5c94a57e8..0000000000 --- a/Zend/zend_strtod.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Derick Rethans | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* This is a header file for the strtod implementation by David M. Gay which - * can be found in zend_strtod.c */ -#ifndef ZEND_STRTOD_H -#define ZEND_STRTOD_H -#include - -BEGIN_EXTERN_C() -ZEND_API double zend_strtod(const char *s00, char **se); -END_EXTERN_C() - -#endif diff --git a/Zend/zend_ts_hash.c b/Zend/zend_ts_hash.c deleted file mode 100644 index 192ca145fe..0000000000 --- a/Zend/zend_ts_hash.c +++ /dev/null @@ -1,365 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Harald Radi | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include "zend.h" -#include "zend_ts_hash.h" - -/* ts management functions */ -static void begin_read(TsHashTable *ht) -{ -#ifdef ZTS - tsrm_mutex_lock(ht->mx_reader); - if ((++(ht->reader)) == 1) { - tsrm_mutex_lock(ht->mx_writer); - } - tsrm_mutex_unlock(ht->mx_reader); -#endif -} - -static void end_read(TsHashTable *ht) -{ -#ifdef ZTS - tsrm_mutex_lock(ht->mx_reader); - if ((--(ht->reader)) == 0) { - tsrm_mutex_unlock(ht->mx_writer); - } - tsrm_mutex_unlock(ht->mx_reader); -#endif -} - -static void begin_write(TsHashTable *ht) -{ -#ifdef ZTS - tsrm_mutex_lock(ht->mx_writer); -#endif -} - -static void end_write(TsHashTable *ht) -{ -#ifdef ZTS - tsrm_mutex_unlock(ht->mx_writer); -#endif -} - -/* delegates */ -ZEND_API int _zend_ts_hash_init(TsHashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC) -{ -#ifdef ZTS - ht->mx_reader = tsrm_mutex_alloc(); - ht->mx_writer = tsrm_mutex_alloc(); - ht->reader = 0; -#endif - return _zend_hash_init(TS_HASH(ht), nSize, pHashFunction, pDestructor, persistent ZEND_FILE_LINE_RELAY_CC); -} - -ZEND_API int _zend_ts_hash_init_ex(TsHashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC) -{ -#ifdef ZTS - ht->mx_reader = tsrm_mutex_alloc(); - ht->mx_writer = tsrm_mutex_alloc(); - ht->reader = 0; -#endif - return _zend_hash_init_ex(TS_HASH(ht), nSize, pHashFunction, pDestructor, persistent, bApplyProtection ZEND_FILE_LINE_RELAY_CC); -} - -ZEND_API void zend_ts_hash_destroy(TsHashTable *ht) -{ -#ifdef ZTS - tsrm_mutex_free(ht->mx_reader); - tsrm_mutex_free(ht->mx_writer); -#endif - zend_hash_destroy(TS_HASH(ht)); -} - -ZEND_API void zend_ts_hash_clean(TsHashTable *ht) -{ - ht->reader = 0; - zend_hash_clean(TS_HASH(ht)); -} - -ZEND_API int _zend_ts_hash_add_or_update(TsHashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC) -{ - int retval; - - begin_write(ht); - retval = _zend_hash_add_or_update(TS_HASH(ht), arKey, nKeyLength, pData, nDataSize, pDest, flag ZEND_FILE_LINE_RELAY_CC); - end_write(ht); - - return retval; -} - -ZEND_API int _zend_ts_hash_quick_add_or_update(TsHashTable *ht, char *arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC) -{ - int retval; - - begin_write(ht); - retval = _zend_hash_quick_add_or_update(TS_HASH(ht), arKey, nKeyLength, h, pData, nDataSize, pDest, flag ZEND_FILE_LINE_RELAY_CC); - end_write(ht); - - return retval; -} - -ZEND_API int _zend_ts_hash_index_update_or_next_insert(TsHashTable *ht, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC) -{ - int retval; - - begin_write(ht); - retval = _zend_hash_index_update_or_next_insert(TS_HASH(ht), h, pData, nDataSize, pDest, flag ZEND_FILE_LINE_RELAY_CC); - end_write(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_add_empty_element(TsHashTable *ht, char *arKey, uint nKeyLength) -{ - int retval; - - begin_write(ht); - retval = zend_hash_add_empty_element(TS_HASH(ht), arKey, nKeyLength); - end_write(ht); - - return retval; -} - -ZEND_API void zend_ts_hash_graceful_destroy(TsHashTable *ht) -{ -#ifdef ZTS - tsrm_mutex_free(ht->mx_reader); - tsrm_mutex_free(ht->mx_reader); -#endif - zend_hash_graceful_destroy(TS_HASH(ht)); -} - -ZEND_API void zend_ts_hash_apply(TsHashTable *ht, apply_func_t apply_func TSRMLS_DC) -{ - begin_write(ht); - zend_hash_apply(TS_HASH(ht), apply_func TSRMLS_CC); - end_write(ht); -} - -ZEND_API void zend_ts_hash_apply_with_argument(TsHashTable *ht, apply_func_arg_t apply_func, void *argument TSRMLS_DC) -{ - begin_write(ht); - zend_hash_apply_with_argument(TS_HASH(ht), apply_func, argument TSRMLS_CC); - end_write(ht); -} - -ZEND_API void zend_ts_hash_apply_with_arguments(TsHashTable *ht, apply_func_args_t apply_func, int num_args, ...) -{ - va_list args; - - va_start(args, num_args); - begin_write(ht); - zend_hash_apply_with_arguments(TS_HASH(ht), apply_func, num_args, args); - end_write(ht); - va_end(args); -} - -ZEND_API void zend_ts_hash_reverse_apply(TsHashTable *ht, apply_func_t apply_func TSRMLS_DC) -{ - begin_write(ht); - zend_hash_reverse_apply(TS_HASH(ht), apply_func TSRMLS_CC); - end_write(ht); -} - -ZEND_API int zend_ts_hash_del_key_or_index(TsHashTable *ht, char *arKey, uint nKeyLength, ulong h, int flag) -{ - int retval; - - begin_write(ht); - retval = zend_hash_del_key_or_index(TS_HASH(ht), arKey, nKeyLength, h, flag); - end_write(ht); - - return retval; -} - -ZEND_API ulong zend_ts_get_hash_value(TsHashTable *ht, char *arKey, uint nKeyLength) -{ - ulong retval; - - begin_read(ht); - retval = zend_get_hash_value(arKey, nKeyLength); - end_read(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_find(TsHashTable *ht, char *arKey, uint nKeyLength, void **pData) -{ - int retval; - - begin_read(ht); - retval = zend_hash_find(TS_HASH(ht), arKey, nKeyLength, pData); - end_read(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_quick_find(TsHashTable *ht, char *arKey, uint nKeyLength, ulong h, void **pData) -{ - int retval; - - begin_read(ht); - retval = zend_hash_quick_find(TS_HASH(ht), arKey, nKeyLength, h, pData); - end_read(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_index_find(TsHashTable *ht, ulong h, void **pData) -{ - int retval; - - begin_read(ht); - retval = zend_hash_index_find(TS_HASH(ht), h, pData); - end_read(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_exists(TsHashTable *ht, char *arKey, uint nKeyLength) -{ - int retval; - - begin_read(ht); - retval = zend_hash_exists(TS_HASH(ht), arKey, nKeyLength); - end_read(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_index_exists(TsHashTable *ht, ulong h) -{ - int retval; - - begin_read(ht); - retval = zend_hash_index_exists(TS_HASH(ht), h); - end_read(ht); - - return retval; -} - -ZEND_API void zend_ts_hash_copy(TsHashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size) -{ - begin_read(source); - begin_write(target); - zend_hash_copy(TS_HASH(target), TS_HASH(source), pCopyConstructor, tmp, size); - end_write(target); - end_read(source); -} - -ZEND_API void zend_ts_hash_merge(TsHashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size, int overwrite) -{ - begin_read(source); - begin_write(target); - zend_hash_merge(TS_HASH(target), TS_HASH(source), pCopyConstructor, tmp, size, overwrite); - end_write(target); - end_read(source); -} - -ZEND_API void zend_ts_hash_merge_ex(TsHashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor, uint size, merge_checker_func_t pMergeSource, void *pParam) -{ - begin_read(source); - begin_write(target); - zend_hash_merge_ex(TS_HASH(target), TS_HASH(source), pCopyConstructor, size, pMergeSource, pParam); - end_write(target); - end_read(source); -} - -ZEND_API int zend_ts_hash_sort(TsHashTable *ht, sort_func_t sort_func, compare_func_t compare_func, int renumber TSRMLS_DC) -{ - int retval; - - begin_write(ht); - retval = zend_hash_sort(TS_HASH(ht), sort_func, compare_func, renumber TSRMLS_CC); - end_write(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_compare(TsHashTable *ht1, TsHashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC) -{ - int retval; - - begin_read(ht1); - begin_read(ht2); - retval = zend_hash_compare(TS_HASH(ht1), TS_HASH(ht2), compar, ordered TSRMLS_CC); - end_read(ht2); - end_read(ht1); - - return retval; -} - -ZEND_API int zend_ts_hash_minmax(TsHashTable *ht, compare_func_t compar, int flag, void **pData TSRMLS_DC) -{ - int retval; - - begin_read(ht); - retval = zend_hash_minmax(TS_HASH(ht), compar, flag, pData TSRMLS_CC); - end_read(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_num_elements(TsHashTable *ht) -{ - int retval; - - begin_read(ht); - retval = zend_hash_num_elements(TS_HASH(ht)); - end_read(ht); - - return retval; -} - -ZEND_API int zend_ts_hash_rehash(TsHashTable *ht) -{ - int retval; - - begin_write(ht); - retval = zend_hash_rehash(TS_HASH(ht)); - end_write(ht); - - return retval; -} - -#if ZEND_DEBUG -void zend_ts_hash_display_pListTail(TsHashTable *ht) -{ - begin_read(ht); - zend_hash_display_pListTail(TS_HASH(ht)); - end_read(ht); -} - -void zend_ts_hash_display(TsHashTable *ht) -{ - begin_read(ht); - zend_hash_display(TS_HASH(ht)); - end_read(ht); -} -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_ts_hash.h b/Zend/zend_ts_hash.h deleted file mode 100644 index da3be8f175..0000000000 --- a/Zend/zend_ts_hash.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Harald Radi | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_TS_HASH_H -#define ZEND_TS_HASH_H - -#include "zend.h" - -typedef struct _zend_ts_hashtable { - HashTable hash; - zend_uint reader; -#ifdef ZTS - MUTEX_T mx_reader; - MUTEX_T mx_writer; -#endif -} TsHashTable; - -BEGIN_EXTERN_C() - -#define TS_HASH(table) (&(table->hash)) - -/* startup/shutdown */ -ZEND_API int _zend_ts_hash_init(TsHashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC); -ZEND_API int _zend_ts_hash_init_ex(TsHashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC); -ZEND_API void zend_ts_hash_destroy(TsHashTable *ht); -ZEND_API void zend_ts_hash_clean(TsHashTable *ht); - -#define zend_ts_hash_init(ht, nSize, pHashFunction, pDestructor, persistent) \ - _zend_ts_hash_init(ht, nSize, pHashFunction, pDestructor, persistent ZEND_FILE_LINE_CC) -#define zend_ts_hash_init_ex(ht, nSize, pHashFunction, pDestructor, persistent, bApplyProtection) \ - _zend_ts_hash_init_ex(ht, nSize, pHashFunction, pDestructor, persistent, bApplyProtection ZEND_FILE_LINE_CC) - - -/* additions/updates/changes */ -ZEND_API int _zend_ts_hash_add_or_update(TsHashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC); -#define zend_ts_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest) \ - _zend_ts_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC) -#define zend_ts_hash_add(ht, arKey, nKeyLength, pData, nDataSize, pDest) \ - _zend_ts_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_ADD ZEND_FILE_LINE_CC) - -ZEND_API int _zend_ts_hash_quick_add_or_update(TsHashTable *ht, char *arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC); -#define zend_ts_hash_quick_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest) \ - _zend_ts_hash_quick_add_or_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC) -#define zend_ts_hash_quick_add(ht, arKey, nKeyLength, h, pData, nDataSize, pDest) \ - _zend_ts_hash_quick_add_or_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest, HASH_ADD ZEND_FILE_LINE_CC) - -ZEND_API int _zend_ts_hash_index_update_or_next_insert(TsHashTable *ht, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC); -#define zend_ts_hash_index_update(ht, h, pData, nDataSize, pDest) \ - _zend_ts_hash_index_update_or_next_insert(ht, h, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC) -#define zend_ts_hash_next_index_insert(ht, pData, nDataSize, pDest) \ - _zend_ts_hash_index_update_or_next_insert(ht, 0, pData, nDataSize, pDest, HASH_NEXT_INSERT ZEND_FILE_LINE_CC) - -ZEND_API int zend_ts_hash_add_empty_element(TsHashTable *ht, char *arKey, uint nKeyLength); - -ZEND_API void zend_ts_hash_graceful_destroy(TsHashTable *ht); -ZEND_API void zend_ts_hash_apply(TsHashTable *ht, apply_func_t apply_func TSRMLS_DC); -ZEND_API void zend_ts_hash_apply_with_argument(TsHashTable *ht, apply_func_arg_t apply_func, void * TSRMLS_DC); -ZEND_API void zend_ts_hash_apply_with_arguments(TsHashTable *ht, apply_func_args_t apply_func, int, ...); - -ZEND_API void zend_ts_hash_reverse_apply(TsHashTable *ht, apply_func_t apply_func TSRMLS_DC); - - -/* Deletes */ -ZEND_API int zend_ts_hash_del_key_or_index(TsHashTable *ht, char *arKey, uint nKeyLength, ulong h, int flag); -#define zend_ts_hash_del(ht, arKey, nKeyLength) \ - zend_ts_hash_del_key_or_index(ht, arKey, nKeyLength, 0, HASH_DEL_KEY) -#define zend_ts_hash_index_del(ht, h) \ - zend_ts_hash_del_key_or_index(ht, NULL, 0, h, HASH_DEL_INDEX) - -ZEND_API ulong zend_ts_get_hash_value(TsHashTable *ht, char *arKey, uint nKeyLength); - -/* Data retreival */ -ZEND_API int zend_ts_hash_find(TsHashTable *ht, char *arKey, uint nKeyLength, void **pData); -ZEND_API int zend_ts_hash_quick_find(TsHashTable *ht, char *arKey, uint nKeyLength, ulong h, void **pData); -ZEND_API int zend_ts_hash_index_find(TsHashTable *ht, ulong h, void **pData); - -/* Misc */ -ZEND_API int zend_ts_hash_exists(TsHashTable *ht, char *arKey, uint nKeyLength); -ZEND_API int zend_ts_hash_index_exists(TsHashTable *ht, ulong h); - -/* Copying, merging and sorting */ -ZEND_API void zend_ts_hash_copy(TsHashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size); -ZEND_API void zend_ts_hash_merge(TsHashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size, int overwrite); -ZEND_API void zend_ts_hash_merge_ex(TsHashTable *target, TsHashTable *source, copy_ctor_func_t pCopyConstructor, uint size, merge_checker_func_t pMergeSource, void *pParam); -ZEND_API int zend_ts_hash_sort(TsHashTable *ht, sort_func_t sort_func, compare_func_t compare_func, int renumber TSRMLS_DC); -ZEND_API int zend_ts_hash_compare(TsHashTable *ht1, TsHashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC); -ZEND_API int zend_ts_hash_minmax(TsHashTable *ht, compare_func_t compar, int flag, void **pData TSRMLS_DC); - -ZEND_API int zend_ts_hash_num_elements(TsHashTable *ht); - -ZEND_API int zend_ts_hash_rehash(TsHashTable *ht); - -ZEND_API ulong zend_ts_hash_func(char *arKey, uint nKeyLength); - -#if ZEND_DEBUG -/* debug */ -void zend_ts_hash_display_pListTail(TsHashTable *ht); -void zend_ts_hash_display(TsHashTable *ht); -#endif - -END_EXTERN_C() - -#define ZEND_TS_INIT_SYMTABLE(ht) \ - ZEND_TS_INIT_SYMTABLE_EX(ht, 2, 0) - -#define ZEND_TS_INIT_SYMTABLE_EX(ht, n, persistent) \ - zend_ts_hash_init(ht, n, NULL, ZVAL_PTR_DTOR, persistent) - -#endif /* ZEND_HASH_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_types.h b/Zend/zend_types.h deleted file mode 100644 index f6b306a5b3..0000000000 --- a/Zend/zend_types.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_TYPES_H -#define ZEND_TYPES_H - -typedef unsigned char zend_bool; -typedef unsigned char zend_uchar; -typedef unsigned int zend_uint; -typedef unsigned long zend_ulong; -typedef unsigned short zend_ushort; - -typedef unsigned int zend_object_handle; -typedef struct _zend_object_handlers zend_object_handlers; - -typedef struct _zend_object_value { - zend_object_handle handle; - zend_object_handlers *handlers; -} zend_object_value; - -#endif /* ZEND_TYPES_H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c deleted file mode 100644 index 0b7143ac4b..0000000000 --- a/Zend/zend_variables.c +++ /dev/null @@ -1,191 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include -#include "zend.h" -#include "zend_API.h" -#include "zend_globals.h" -#include "zend_constants.h" -#include "zend_list.h" - - -ZEND_API void _zval_dtor_func(zval *zvalue ZEND_FILE_LINE_DC) -{ - switch (zvalue->type & ~IS_CONSTANT_INDEX) { - case IS_STRING: - case IS_CONSTANT: - CHECK_ZVAL_STRING_REL(zvalue); - STR_FREE_REL(zvalue->value.str.val); - break; - case IS_ARRAY: - case IS_CONSTANT_ARRAY: { - TSRMLS_FETCH(); - - if (zvalue->value.ht && (zvalue->value.ht != &EG(symbol_table))) { - zend_hash_destroy(zvalue->value.ht); - FREE_HASHTABLE(zvalue->value.ht); - } - } - break; - case IS_OBJECT: - { - TSRMLS_FETCH(); - - Z_OBJ_HT_P(zvalue)->del_ref(zvalue TSRMLS_CC); - } - break; - case IS_RESOURCE: - { - TSRMLS_FETCH(); - - /* destroy resource */ - zend_list_delete(zvalue->value.lval); - } - break; - case IS_LONG: - case IS_DOUBLE: - case IS_BOOL: - case IS_NULL: - default: - return; - break; - } -} - - -ZEND_API void _zval_internal_dtor(zval *zvalue ZEND_FILE_LINE_DC) -{ - switch (zvalue->type & ~IS_CONSTANT_INDEX) { - case IS_STRING: - case IS_CONSTANT: - CHECK_ZVAL_STRING_REL(zvalue); - free(zvalue->value.str.val); - break; - case IS_ARRAY: - case IS_CONSTANT_ARRAY: - case IS_OBJECT: - case IS_RESOURCE: - zend_error(E_CORE_ERROR, "Internal zval's can't be arrays, objects or resources"); - break; - case IS_LONG: - case IS_DOUBLE: - case IS_BOOL: - case IS_NULL: - default: - break; - } -} - - -ZEND_API void zval_add_ref(zval **p) -{ - (*p)->refcount++; -} - - -ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC) -{ - switch (zvalue->type) { - case IS_RESOURCE: { - TSRMLS_FETCH(); - - zend_list_addref(zvalue->value.lval); - } - break; - case IS_BOOL: - case IS_LONG: - case IS_NULL: - break; - case IS_CONSTANT: - case IS_STRING: - CHECK_ZVAL_STRING_REL(zvalue); - zvalue->value.str.val = (char *) estrndup_rel(zvalue->value.str.val, zvalue->value.str.len); - break; - case IS_ARRAY: - case IS_CONSTANT_ARRAY: { - zval *tmp; - HashTable *original_ht = zvalue->value.ht; - HashTable *tmp_ht = NULL; - TSRMLS_FETCH(); - - if (zvalue->value.ht == &EG(symbol_table)) { - return; /* do nothing */ - } - ALLOC_HASHTABLE_REL(tmp_ht); - zend_hash_init(tmp_ht, zend_hash_num_elements(original_ht), NULL, ZVAL_PTR_DTOR, 0); - zend_hash_copy(tmp_ht, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); - zvalue->value.ht = tmp_ht; - } - break; - case IS_OBJECT: - { - TSRMLS_FETCH(); - Z_OBJ_HT_P(zvalue)->add_ref(zvalue TSRMLS_CC); - } - break; - } -} - - -ZEND_API int zend_print_variable(zval *var) -{ - return zend_print_zval(var, 0); -} - - -#if ZEND_DEBUG -ZEND_API void _zval_copy_ctor_wrapper(zval *zvalue) -{ - zval_copy_ctor(zvalue); -} - - -ZEND_API void _zval_dtor_wrapper(zval *zvalue) -{ - zval_dtor(zvalue); -} - - -ZEND_API void _zval_internal_dtor_wrapper(zval *zvalue) -{ - zval_internal_dtor(zvalue); -} - - -ZEND_API void _zval_ptr_dtor_wrapper(zval **zval_ptr) -{ - zval_ptr_dtor(zval_ptr); -} - - -ZEND_API void _zval_internal_ptr_dtor_wrapper(zval **zval_ptr) -{ - zval_internal_ptr_dtor(zval_ptr); -} -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_variables.h b/Zend/zend_variables.h deleted file mode 100644 index 8797eaf375..0000000000 --- a/Zend/zend_variables.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_VARIABLES_H -#define ZEND_VARIABLES_H - - -BEGIN_EXTERN_C() - -ZEND_API void _zval_dtor_func(zval *zvalue ZEND_FILE_LINE_DC); - -static inline void _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC) -{ - if (zvalue->type <= IS_BOOL) { - return; - } - _zval_dtor_func(zvalue ZEND_FILE_LINE_CC); -} - -ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC); - -static inline void _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC) -{ - if (zvalue->type <= IS_BOOL) { - return; - } - _zval_copy_ctor_func(zvalue ZEND_FILE_LINE_CC); -} - - -ZEND_API int zend_print_variable(zval *var); -ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC); -ZEND_API void _zval_internal_dtor(zval *zvalue ZEND_FILE_LINE_DC); -ZEND_API void _zval_internal_ptr_dtor(zval **zvalue ZEND_FILE_LINE_DC); -#define zval_copy_ctor(zvalue) _zval_copy_ctor((zvalue) ZEND_FILE_LINE_CC) -#define zval_dtor(zvalue) _zval_dtor((zvalue) ZEND_FILE_LINE_CC) -#define zval_ptr_dtor(zval_ptr) _zval_ptr_dtor((zval_ptr) ZEND_FILE_LINE_CC) -#define zval_internal_dtor(zvalue) _zval_internal_dtor((zvalue) ZEND_FILE_LINE_CC) -#define zval_internal_ptr_dtor(zvalue) _zval_internal_ptr_dtor((zvalue) ZEND_FILE_LINE_CC) - -#if ZEND_DEBUG -ZEND_API void _zval_copy_ctor_wrapper(zval *zvalue); -ZEND_API void _zval_dtor_wrapper(zval *zvalue); -ZEND_API void _zval_ptr_dtor_wrapper(zval **zval_ptr); -ZEND_API void _zval_internal_dtor_wrapper(zval *zvalue); -ZEND_API void _zval_internal_ptr_dtor_wrapper(zval **zvalue); -#define zval_copy_ctor_wrapper _zval_copy_ctor_wrapper -#define zval_dtor_wrapper _zval_dtor_wrapper -#define zval_ptr_dtor_wrapper _zval_ptr_dtor_wrapper -#define zval_internal_dtor_wrapper _zval_internal_dtor_wrapper -#define zval_internal_ptr_dtor_wrapper _zval_internal_ptr_dtor_wrapper -#else -#define zval_copy_ctor_wrapper _zval_copy_ctor_func -#define zval_dtor_wrapper _zval_dtor_func -#define zval_ptr_dtor_wrapper _zval_ptr_dtor -#define zval_internal_dtor_wrapper _zval_internal_dtor -#define zval_internal_ptr_dtor_wrapper _zval_internal_ptr_dtor -#endif - -ZEND_API void zval_add_ref(zval **p); - -END_EXTERN_C() - -#define ZVAL_DESTRUCTOR (void (*)(void *)) zval_dtor_wrapper -#define ZVAL_PTR_DTOR (void (*)(void *)) zval_ptr_dtor_wrapper -#define ZVAL_INTERNAL_DTOR (void (*)(void *)) zval_internal_dtor_wrapper -#define ZVAL_INTERNAL_PTR_DTOR (void (*)(void *)) zval_internal_ptr_dtor_wrapper -#define ZVAL_COPY_CTOR (void (*)(void *)) zval_copy_ctor_wrapper - -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/Zend/zend_vm.h b/Zend/zend_vm.h deleted file mode 100644 index 6e60cc82d2..0000000000 --- a/Zend/zend_vm.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#ifndef ZEND_VM_H -#define ZEND_VM_H - -ZEND_API void zend_vm_use_old_executor(); -ZEND_API void zend_vm_set_opcode_handler(zend_op* opcode); - -#define ZEND_VM_SET_OPCODE_HANDLER(opline) zend_vm_set_opcode_handler(opline) - -#endif diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h deleted file mode 100644 index ef44ed108a..0000000000 --- a/Zend/zend_vm_def.h +++ /dev/null @@ -1,3826 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - | Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* If you change this file, please regenerate the zend_vm_execute.h and - * zend_vm_opcodes.h files by running: - * php zend_vm_gen.php - */ - -ZEND_VM_HANDLER(1, ZEND_ADD, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(2, ZEND_SUB, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(3, ZEND_MUL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(4, ZEND_DIV, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(5, ZEND_MOD, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(6, ZEND_SL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(7, ZEND_SR, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(8, ZEND_CONCAT, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(15, ZEND_IS_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(16, ZEND_IS_NOT_IDENTICAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(17, ZEND_IS_EQUAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(18, ZEND_IS_NOT_EQUAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(19, ZEND_IS_SMALLER, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(20, ZEND_IS_SMALLER_OR_EQUAL, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(9, ZEND_BW_OR, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(10, ZEND_BW_AND, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(11, ZEND_BW_XOR, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(14, ZEND_BOOL_XOR, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(12, ZEND_BW_NOT, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_not_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(13, ZEND_BOOL_NOT, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - boolean_not_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - FREE_OP1(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV, int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC)) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1, free_op2, free_op_data1; - zval **object_ptr = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W); - zval *object; - zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - FREE_OP2(); - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&property); - } else { - FREE_OP2(); - } - FREE_OP(free_op_data1); - } - - FREE_OP1_VAR_PTR(); - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HELPER_EX(zend_binary_assign_op_helper, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV, int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC)) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_obj_helper, binary_op, binary_op); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W); - - if (OP1_TYPE != IS_CV && !OP1_FREE) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (Z_TYPE_PP(object_ptr) == IS_OBJECT) { - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_obj_helper, binary_op, binary_op); - } else { - zend_op *op_data = opline+1; - zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW), dim, IS_OP2_TMP_FREE(), BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = GET_OP2_ZVAL_PTR(BP_VAR_R); - var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - FREE_OP2(); - FREE_OP1_VAR_PTR(); - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - FREE_OP2(); - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(23, ZEND_ASSIGN_ADD, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, add_function); -} - -ZEND_VM_HANDLER(24, ZEND_ASSIGN_SUB, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, sub_function); -} - -ZEND_VM_HANDLER(25, ZEND_ASSIGN_MUL, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, mul_function); -} - -ZEND_VM_HANDLER(26, ZEND_ASSIGN_DIV, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, div_function); -} - -ZEND_VM_HANDLER(27, ZEND_ASSIGN_MOD, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, mod_function); -} - -ZEND_VM_HANDLER(28, ZEND_ASSIGN_SL, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, shift_left_function); -} - -ZEND_VM_HANDLER(29, ZEND_ASSIGN_SR, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, shift_right_function); -} - -ZEND_VM_HANDLER(30, ZEND_ASSIGN_CONCAT, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, concat_function); -} - -ZEND_VM_HANDLER(31, ZEND_ASSIGN_BW_OR, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, bitwise_or_function); -} - -ZEND_VM_HANDLER(32, ZEND_ASSIGN_BW_AND, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, bitwise_and_function); -} - -ZEND_VM_HANDLER(33, ZEND_ASSIGN_BW_XOR, VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_binary_assign_op_helper, binary_op, bitwise_xor_function); -} - -ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR|CV, incdec_t incdec_op) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **object_ptr = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W); - zval *object; - zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - FREE_OP2(); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&property); - } else { - FREE_OP2(); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(132, ZEND_PRE_INC_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_pre_incdec_property_helper, incdec_op, increment_function); -} - -ZEND_VM_HANDLER(133, ZEND_PRE_DEC_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_pre_incdec_property_helper, incdec_op, decrement_function); -} - -ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMP|VAR|CV, incdec_t incdec_op) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **object_ptr = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W); - zval *object; - zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - FREE_OP2(); - *retval = *EG(uninitialized_zval_ptr); - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - zval *z_copy; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&property); - } else { - FREE_OP2(); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(134, ZEND_POST_INC_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_post_incdec_property_helper, incdec_op, increment_function); -} - -ZEND_VM_HANDLER(135, ZEND_POST_DEC_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_post_incdec_property_helper, incdec_op, decrement_function); -} - -ZEND_VM_HANDLER(34, ZEND_PRE_INC, VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - increment_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - increment_function(*var_ptr); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(35, ZEND_PRE_DEC, VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - decrement_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - decrement_function(*var_ptr); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(36, ZEND_POST_INC, VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).tmp_var = *EG(uninitialized_zval_ptr); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); - } - - EX_T(opline->result.u.var).tmp_var = **var_ptr; - zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var); - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - increment_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - increment_function(*var_ptr); - } - - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(37, ZEND_POST_DEC, VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **var_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).tmp_var = *EG(uninitialized_zval_ptr); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); - } - - EX_T(opline->result.u.var).tmp_var = **var_ptr; - zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var); - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - decrement_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - decrement_function(*var_ptr); - } - - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(40, ZEND_ECHO, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval z_copy; - zval *z = GET_OP1_ZVAL_PTR(BP_VAR_R); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL && - zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) { - zend_print_variable(&z_copy); - zval_dtor(&z_copy); - } else { - zend_print_variable(z); - } - - FREE_OP1(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(41, ZEND_PRINT, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG; - - ZEND_VM_DISPATCH_TO_HANDLER(ZEND_ECHO); -} - -ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, ANY, int type) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *varname = GET_OP1_ZVAL_PTR(BP_VAR_R); - zval **retval; - zval tmp_varname; - HashTable *target_symbol_table; - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp_varname = *varname; - zval_copy_ctor(&tmp_varname); - convert_to_string(&tmp_varname); - varname = &tmp_varname; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0 TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC); -/* - if (!target_symbol_table) { - ZEND_VM_NEXT_OPCODE(); - } -*/ - if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &retval) == FAILURE) { - switch (type) { - case BP_VAR_R: - case BP_VAR_UNSET: - zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_IS: - retval = &EG(uninitialized_zval_ptr); - break; - case BP_VAR_RW: - zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_W: { - zval *new_zval = &EG(uninitialized_zval); - - new_zval->refcount++; - zend_hash_update(target_symbol_table, varname->value.str.val, varname->value.str.len+1, &new_zval, sizeof(zval *), (void **) &retval); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } - switch (opline->op2.u.EA.type) { - case ZEND_FETCH_GLOBAL: - if (OP1_TYPE != IS_TMP_VAR) { - FREE_OP1(); - } - break; - case ZEND_FETCH_LOCAL: - FREE_OP1(); - break; - case ZEND_FETCH_STATIC: - zval_update_constant(retval, (void*) 1 TSRMLS_CC); - break; - case ZEND_FETCH_GLOBAL_LOCK: - if (OP1_TYPE == IS_VAR && !free_op1.var) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - break; - } - } - - - if (varname == &tmp_varname) { - zval_dtor(varname); - } - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = retval; - PZVAL_LOCK(*retval); - switch (type) { - case BP_VAR_R: - case BP_VAR_IS: - AI_USE_PTR(EX_T(opline->result.u.var).var); - break; - case BP_VAR_UNSET: { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - break; - } - } - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(80, ZEND_FETCH_R, CONST|TMP|VAR|CV, ANY) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, BP_VAR_R); -} - -ZEND_VM_HANDLER(83, ZEND_FETCH_W, CONST|TMP|VAR|CV, ANY) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, BP_VAR_W); -} - -ZEND_VM_HANDLER(86, ZEND_FETCH_RW, CONST|TMP|VAR|CV, ANY) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, BP_VAR_RW); -} - -ZEND_VM_HANDLER(92, ZEND_FETCH_FUNC_ARG, CONST|TMP|VAR|CV, ANY) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, - ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), EX(opline)->extended_value)?BP_VAR_W:BP_VAR_R); -} - -ZEND_VM_HANDLER(95, ZEND_FETCH_UNSET, CONST|TMP|VAR|CV, ANY) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, BP_VAR_UNSET); -} - -ZEND_VM_HANDLER(89, ZEND_FETCH_IS, CONST|TMP|VAR|CV, ANY) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, BP_VAR_IS); -} - -ZEND_VM_HANDLER(81, ZEND_FETCH_DIM_R, VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && OP1_TYPE != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), GET_OP1_ZVAL_PTR_PTR(BP_VAR_R), dim, IS_OP2_TMP_FREE(), BP_VAR_R TSRMLS_CC); - FREE_OP2(); - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(84, ZEND_FETCH_DIM_W, VAR|CV, CONST|TMP|VAR|UNUSED|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), GET_OP1_ZVAL_PTR_PTR(BP_VAR_W), dim, IS_OP2_TMP_FREE(), BP_VAR_W TSRMLS_CC); - FREE_OP2(); - if (OP1_TYPE == IS_VAR && OP1_FREE && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(87, ZEND_FETCH_DIM_RW, VAR|CV, CONST|TMP|VAR|UNUSED|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), GET_OP1_ZVAL_PTR_PTR(BP_VAR_RW), dim, IS_OP2_TMP_FREE(), BP_VAR_RW TSRMLS_CC); - FREE_OP2(); - if (OP1_TYPE == IS_VAR && OP1_FREE && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(90, ZEND_FETCH_DIM_IS, VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), GET_OP1_ZVAL_PTR_PTR(BP_VAR_IS), dim, IS_OP2_TMP_FREE(), BP_VAR_IS TSRMLS_CC); - FREE_OP2(); - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(93, ZEND_FETCH_DIM_FUNC_ARG, VAR|CV, CONST|TMP|VAR|UNUSED|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (OP2_TYPE == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), GET_OP1_ZVAL_PTR_PTR(type), dim, IS_OP2_TMP_FREE(), type TSRMLS_CC); - FREE_OP2(); - if (OP1_TYPE == IS_VAR && type == BP_VAR_W && OP1_FREE && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(96, ZEND_FETCH_DIM_UNSET, VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_UNSET); - zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (OP1_TYPE == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, IS_OP2_TMP_FREE(), BP_VAR_UNSET TSRMLS_CC); - FREE_OP2(); - if (OP1_TYPE == IS_VAR && OP1_FREE && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - FREE_OP1_VAR_PTR(); - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HELPER_EX(zend_fetch_property_address_read_helper, VAR|UNUSED|CV, CONST|TMP|VAR|CV, int type) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - zend_free_op free_op1; - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = GET_OP1_OBJ_ZVAL_PTR(type); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - FREE_OP1(); - ZEND_VM_NEXT_OPCODE(); - } - - - if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - } - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - zend_free_op free_op2; - zval *offset = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&offset); - } else { - FREE_OP2(); - } - } - - FREE_OP1(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(82, ZEND_FETCH_OBJ_R, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_property_address_read_helper, type, BP_VAR_R); -} - -ZEND_VM_HANDLER(85, ZEND_FETCH_OBJ_W, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && OP1_TYPE != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W), property, BP_VAR_W TSRMLS_CC); - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&property); - } else { - FREE_OP2(); - } - if (OP1_TYPE == IS_VAR && OP1_FREE && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(88, ZEND_FETCH_OBJ_RW, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_RW), property, BP_VAR_RW TSRMLS_CC); - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&property); - } else { - FREE_OP2(); - } - if (OP1_TYPE == IS_VAR && OP1_FREE && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(91, ZEND_FETCH_OBJ_IS, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_property_address_read_helper, type, BP_VAR_IS); -} - -ZEND_VM_HANDLER(94, ZEND_FETCH_OBJ_FUNC_ARG, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1, free_op2; - zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W), property, BP_VAR_W TSRMLS_CC); - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&property); - } else { - FREE_OP2(); - } - if (OP1_TYPE == IS_VAR && OP1_FREE && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); - } else { - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_property_address_read_helper, type, BP_VAR_R); - } -} - -ZEND_VM_HANDLER(97, ZEND_FETCH_OBJ_UNSET, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2, free_res; - zval **container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_R); - zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (OP1_TYPE == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_R TSRMLS_CC); - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&property); - } else { - FREE_OP2(); - } - if (OP1_TYPE == IS_VAR && OP1_FREE && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - FREE_OP1_VAR_PTR(); - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(98, ZEND_FETCH_DIM_TMP_VAR, TMP, CONST) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *container = GET_OP1_ZVAL_PTR(BP_VAR_R); - - if (Z_TYPE_P(container) != IS_ARRAY) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - } - } else { - zend_free_op free_op2; - zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - - EX_T(opline->result.u.var).var.ptr_ptr = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, BP_VAR_R TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &opline->result); - FREE_OP2(); - } - AI_USE_PTR(EX_T(opline->result.u.var).var); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(136, ZEND_ASSIGN_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_W); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - FREE_OP1_VAR_PTR(); - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(147, ZEND_ASSIGN_DIM, VAR|CV, CONST|TMP|VAR|UNUSED|CV) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr; - - if (OP1_TYPE == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W); - } else { - object_ptr = NULL; - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op2, free_op_data1; - zval *value; - zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, IS_OP2_TMP_FREE(), BP_VAR_W TSRMLS_CC); - FREE_OP2(); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - FREE_OP1_VAR_PTR(); - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(38, ZEND_ASSIGN, VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *value = GET_OP2_ZVAL_PTR(BP_VAR_R); - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (IS_OP2_TMP_FREE()?IS_TMP_VAR:OP2_TYPE), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - FREE_OP2_IF_VAR(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **variable_ptr_ptr; - zval **value_ptr_ptr = GET_OP2_ZVAL_PTR_PTR(BP_VAR_W); - - if (OP2_TYPE == IS_VAR && - value_ptr_ptr && - !(*value_ptr_ptr)->is_ref && - opline->extended_value == ZEND_RETURNS_FUNCTION && - !EX_T(opline->op2.u.var).var.fcall_returned_reference) { - if (free_op2.var == NULL) { - PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_STRICT, "Only variables should be assigned by reference"); - ZEND_VM_DISPATCH_TO_HANDLER(ZEND_ASSIGN); - } - if (OP1_TYPE == IS_VAR && EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - zend_error(E_ERROR, "Cannot assign by reference to overloaded object"); - } - - variable_ptr_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W); - zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = variable_ptr_ptr; - PZVAL_LOCK(*variable_ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - FREE_OP1_VAR_PTR(); - FREE_OP2_VAR_PTR(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(42, ZEND_JMP, ANY, ANY) -{ -#if DEBUG_ZEND>=2 - printf("Jumping to %d\n", EX(opline)->op1.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(EX(opline)->op1.u.jmp_addr); - ZEND_VM_CONTINUE(); /* CHECK_ME */ -} - -ZEND_VM_HANDLER(43, ZEND_JMPZ, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int ret = i_zend_is_true(GET_OP1_ZVAL_PTR(BP_VAR_R)); - - FREE_OP1(); - if (!ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(44, ZEND_JMPNZ, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int ret = i_zend_is_true(GET_OP1_ZVAL_PTR(BP_VAR_R)); - - FREE_OP1(); - if (ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(45, ZEND_JMPZNZ, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(GET_OP1_ZVAL_PTR(BP_VAR_R)); - - FREE_OP1(); - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on true to %d\n", opline->extended_value); -#endif - ZEND_VM_JMP(&EX(op_array)->opcodes[opline->extended_value]); - } else { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on false to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(&EX(op_array)->opcodes[opline->op2.u.opline_num]); - } -} - -ZEND_VM_HANDLER(46, ZEND_JMPZ_EX, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(GET_OP1_ZVAL_PTR(BP_VAR_R)); - - FREE_OP1(); - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - if (!retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(47, ZEND_JMPNZ_EX, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(GET_OP1_ZVAL_PTR(BP_VAR_R)); - - FREE_OP1(); - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(70, ZEND_FREE, TMP, ANY) -{ - zendi_zval_dtor(EX_T(EX(opline)->op1.u.var).tmp_var); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(53, ZEND_INIT_STRING, ANY, ANY) -{ - zval *tmp = &EX_T(EX(opline)->result.u.var).tmp_var; - - tmp->value.str.val = emalloc(1); - tmp->value.str.val[0] = 0; - tmp->value.str.len = 0; - tmp->refcount = 1; - tmp->type = IS_STRING; - tmp->is_ref = 0; - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(54, ZEND_ADD_CHAR, TMP, CONST) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - add_char_to_string(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_NA), - &opline->op2.u.constant); - /* FREE_OP is missing intentionally here - we're always working on the same temporary variable */ - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(55, ZEND_ADD_STRING, TMP, CONST) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - add_string_to_string(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_NA), - &opline->op2.u.constant); - /* FREE_OP is missing intentionally here - we're always working on the same temporary variable */ - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(56, ZEND_ADD_VAR, TMP, TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *var = GET_OP2_ZVAL_PTR(BP_VAR_R); - zval var_copy; - int use_copy; - - zend_make_printable_zval(var, &var_copy, &use_copy); - if (use_copy) { - var = &var_copy; - } - add_string_to_string( &EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_NA), - var); - if (use_copy) { - zval_dtor(var); - } - /* original comment, possibly problematic: - * FREE_OP is missing intentionally here - we're always working on the same temporary variable - * (Zeev): I don't think it's problematic, we only use variables - * which aren't affected by FREE_OP(Ts, )'s anyway, unless they're - * string offsets or overloaded objects - */ - FREE_OP2(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(109, ZEND_FETCH_CLASS, ANY, CONST|TMP|VAR|UNUSED|CV) -{ - zend_op *opline = EX(opline); - zval *class_name; - zend_free_op free_op2; - - - if (OP2_TYPE == IS_UNUSED) { - EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - - class_name = GET_OP2_ZVAL_PTR(BP_VAR_R); - - switch (Z_TYPE_P(class_name)) { - case IS_OBJECT: - EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name); - break; - case IS_STRING: - EX_T(opline->result.u.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC); - break; - default: - zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string"); - break; - } - - FREE_OP2(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, TMP|VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1, free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_R); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - FREE_OP2(); - FREE_OP1_IF_VAR(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, ANY, CONST|TMP|VAR|UNUSED|CV) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_class_entry *ce; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - ce = EX_T(opline->op1.u.var).class_entry; - if(OP2_TYPE != IS_UNUSED) { - char *function_name_strval; - int function_name_strlen; - zend_bool is_const = (OP2_TYPE == IS_CONST); - zend_free_op free_op2; - - if (is_const) { - function_name_strval = Z_STRVAL(opline->op2.u.constant); - function_name_strlen = Z_STRLEN(opline->op2.u.constant); - } else { - function_name = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (Z_TYPE_P(function_name) != IS_STRING) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = zend_str_tolower_dup(function_name->value.str.val, function_name->value.str.len); - function_name_strlen = function_name->value.str.len; - } - - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); - - if (!is_const) { - efree(function_name_strval); - FREE_OP2(); - } - } else { - if(!ce->constructor) { - zend_error_noreturn(E_ERROR, "Can not call constructor"); - } - if (Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { - zend_error(E_COMPILE_ERROR, "Cannot call private %s::__construct()", ce->name); - } - EX(fbc) = ce->constructor; - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (OP2_TYPE != IS_UNUSED && - EG(This) && - Z_OBJ_HT_P(EG(This))->get_class_entry && - !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) { - /* We are calling method of the other (incompatible) class, - but passing $this. This is done for compatibility with php-4. */ - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); - - } - if ((EX(object) = EG(This))) { - EX(object)->refcount++; - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_function *function; - char *function_name_strval, *lcname; - int function_name_strlen; - zend_free_op free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - if (OP2_TYPE == IS_CONST) { - function_name_strval = opline->op2.u.constant.value.str.val; - function_name_strlen = opline->op2.u.constant.value.str.len; - } else { - function_name = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (Z_TYPE_P(function_name) != IS_STRING) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = function_name->value.str.val; - function_name_strlen = function_name->value.str.len; - } - - lcname = zend_str_tolower_dup(function_name_strval, function_name_strlen); - if (zend_hash_find(EG(function_table), lcname, function_name_strlen+1, (void **) &function)==FAILURE) { - efree(lcname); - zend_error_noreturn(E_ERROR, "Call to undefined function %s()", function_name_strval); - } - - efree(lcname); - if (OP2_TYPE != IS_CONST) { - FREE_OP2(); - } - - EX(object) = NULL; - - EX(fbc) = function; - - ZEND_VM_NEXT_OPCODE(); -} - - -ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY) -{ - zend_op *opline = EX(opline); - zval **original_return_value; - zend_class_entry *current_scope = NULL; - zval *current_this = NULL; - int return_value_used = RETURN_VALUE_USED(opline); - zend_bool should_change_scope; - zend_op *ctor_opline; - - if (EX(function_state).function->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) { - if (EX(function_state).function->common.fn_flags & ZEND_ACC_ABSTRACT) { - zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name); - ZEND_VM_NEXT_OPCODE(); /* Never reached */ - } - if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) { - zend_error(E_STRICT, "Function %s%s%s() is deprecated", - EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "", - EX(function_state).function->common.scope ? "::" : "", - EX(function_state).function->common.function_name); - } - } - - zend_ptr_stack_2_push(&EG(argument_stack), (void *) opline->extended_value, NULL); - - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - - if (EX(function_state).function->type == ZEND_USER_FUNCTION - || EX(function_state).function->common.scope) { - should_change_scope = 1; - current_this = EG(This); - EG(This) = EX(object); - current_scope = EG(scope); - EG(scope) = (EX(function_state).function->type == ZEND_USER_FUNCTION || !EX(object)) ? EX(function_state).function->common.scope : NULL; - } else { - should_change_scope = 0; - } - - EX_T(opline->result.u.var).var.fcall_returned_reference = 0; - - if (EX(function_state).function->common.scope) { - if (!EG(This) && !(EX(function_state).function->common.fn_flags & ZEND_ACC_STATIC)) { - int severity; - char *severity_word; - if (EX(function_state).function->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - severity = E_STRICT; - severity_word = "should not"; - } else { - severity = E_ERROR; - severity_word = "cannot"; - } - zend_error(severity, "Non-static method %s::%s() %s be called statically", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name, severity_word); - } - } - if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) { - unsigned char return_reference = EX(function_state).function->common.return_reference; - - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*(EX_T(opline->result.u.var).var.ptr)); - - if (EX(function_state).function->common.arg_info) { - zend_uint i=0; - zval **p; - ulong arg_count; - - p = (zval **) EG(argument_stack).top_element-2; - arg_count = (ulong) *p; - - while (arg_count>0) { - zend_verify_arg_type(EX(function_state).function, ++i, *(p-arg_count) TSRMLS_CC); - arg_count--; - } - } - if (!zend_execute_internal) { - /* saves one function call if zend_execute_internal is not used */ - ((zend_internal_function *) EX(function_state).function)->handler(opline->extended_value, EX_T(opline->result.u.var).var.ptr, EX(function_state).function->common.return_reference?&EX_T(opline->result.u.var).var.ptr:NULL, EX(object), return_value_used TSRMLS_CC); - } else { - zend_execute_internal(EXECUTE_DATA, return_value_used TSRMLS_CC); - } - - EG(current_execute_data) = EXECUTE_DATA; - -/* We shouldn't fix bad extensions here, - because it can break proper ones (Bug #34045) - if (!EX(function_state).function->common.return_reference) { - EX_T(opline->result.u.var).var.ptr->is_ref = 0; - EX_T(opline->result.u.var).var.ptr->refcount = 1; - } -*/ - if (!return_value_used) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } else { - EX_T(opline->result.u.var).var.fcall_returned_reference = return_reference; - } - } else if (EX(function_state).function->type == ZEND_USER_FUNCTION) { - EX_T(opline->result.u.var).var.ptr = NULL; - if (EG(symtable_cache_ptr)>=EG(symtable_cache)) { - /*printf("Cache hit! Reusing %x\n", symtable_cache[symtable_cache_ptr]);*/ - EX(function_state).function_symbol_table = *(EG(symtable_cache_ptr)--); - } else { - ALLOC_HASHTABLE(EX(function_state).function_symbol_table); - zend_hash_init(EX(function_state).function_symbol_table, 0, NULL, ZVAL_PTR_DTOR, 0); - /*printf("Cache miss! Initialized %x\n", function_state.function_symbol_table);*/ - } - EG(active_symbol_table) = EX(function_state).function_symbol_table; - original_return_value = EG(return_value_ptr_ptr); - EG(return_value_ptr_ptr) = EX_T(opline->result.u.var).var.ptr_ptr; - EG(active_op_array) = (zend_op_array *) EX(function_state).function; - - zend_execute(EG(active_op_array) TSRMLS_CC); - EX_T(opline->result.u.var).var.fcall_returned_reference = EG(active_op_array)->return_reference; - - if (return_value_used && !EX_T(opline->result.u.var).var.ptr) { - if (!EG(exception)) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*EX_T(opline->result.u.var).var.ptr); - } - } else if (!return_value_used && EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - - EG(opline_ptr) = &EX(opline); - EG(active_op_array) = EX(op_array); - EG(return_value_ptr_ptr)=original_return_value; - if (EG(symtable_cache_ptr)>=EG(symtable_cache_limit)) { - zend_hash_destroy(EX(function_state).function_symbol_table); - FREE_HASHTABLE(EX(function_state).function_symbol_table); - } else { - /* clean before putting into the cache, since clean - could call dtors, which could use cached hash */ - zend_hash_clean(EX(function_state).function_symbol_table); - *(++EG(symtable_cache_ptr)) = EX(function_state).function_symbol_table; - } - EG(active_symbol_table) = EX(symbol_table); - } else { /* ZEND_OVERLOADED_FUNCTION */ - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*(EX_T(opline->result.u.var).var.ptr)); - - /* Not sure what should be done here if it's a static method */ - if (EX(object)) { - Z_OBJ_HT_P(EX(object))->call_method(EX(fbc)->common.function_name, opline->extended_value, EX_T(opline->result.u.var).var.ptr, &EX_T(opline->result.u.var).var.ptr, EX(object), return_value_used TSRMLS_CC); - } else { - zend_error_noreturn(E_ERROR, "Cannot call overloaded function for non-object"); - } - - if (EX(function_state).function->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY) { - efree(EX(function_state).function->common.function_name); - } - efree(EX(fbc)); - - if (!return_value_used) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } else { - EX_T(opline->result.u.var).var.ptr->is_ref = 0; - EX_T(opline->result.u.var).var.ptr->refcount = 1; - } - } - - ctor_opline = (zend_op*)zend_ptr_stack_pop(&EG(arg_types_stack)); - - if (EG(This)) { - if (EG(exception) && ctor_opline) { - if (RETURN_VALUE_USED(ctor_opline)) { - EG(This)->refcount--; - } - if (EG(This)->refcount == 1) { - zend_object_store_ctor_failed(EG(This) TSRMLS_CC); - } - } - if (should_change_scope) { - zval_ptr_dtor(&EG(This)); - } - } - - if (should_change_scope) { - EG(This) = current_this; - EG(scope) = current_scope; - } - zend_ptr_stack_2_pop(&EG(arg_types_stack), (void**)&EX(object), (void**)&EX(fbc)); - - EX(function_state).function = (zend_function *) EX(op_array); - EG(function_state_ptr) = &EX(function_state); - zend_ptr_stack_clear_multiple(TSRMLS_C); - - if (EG(exception)) { - zend_throw_exception_internal(NULL TSRMLS_CC); - if (return_value_used && EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(61, ZEND_DO_FCALL_BY_NAME, ANY, ANY) -{ - EX(function_state).function = EX(fbc); - ZEND_VM_DISPATCH_TO_HELPER(zend_do_fcall_common_helper); -} - -ZEND_VM_HANDLER(60, ZEND_DO_FCALL, CONST, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *fname = GET_OP1_ZVAL_PTR(BP_VAR_R); - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - if (zend_hash_find(EG(function_table), fname->value.str.val, fname->value.str.len+1, (void **) &EX(function_state).function)==FAILURE) { - zend_error_noreturn(E_ERROR, "Call to undefined function %s()", fname->value.str.val); - } - EX(object) = NULL; - - FREE_OP1(); - - ZEND_VM_DISPATCH_TO_HELPER(zend_do_fcall_common_helper); -} - -ZEND_VM_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zval *retval_ptr; - zval **retval_ptr_ptr; - zend_free_op free_op1; - - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF) { - - if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_TMP_VAR) { - /* Not supposed to happen, but we'll allow it */ - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - ZEND_VM_C_GOTO(return_by_value); - } - - retval_ptr_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W); - - if (!retval_ptr_ptr) { - zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference"); - } - - if (OP1_TYPE == IS_VAR && !(*retval_ptr_ptr)->is_ref) { - if (opline->extended_value == ZEND_RETURNS_FUNCTION && - EX_T(opline->op1.u.var).var.fcall_returned_reference) { - } else if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - if (OP1_TYPE == IS_VAR && !OP1_FREE) { - PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - ZEND_VM_C_GOTO(return_by_value); - } - } - - SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr_ptr); - (*retval_ptr_ptr)->refcount++; - - (*EG(return_value_ptr_ptr)) = (*retval_ptr_ptr); - } else { -ZEND_VM_C_LABEL(return_by_value): - - retval_ptr = GET_OP1_ZVAL_PTR(BP_VAR_R); - - if (EG(ze1_compatibility_mode) && Z_TYPE_P(retval_ptr) == IS_OBJECT) { - zval *ret; - char *class_name; - zend_uint class_name_len; - int dup; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - dup = zend_get_object_classname(retval_ptr, &class_name, &class_name_len TSRMLS_CC); - if (Z_OBJ_HT_P(retval_ptr)->clone_obj == NULL) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", class_name); - } - zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name); - ret->value.obj = Z_OBJ_HT_P(retval_ptr)->clone_obj(retval_ptr TSRMLS_CC); - *EG(return_value_ptr_ptr) = ret; - if (!dup) { - efree(class_name); - } - } else if (!IS_OP1_TMP_FREE()) { /* Not a temp var */ - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF || - (PZVAL_IS_REF(retval_ptr) && retval_ptr->refcount > 0)) { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - zval_copy_ctor(ret); - *EG(return_value_ptr_ptr) = ret; - } else { - *EG(return_value_ptr_ptr) = retval_ptr; - retval_ptr->refcount++; - } - } else { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - *EG(return_value_ptr_ptr) = ret; - } - } - FREE_OP1_IF_VAR(); - ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); -} - -ZEND_VM_HANDLER(108, ZEND_THROW, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zval *value; - zval *exception; - zend_free_op free_op1; - - value = GET_OP1_ZVAL_PTR(BP_VAR_R); - - if (Z_TYPE_P(value) != IS_OBJECT) { - zend_error_noreturn(E_ERROR, "Can only throw objects"); - } - /* Not sure if a complete copy is what we want here */ - ALLOC_ZVAL(exception); - INIT_PZVAL_COPY(exception, value); - if (!IS_OP1_TMP_FREE()) { - zval_copy_ctor(exception); - } - - zend_throw_exception_object(exception TSRMLS_CC); - FREE_OP1_IF_VAR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(107, ZEND_CATCH, ANY, ANY) -{ - zend_op *opline = EX(opline); - zend_class_entry *ce; - - /* Check whether an exception has been thrown, if not, jump over code */ - if (EG(exception) == NULL) { - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->extended_value]); - ZEND_VM_CONTINUE(); /* CHECK_ME */ - } - ce = Z_OBJCE_P(EG(exception)); - if (ce != EX_T(opline->op1.u.var).class_entry) { - if (!instanceof_function(ce, EX_T(opline->op1.u.var).class_entry TSRMLS_CC)) { - if (opline->op1.u.EA.type) { - zend_throw_exception_internal(NULL TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->extended_value]); - ZEND_VM_CONTINUE(); /* CHECK_ME */ - } - } - - zend_hash_update(EG(active_symbol_table), opline->op2.u.constant.value.str.val, - opline->op2.u.constant.value.str.len+1, &EG(exception), sizeof(zval *), (void **) NULL); - EG(exception) = NULL; - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(65, ZEND_SEND_VAL, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - if (opline->extended_value==ZEND_DO_FCALL_BY_NAME - && ARG_MUST_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.u.opline_num); - } - { - zval *valptr; - zval *value; - zend_free_op free_op1; - - value = GET_OP1_ZVAL_PTR(BP_VAR_R); - - ALLOC_ZVAL(valptr); - INIT_PZVAL_COPY(valptr, value); - if (!IS_OP1_TMP_FREE()) { - zval_copy_ctor(valptr); - } - zend_ptr_stack_push(&EG(argument_stack), valptr); - FREE_OP1_IF_VAR(); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HELPER(zend_send_by_var_helper, VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zval *varptr; - zend_free_op free_op1; - varptr = GET_OP1_ZVAL_PTR(BP_VAR_R); - - if (varptr == &EG(uninitialized_zval)) { - ALLOC_ZVAL(varptr); - INIT_ZVAL(*varptr); - varptr->refcount = 0; - } else if (PZVAL_IS_REF(varptr)) { - zval *original_var = varptr; - - ALLOC_ZVAL(varptr); - *varptr = *original_var; - varptr->is_ref = 0; - varptr->refcount = 0; - zval_copy_ctor(varptr); - } - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - FREE_OP1(); /* for string offsets */ - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *varptr; - - if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */ - if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) { - ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper); - } - } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper); - } - - varptr = GET_OP1_ZVAL_PTR(BP_VAR_R); - if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) || - EX_T(opline->op1.u.var).var.fcall_returned_reference) && - varptr != &EG(uninitialized_zval) && - (PZVAL_IS_REF(varptr) || - (varptr->refcount == 1 && (OP1_TYPE == IS_CV || free_op1.var)))) { - varptr->is_ref = 1; - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - } else { - zval *valptr; - - zend_error(E_STRICT, "Only variables should be passed by reference"); - ALLOC_ZVAL(valptr); - INIT_PZVAL_COPY(valptr, varptr); - if (!IS_OP1_TMP_FREE()) { - zval_copy_ctor(valptr); - } - zend_ptr_stack_push(&EG(argument_stack), valptr); - } - FREE_OP1_IF_VAR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **varptr_ptr; - zval *varptr; - varptr_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W); - - if (!varptr_ptr) { - zend_error_noreturn(E_ERROR, "Only variables can be passed by reference"); - } - - SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr); - varptr = *varptr_ptr; - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - - FREE_OP1_VAR_PTR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(66, ZEND_SEND_VAR, VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - - if ((opline->extended_value == ZEND_DO_FCALL_BY_NAME) - && ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - ZEND_VM_DISPATCH_TO_HANDLER(ZEND_SEND_REF); - } - ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper); -} - -ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY) -{ - zend_op *opline = EX(opline); - zval **param; - zend_uint arg_num = Z_LVAL(opline->op1.u.constant); - - if (zend_ptr_stack_get_arg(arg_num, (void **) ¶m TSRMLS_CC)==FAILURE) { - char *space; - char *class_name = get_active_class_name(&space TSRMLS_CC); - zend_execute_data *ptr = EX(prev_execute_data); - - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL TSRMLS_CC); - if(ptr && ptr->op_array) { - zend_error(E_WARNING, "Missing argument %ld for %s%s%s(), called in %s on line %d and defined", opline->op1.u.constant.value.lval, class_name, space, get_active_function_name(TSRMLS_C), ptr->op_array->filename, ptr->opline->lineno); - } else { - zend_error(E_WARNING, "Missing argument %ld for %s%s%s()", opline->op1.u.constant.value.lval, class_name, space, get_active_function_name(TSRMLS_C)); - } - if (opline->result.op_type == IS_VAR) { - PZVAL_UNLOCK_FREE(*EX_T(opline->result.u.var).var.ptr_ptr); - } - } else { - zend_free_op free_res; - zval **var_ptr; - - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param TSRMLS_CC); - var_ptr = get_zval_ptr_ptr(&opline->result, EX(Ts), &free_res, BP_VAR_W); - if (PZVAL_IS_REF(*param)) { - zend_assign_to_variable_reference(var_ptr, param TSRMLS_CC); - } else { - zend_receive(var_ptr, *param TSRMLS_CC); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST) -{ - zend_op *opline = EX(opline); - zval **param, *assignment_value; - zend_uint arg_num = Z_LVAL(opline->op1.u.constant); - zend_free_op free_res; - - if (zend_ptr_stack_get_arg(arg_num, (void **) ¶m TSRMLS_CC)==FAILURE) { - if (Z_TYPE(opline->op2.u.constant) == IS_CONSTANT || Z_TYPE(opline->op2.u.constant)==IS_CONSTANT_ARRAY) { - zval *default_value; - - ALLOC_ZVAL(default_value); - *default_value = opline->op2.u.constant; - if (Z_TYPE(opline->op2.u.constant)==IS_CONSTANT_ARRAY) { - zval_copy_ctor(default_value); - } - default_value->refcount=1; - zval_update_constant(&default_value, 0 TSRMLS_CC); - default_value->refcount=0; - default_value->is_ref=0; - param = &default_value; - assignment_value = default_value; - } else { - param = NULL; - assignment_value = &opline->op2.u.constant; - } - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value TSRMLS_CC); - zend_assign_to_variable(NULL, &opline->result, NULL, assignment_value, IS_VAR, EX(Ts) TSRMLS_CC); - } else { - zval **var_ptr = get_zval_ptr_ptr(&opline->result, EX(Ts), &free_res, BP_VAR_W); - - assignment_value = *param; - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value TSRMLS_CC); - if (PZVAL_IS_REF(assignment_value)) { - zend_assign_to_variable_reference(var_ptr, param TSRMLS_CC); - } else { - zend_receive(var_ptr, assignment_value TSRMLS_CC); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(52, ZEND_BOOL, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */ - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = i_zend_is_true(GET_OP1_ZVAL_PTR(BP_VAR_R)); - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - FREE_OP1(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(50, ZEND_BRK, ANY, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zend_brk_cont_element *el; - - el = zend_brk_cont(GET_OP2_ZVAL_PTR(BP_VAR_R), opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC); - FREE_OP2(); - ZEND_VM_JMP(EX(op_array)->opcodes + el->brk); -} - -ZEND_VM_HANDLER(51, ZEND_CONT, ANY, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zend_brk_cont_element *el; - - el = zend_brk_cont(GET_OP2_ZVAL_PTR(BP_VAR_R), opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC); - FREE_OP2(); - ZEND_VM_JMP(EX(op_array)->opcodes + el->cont); -} - -ZEND_VM_HANDLER(48, ZEND_CASE, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1, free_op2; - - if (OP1_TYPE==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - GET_OP1_ZVAL_PTR(BP_VAR_R), - GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); - - FREE_OP2(); - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - FREE_OP1(); - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(49, ZEND_SWITCH_FREE, TMP|VAR, ANY) -{ - zend_switch_free(EX(opline), EX(Ts) TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(68, ZEND_NEW, ANY, ANY) -{ - zend_op *opline = EX(opline); - zval *object_zval; - zend_function *constructor; - - if (EX_T(opline->op1.u.var).class_entry->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) { - char *class_type; - - if (EX_T(opline->op1.u.var).class_entry->ce_flags & ZEND_ACC_INTERFACE) { - class_type = "interface"; - } else { - class_type = "abstract class"; - } - zend_error_noreturn(E_ERROR, "Cannot instantiate %s %s", class_type, EX_T(opline->op1.u.var).class_entry->name); - } - ALLOC_ZVAL(object_zval); - object_init_ex(object_zval, EX_T(opline->op1.u.var).class_entry); - INIT_PZVAL(object_zval); - - constructor = Z_OBJ_HT_P(object_zval)->get_constructor(object_zval TSRMLS_CC); - - if (constructor == NULL) { - if (RETURN_VALUE_USED(opline)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr = object_zval; - } else { - zval_ptr_dtor(&object_zval); - } - ZEND_VM_JMP(EX(op_array)->opcodes + opline->op2.u.opline_num); - } else { - SELECTIVE_PZVAL_LOCK(object_zval, &opline->result); - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr = object_zval; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), opline); - - /* We are not handling overloaded classes right now */ - EX(object) = object_zval; - EX(fbc) = constructor; - - ZEND_VM_NEXT_OPCODE(); - } -} - -ZEND_VM_HANDLER(110, ZEND_CLONE, CONST|TMP|VAR|UNUSED|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *obj = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_R); - zend_class_entry *ce; - zend_function *clone; - zend_object_clone_obj_t clone_call; - - if (!obj || Z_TYPE_P(obj) != IS_OBJECT) { - zend_error(E_WARNING, "__clone method called on non-object"); - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - FREE_OP1_IF_VAR(); - ZEND_VM_NEXT_OPCODE(); - } - - ce = Z_OBJCE_P(obj); - clone = ce ? ce->clone : NULL; - clone_call = Z_OBJ_HT_P(obj)->clone_obj; - if (!clone_call) { - if (ce) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", ce->name); - } else { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object"); - } - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - } - - if (ce && clone) { - if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) { - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : ""); - } - } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : ""); - } - } - } - - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (!EG(exception)) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - Z_OBJVAL_P(EX_T(opline->result.u.var).var.ptr) = clone_call(obj TSRMLS_CC); - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_OBJECT; - EX_T(opline->result.u.var).var.ptr->refcount=1; - EX_T(opline->result.u.var).var.ptr->is_ref=1; - if (!RETURN_VALUE_USED(opline) || EG(exception)) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } - FREE_OP1_IF_VAR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, CONST|UNUSED, CONST) -{ - zend_op *opline = EX(opline); - zend_class_entry *ce = NULL; - zval **value; - - if (OP1_TYPE == IS_UNUSED) { -/* This seems to be a reminant of namespaces - if (EG(scope)) { - ce = EG(scope); - if (zend_hash_find(&ce->constants_table, Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant)+1, (void **) &value) == SUCCESS) { - zval_update_constant(value, (void *) 1 TSRMLS_CC); - EX_T(opline->result.u.var).tmp_var = **value; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - ZEND_VM_NEXT_OPCODE(); - } - } -*/ - if (!zend_get_constant(opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len, &EX_T(opline->result.u.var).tmp_var TSRMLS_CC)) { - zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", - opline->op2.u.constant.value.str.val, - opline->op2.u.constant.value.str.val); - EX_T(opline->result.u.var).tmp_var = opline->op2.u.constant; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } - ZEND_VM_NEXT_OPCODE(); - } - - ce = EX_T(opline->op1.u.var).class_entry; - - if (zend_hash_find(&ce->constants_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, (void **) &value) == SUCCESS) { - zval_update_constant(value, (void *) 1 TSRMLS_CC); - EX_T(opline->result.u.var).tmp_var = **value; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } else { - zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", opline->op2.u.constant.value.str.val); - } - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(72, ZEND_ADD_ARRAY_ELEMENT, CONST|TMP|VAR|CV, CONST|TMP|VAR|UNUSED|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=GET_OP2_ZVAL_PTR(BP_VAR_R); - -#if !defined(ZEND_VM_SPEC) || OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=GET_OP1_ZVAL_PTR_PTR(BP_VAR_W); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=GET_OP1_ZVAL_PTR(BP_VAR_R); - } -#else - expr_ptr=GET_OP1_ZVAL_PTR(BP_VAR_R); -#endif - - if (IS_OP1_TMP_FREE()) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if !defined(ZEND_VM_SPEC) || OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - FREE_OP2(); - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - FREE_OP1_VAR_PTR(); - } else { - FREE_OP1_IF_VAR(); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(71, ZEND_INIT_ARRAY, CONST|TMP|VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (OP1_TYPE == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if !defined(ZEND_VM_SPEC) || OP1_TYPE != IS_UNUSED - } else { - ZEND_VM_DISPATCH_TO_HANDLER(ZEND_ADD_ARRAY_ELEMENT); -#endif - } -} - -ZEND_VM_HANDLER(21, ZEND_CAST, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *expr = GET_OP1_ZVAL_PTR(BP_VAR_R); - zval *result = &EX_T(opline->result.u.var).tmp_var; - - *result = *expr; - if (!IS_OP1_TMP_FREE()) { - zendi_zval_copy_ctor(*result); - } - switch (opline->extended_value) { - case IS_NULL: - convert_to_null(result); - break; - case IS_BOOL: - convert_to_boolean(result); - break; - case IS_LONG: - convert_to_long(result); - break; - case IS_DOUBLE: - convert_to_double(result); - break; - case IS_STRING: { - zval var_copy; - int use_copy; - - zend_make_printable_zval(result, &var_copy, &use_copy); - if (use_copy) { - zval_dtor(result); - *result = var_copy; - } - break; - } - case IS_ARRAY: - convert_to_array(result); - break; - case IS_OBJECT: - convert_to_object(result); - break; - } - FREE_OP1_IF_VAR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_op_array *new_op_array=NULL; - zval **original_return_value = EG(return_value_ptr_ptr); - int return_value_used; - zend_free_op free_op1; - zval *inc_filename = GET_OP1_ZVAL_PTR(BP_VAR_R); - zval tmp_inc_filename; - zend_bool failure_retval=0; - - if (inc_filename->type!=IS_STRING) { - tmp_inc_filename = *inc_filename; - zval_copy_ctor(&tmp_inc_filename); - convert_to_string(&tmp_inc_filename); - inc_filename = &tmp_inc_filename; - } - - return_value_used = RETURN_VALUE_USED(opline); - - switch (Z_LVAL(opline->op2.u.constant)) { - case ZEND_INCLUDE_ONCE: - case ZEND_REQUIRE_ONCE: { - zend_file_handle file_handle; - char cwd[MAXPATHLEN]; - cwd_state state; - - if (IS_ABSOLUTE_PATH(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename))) { - cwd[0] = '\0'; - } else if (!VCWD_GETCWD(cwd, MAXPATHLEN)) { - cwd[0] = '\0'; - } - - state.cwd_length = strlen(cwd); - state.cwd = zend_strndup(cwd, state.cwd_length); - - failure_retval = (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) && - zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1)); - - free(state.cwd); - - if (failure_retval) { - /* do nothing */ - } else if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename), &file_handle TSRMLS_CC)) { - - if (!file_handle.opened_path) { - file_handle.opened_path = estrndup(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename)); - } - - if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) { - new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC); - zend_destroy_file_handle(&file_handle TSRMLS_CC); - } else { - zend_file_handle_dtor(&file_handle); - failure_retval=1; - } - } else { - if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) { - zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename)); - } else { - zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename)); - } - } - } - break; - case ZEND_INCLUDE: - case ZEND_REQUIRE: - new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), inc_filename TSRMLS_CC); - break; - case ZEND_EVAL: { - char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC); - - new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC); - efree(eval_desc); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - if (inc_filename==&tmp_inc_filename) { - zval_dtor(&tmp_inc_filename); - } - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (new_op_array) { - zval *saved_object; - zend_function *saved_function; - - EG(return_value_ptr_ptr) = EX_T(opline->result.u.var).var.ptr_ptr; - EG(active_op_array) = new_op_array; - EX_T(opline->result.u.var).var.ptr = NULL; - - saved_object = EX(object); - saved_function = EX(function_state).function; - - EX(function_state).function = (zend_function *) new_op_array; - EX(object) = NULL; - - zend_execute(new_op_array TSRMLS_CC); - - EX(function_state).function = saved_function; - EX(object) = saved_object; - - if (!return_value_used) { - if (EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } else { /* return value is used */ - if (!EX_T(opline->result.u.var).var.ptr) { /* there was no return statement */ - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_PZVAL(EX_T(opline->result.u.var).var.ptr); - Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = 1; - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL; - } - } - - EG(opline_ptr) = &EX(opline); - EG(active_op_array) = EX(op_array); - EG(function_state_ptr) = &EX(function_state); - destroy_op_array(new_op_array TSRMLS_CC); - efree(new_op_array); - if (EG(exception)) { - zend_throw_exception_internal(NULL TSRMLS_CC); - } - } else { - if (return_value_used) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*EX_T(opline->result.u.var).var.ptr); - Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = failure_retval; - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL; - } - } - FREE_OP1(); - EG(return_value_ptr_ptr) = original_return_value; - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zval tmp, *varname; - HashTable *target_symbol_table; - zend_free_op free_op1; - - varname = GET_OP1_ZVAL_PTR(BP_VAR_R); - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - varname = &tmp; - } else if (OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) { - varname->refcount++; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname) TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_hash_del(target_symbol_table, varname->value.str.val, varname->value.str.len+1) == SUCCESS) { - zend_execute_data *ex = EXECUTE_DATA; - ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1); - - do { - int i; - - if (ex->op_array) { - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == varname->value.str.len && - !memcmp(ex->op_array->vars[i].name, varname->value.str.val, varname->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - ex = ex->prev_execute_data; - } while (ex && ex->symbol_table == target_symbol_table); - } - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } else if (OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) { - zval_ptr_dtor(&varname); - } - FREE_OP1(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_UNSET); - zval *offset = GET_OP2_ZVAL_PTR(BP_VAR_R); - long index; - - if (container) { - if (OP1_TYPE == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_STRING: - if (OP2_TYPE == IS_CV || OP2_TYPE == IS_VAR) { - offset->refcount++; - } - if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); - - for (ex = EXECUTE_DATA; ex; ex = ex->prev_execute_data) { - if (ex->op_array && ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset->value.str.len && - !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (OP2_TYPE == IS_CV || OP2_TYPE == IS_VAR) { - zval_ptr_dtor(&offset); - } - break; - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - FREE_OP2(); - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&offset); - } else { - FREE_OP2(); - } - break; - case IS_STRING: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - FREE_OP2(); - break; - } - } else { - FREE_OP2(); - } - FREE_OP1_VAR_PTR(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(76, ZEND_UNSET_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_UNSET); - zval *offset = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (container) { - if (OP1_TYPE == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&offset); - } else { - FREE_OP2(); - } - } else { - FREE_OP2(); - } - } else { - FREE_OP2(); - } - FREE_OP1_VAR_PTR(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr, **array_ptr_ptr; - HashTable *fe_ht; - zend_object_iterator *iter = NULL; - zend_class_entry *ce = NULL; - zend_bool is_empty = 0; - - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - array_ptr_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_R); - if (array_ptr_ptr == NULL || array_ptr_ptr == &EG(uninitialized_zval_ptr)) { - ALLOC_INIT_ZVAL(array_ptr); - } else if (Z_TYPE_PP(array_ptr_ptr) == IS_OBJECT) { - if(Z_OBJ_HT_PP(array_ptr_ptr)->get_class_entry == NULL) { - zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class"); - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } - - ce = Z_OBJCE_PP(array_ptr_ptr); - if (!ce || ce->get_iterator == NULL) { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - (*array_ptr_ptr)->refcount++; - } - array_ptr = *array_ptr_ptr; - } else { - if (Z_TYPE_PP(array_ptr_ptr) == IS_ARRAY) { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - } - array_ptr = *array_ptr_ptr; - array_ptr->refcount++; - } - } else { - array_ptr = GET_OP1_ZVAL_PTR(BP_VAR_R); - if (IS_OP1_TMP_FREE()) { /* IS_TMP_VAR */ - zval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL_COPY(tmp, array_ptr); - array_ptr = tmp; - } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { - ce = Z_OBJCE_P(array_ptr); - if (!ce || !ce->get_iterator) { - array_ptr->refcount++; - } - } else { - if (OP1_TYPE == IS_VAR && - free_op1.var == NULL && - !array_ptr->is_ref && - array_ptr->refcount > 1) { - /* non-separated return value from function */ - zval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL_COPY(tmp, array_ptr); - zval_copy_ctor(tmp); - array_ptr = tmp; - } else { - array_ptr->refcount++; - } - } - } - - if (ce && ce->get_iterator) { - iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC); - - if (iter && !EG(exception)) { - array_ptr = zend_iterator_wrap(iter TSRMLS_CC); - } else { - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - FREE_OP1_VAR_PTR(); - } else { - FREE_OP1_IF_VAR(); - } - if (!EG(exception)) { - zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name); - } - zend_throw_exception_internal(NULL TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - } - - PZVAL_LOCK(array_ptr); - EX_T(opline->result.u.var).var.ptr = array_ptr; - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - - if (iter) { - iter->index = 0; - if (iter->funcs->rewind) { - iter->funcs->rewind(iter TSRMLS_CC); - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - FREE_OP1_VAR_PTR(); - } else { - FREE_OP1_IF_VAR(); - } - ZEND_VM_NEXT_OPCODE(); - } - } - is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - FREE_OP1_VAR_PTR(); - } else { - FREE_OP1_IF_VAR(); - } - ZEND_VM_NEXT_OPCODE(); - } - iter->index = -1; /* will be set to 0 before using next handler */ - } else if ((fe_ht = HASH_OF(array_ptr)) != NULL) { - zend_hash_internal_pointer_reset(fe_ht); - if (ce) { - zend_object *zobj = zend_objects_get_address(array_ptr TSRMLS_CC); - while (zend_hash_has_more_elements(fe_ht) == SUCCESS) { - char *str_key; - uint str_key_len; - ulong int_key; - zend_uchar key_type; - - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL); - if (key_type != HASH_KEY_NON_EXISTANT && - zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS) { - break; - } - zend_hash_move_forward(fe_ht); - } - } - is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS; - } else { - zend_error(E_WARNING, "Invalid argument supplied for foreach()"); - is_empty = 1; - } - - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - FREE_OP1_VAR_PTR(); - } else { - FREE_OP1_IF_VAR(); - } - if (is_empty) { - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } else { - ZEND_VM_NEXT_OPCODE(); - } -} - -ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array = GET_OP1_ZVAL_PTR(BP_VAR_R); - zval **value; - char *str_key; - uint str_key_len; - ulong int_key; - HashTable *fe_ht; - zend_object_iterator *iter = NULL; - int key_type = 0; - zend_bool use_key = (zend_bool)(opline->extended_value & ZEND_FE_FETCH_WITH_KEY); - - PZVAL_LOCK(array); - - switch (zend_iterator_unwrap(array, &iter TSRMLS_CC)) { - default: - case ZEND_ITER_INVALID: - zend_error(E_WARNING, "Invalid argument supplied for foreach()"); - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - - case ZEND_ITER_PLAIN_OBJECT: { - char *class_name, *prop_name; - zend_object *zobj = zend_objects_get_address(array TSRMLS_CC); - - fe_ht = HASH_OF(array); - do { - if (zend_hash_get_current_data(fe_ht, (void **) &value)==FAILURE) { - /* reached end of iteration */ - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL); - - zend_hash_move_forward(fe_ht); - } while (key_type == HASH_KEY_NON_EXISTANT || zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) != SUCCESS); - if (use_key) { - zend_unmangle_property_name(str_key, str_key_len-1, &class_name, &prop_name); - str_key_len = strlen(prop_name); - str_key = estrndup(prop_name, str_key_len); - str_key_len++; - } - break; - } - - case ZEND_ITER_PLAIN_ARRAY: - fe_ht = HASH_OF(array); - if (zend_hash_get_current_data(fe_ht, (void **) &value)==FAILURE) { - /* reached end of iteration */ - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } - if (use_key) { - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 1, NULL); - } - zend_hash_move_forward(fe_ht); - break; - - case ZEND_ITER_OBJECT: - /* !iter happens from exception */ - if (iter && ++iter->index > 0) { - /* This could cause an endless loop if index becomes zero again. - * In case that ever happens we need an additional flag. */ - iter->funcs->move_forward(iter TSRMLS_CC); - if (EG(exception)) { - array->refcount--; - zval_ptr_dtor(&array); - ZEND_VM_NEXT_OPCODE(); - } - } - /* If index is zero we come from FE_RESET and checked valid() already. */ - if (!iter || (iter->index > 0 && iter->funcs->valid(iter TSRMLS_CC) == FAILURE)) { - /* reached end of iteration */ - if (EG(exception)) { - array->refcount--; - zval_ptr_dtor(&array); - ZEND_VM_NEXT_OPCODE(); - } - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } - iter->funcs->get_current_data(iter, &value TSRMLS_CC); - if (EG(exception)) { - array->refcount--; - zval_ptr_dtor(&array); - ZEND_VM_NEXT_OPCODE(); - } - if (!value) { - /* failure in get_current_data */ - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } - if (use_key) { - if (iter->funcs->get_current_key) { - key_type = iter->funcs->get_current_key(iter, &str_key, &str_key_len, &int_key TSRMLS_CC); - if (EG(exception)) { - array->refcount--; - zval_ptr_dtor(&array); - ZEND_VM_NEXT_OPCODE(); - } - } else { - key_type = HASH_KEY_IS_LONG; - int_key = iter->index; - } - } - break; - } - - if (opline->extended_value & ZEND_FE_FETCH_BYREF) { - SEPARATE_ZVAL_IF_NOT_REF(value); - (*value)->is_ref = 1; - EX_T(opline->result.u.var).var.ptr_ptr = value; - (*value)->refcount++; - } else { - EX_T(opline->result.u.var).var.ptr_ptr = value; - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (use_key) { - zend_op *op_data = opline+1; - zval *key = &EX_T(op_data->result.u.var).tmp_var; - - switch (key_type) { - case HASH_KEY_IS_STRING: - Z_STRVAL_P(key) = str_key; - Z_STRLEN_P(key) = str_key_len-1; - Z_TYPE_P(key) = IS_STRING; - break; - case HASH_KEY_IS_LONG: - Z_LVAL_P(key) = int_key; - Z_TYPE_P(key) = IS_LONG; - break; - default: - case HASH_KEY_NON_EXISTANT: - ZVAL_NULL(key); - break; - } - } - - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval tmp, *varname = GET_OP1_ZVAL_PTR(BP_VAR_IS); - zval **value; - zend_bool isset = 1; - HashTable *target_symbol_table; - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - varname = &tmp; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - value = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1 TSRMLS_CC); - if (!value) { - isset = 0; - } - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) { - isset = 0; - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0; - } else { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1; - } else { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0; - } - break; - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } - FREE_OP1(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, VAR|UNUSED|CV, CONST|TMP|VAR|CV, int prop_dim) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_IS); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - zend_free_op free_op2; - zval *offset = GET_OP2_ZVAL_PTR(BP_VAR_R); - - if (Z_TYPE_PP(container) == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - FREE_OP2(); - } else if (Z_TYPE_PP(container) == IS_OBJECT) { - if (IS_OP2_TMP_FREE()) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (IS_OP2_TMP_FREE()) { - zval_ptr_dtor(&offset); - } else { - FREE_OP2(); - } - } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ - zval tmp; - - if (Z_TYPE_P(offset) != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (Z_TYPE_P(offset) == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') { - result = 1; - } - break; - } - } - FREE_OP2(); - } else { - FREE_OP2(); - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result; - break; - case ZEND_ISEMPTY: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result; - break; - } - - FREE_OP1_VAR_PTR(); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(115, ZEND_ISSET_ISEMPTY_DIM_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, prop_dim, 0); -} - -ZEND_VM_HANDLER(148, ZEND_ISSET_ISEMPTY_PROP_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV) -{ - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, prop_dim, 1); -} - -ZEND_VM_HANDLER(79, ZEND_EXIT, CONST|TMP|VAR|UNUSED|CV, ANY) -{ -#if !defined(ZEND_VM_SPEC) || (OP1_TYPE != IS_UNUSED) - zend_op *opline = EX(opline); - if (OP1_TYPE != IS_UNUSED) { - zend_free_op free_op1; - zval *ptr = GET_OP1_ZVAL_PTR(BP_VAR_R); - - if (Z_TYPE_P(ptr) == IS_LONG) { - EG(exit_status) = Z_LVAL_P(ptr); - } else { - zend_print_variable(ptr); - } - FREE_OP1(); - } -#endif - zend_bailout(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(57, ZEND_BEGIN_SILENCE, ANY, ANY) -{ - zend_op *opline = EX(opline); - - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = EG(error_reporting); - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG; /* shouldn't be necessary */ - if (EX(old_error_reporting) == NULL) { - EX(old_error_reporting) = &EX_T(opline->result.u.var).tmp_var; - } - - if (EG(error_reporting)) { - zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), "0", 1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(142, ZEND_RAISE_ABSTRACT_ERROR, ANY, ANY) -{ - zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", EG(scope)->name, EX(op_array)->function_name); - ZEND_VM_NEXT_OPCODE(); /* Never reached */ -} - -ZEND_VM_HANDLER(58, ZEND_END_SILENCE, TMP, ANY) -{ - zend_op *opline = EX(opline); - zval restored_error_reporting; - - if (!EG(error_reporting) && Z_LVAL(EX_T(opline->op1.u.var).tmp_var) != 0) { - Z_TYPE(restored_error_reporting) = IS_LONG; - Z_LVAL(restored_error_reporting) = Z_LVAL(EX_T(opline->op1.u.var).tmp_var); - convert_to_string(&restored_error_reporting); - zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME); - zendi_zval_dtor(restored_error_reporting); - } - if (EX(old_error_reporting) == &EX_T(opline->op1.u.var).tmp_var) { - EX(old_error_reporting) = NULL; - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(22, ZEND_QM_ASSIGN, CONST|TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *value = GET_OP1_ZVAL_PTR(BP_VAR_R); - - EX_T(opline->result.u.var).tmp_var = *value; - if (!IS_OP1_TMP_FREE()) { - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } - FREE_OP1_IF_VAR(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(101, ZEND_EXT_STMT, ANY, ANY) -{ - if (!EG(no_extensions)) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_statement_handler, EX(op_array) TSRMLS_CC); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(102, ZEND_EXT_FCALL_BEGIN, ANY, ANY) -{ - if (!EG(no_extensions)) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_begin_handler, EX(op_array) TSRMLS_CC); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(103, ZEND_EXT_FCALL_END, ANY, ANY) -{ - if (!EG(no_extensions)) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_end_handler, EX(op_array) TSRMLS_CC); - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(139, ZEND_DECLARE_CLASS, ANY, ANY) -{ - zend_op *opline = EX(opline); - - EX_T(opline->result.u.var).class_entry = do_bind_class(opline, EG(class_table), 0 TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(140, ZEND_DECLARE_INHERITED_CLASS, ANY, ANY) -{ - zend_op *opline = EX(opline); - - EX_T(opline->result.u.var).class_entry = do_bind_inherited_class(opline, EG(class_table), EX_T(opline->extended_value).class_entry, 0 TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(141, ZEND_DECLARE_FUNCTION, ANY, ANY) -{ - do_bind_function(EX(opline), EG(function_table), 0); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(105, ZEND_TICKS, CONST, ANY) -{ - zend_op *opline = EX(opline); - - if (++EG(ticks_count)>=Z_LVAL(opline->op1.u.constant)) { - EG(ticks_count)=0; - if (zend_ticks_function) { - zend_ticks_function(Z_LVAL(opline->op1.u.constant)); - } - } - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(138, ZEND_INSTANCEOF, TMP|VAR|CV, ANY) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *expr = GET_OP1_ZVAL_PTR(BP_VAR_R); - zend_bool result; - - if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->get_class_entry) { - result = instanceof_function(Z_OBJCE_P(expr), EX_T(opline->op2.u.var).class_entry TSRMLS_CC); - } else { - result = 0; - } - ZVAL_BOOL(&EX_T(opline->result.u.var).tmp_var, result); - FREE_OP1(); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(104, ZEND_EXT_NOP, ANY, ANY) -{ - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(0, ZEND_NOP, ANY, ANY) -{ - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(144, ZEND_ADD_INTERFACE, ANY, ANY) -{ - zend_op *opline = EX(opline); - zend_class_entry *ce = EX_T(opline->op1.u.var).class_entry; - zend_class_entry *iface = EX_T(opline->op2.u.var).class_entry; - - if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) { - zend_error_noreturn(E_ERROR, "%s cannot implement %s - it is not an interface", ce->name, iface->name); - } - - zend_do_implement_interface(ce, iface TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY) -{ - zend_uint op_num = EG(opline_before_exception)-EG(active_op_array)->opcodes; - int i; - zend_uint catch_op_num; - int catched = 0; - zval **stack_zval_pp; - zval restored_error_reporting; - - stack_zval_pp = (zval **) EG(argument_stack).top_element - 1; - while (*stack_zval_pp != NULL) { - zval_ptr_dtor(stack_zval_pp); - EG(argument_stack).top_element--; - EG(argument_stack).top--; - stack_zval_pp--; - } - - for (i=0; ilast_try_catch; i++) { - if (EG(active_op_array)->try_catch_array[i].try_op > op_num) { - /* further blocks will not be relevant... */ - break; - } - if (op_num >= EG(active_op_array)->try_catch_array[i].try_op - && op_num < EG(active_op_array)->try_catch_array[i].catch_op) { - catch_op_num = EX(op_array)->try_catch_array[i].catch_op; - catched = 1; - } - } - - while (EX(fbc)) { - zend_op *ctor_opline = (zend_op*)zend_ptr_stack_pop(&EG(arg_types_stack)); - - if (EX(object)) { - if (ctor_opline && RETURN_VALUE_USED(ctor_opline)) { - EX(object)->refcount--; - } - zval_ptr_dtor(&EX(object)); - } - zend_ptr_stack_2_pop(&EG(arg_types_stack), (void**)&EX(object), (void**)&EX(fbc)); - } - - for (i=0; ilast_brk_cont; i++) { - if (EX(op_array)->brk_cont_array[i].start > op_num) { - /* further blocks will not be relevant... */ - break; - } - if (op_num < EX(op_array)->brk_cont_array[i].brk) { - if (!catched || - catch_op_num >= EX(op_array)->brk_cont_array[i].brk) { - zend_op *brk_opline = &EX(op_array)->opcodes[EX(op_array)->brk_cont_array[i].brk]; - - switch (brk_opline->opcode) { - case ZEND_SWITCH_FREE: - zend_switch_free(brk_opline, EX(Ts) TSRMLS_CC); - break; - case ZEND_FREE: - zendi_zval_dtor(EX_T(brk_opline->op1.u.var).tmp_var); - break; - } - } - } - } - - /* restore previous error_reporting value */ - if (!EG(error_reporting) && EX(old_error_reporting) != NULL && Z_LVAL_P(EX(old_error_reporting)) != 0) { - Z_TYPE(restored_error_reporting) = IS_LONG; - Z_LVAL(restored_error_reporting) = Z_LVAL_P(EX(old_error_reporting)); - convert_to_string(&restored_error_reporting); - zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME); - zendi_zval_dtor(restored_error_reporting); - } - EX(old_error_reporting) = NULL; - - if (!catched) { - ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); - } else { - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[catch_op_num]); - ZEND_VM_CONTINUE(); - } -} - -ZEND_VM_HANDLER(146, ZEND_VERIFY_ABSTRACT_CLASS, ANY, ANY) -{ - zend_verify_abstract_class(EX_T(EX(opline)->op1.u.var).class_entry TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -ZEND_VM_HANDLER(150, ZEND_USER_OPCODE, ANY, ANY) -{ - int ret = zend_user_opcode_handlers[EX(opline)->opcode](ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL); - - switch (ret) { - case ZEND_USER_OPCODE_CONTINUE: - ZEND_VM_CONTINUE(); - case ZEND_USER_OPCODE_RETURN: - ZEND_VM_RETURN(); - case ZEND_USER_OPCODE_DISPATCH: - ZEND_VM_DISPATCH(EX(opline)->opcode, EX(opline)); - default: - ZEND_VM_DISPATCH(ret & 0xff, EX(opline)); - } -} - -ZEND_VM_EXPORT_HELPER(zend_do_fcall, zend_do_fcall_common_helper) diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h deleted file mode 100644 index f23e6ab835..0000000000 --- a/Zend/zend_vm_execute.h +++ /dev/null @@ -1,30309 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - | Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ - -static opcode_handler_t zend_user_opcode_handlers[256] = {(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL,(opcode_handler_t)NULL}; - -static zend_uchar zend_user_opcodes[256] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255}; - -static opcode_handler_t zend_vm_get_opcode_handler(zend_uchar opcode, zend_op* op); - - -#define ZEND_VM_CONTINUE() return 0 -#define ZEND_VM_RETURN() return 1 -#define ZEND_VM_DISPATCH(opcode, opline) return zend_vm_get_opcode_handler(opcode, opline)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - -#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data TSRMLS_CC - -ZEND_API void execute(zend_op_array *op_array TSRMLS_DC) -{ - zend_execute_data execute_data; - - - if (EG(exception)) { - return; - } - - /* Initialize execute_data */ - EX(fbc) = NULL; - EX(object) = NULL; - EX(old_error_reporting) = NULL; - if (op_array->T < TEMP_VAR_STACK_LIMIT) { - EX(Ts) = (temp_variable *) do_alloca(sizeof(temp_variable) * op_array->T); - } else { - EX(Ts) = (temp_variable *) safe_emalloc(sizeof(temp_variable), op_array->T, 0); - } - EX(CVs) = (zval***)do_alloca(sizeof(zval**) * op_array->last_var); - memset(EX(CVs), 0, sizeof(zval**) * op_array->last_var); - EX(op_array) = op_array; - EX(original_in_execution) = EG(in_execution); - EX(symbol_table) = EG(active_symbol_table); - EX(prev_execute_data) = EG(current_execute_data); - EG(current_execute_data) = &execute_data; - - EG(in_execution) = 1; - if (op_array->start_op) { - ZEND_VM_SET_OPCODE(op_array->start_op); - } else { - ZEND_VM_SET_OPCODE(op_array->opcodes); - } - - if (op_array->uses_this && EG(This)) { - EG(This)->refcount++; /* For $this pointer */ - if (zend_hash_add(EG(active_symbol_table), "this", sizeof("this"), &EG(This), sizeof(zval *), NULL)==FAILURE) { - EG(This)->refcount--; - } - } - - EG(opline_ptr) = &EX(opline); - - EX(function_state).function = (zend_function *) op_array; - EG(function_state_ptr) = &EX(function_state); -#if ZEND_DEBUG - /* function_state.function_symbol_table is saved as-is to a stack, - * which is an intentional UMR. Shut it up if we're in DEBUG. - */ - EX(function_state).function_symbol_table = NULL; -#endif - - while (1) { -#ifdef ZEND_WIN32 - if (EG(timed_out)) { - zend_timeout(0); - } -#endif - - if (EX(opline)->handler(&execute_data TSRMLS_CC) > 0) { - return; - } - - } - zend_error_noreturn(E_ERROR, "Arrived at end of main loop which shouldn't happen"); -} - -#undef EX -#define EX(element) execute_data->element - -static int ZEND_JMP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ -#if DEBUG_ZEND>=2 - printf("Jumping to %d\n", EX(opline)->op1.u.opline_num); -#endif - ZEND_VM_SET_OPCODE(EX(opline)->op1.u.jmp_addr); - ZEND_VM_CONTINUE(); /* CHECK_ME */ -} - -static int ZEND_INIT_STRING_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zval *tmp = &EX_T(EX(opline)->result.u.var).tmp_var; - - tmp->value.str.val = emalloc(1); - tmp->value.str.val[0] = 0; - tmp->value.str.len = 0; - tmp->refcount = 1; - tmp->type = IS_STRING; - tmp->is_ref = 0; - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval **original_return_value; - zend_class_entry *current_scope = NULL; - zval *current_this = NULL; - int return_value_used = RETURN_VALUE_USED(opline); - zend_bool should_change_scope; - zend_op *ctor_opline; - - if (EX(function_state).function->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) { - if (EX(function_state).function->common.fn_flags & ZEND_ACC_ABSTRACT) { - zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name); - ZEND_VM_NEXT_OPCODE(); /* Never reached */ - } - if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) { - zend_error(E_STRICT, "Function %s%s%s() is deprecated", - EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "", - EX(function_state).function->common.scope ? "::" : "", - EX(function_state).function->common.function_name); - } - } - - zend_ptr_stack_2_push(&EG(argument_stack), (void *) opline->extended_value, NULL); - - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - - if (EX(function_state).function->type == ZEND_USER_FUNCTION - || EX(function_state).function->common.scope) { - should_change_scope = 1; - current_this = EG(This); - EG(This) = EX(object); - current_scope = EG(scope); - EG(scope) = (EX(function_state).function->type == ZEND_USER_FUNCTION || !EX(object)) ? EX(function_state).function->common.scope : NULL; - } else { - should_change_scope = 0; - } - - EX_T(opline->result.u.var).var.fcall_returned_reference = 0; - - if (EX(function_state).function->common.scope) { - if (!EG(This) && !(EX(function_state).function->common.fn_flags & ZEND_ACC_STATIC)) { - int severity; - char *severity_word; - if (EX(function_state).function->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - severity = E_STRICT; - severity_word = "should not"; - } else { - severity = E_ERROR; - severity_word = "cannot"; - } - zend_error(severity, "Non-static method %s::%s() %s be called statically", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name, severity_word); - } - } - if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) { - unsigned char return_reference = EX(function_state).function->common.return_reference; - - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*(EX_T(opline->result.u.var).var.ptr)); - - if (EX(function_state).function->common.arg_info) { - zend_uint i=0; - zval **p; - ulong arg_count; - - p = (zval **) EG(argument_stack).top_element-2; - arg_count = (ulong) *p; - - while (arg_count>0) { - zend_verify_arg_type(EX(function_state).function, ++i, *(p-arg_count) TSRMLS_CC); - arg_count--; - } - } - if (!zend_execute_internal) { - /* saves one function call if zend_execute_internal is not used */ - ((zend_internal_function *) EX(function_state).function)->handler(opline->extended_value, EX_T(opline->result.u.var).var.ptr, EX(function_state).function->common.return_reference?&EX_T(opline->result.u.var).var.ptr:NULL, EX(object), return_value_used TSRMLS_CC); - } else { - zend_execute_internal(execute_data, return_value_used TSRMLS_CC); - } - - EG(current_execute_data) = execute_data; - -/* We shouldn't fix bad extensions here, - because it can break proper ones (Bug #34045) - if (!EX(function_state).function->common.return_reference) { - EX_T(opline->result.u.var).var.ptr->is_ref = 0; - EX_T(opline->result.u.var).var.ptr->refcount = 1; - } -*/ - if (!return_value_used) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } else { - EX_T(opline->result.u.var).var.fcall_returned_reference = return_reference; - } - } else if (EX(function_state).function->type == ZEND_USER_FUNCTION) { - EX_T(opline->result.u.var).var.ptr = NULL; - if (EG(symtable_cache_ptr)>=EG(symtable_cache)) { - /*printf("Cache hit! Reusing %x\n", symtable_cache[symtable_cache_ptr]);*/ - EX(function_state).function_symbol_table = *(EG(symtable_cache_ptr)--); - } else { - ALLOC_HASHTABLE(EX(function_state).function_symbol_table); - zend_hash_init(EX(function_state).function_symbol_table, 0, NULL, ZVAL_PTR_DTOR, 0); - /*printf("Cache miss! Initialized %x\n", function_state.function_symbol_table);*/ - } - EG(active_symbol_table) = EX(function_state).function_symbol_table; - original_return_value = EG(return_value_ptr_ptr); - EG(return_value_ptr_ptr) = EX_T(opline->result.u.var).var.ptr_ptr; - EG(active_op_array) = (zend_op_array *) EX(function_state).function; - - zend_execute(EG(active_op_array) TSRMLS_CC); - EX_T(opline->result.u.var).var.fcall_returned_reference = EG(active_op_array)->return_reference; - - if (return_value_used && !EX_T(opline->result.u.var).var.ptr) { - if (!EG(exception)) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*EX_T(opline->result.u.var).var.ptr); - } - } else if (!return_value_used && EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - - EG(opline_ptr) = &EX(opline); - EG(active_op_array) = EX(op_array); - EG(return_value_ptr_ptr)=original_return_value; - if (EG(symtable_cache_ptr)>=EG(symtable_cache_limit)) { - zend_hash_destroy(EX(function_state).function_symbol_table); - FREE_HASHTABLE(EX(function_state).function_symbol_table); - } else { - /* clean before putting into the cache, since clean - could call dtors, which could use cached hash */ - zend_hash_clean(EX(function_state).function_symbol_table); - *(++EG(symtable_cache_ptr)) = EX(function_state).function_symbol_table; - } - EG(active_symbol_table) = EX(symbol_table); - } else { /* ZEND_OVERLOADED_FUNCTION */ - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*(EX_T(opline->result.u.var).var.ptr)); - - /* Not sure what should be done here if it's a static method */ - if (EX(object)) { - Z_OBJ_HT_P(EX(object))->call_method(EX(fbc)->common.function_name, opline->extended_value, EX_T(opline->result.u.var).var.ptr, &EX_T(opline->result.u.var).var.ptr, EX(object), return_value_used TSRMLS_CC); - } else { - zend_error_noreturn(E_ERROR, "Cannot call overloaded function for non-object"); - } - - if (EX(function_state).function->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY) { - efree(EX(function_state).function->common.function_name); - } - efree(EX(fbc)); - - if (!return_value_used) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } else { - EX_T(opline->result.u.var).var.ptr->is_ref = 0; - EX_T(opline->result.u.var).var.ptr->refcount = 1; - } - } - - ctor_opline = (zend_op*)zend_ptr_stack_pop(&EG(arg_types_stack)); - - if (EG(This)) { - if (EG(exception) && ctor_opline) { - if (RETURN_VALUE_USED(ctor_opline)) { - EG(This)->refcount--; - } - if (EG(This)->refcount == 1) { - zend_object_store_ctor_failed(EG(This) TSRMLS_CC); - } - } - if (should_change_scope) { - zval_ptr_dtor(&EG(This)); - } - } - - if (should_change_scope) { - EG(This) = current_this; - EG(scope) = current_scope; - } - zend_ptr_stack_2_pop(&EG(arg_types_stack), (void**)&EX(object), (void**)&EX(fbc)); - - EX(function_state).function = (zend_function *) EX(op_array); - EG(function_state_ptr) = &EX(function_state); - zend_ptr_stack_clear_multiple(TSRMLS_C); - - if (EG(exception)) { - zend_throw_exception_internal(NULL TSRMLS_CC); - if (return_value_used && EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - EX(function_state).function = EX(fbc); - return zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_CATCH_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_class_entry *ce; - - /* Check whether an exception has been thrown, if not, jump over code */ - if (EG(exception) == NULL) { - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->extended_value]); - ZEND_VM_CONTINUE(); /* CHECK_ME */ - } - ce = Z_OBJCE_P(EG(exception)); - if (ce != EX_T(opline->op1.u.var).class_entry) { - if (!instanceof_function(ce, EX_T(opline->op1.u.var).class_entry TSRMLS_CC)) { - if (opline->op1.u.EA.type) { - zend_throw_exception_internal(NULL TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->extended_value]); - ZEND_VM_CONTINUE(); /* CHECK_ME */ - } - } - - zend_hash_update(EG(active_symbol_table), opline->op2.u.constant.value.str.val, - opline->op2.u.constant.value.str.len+1, &EG(exception), sizeof(zval *), (void **) NULL); - EG(exception) = NULL; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval **param; - zend_uint arg_num = Z_LVAL(opline->op1.u.constant); - - if (zend_ptr_stack_get_arg(arg_num, (void **) ¶m TSRMLS_CC)==FAILURE) { - char *space; - char *class_name = get_active_class_name(&space TSRMLS_CC); - zend_execute_data *ptr = EX(prev_execute_data); - - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL TSRMLS_CC); - if(ptr && ptr->op_array) { - zend_error(E_WARNING, "Missing argument %ld for %s%s%s(), called in %s on line %d and defined", opline->op1.u.constant.value.lval, class_name, space, get_active_function_name(TSRMLS_C), ptr->op_array->filename, ptr->opline->lineno); - } else { - zend_error(E_WARNING, "Missing argument %ld for %s%s%s()", opline->op1.u.constant.value.lval, class_name, space, get_active_function_name(TSRMLS_C)); - } - if (opline->result.op_type == IS_VAR) { - PZVAL_UNLOCK_FREE(*EX_T(opline->result.u.var).var.ptr_ptr); - } - } else { - zend_free_op free_res; - zval **var_ptr; - - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param TSRMLS_CC); - var_ptr = get_zval_ptr_ptr(&opline->result, EX(Ts), &free_res, BP_VAR_W); - if (PZVAL_IS_REF(*param)) { - zend_assign_to_variable_reference(var_ptr, param TSRMLS_CC); - } else { - zend_receive(var_ptr, *param TSRMLS_CC); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_NEW_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *object_zval; - zend_function *constructor; - - if (EX_T(opline->op1.u.var).class_entry->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) { - char *class_type; - - if (EX_T(opline->op1.u.var).class_entry->ce_flags & ZEND_ACC_INTERFACE) { - class_type = "interface"; - } else { - class_type = "abstract class"; - } - zend_error_noreturn(E_ERROR, "Cannot instantiate %s %s", class_type, EX_T(opline->op1.u.var).class_entry->name); - } - ALLOC_ZVAL(object_zval); - object_init_ex(object_zval, EX_T(opline->op1.u.var).class_entry); - INIT_PZVAL(object_zval); - - constructor = Z_OBJ_HT_P(object_zval)->get_constructor(object_zval TSRMLS_CC); - - if (constructor == NULL) { - if (RETURN_VALUE_USED(opline)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr = object_zval; - } else { - zval_ptr_dtor(&object_zval); - } - ZEND_VM_JMP(EX(op_array)->opcodes + opline->op2.u.opline_num); - } else { - SELECTIVE_PZVAL_LOCK(object_zval, &opline->result); - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr = object_zval; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), opline); - - /* We are not handling overloaded classes right now */ - EX(object) = object_zval; - EX(fbc) = constructor; - - ZEND_VM_NEXT_OPCODE(); - } -} - -static int ZEND_BEGIN_SILENCE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = EG(error_reporting); - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG; /* shouldn't be necessary */ - if (EX(old_error_reporting) == NULL) { - EX(old_error_reporting) = &EX_T(opline->result.u.var).tmp_var; - } - - if (EG(error_reporting)) { - zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), "0", 1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", EG(scope)->name, EX(op_array)->function_name); - ZEND_VM_NEXT_OPCODE(); /* Never reached */ -} - -static int ZEND_EXT_STMT_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - if (!EG(no_extensions)) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_statement_handler, EX(op_array) TSRMLS_CC); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - if (!EG(no_extensions)) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_begin_handler, EX(op_array) TSRMLS_CC); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_EXT_FCALL_END_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - if (!EG(no_extensions)) { - zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_end_handler, EX(op_array) TSRMLS_CC); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DECLARE_CLASS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - EX_T(opline->result.u.var).class_entry = do_bind_class(opline, EG(class_table), 0 TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - EX_T(opline->result.u.var).class_entry = do_bind_inherited_class(opline, EG(class_table), EX_T(opline->extended_value).class_entry, 0 TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DECLARE_FUNCTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - do_bind_function(EX(opline), EG(function_table), 0); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_EXT_NOP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_NOP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_INTERFACE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_class_entry *ce = EX_T(opline->op1.u.var).class_entry; - zend_class_entry *iface = EX_T(opline->op2.u.var).class_entry; - - if (!(iface->ce_flags & ZEND_ACC_INTERFACE)) { - zend_error_noreturn(E_ERROR, "%s cannot implement %s - it is not an interface", ce->name, iface->name); - } - - zend_do_implement_interface(ce, iface TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_uint op_num = EG(opline_before_exception)-EG(active_op_array)->opcodes; - int i; - zend_uint catch_op_num; - int catched = 0; - zval **stack_zval_pp; - zval restored_error_reporting; - - stack_zval_pp = (zval **) EG(argument_stack).top_element - 1; - while (*stack_zval_pp != NULL) { - zval_ptr_dtor(stack_zval_pp); - EG(argument_stack).top_element--; - EG(argument_stack).top--; - stack_zval_pp--; - } - - for (i=0; ilast_try_catch; i++) { - if (EG(active_op_array)->try_catch_array[i].try_op > op_num) { - /* further blocks will not be relevant... */ - break; - } - if (op_num >= EG(active_op_array)->try_catch_array[i].try_op - && op_num < EG(active_op_array)->try_catch_array[i].catch_op) { - catch_op_num = EX(op_array)->try_catch_array[i].catch_op; - catched = 1; - } - } - - while (EX(fbc)) { - zend_op *ctor_opline = (zend_op*)zend_ptr_stack_pop(&EG(arg_types_stack)); - - if (EX(object)) { - if (ctor_opline && RETURN_VALUE_USED(ctor_opline)) { - EX(object)->refcount--; - } - zval_ptr_dtor(&EX(object)); - } - zend_ptr_stack_2_pop(&EG(arg_types_stack), (void**)&EX(object), (void**)&EX(fbc)); - } - - for (i=0; ilast_brk_cont; i++) { - if (EX(op_array)->brk_cont_array[i].start > op_num) { - /* further blocks will not be relevant... */ - break; - } - if (op_num < EX(op_array)->brk_cont_array[i].brk) { - if (!catched || - catch_op_num >= EX(op_array)->brk_cont_array[i].brk) { - zend_op *brk_opline = &EX(op_array)->opcodes[EX(op_array)->brk_cont_array[i].brk]; - - switch (brk_opline->opcode) { - case ZEND_SWITCH_FREE: - zend_switch_free(brk_opline, EX(Ts) TSRMLS_CC); - break; - case ZEND_FREE: - zendi_zval_dtor(EX_T(brk_opline->op1.u.var).tmp_var); - break; - } - } - } - } - - /* restore previous error_reporting value */ - if (!EG(error_reporting) && EX(old_error_reporting) != NULL && Z_LVAL_P(EX(old_error_reporting)) != 0) { - Z_TYPE(restored_error_reporting) = IS_LONG; - Z_LVAL(restored_error_reporting) = Z_LVAL_P(EX(old_error_reporting)); - convert_to_string(&restored_error_reporting); - zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME); - zendi_zval_dtor(restored_error_reporting); - } - EX(old_error_reporting) = NULL; - - if (!catched) { - ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); - } else { - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[catch_op_num]); - ZEND_VM_CONTINUE(); - } -} - -static int ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_verify_abstract_class(EX_T(EX(opline)->op1.u.var).class_entry TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - int ret = zend_user_opcode_handlers[EX(opline)->opcode](ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL); - - switch (ret) { - case ZEND_USER_OPCODE_CONTINUE: - ZEND_VM_CONTINUE(); - case ZEND_USER_OPCODE_RETURN: - ZEND_VM_RETURN(); - case ZEND_USER_OPCODE_DISPATCH: - ZEND_VM_DISPATCH(EX(opline)->opcode, EX(opline)); - default: - ZEND_VM_DISPATCH(ret & 0xff, EX(opline)); - } -} - -static int ZEND_FETCH_CLASS_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *class_name; - - - - if (IS_CONST == IS_UNUSED) { - EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - - class_name = &opline->op2.u.constant; - - switch (Z_TYPE_P(class_name)) { - case IS_OBJECT: - EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name); - break; - case IS_STRING: - EX_T(opline->result.u.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC); - break; - default: - zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string"); - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_class_entry *ce; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - ce = EX_T(opline->op1.u.var).class_entry; - if(IS_CONST != IS_UNUSED) { - char *function_name_strval; - int function_name_strlen; - zend_bool is_const = (IS_CONST == IS_CONST); - - - if (is_const) { - function_name_strval = Z_STRVAL(opline->op2.u.constant); - function_name_strlen = Z_STRLEN(opline->op2.u.constant); - } else { - function_name = &opline->op2.u.constant; - - if (Z_TYPE_P(function_name) != IS_STRING) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = zend_str_tolower_dup(function_name->value.str.val, function_name->value.str.len); - function_name_strlen = function_name->value.str.len; - } - - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); - - if (!is_const) { - efree(function_name_strval); - - } - } else { - if(!ce->constructor) { - zend_error_noreturn(E_ERROR, "Can not call constructor"); - } - if (Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { - zend_error(E_COMPILE_ERROR, "Cannot call private %s::__construct()", ce->name); - } - EX(fbc) = ce->constructor; - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (IS_CONST != IS_UNUSED && - EG(This) && - Z_OBJ_HT_P(EG(This))->get_class_entry && - !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) { - /* We are calling method of the other (incompatible) class, - but passing $this. This is done for compatibility with php-4. */ - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); - - } - if ((EX(object) = EG(This))) { - EX(object)->refcount++; - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_function *function; - char *function_name_strval, *lcname; - int function_name_strlen; - - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - if (IS_CONST == IS_CONST) { - function_name_strval = opline->op2.u.constant.value.str.val; - function_name_strlen = opline->op2.u.constant.value.str.len; - } else { - function_name = &opline->op2.u.constant; - - if (Z_TYPE_P(function_name) != IS_STRING) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = function_name->value.str.val; - function_name_strlen = function_name->value.str.len; - } - - lcname = zend_str_tolower_dup(function_name_strval, function_name_strlen); - if (zend_hash_find(EG(function_table), lcname, function_name_strlen+1, (void **) &function)==FAILURE) { - efree(lcname); - zend_error_noreturn(E_ERROR, "Call to undefined function %s()", function_name_strval); - } - - efree(lcname); - if (IS_CONST != IS_CONST) { - - } - - EX(object) = NULL; - - EX(fbc) = function; - - ZEND_VM_NEXT_OPCODE(); -} - - -static int ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval **param, *assignment_value; - zend_uint arg_num = Z_LVAL(opline->op1.u.constant); - zend_free_op free_res; - - if (zend_ptr_stack_get_arg(arg_num, (void **) ¶m TSRMLS_CC)==FAILURE) { - if (Z_TYPE(opline->op2.u.constant) == IS_CONSTANT || Z_TYPE(opline->op2.u.constant)==IS_CONSTANT_ARRAY) { - zval *default_value; - - ALLOC_ZVAL(default_value); - *default_value = opline->op2.u.constant; - if (Z_TYPE(opline->op2.u.constant)==IS_CONSTANT_ARRAY) { - zval_copy_ctor(default_value); - } - default_value->refcount=1; - zval_update_constant(&default_value, 0 TSRMLS_CC); - default_value->refcount=0; - default_value->is_ref=0; - param = &default_value; - assignment_value = default_value; - } else { - param = NULL; - assignment_value = &opline->op2.u.constant; - } - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value TSRMLS_CC); - zend_assign_to_variable(NULL, &opline->result, NULL, assignment_value, IS_VAR, EX(Ts) TSRMLS_CC); - } else { - zval **var_ptr = get_zval_ptr_ptr(&opline->result, EX(Ts), &free_res, BP_VAR_W); - - assignment_value = *param; - zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value TSRMLS_CC); - if (PZVAL_IS_REF(assignment_value)) { - zend_assign_to_variable_reference(var_ptr, param TSRMLS_CC); - } else { - zend_receive(var_ptr, assignment_value TSRMLS_CC); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BRK_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zend_brk_cont_element *el; - - el = zend_brk_cont(&opline->op2.u.constant, opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC); - - ZEND_VM_JMP(EX(op_array)->opcodes + el->brk); -} - -static int ZEND_CONT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zend_brk_cont_element *el; - - el = zend_brk_cont(&opline->op2.u.constant, opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC); - - ZEND_VM_JMP(EX(op_array)->opcodes + el->cont); -} - -static int ZEND_FETCH_CLASS_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *class_name; - zend_free_op free_op2; - - - if (IS_TMP_VAR == IS_UNUSED) { - EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - - class_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - switch (Z_TYPE_P(class_name)) { - case IS_OBJECT: - EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name); - break; - case IS_STRING: - EX_T(opline->result.u.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC); - break; - default: - zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string"); - break; - } - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_class_entry *ce; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - ce = EX_T(opline->op1.u.var).class_entry; - if(IS_TMP_VAR != IS_UNUSED) { - char *function_name_strval; - int function_name_strlen; - zend_bool is_const = (IS_TMP_VAR == IS_CONST); - zend_free_op free_op2; - - if (is_const) { - function_name_strval = Z_STRVAL(opline->op2.u.constant); - function_name_strlen = Z_STRLEN(opline->op2.u.constant); - } else { - function_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = zend_str_tolower_dup(function_name->value.str.val, function_name->value.str.len); - function_name_strlen = function_name->value.str.len; - } - - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); - - if (!is_const) { - efree(function_name_strval); - zval_dtor(free_op2.var); - } - } else { - if(!ce->constructor) { - zend_error_noreturn(E_ERROR, "Can not call constructor"); - } - if (Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { - zend_error(E_COMPILE_ERROR, "Cannot call private %s::__construct()", ce->name); - } - EX(fbc) = ce->constructor; - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (IS_TMP_VAR != IS_UNUSED && - EG(This) && - Z_OBJ_HT_P(EG(This))->get_class_entry && - !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) { - /* We are calling method of the other (incompatible) class, - but passing $this. This is done for compatibility with php-4. */ - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); - - } - if ((EX(object) = EG(This))) { - EX(object)->refcount++; - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_function *function; - char *function_name_strval, *lcname; - int function_name_strlen; - zend_free_op free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - if (IS_TMP_VAR == IS_CONST) { - function_name_strval = opline->op2.u.constant.value.str.val; - function_name_strlen = opline->op2.u.constant.value.str.len; - } else { - function_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = function_name->value.str.val; - function_name_strlen = function_name->value.str.len; - } - - lcname = zend_str_tolower_dup(function_name_strval, function_name_strlen); - if (zend_hash_find(EG(function_table), lcname, function_name_strlen+1, (void **) &function)==FAILURE) { - efree(lcname); - zend_error_noreturn(E_ERROR, "Call to undefined function %s()", function_name_strval); - } - - efree(lcname); - if (IS_TMP_VAR != IS_CONST) { - zval_dtor(free_op2.var); - } - - EX(object) = NULL; - - EX(fbc) = function; - - ZEND_VM_NEXT_OPCODE(); -} - - -static int ZEND_BRK_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zend_brk_cont_element *el; - - el = zend_brk_cont(_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC), opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC); - zval_dtor(free_op2.var); - ZEND_VM_JMP(EX(op_array)->opcodes + el->brk); -} - -static int ZEND_CONT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zend_brk_cont_element *el; - - el = zend_brk_cont(_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC), opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC); - zval_dtor(free_op2.var); - ZEND_VM_JMP(EX(op_array)->opcodes + el->cont); -} - -static int ZEND_FETCH_CLASS_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *class_name; - zend_free_op free_op2; - - - if (IS_VAR == IS_UNUSED) { - EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - - class_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - switch (Z_TYPE_P(class_name)) { - case IS_OBJECT: - EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name); - break; - case IS_STRING: - EX_T(opline->result.u.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC); - break; - default: - zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string"); - break; - } - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_class_entry *ce; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - ce = EX_T(opline->op1.u.var).class_entry; - if(IS_VAR != IS_UNUSED) { - char *function_name_strval; - int function_name_strlen; - zend_bool is_const = (IS_VAR == IS_CONST); - zend_free_op free_op2; - - if (is_const) { - function_name_strval = Z_STRVAL(opline->op2.u.constant); - function_name_strlen = Z_STRLEN(opline->op2.u.constant); - } else { - function_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = zend_str_tolower_dup(function_name->value.str.val, function_name->value.str.len); - function_name_strlen = function_name->value.str.len; - } - - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); - - if (!is_const) { - efree(function_name_strval); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else { - if(!ce->constructor) { - zend_error_noreturn(E_ERROR, "Can not call constructor"); - } - if (Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { - zend_error(E_COMPILE_ERROR, "Cannot call private %s::__construct()", ce->name); - } - EX(fbc) = ce->constructor; - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (IS_VAR != IS_UNUSED && - EG(This) && - Z_OBJ_HT_P(EG(This))->get_class_entry && - !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) { - /* We are calling method of the other (incompatible) class, - but passing $this. This is done for compatibility with php-4. */ - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); - - } - if ((EX(object) = EG(This))) { - EX(object)->refcount++; - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_function *function; - char *function_name_strval, *lcname; - int function_name_strlen; - zend_free_op free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - if (IS_VAR == IS_CONST) { - function_name_strval = opline->op2.u.constant.value.str.val; - function_name_strlen = opline->op2.u.constant.value.str.len; - } else { - function_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = function_name->value.str.val; - function_name_strlen = function_name->value.str.len; - } - - lcname = zend_str_tolower_dup(function_name_strval, function_name_strlen); - if (zend_hash_find(EG(function_table), lcname, function_name_strlen+1, (void **) &function)==FAILURE) { - efree(lcname); - zend_error_noreturn(E_ERROR, "Call to undefined function %s()", function_name_strval); - } - - efree(lcname); - if (IS_VAR != IS_CONST) { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - EX(object) = NULL; - - EX(fbc) = function; - - ZEND_VM_NEXT_OPCODE(); -} - - -static int ZEND_BRK_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zend_brk_cont_element *el; - - el = zend_brk_cont(_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC), opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_JMP(EX(op_array)->opcodes + el->brk); -} - -static int ZEND_CONT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zend_brk_cont_element *el; - - el = zend_brk_cont(_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC), opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_JMP(EX(op_array)->opcodes + el->cont); -} - -static int ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *class_name; - - - - if (IS_UNUSED == IS_UNUSED) { - EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - - class_name = NULL; - - switch (Z_TYPE_P(class_name)) { - case IS_OBJECT: - EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name); - break; - case IS_STRING: - EX_T(opline->result.u.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC); - break; - default: - zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string"); - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_class_entry *ce; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - ce = EX_T(opline->op1.u.var).class_entry; - if(IS_UNUSED != IS_UNUSED) { - char *function_name_strval; - int function_name_strlen; - zend_bool is_const = (IS_UNUSED == IS_CONST); - - - if (is_const) { - function_name_strval = Z_STRVAL(opline->op2.u.constant); - function_name_strlen = Z_STRLEN(opline->op2.u.constant); - } else { - function_name = NULL; - - if (Z_TYPE_P(function_name) != IS_STRING) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = zend_str_tolower_dup(function_name->value.str.val, function_name->value.str.len); - function_name_strlen = function_name->value.str.len; - } - - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); - - if (!is_const) { - efree(function_name_strval); - - } - } else { - if(!ce->constructor) { - zend_error_noreturn(E_ERROR, "Can not call constructor"); - } - if (Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { - zend_error(E_COMPILE_ERROR, "Cannot call private %s::__construct()", ce->name); - } - EX(fbc) = ce->constructor; - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (IS_UNUSED != IS_UNUSED && - EG(This) && - Z_OBJ_HT_P(EG(This))->get_class_entry && - !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) { - /* We are calling method of the other (incompatible) class, - but passing $this. This is done for compatibility with php-4. */ - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); - - } - if ((EX(object) = EG(This))) { - EX(object)->refcount++; - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_CLASS_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *class_name; - - - - if (IS_CV == IS_UNUSED) { - EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - - class_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - switch (Z_TYPE_P(class_name)) { - case IS_OBJECT: - EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name); - break; - case IS_STRING: - EX_T(opline->result.u.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC); - break; - default: - zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string"); - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_class_entry *ce; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - ce = EX_T(opline->op1.u.var).class_entry; - if(IS_CV != IS_UNUSED) { - char *function_name_strval; - int function_name_strlen; - zend_bool is_const = (IS_CV == IS_CONST); - - - if (is_const) { - function_name_strval = Z_STRVAL(opline->op2.u.constant); - function_name_strlen = Z_STRLEN(opline->op2.u.constant); - } else { - function_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = zend_str_tolower_dup(function_name->value.str.val, function_name->value.str.len); - function_name_strlen = function_name->value.str.len; - } - - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); - - if (!is_const) { - efree(function_name_strval); - - } - } else { - if(!ce->constructor) { - zend_error_noreturn(E_ERROR, "Can not call constructor"); - } - if (Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { - zend_error(E_COMPILE_ERROR, "Cannot call private %s::__construct()", ce->name); - } - EX(fbc) = ce->constructor; - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (IS_CV != IS_UNUSED && - EG(This) && - Z_OBJ_HT_P(EG(This))->get_class_entry && - !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) { - /* We are calling method of the other (incompatible) class, - but passing $this. This is done for compatibility with php-4. */ - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); - - } - if ((EX(object) = EG(This))) { - EX(object)->refcount++; - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - zend_function *function; - char *function_name_strval, *lcname; - int function_name_strlen; - - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - if (IS_CV == IS_CONST) { - function_name_strval = opline->op2.u.constant.value.str.val; - function_name_strlen = opline->op2.u.constant.value.str.len; - } else { - function_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(function_name) != IS_STRING) { - zend_error_noreturn(E_ERROR, "Function name must be a string"); - } - function_name_strval = function_name->value.str.val; - function_name_strlen = function_name->value.str.len; - } - - lcname = zend_str_tolower_dup(function_name_strval, function_name_strlen); - if (zend_hash_find(EG(function_table), lcname, function_name_strlen+1, (void **) &function)==FAILURE) { - efree(lcname); - zend_error_noreturn(E_ERROR, "Call to undefined function %s()", function_name_strval); - } - - efree(lcname); - if (IS_CV != IS_CONST) { - - } - - EX(object) = NULL; - - EX(fbc) = function; - - ZEND_VM_NEXT_OPCODE(); -} - - -static int ZEND_BRK_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zend_brk_cont_element *el; - - el = zend_brk_cont(_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC), opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC); - - ZEND_VM_JMP(EX(op_array)->opcodes + el->brk); -} - -static int ZEND_CONT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zend_brk_cont_element *el; - - el = zend_brk_cont(_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC), opline->op1.u.opline_num, - EX(op_array), EX(Ts) TSRMLS_CC); - - ZEND_VM_JMP(EX(op_array)->opcodes + el->cont); -} - -static int ZEND_BW_NOT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_not_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_NOT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - boolean_not_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ECHO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval z_copy; - zval *z = &opline->op1.u.constant; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL && - zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) { - zend_print_variable(&z_copy); - zval_dtor(&z_copy); - } else { - zend_print_variable(z); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRINT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG; - - return ZEND_ECHO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_fetch_var_address_helper_SPEC_CONST(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *varname = &opline->op1.u.constant; - zval **retval; - zval tmp_varname; - HashTable *target_symbol_table; - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp_varname = *varname; - zval_copy_ctor(&tmp_varname); - convert_to_string(&tmp_varname); - varname = &tmp_varname; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0 TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC); -/* - if (!target_symbol_table) { - ZEND_VM_NEXT_OPCODE(); - } -*/ - if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &retval) == FAILURE) { - switch (type) { - case BP_VAR_R: - case BP_VAR_UNSET: - zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_IS: - retval = &EG(uninitialized_zval_ptr); - break; - case BP_VAR_RW: - zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_W: { - zval *new_zval = &EG(uninitialized_zval); - - new_zval->refcount++; - zend_hash_update(target_symbol_table, varname->value.str.val, varname->value.str.len+1, &new_zval, sizeof(zval *), (void **) &retval); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } - switch (opline->op2.u.EA.type) { - case ZEND_FETCH_GLOBAL: - if (IS_CONST != IS_TMP_VAR) { - - } - break; - case ZEND_FETCH_LOCAL: - - break; - case ZEND_FETCH_STATIC: - zval_update_constant(retval, (void*) 1 TSRMLS_CC); - break; - case ZEND_FETCH_GLOBAL_LOCK: - if (IS_CONST == IS_VAR && !free_op1.var) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - break; - } - } - - - if (varname == &tmp_varname) { - zval_dtor(varname); - } - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = retval; - PZVAL_LOCK(*retval); - switch (type) { - case BP_VAR_R: - case BP_VAR_IS: - AI_USE_PTR(EX_T(opline->result.u.var).var); - break; - case BP_VAR_UNSET: { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - break; - } - } - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_R_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_W_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CONST(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_RW_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CONST(BP_VAR_RW, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_FUNC_ARG_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CONST(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), EX(opline)->extended_value)?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_UNSET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CONST(BP_VAR_UNSET, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_IS_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CONST(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_JMPZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int ret = i_zend_is_true(&opline->op1.u.constant); - - if (!ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPNZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int ret = i_zend_is_true(&opline->op1.u.constant); - - if (ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPZNZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int retval = i_zend_is_true(&opline->op1.u.constant); - - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on true to %d\n", opline->extended_value); -#endif - ZEND_VM_JMP(&EX(op_array)->opcodes[opline->extended_value]); - } else { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on false to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(&EX(op_array)->opcodes[opline->op2.u.opline_num]); - } -} - -static int ZEND_JMPZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int retval = i_zend_is_true(&opline->op1.u.constant); - - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - if (!retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPNZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int retval = i_zend_is_true(&opline->op1.u.constant); - - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DO_FCALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *fname = &opline->op1.u.constant; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - if (zend_hash_find(EG(function_table), fname->value.str.val, fname->value.str.len+1, (void **) &EX(function_state).function)==FAILURE) { - zend_error_noreturn(E_ERROR, "Call to undefined function %s()", fname->value.str.val); - } - EX(object) = NULL; - - return zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_RETURN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *retval_ptr; - zval **retval_ptr_ptr; - - - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF) { - - if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) { - /* Not supposed to happen, but we'll allow it */ - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - goto return_by_value; - } - - retval_ptr_ptr = NULL; - - if (!retval_ptr_ptr) { - zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference"); - } - - if (IS_CONST == IS_VAR && !(*retval_ptr_ptr)->is_ref) { - if (opline->extended_value == ZEND_RETURNS_FUNCTION && - EX_T(opline->op1.u.var).var.fcall_returned_reference) { - } else if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - if (IS_CONST == IS_VAR && !0) { - PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - goto return_by_value; - } - } - - SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr_ptr); - (*retval_ptr_ptr)->refcount++; - - (*EG(return_value_ptr_ptr)) = (*retval_ptr_ptr); - } else { -return_by_value: - - retval_ptr = &opline->op1.u.constant; - - if (EG(ze1_compatibility_mode) && Z_TYPE_P(retval_ptr) == IS_OBJECT) { - zval *ret; - char *class_name; - zend_uint class_name_len; - int dup; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - dup = zend_get_object_classname(retval_ptr, &class_name, &class_name_len TSRMLS_CC); - if (Z_OBJ_HT_P(retval_ptr)->clone_obj == NULL) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", class_name); - } - zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name); - ret->value.obj = Z_OBJ_HT_P(retval_ptr)->clone_obj(retval_ptr TSRMLS_CC); - *EG(return_value_ptr_ptr) = ret; - if (!dup) { - efree(class_name); - } - } else if (!0) { /* Not a temp var */ - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF || - (PZVAL_IS_REF(retval_ptr) && retval_ptr->refcount > 0)) { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - zval_copy_ctor(ret); - *EG(return_value_ptr_ptr) = ret; - } else { - *EG(return_value_ptr_ptr) = retval_ptr; - retval_ptr->refcount++; - } - } else { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - *EG(return_value_ptr_ptr) = ret; - } - } - - ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); -} - -static int ZEND_THROW_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *value; - zval *exception; - - - value = &opline->op1.u.constant; - - if (Z_TYPE_P(value) != IS_OBJECT) { - zend_error_noreturn(E_ERROR, "Can only throw objects"); - } - /* Not sure if a complete copy is what we want here */ - ALLOC_ZVAL(exception); - INIT_PZVAL_COPY(exception, value); - if (!0) { - zval_copy_ctor(exception); - } - - zend_throw_exception_object(exception TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_VAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - if (opline->extended_value==ZEND_DO_FCALL_BY_NAME - && ARG_MUST_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.u.opline_num); - } - { - zval *valptr; - zval *value; - - - value = &opline->op1.u.constant; - - ALLOC_ZVAL(valptr); - INIT_PZVAL_COPY(valptr, value); - if (!0) { - zval_copy_ctor(valptr); - } - zend_ptr_stack_push(&EG(argument_stack), valptr); - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */ - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = i_zend_is_true(&opline->op1.u.constant); - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *obj = &opline->op1.u.constant; - zend_class_entry *ce; - zend_function *clone; - zend_object_clone_obj_t clone_call; - - if (!obj || Z_TYPE_P(obj) != IS_OBJECT) { - zend_error(E_WARNING, "__clone method called on non-object"); - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - - ZEND_VM_NEXT_OPCODE(); - } - - ce = Z_OBJCE_P(obj); - clone = ce ? ce->clone : NULL; - clone_call = Z_OBJ_HT_P(obj)->clone_obj; - if (!clone_call) { - if (ce) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", ce->name); - } else { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object"); - } - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - } - - if (ce && clone) { - if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) { - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : ""); - } - } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : ""); - } - } - } - - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (!EG(exception)) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - Z_OBJVAL_P(EX_T(opline->result.u.var).var.ptr) = clone_call(obj TSRMLS_CC); - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_OBJECT; - EX_T(opline->result.u.var).var.ptr->refcount=1; - EX_T(opline->result.u.var).var.ptr->is_ref=1; - if (!RETURN_VALUE_USED(opline) || EG(exception)) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CAST_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *expr = &opline->op1.u.constant; - zval *result = &EX_T(opline->result.u.var).tmp_var; - - *result = *expr; - if (!0) { - zendi_zval_copy_ctor(*result); - } - switch (opline->extended_value) { - case IS_NULL: - convert_to_null(result); - break; - case IS_BOOL: - convert_to_boolean(result); - break; - case IS_LONG: - convert_to_long(result); - break; - case IS_DOUBLE: - convert_to_double(result); - break; - case IS_STRING: { - zval var_copy; - int use_copy; - - zend_make_printable_zval(result, &var_copy, &use_copy); - if (use_copy) { - zval_dtor(result); - *result = var_copy; - } - break; - } - case IS_ARRAY: - convert_to_array(result); - break; - case IS_OBJECT: - convert_to_object(result); - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op_array *new_op_array=NULL; - zval **original_return_value = EG(return_value_ptr_ptr); - int return_value_used; - - zval *inc_filename = &opline->op1.u.constant; - zval tmp_inc_filename; - zend_bool failure_retval=0; - - if (inc_filename->type!=IS_STRING) { - tmp_inc_filename = *inc_filename; - zval_copy_ctor(&tmp_inc_filename); - convert_to_string(&tmp_inc_filename); - inc_filename = &tmp_inc_filename; - } - - return_value_used = RETURN_VALUE_USED(opline); - - switch (Z_LVAL(opline->op2.u.constant)) { - case ZEND_INCLUDE_ONCE: - case ZEND_REQUIRE_ONCE: { - zend_file_handle file_handle; - char cwd[MAXPATHLEN]; - cwd_state state; - - if (IS_ABSOLUTE_PATH(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename))) { - cwd[0] = '\0'; - } else if (!VCWD_GETCWD(cwd, MAXPATHLEN)) { - cwd[0] = '\0'; - } - - state.cwd_length = strlen(cwd); - state.cwd = zend_strndup(cwd, state.cwd_length); - - failure_retval = (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) && - zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1)); - - free(state.cwd); - - if (failure_retval) { - /* do nothing */ - } else if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename), &file_handle TSRMLS_CC)) { - - if (!file_handle.opened_path) { - file_handle.opened_path = estrndup(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename)); - } - - if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) { - new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC); - zend_destroy_file_handle(&file_handle TSRMLS_CC); - } else { - zend_file_handle_dtor(&file_handle); - failure_retval=1; - } - } else { - if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) { - zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename)); - } else { - zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename)); - } - } - } - break; - case ZEND_INCLUDE: - case ZEND_REQUIRE: - new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), inc_filename TSRMLS_CC); - break; - case ZEND_EVAL: { - char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC); - - new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC); - efree(eval_desc); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - if (inc_filename==&tmp_inc_filename) { - zval_dtor(&tmp_inc_filename); - } - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (new_op_array) { - zval *saved_object; - zend_function *saved_function; - - EG(return_value_ptr_ptr) = EX_T(opline->result.u.var).var.ptr_ptr; - EG(active_op_array) = new_op_array; - EX_T(opline->result.u.var).var.ptr = NULL; - - saved_object = EX(object); - saved_function = EX(function_state).function; - - EX(function_state).function = (zend_function *) new_op_array; - EX(object) = NULL; - - zend_execute(new_op_array TSRMLS_CC); - - EX(function_state).function = saved_function; - EX(object) = saved_object; - - if (!return_value_used) { - if (EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } else { /* return value is used */ - if (!EX_T(opline->result.u.var).var.ptr) { /* there was no return statement */ - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_PZVAL(EX_T(opline->result.u.var).var.ptr); - Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = 1; - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL; - } - } - - EG(opline_ptr) = &EX(opline); - EG(active_op_array) = EX(op_array); - EG(function_state_ptr) = &EX(function_state); - destroy_op_array(new_op_array TSRMLS_CC); - efree(new_op_array); - if (EG(exception)) { - zend_throw_exception_internal(NULL TSRMLS_CC); - } - } else { - if (return_value_used) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*EX_T(opline->result.u.var).var.ptr); - Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = failure_retval; - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL; - } - } - - EG(return_value_ptr_ptr) = original_return_value; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval tmp, *varname; - HashTable *target_symbol_table; - - - varname = &opline->op1.u.constant; - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - varname = &tmp; - } else if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { - varname->refcount++; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname) TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_hash_del(target_symbol_table, varname->value.str.val, varname->value.str.len+1) == SUCCESS) { - zend_execute_data *ex = execute_data; - ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1); - - do { - int i; - - if (ex->op_array) { - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == varname->value.str.len && - !memcmp(ex->op_array->vars[i].name, varname->value.str.val, varname->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - ex = ex->prev_execute_data; - } while (ex && ex->symbol_table == target_symbol_table); - } - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } else if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { - zval_ptr_dtor(&varname); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr, **array_ptr_ptr; - HashTable *fe_ht; - zend_object_iterator *iter = NULL; - zend_class_entry *ce = NULL; - zend_bool is_empty = 0; - - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - array_ptr_ptr = NULL; - if (array_ptr_ptr == NULL || array_ptr_ptr == &EG(uninitialized_zval_ptr)) { - ALLOC_INIT_ZVAL(array_ptr); - } else if (Z_TYPE_PP(array_ptr_ptr) == IS_OBJECT) { - if(Z_OBJ_HT_PP(array_ptr_ptr)->get_class_entry == NULL) { - zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class"); - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } - - ce = Z_OBJCE_PP(array_ptr_ptr); - if (!ce || ce->get_iterator == NULL) { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - (*array_ptr_ptr)->refcount++; - } - array_ptr = *array_ptr_ptr; - } else { - if (Z_TYPE_PP(array_ptr_ptr) == IS_ARRAY) { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - } - array_ptr = *array_ptr_ptr; - array_ptr->refcount++; - } - } else { - array_ptr = &opline->op1.u.constant; - if (0) { /* IS_TMP_VAR */ - zval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL_COPY(tmp, array_ptr); - array_ptr = tmp; - } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { - ce = Z_OBJCE_P(array_ptr); - if (!ce || !ce->get_iterator) { - array_ptr->refcount++; - } - } else { - if (IS_CONST == IS_VAR && - free_op1.var == NULL && - !array_ptr->is_ref && - array_ptr->refcount > 1) { - /* non-separated return value from function */ - zval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL_COPY(tmp, array_ptr); - zval_copy_ctor(tmp); - array_ptr = tmp; - } else { - array_ptr->refcount++; - } - } - } - - if (ce && ce->get_iterator) { - iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC); - - if (iter && !EG(exception)) { - array_ptr = zend_iterator_wrap(iter TSRMLS_CC); - } else { - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } else { - - } - if (!EG(exception)) { - zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name); - } - zend_throw_exception_internal(NULL TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - } - - PZVAL_LOCK(array_ptr); - EX_T(opline->result.u.var).var.ptr = array_ptr; - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - - if (iter) { - iter->index = 0; - if (iter->funcs->rewind) { - iter->funcs->rewind(iter TSRMLS_CC); - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); - } - } - is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); - } - iter->index = -1; /* will be set to 0 before using next handler */ - } else if ((fe_ht = HASH_OF(array_ptr)) != NULL) { - zend_hash_internal_pointer_reset(fe_ht); - if (ce) { - zend_object *zobj = zend_objects_get_address(array_ptr TSRMLS_CC); - while (zend_hash_has_more_elements(fe_ht) == SUCCESS) { - char *str_key; - uint str_key_len; - ulong int_key; - zend_uchar key_type; - - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL); - if (key_type != HASH_KEY_NON_EXISTANT && - zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS) { - break; - } - zend_hash_move_forward(fe_ht); - } - } - is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS; - } else { - zend_error(E_WARNING, "Invalid argument supplied for foreach()"); - is_empty = 1; - } - - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } else { - - } - if (is_empty) { - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } else { - ZEND_VM_NEXT_OPCODE(); - } -} - -static int ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval tmp, *varname = &opline->op1.u.constant; - zval **value; - zend_bool isset = 1; - HashTable *target_symbol_table; - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - varname = &tmp; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - value = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1 TSRMLS_CC); - if (!value) { - isset = 0; - } - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) { - isset = 0; - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0; - } else { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1; - } else { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0; - } - break; - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_EXIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ -#if 0 || (IS_CONST != IS_UNUSED) - zend_op *opline = EX(opline); - if (IS_CONST != IS_UNUSED) { - - zval *ptr = &opline->op1.u.constant; - - if (Z_TYPE_P(ptr) == IS_LONG) { - EG(exit_status) = Z_LVAL_P(ptr); - } else { - zend_print_variable(ptr); - } - - } -#endif - zend_bailout(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_QM_ASSIGN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *value = &opline->op1.u.constant; - - EX_T(opline->result.u.var).tmp_var = *value; - if (!0) { - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_TICKS_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (++EG(ticks_count)>=Z_LVAL(opline->op1.u.constant)) { - EG(ticks_count)=0; - if (zend_ticks_function) { - zend_ticks_function(Z_LVAL(opline->op1.u.constant)); - } - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - add_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - sub_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - mul_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - div_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - mod_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - concat_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - - - if (IS_CONST==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - &opline->op2.u.constant TSRMLS_CC); - - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_class_entry *ce = NULL; - zval **value; - - if (IS_CONST == IS_UNUSED) { -/* This seems to be a reminant of namespaces - if (EG(scope)) { - ce = EG(scope); - if (zend_hash_find(&ce->constants_table, Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant)+1, (void **) &value) == SUCCESS) { - zval_update_constant(value, (void *) 1 TSRMLS_CC); - EX_T(opline->result.u.var).tmp_var = **value; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - ZEND_VM_NEXT_OPCODE(); - } - } -*/ - if (!zend_get_constant(opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len, &EX_T(opline->result.u.var).tmp_var TSRMLS_CC)) { - zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", - opline->op2.u.constant.value.str.val, - opline->op2.u.constant.value.str.val); - EX_T(opline->result.u.var).tmp_var = opline->op2.u.constant; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } - ZEND_VM_NEXT_OPCODE(); - } - - ce = EX_T(opline->op1.u.var).class_entry; - - if (zend_hash_find(&ce->constants_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, (void **) &value) == SUCCESS) { - zval_update_constant(value, (void *) 1 TSRMLS_CC); - EX_T(opline->result.u.var).tmp_var = **value; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } else { - zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", opline->op2.u.constant.value.str.val); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=&opline->op2.u.constant; - -#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=&opline->op1.u.constant; - } -#else - expr_ptr=&opline->op1.u.constant; -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_CONST == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_CONST != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_ADD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op2; - - if (IS_CONST==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - -#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=&opline->op1.u.constant; - } -#else - expr_ptr=&opline->op1.u.constant; -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - zval_dtor(free_op2.var); - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_CONST == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_CONST != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_ADD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op2; - - if (IS_CONST==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - -#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=&opline->op1.u.constant; - } -#else - expr_ptr=&opline->op1.u.constant; -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_CONST == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_CONST != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=NULL; - -#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=&opline->op1.u.constant; - } -#else - expr_ptr=&opline->op1.u.constant; -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_CONST == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_CONST != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_ADD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - add_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - sub_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - mul_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - div_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - mod_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - concat_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - - - if (IS_CONST==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - &opline->op1.u.constant, - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - -#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=&opline->op1.u.constant; - } -#else - expr_ptr=&opline->op1.u.constant; -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_CONST == IS_VAR || IS_CONST == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_CONST == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_CONST != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_BW_NOT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_not_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_NOT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - boolean_not_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ECHO_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval z_copy; - zval *z = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL && - zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) { - zend_print_variable(&z_copy); - zval_dtor(&z_copy); - } else { - zend_print_variable(z); - } - - zval_dtor(free_op1.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRINT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG; - - return ZEND_ECHO_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_fetch_var_address_helper_SPEC_TMP(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *varname = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **retval; - zval tmp_varname; - HashTable *target_symbol_table; - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp_varname = *varname; - zval_copy_ctor(&tmp_varname); - convert_to_string(&tmp_varname); - varname = &tmp_varname; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0 TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC); -/* - if (!target_symbol_table) { - ZEND_VM_NEXT_OPCODE(); - } -*/ - if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &retval) == FAILURE) { - switch (type) { - case BP_VAR_R: - case BP_VAR_UNSET: - zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_IS: - retval = &EG(uninitialized_zval_ptr); - break; - case BP_VAR_RW: - zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_W: { - zval *new_zval = &EG(uninitialized_zval); - - new_zval->refcount++; - zend_hash_update(target_symbol_table, varname->value.str.val, varname->value.str.len+1, &new_zval, sizeof(zval *), (void **) &retval); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } - switch (opline->op2.u.EA.type) { - case ZEND_FETCH_GLOBAL: - if (IS_TMP_VAR != IS_TMP_VAR) { - zval_dtor(free_op1.var); - } - break; - case ZEND_FETCH_LOCAL: - zval_dtor(free_op1.var); - break; - case ZEND_FETCH_STATIC: - zval_update_constant(retval, (void*) 1 TSRMLS_CC); - break; - case ZEND_FETCH_GLOBAL_LOCK: - if (IS_TMP_VAR == IS_VAR && !free_op1.var) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - break; - } - } - - - if (varname == &tmp_varname) { - zval_dtor(varname); - } - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = retval; - PZVAL_LOCK(*retval); - switch (type) { - case BP_VAR_R: - case BP_VAR_IS: - AI_USE_PTR(EX_T(opline->result.u.var).var); - break; - case BP_VAR_UNSET: { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - break; - } - } - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_R_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_TMP(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_W_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_TMP(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_RW_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_TMP(BP_VAR_RW, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_FUNC_ARG_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_TMP(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), EX(opline)->extended_value)?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_UNSET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_TMP(BP_VAR_UNSET, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_IS_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_TMP(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_JMPZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int ret = i_zend_is_true(_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - zval_dtor(free_op1.var); - if (!ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPNZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int ret = i_zend_is_true(_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - zval_dtor(free_op1.var); - if (ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPZNZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - zval_dtor(free_op1.var); - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on true to %d\n", opline->extended_value); -#endif - ZEND_VM_JMP(&EX(op_array)->opcodes[opline->extended_value]); - } else { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on false to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(&EX(op_array)->opcodes[opline->op2.u.opline_num]); - } -} - -static int ZEND_JMPZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - zval_dtor(free_op1.var); - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - if (!retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPNZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - zval_dtor(free_op1.var); - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FREE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zendi_zval_dtor(EX_T(EX(opline)->op1.u.var).tmp_var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_RETURN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *retval_ptr; - zval **retval_ptr_ptr; - zend_free_op free_op1; - - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF) { - - if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) { - /* Not supposed to happen, but we'll allow it */ - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - goto return_by_value; - } - - retval_ptr_ptr = NULL; - - if (!retval_ptr_ptr) { - zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference"); - } - - if (IS_TMP_VAR == IS_VAR && !(*retval_ptr_ptr)->is_ref) { - if (opline->extended_value == ZEND_RETURNS_FUNCTION && - EX_T(opline->op1.u.var).var.fcall_returned_reference) { - } else if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - if (IS_TMP_VAR == IS_VAR && !1) { - PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - goto return_by_value; - } - } - - SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr_ptr); - (*retval_ptr_ptr)->refcount++; - - (*EG(return_value_ptr_ptr)) = (*retval_ptr_ptr); - } else { -return_by_value: - - retval_ptr = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EG(ze1_compatibility_mode) && Z_TYPE_P(retval_ptr) == IS_OBJECT) { - zval *ret; - char *class_name; - zend_uint class_name_len; - int dup; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - dup = zend_get_object_classname(retval_ptr, &class_name, &class_name_len TSRMLS_CC); - if (Z_OBJ_HT_P(retval_ptr)->clone_obj == NULL) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", class_name); - } - zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name); - ret->value.obj = Z_OBJ_HT_P(retval_ptr)->clone_obj(retval_ptr TSRMLS_CC); - *EG(return_value_ptr_ptr) = ret; - if (!dup) { - efree(class_name); - } - } else if (!1) { /* Not a temp var */ - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF || - (PZVAL_IS_REF(retval_ptr) && retval_ptr->refcount > 0)) { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - zval_copy_ctor(ret); - *EG(return_value_ptr_ptr) = ret; - } else { - *EG(return_value_ptr_ptr) = retval_ptr; - retval_ptr->refcount++; - } - } else { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - *EG(return_value_ptr_ptr) = ret; - } - } - - ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); -} - -static int ZEND_THROW_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *value; - zval *exception; - zend_free_op free_op1; - - value = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (Z_TYPE_P(value) != IS_OBJECT) { - zend_error_noreturn(E_ERROR, "Can only throw objects"); - } - /* Not sure if a complete copy is what we want here */ - ALLOC_ZVAL(exception); - INIT_PZVAL_COPY(exception, value); - if (!1) { - zval_copy_ctor(exception); - } - - zend_throw_exception_object(exception TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_VAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - if (opline->extended_value==ZEND_DO_FCALL_BY_NAME - && ARG_MUST_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.u.opline_num); - } - { - zval *valptr; - zval *value; - zend_free_op free_op1; - - value = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - ALLOC_ZVAL(valptr); - INIT_PZVAL_COPY(valptr, value); - if (!1) { - zval_copy_ctor(valptr); - } - zend_ptr_stack_push(&EG(argument_stack), valptr); - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */ - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = i_zend_is_true(_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SWITCH_FREE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_switch_free(EX(opline), EX(Ts) TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CLONE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *obj = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zend_class_entry *ce; - zend_function *clone; - zend_object_clone_obj_t clone_call; - - if (!obj || Z_TYPE_P(obj) != IS_OBJECT) { - zend_error(E_WARNING, "__clone method called on non-object"); - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - - ZEND_VM_NEXT_OPCODE(); - } - - ce = Z_OBJCE_P(obj); - clone = ce ? ce->clone : NULL; - clone_call = Z_OBJ_HT_P(obj)->clone_obj; - if (!clone_call) { - if (ce) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", ce->name); - } else { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object"); - } - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - } - - if (ce && clone) { - if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) { - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : ""); - } - } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : ""); - } - } - } - - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (!EG(exception)) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - Z_OBJVAL_P(EX_T(opline->result.u.var).var.ptr) = clone_call(obj TSRMLS_CC); - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_OBJECT; - EX_T(opline->result.u.var).var.ptr->refcount=1; - EX_T(opline->result.u.var).var.ptr->is_ref=1; - if (!RETURN_VALUE_USED(opline) || EG(exception)) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *expr = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *result = &EX_T(opline->result.u.var).tmp_var; - - *result = *expr; - if (!1) { - zendi_zval_copy_ctor(*result); - } - switch (opline->extended_value) { - case IS_NULL: - convert_to_null(result); - break; - case IS_BOOL: - convert_to_boolean(result); - break; - case IS_LONG: - convert_to_long(result); - break; - case IS_DOUBLE: - convert_to_double(result); - break; - case IS_STRING: { - zval var_copy; - int use_copy; - - zend_make_printable_zval(result, &var_copy, &use_copy); - if (use_copy) { - zval_dtor(result); - *result = var_copy; - } - break; - } - case IS_ARRAY: - convert_to_array(result); - break; - case IS_OBJECT: - convert_to_object(result); - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op_array *new_op_array=NULL; - zval **original_return_value = EG(return_value_ptr_ptr); - int return_value_used; - zend_free_op free_op1; - zval *inc_filename = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval tmp_inc_filename; - zend_bool failure_retval=0; - - if (inc_filename->type!=IS_STRING) { - tmp_inc_filename = *inc_filename; - zval_copy_ctor(&tmp_inc_filename); - convert_to_string(&tmp_inc_filename); - inc_filename = &tmp_inc_filename; - } - - return_value_used = RETURN_VALUE_USED(opline); - - switch (Z_LVAL(opline->op2.u.constant)) { - case ZEND_INCLUDE_ONCE: - case ZEND_REQUIRE_ONCE: { - zend_file_handle file_handle; - char cwd[MAXPATHLEN]; - cwd_state state; - - if (IS_ABSOLUTE_PATH(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename))) { - cwd[0] = '\0'; - } else if (!VCWD_GETCWD(cwd, MAXPATHLEN)) { - cwd[0] = '\0'; - } - - state.cwd_length = strlen(cwd); - state.cwd = zend_strndup(cwd, state.cwd_length); - - failure_retval = (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) && - zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1)); - - free(state.cwd); - - if (failure_retval) { - /* do nothing */ - } else if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename), &file_handle TSRMLS_CC)) { - - if (!file_handle.opened_path) { - file_handle.opened_path = estrndup(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename)); - } - - if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) { - new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC); - zend_destroy_file_handle(&file_handle TSRMLS_CC); - } else { - zend_file_handle_dtor(&file_handle); - failure_retval=1; - } - } else { - if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) { - zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename)); - } else { - zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename)); - } - } - } - break; - case ZEND_INCLUDE: - case ZEND_REQUIRE: - new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), inc_filename TSRMLS_CC); - break; - case ZEND_EVAL: { - char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC); - - new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC); - efree(eval_desc); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - if (inc_filename==&tmp_inc_filename) { - zval_dtor(&tmp_inc_filename); - } - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (new_op_array) { - zval *saved_object; - zend_function *saved_function; - - EG(return_value_ptr_ptr) = EX_T(opline->result.u.var).var.ptr_ptr; - EG(active_op_array) = new_op_array; - EX_T(opline->result.u.var).var.ptr = NULL; - - saved_object = EX(object); - saved_function = EX(function_state).function; - - EX(function_state).function = (zend_function *) new_op_array; - EX(object) = NULL; - - zend_execute(new_op_array TSRMLS_CC); - - EX(function_state).function = saved_function; - EX(object) = saved_object; - - if (!return_value_used) { - if (EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } else { /* return value is used */ - if (!EX_T(opline->result.u.var).var.ptr) { /* there was no return statement */ - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_PZVAL(EX_T(opline->result.u.var).var.ptr); - Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = 1; - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL; - } - } - - EG(opline_ptr) = &EX(opline); - EG(active_op_array) = EX(op_array); - EG(function_state_ptr) = &EX(function_state); - destroy_op_array(new_op_array TSRMLS_CC); - efree(new_op_array); - if (EG(exception)) { - zend_throw_exception_internal(NULL TSRMLS_CC); - } - } else { - if (return_value_used) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*EX_T(opline->result.u.var).var.ptr); - Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = failure_retval; - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL; - } - } - zval_dtor(free_op1.var); - EG(return_value_ptr_ptr) = original_return_value; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval tmp, *varname; - HashTable *target_symbol_table; - zend_free_op free_op1; - - varname = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - varname = &tmp; - } else if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { - varname->refcount++; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname) TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_hash_del(target_symbol_table, varname->value.str.val, varname->value.str.len+1) == SUCCESS) { - zend_execute_data *ex = execute_data; - ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1); - - do { - int i; - - if (ex->op_array) { - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == varname->value.str.len && - !memcmp(ex->op_array->vars[i].name, varname->value.str.val, varname->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - ex = ex->prev_execute_data; - } while (ex && ex->symbol_table == target_symbol_table); - } - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } else if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { - zval_ptr_dtor(&varname); - } - zval_dtor(free_op1.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr, **array_ptr_ptr; - HashTable *fe_ht; - zend_object_iterator *iter = NULL; - zend_class_entry *ce = NULL; - zend_bool is_empty = 0; - - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - array_ptr_ptr = NULL; - if (array_ptr_ptr == NULL || array_ptr_ptr == &EG(uninitialized_zval_ptr)) { - ALLOC_INIT_ZVAL(array_ptr); - } else if (Z_TYPE_PP(array_ptr_ptr) == IS_OBJECT) { - if(Z_OBJ_HT_PP(array_ptr_ptr)->get_class_entry == NULL) { - zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class"); - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } - - ce = Z_OBJCE_PP(array_ptr_ptr); - if (!ce || ce->get_iterator == NULL) { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - (*array_ptr_ptr)->refcount++; - } - array_ptr = *array_ptr_ptr; - } else { - if (Z_TYPE_PP(array_ptr_ptr) == IS_ARRAY) { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - } - array_ptr = *array_ptr_ptr; - array_ptr->refcount++; - } - } else { - array_ptr = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - if (1) { /* IS_TMP_VAR */ - zval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL_COPY(tmp, array_ptr); - array_ptr = tmp; - } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { - ce = Z_OBJCE_P(array_ptr); - if (!ce || !ce->get_iterator) { - array_ptr->refcount++; - } - } else { - if (IS_TMP_VAR == IS_VAR && - free_op1.var == NULL && - !array_ptr->is_ref && - array_ptr->refcount > 1) { - /* non-separated return value from function */ - zval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL_COPY(tmp, array_ptr); - zval_copy_ctor(tmp); - array_ptr = tmp; - } else { - array_ptr->refcount++; - } - } - } - - if (ce && ce->get_iterator) { - iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC); - - if (iter && !EG(exception)) { - array_ptr = zend_iterator_wrap(iter TSRMLS_CC); - } else { - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } else { - - } - if (!EG(exception)) { - zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name); - } - zend_throw_exception_internal(NULL TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - } - - PZVAL_LOCK(array_ptr); - EX_T(opline->result.u.var).var.ptr = array_ptr; - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - - if (iter) { - iter->index = 0; - if (iter->funcs->rewind) { - iter->funcs->rewind(iter TSRMLS_CC); - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); - } - } - is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); - } - iter->index = -1; /* will be set to 0 before using next handler */ - } else if ((fe_ht = HASH_OF(array_ptr)) != NULL) { - zend_hash_internal_pointer_reset(fe_ht); - if (ce) { - zend_object *zobj = zend_objects_get_address(array_ptr TSRMLS_CC); - while (zend_hash_has_more_elements(fe_ht) == SUCCESS) { - char *str_key; - uint str_key_len; - ulong int_key; - zend_uchar key_type; - - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL); - if (key_type != HASH_KEY_NON_EXISTANT && - zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS) { - break; - } - zend_hash_move_forward(fe_ht); - } - } - is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS; - } else { - zend_error(E_WARNING, "Invalid argument supplied for foreach()"); - is_empty = 1; - } - - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } else { - - } - if (is_empty) { - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } else { - ZEND_VM_NEXT_OPCODE(); - } -} - -static int ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval tmp, *varname = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **value; - zend_bool isset = 1; - HashTable *target_symbol_table; - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - varname = &tmp; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - value = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1 TSRMLS_CC); - if (!value) { - isset = 0; - } - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) { - isset = 0; - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0; - } else { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1; - } else { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0; - } - break; - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_EXIT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ -#if 0 || (IS_TMP_VAR != IS_UNUSED) - zend_op *opline = EX(opline); - if (IS_TMP_VAR != IS_UNUSED) { - zend_free_op free_op1; - zval *ptr = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (Z_TYPE_P(ptr) == IS_LONG) { - EG(exit_status) = Z_LVAL_P(ptr); - } else { - zend_print_variable(ptr); - } - zval_dtor(free_op1.var); - } -#endif - zend_bailout(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_END_SILENCE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval restored_error_reporting; - - if (!EG(error_reporting) && Z_LVAL(EX_T(opline->op1.u.var).tmp_var) != 0) { - Z_TYPE(restored_error_reporting) = IS_LONG; - Z_LVAL(restored_error_reporting) = Z_LVAL(EX_T(opline->op1.u.var).tmp_var); - convert_to_string(&restored_error_reporting); - zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME); - zendi_zval_dtor(restored_error_reporting); - } - if (EX(old_error_reporting) == &EX_T(opline->op1.u.var).tmp_var) { - EX(old_error_reporting) = NULL; - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_QM_ASSIGN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *value = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - EX_T(opline->result.u.var).tmp_var = *value; - if (!1) { - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INSTANCEOF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *expr = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zend_bool result; - - if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->get_class_entry) { - result = instanceof_function(Z_OBJCE_P(expr), EX_T(opline->op2.u.var).class_entry TSRMLS_CC); - } else { - result = 0; - } - ZVAL_BOOL(&EX_T(opline->result.u.var).tmp_var, result); - zval_dtor(free_op1.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_TMP_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *container = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (Z_TYPE_P(container) != IS_ARRAY) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - } - } else { - - zval *dim = &opline->op2.u.constant; - - EX_T(opline->result.u.var).var.ptr_ptr = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, BP_VAR_R TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &opline->result); - - } - AI_USE_PTR(EX_T(opline->result.u.var).var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_CHAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - add_char_to_string(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant); - /* FREE_OP is missing intentionally here - we're always working on the same temporary variable */ - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_STRING_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - add_string_to_string(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant); - /* FREE_OP is missing intentionally here - we're always working on the same temporary variable */ - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = &opline->op2.u.constant; - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1; - - if (IS_TMP_VAR==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - zval_dtor(free_op1.var); - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=&opline->op2.u.constant; - -#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); -#endif - - if (1) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_TMP_VAR == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_TMP_VAR != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_ADD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_VAR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *var = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval var_copy; - int use_copy; - - zend_make_printable_zval(var, &var_copy, &use_copy); - if (use_copy) { - var = &var_copy; - } - add_string_to_string( &EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - var); - if (use_copy) { - zval_dtor(var); - } - /* original comment, possibly problematic: - * FREE_OP is missing intentionally here - we're always working on the same temporary variable - * (Zeev): I don't think it's problematic, we only use variables - * which aren't affected by FREE_OP(Ts, )'s anyway, unless they're - * string offsets or overloaded objects - */ - zval_dtor(free_op2.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1, free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - zval_dtor(free_op2.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1, free_op2; - - if (IS_TMP_VAR==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - zval_dtor(free_op1.var); - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - -#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); -#endif - - if (1) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - zval_dtor(free_op2.var); - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_TMP_VAR == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_TMP_VAR != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_ADD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *var = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval var_copy; - int use_copy; - - zend_make_printable_zval(var, &var_copy, &use_copy); - if (use_copy) { - var = &var_copy; - } - add_string_to_string( &EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - var); - if (use_copy) { - zval_dtor(var); - } - /* original comment, possibly problematic: - * FREE_OP is missing intentionally here - we're always working on the same temporary variable - * (Zeev): I don't think it's problematic, we only use variables - * which aren't affected by FREE_OP(Ts, )'s anyway, unless they're - * string offsets or overloaded objects - */ - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1, free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1, free_op2; - - if (IS_TMP_VAR==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - zval_dtor(free_op1.var); - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - -#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); -#endif - - if (1) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_TMP_VAR == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_TMP_VAR != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=NULL; - -#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); -#endif - - if (1) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_TMP_VAR == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_TMP_VAR != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_ADD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - zval_dtor(free_op1.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_VAR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *var = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval var_copy; - int use_copy; - - zend_make_printable_zval(var, &var_copy, &use_copy); - if (use_copy) { - var = &var_copy; - } - add_string_to_string( &EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - var); - if (use_copy) { - zval_dtor(var); - } - /* original comment, possibly problematic: - * FREE_OP is missing intentionally here - we're always working on the same temporary variable - * (Zeev): I don't think it's problematic, we only use variables - * which aren't affected by FREE_OP(Ts, )'s anyway, unless they're - * string offsets or overloaded objects - */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1; - - if (IS_TMP_VAR==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - zval_dtor(free_op1.var); - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - -#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=NULL; - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); -#endif - - if (1) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_TMP_VAR == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_TMP_VAR != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_BW_NOT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_not_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_NOT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - boolean_not_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - increment_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - increment_function(*var_ptr); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - decrement_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - decrement_function(*var_ptr); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).tmp_var = *EG(uninitialized_zval_ptr); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - EX_T(opline->result.u.var).tmp_var = **var_ptr; - zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var); - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - increment_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - increment_function(*var_ptr); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).tmp_var = *EG(uninitialized_zval_ptr); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - EX_T(opline->result.u.var).tmp_var = **var_ptr; - zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var); - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - decrement_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - decrement_function(*var_ptr); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ECHO_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval z_copy; - zval *z = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL && - zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) { - zend_print_variable(&z_copy); - zval_dtor(&z_copy); - } else { - zend_print_variable(z); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRINT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG; - - return ZEND_ECHO_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_fetch_var_address_helper_SPEC_VAR(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *varname = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **retval; - zval tmp_varname; - HashTable *target_symbol_table; - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp_varname = *varname; - zval_copy_ctor(&tmp_varname); - convert_to_string(&tmp_varname); - varname = &tmp_varname; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0 TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC); -/* - if (!target_symbol_table) { - ZEND_VM_NEXT_OPCODE(); - } -*/ - if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &retval) == FAILURE) { - switch (type) { - case BP_VAR_R: - case BP_VAR_UNSET: - zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_IS: - retval = &EG(uninitialized_zval_ptr); - break; - case BP_VAR_RW: - zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_W: { - zval *new_zval = &EG(uninitialized_zval); - - new_zval->refcount++; - zend_hash_update(target_symbol_table, varname->value.str.val, varname->value.str.len+1, &new_zval, sizeof(zval *), (void **) &retval); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } - switch (opline->op2.u.EA.type) { - case ZEND_FETCH_GLOBAL: - if (IS_VAR != IS_TMP_VAR) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - break; - case ZEND_FETCH_LOCAL: - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - break; - case ZEND_FETCH_STATIC: - zval_update_constant(retval, (void*) 1 TSRMLS_CC); - break; - case ZEND_FETCH_GLOBAL_LOCK: - if (IS_VAR == IS_VAR && !free_op1.var) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - break; - } - } - - - if (varname == &tmp_varname) { - zval_dtor(varname); - } - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = retval; - PZVAL_LOCK(*retval); - switch (type) { - case BP_VAR_R: - case BP_VAR_IS: - AI_USE_PTR(EX_T(opline->result.u.var).var); - break; - case BP_VAR_UNSET: { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - break; - } - } - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_R_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_W_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_VAR(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_RW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_VAR(BP_VAR_RW, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_FUNC_ARG_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_VAR(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), EX(opline)->extended_value)?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_UNSET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_VAR(BP_VAR_UNSET, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_IS_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_VAR(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_JMPZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int ret = i_zend_is_true(_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (!ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int ret = i_zend_is_true(_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPZNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on true to %d\n", opline->extended_value); -#endif - ZEND_VM_JMP(&EX(op_array)->opcodes[opline->extended_value]); - } else { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on false to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(&EX(op_array)->opcodes[opline->op2.u.opline_num]); - } -} - -static int ZEND_JMPZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - if (!retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPNZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int retval = i_zend_is_true(_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *retval_ptr; - zval **retval_ptr_ptr; - zend_free_op free_op1; - - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF) { - - if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) { - /* Not supposed to happen, but we'll allow it */ - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - goto return_by_value; - } - - retval_ptr_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (!retval_ptr_ptr) { - zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference"); - } - - if (IS_VAR == IS_VAR && !(*retval_ptr_ptr)->is_ref) { - if (opline->extended_value == ZEND_RETURNS_FUNCTION && - EX_T(opline->op1.u.var).var.fcall_returned_reference) { - } else if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - if (IS_VAR == IS_VAR && !(free_op1.var != NULL)) { - PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - goto return_by_value; - } - } - - SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr_ptr); - (*retval_ptr_ptr)->refcount++; - - (*EG(return_value_ptr_ptr)) = (*retval_ptr_ptr); - } else { -return_by_value: - - retval_ptr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EG(ze1_compatibility_mode) && Z_TYPE_P(retval_ptr) == IS_OBJECT) { - zval *ret; - char *class_name; - zend_uint class_name_len; - int dup; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - dup = zend_get_object_classname(retval_ptr, &class_name, &class_name_len TSRMLS_CC); - if (Z_OBJ_HT_P(retval_ptr)->clone_obj == NULL) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", class_name); - } - zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name); - ret->value.obj = Z_OBJ_HT_P(retval_ptr)->clone_obj(retval_ptr TSRMLS_CC); - *EG(return_value_ptr_ptr) = ret; - if (!dup) { - efree(class_name); - } - } else if (!0) { /* Not a temp var */ - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF || - (PZVAL_IS_REF(retval_ptr) && retval_ptr->refcount > 0)) { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - zval_copy_ctor(ret); - *EG(return_value_ptr_ptr) = ret; - } else { - *EG(return_value_ptr_ptr) = retval_ptr; - retval_ptr->refcount++; - } - } else { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - *EG(return_value_ptr_ptr) = ret; - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); -} - -static int ZEND_THROW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *value; - zval *exception; - zend_free_op free_op1; - - value = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (Z_TYPE_P(value) != IS_OBJECT) { - zend_error_noreturn(E_ERROR, "Can only throw objects"); - } - /* Not sure if a complete copy is what we want here */ - ALLOC_ZVAL(exception); - INIT_PZVAL_COPY(exception, value); - if (!0) { - zval_copy_ctor(exception); - } - - zend_throw_exception_object(exception TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_VAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - if (opline->extended_value==ZEND_DO_FCALL_BY_NAME - && ARG_MUST_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.u.opline_num); - } - { - zval *valptr; - zval *value; - zend_free_op free_op1; - - value = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - ALLOC_ZVAL(valptr); - INIT_PZVAL_COPY(valptr, value); - if (!0) { - zval_copy_ctor(valptr); - } - zend_ptr_stack_push(&EG(argument_stack), valptr); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *varptr; - zend_free_op free_op1; - varptr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (varptr == &EG(uninitialized_zval)) { - ALLOC_ZVAL(varptr); - INIT_ZVAL(*varptr); - varptr->refcount = 0; - } else if (PZVAL_IS_REF(varptr)) { - zval *original_var = varptr; - - ALLOC_ZVAL(varptr); - *varptr = *original_var; - varptr->is_ref = 0; - varptr->refcount = 0; - zval_copy_ctor(varptr); - } - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; /* for string offsets */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *varptr; - - if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */ - if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) { - return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - - varptr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) || - EX_T(opline->op1.u.var).var.fcall_returned_reference) && - varptr != &EG(uninitialized_zval) && - (PZVAL_IS_REF(varptr) || - (varptr->refcount == 1 && (IS_VAR == IS_CV || free_op1.var)))) { - varptr->is_ref = 1; - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - } else { - zval *valptr; - - zend_error(E_STRICT, "Only variables should be passed by reference"); - ALLOC_ZVAL(valptr); - INIT_PZVAL_COPY(valptr, varptr); - if (!0) { - zval_copy_ctor(valptr); - } - zend_ptr_stack_push(&EG(argument_stack), valptr); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **varptr_ptr; - zval *varptr; - varptr_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (!varptr_ptr) { - zend_error_noreturn(E_ERROR, "Only variables can be passed by reference"); - } - - SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr); - varptr = *varptr_ptr; - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if ((opline->extended_value == ZEND_DO_FCALL_BY_NAME) - && ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - return ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_BOOL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */ - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = i_zend_is_true(_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)); - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SWITCH_FREE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_switch_free(EX(opline), EX(Ts) TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CLONE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *obj = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zend_class_entry *ce; - zend_function *clone; - zend_object_clone_obj_t clone_call; - - if (!obj || Z_TYPE_P(obj) != IS_OBJECT) { - zend_error(E_WARNING, "__clone method called on non-object"); - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - ce = Z_OBJCE_P(obj); - clone = ce ? ce->clone : NULL; - clone_call = Z_OBJ_HT_P(obj)->clone_obj; - if (!clone_call) { - if (ce) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", ce->name); - } else { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object"); - } - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - } - - if (ce && clone) { - if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) { - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : ""); - } - } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : ""); - } - } - } - - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (!EG(exception)) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - Z_OBJVAL_P(EX_T(opline->result.u.var).var.ptr) = clone_call(obj TSRMLS_CC); - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_OBJECT; - EX_T(opline->result.u.var).var.ptr->refcount=1; - EX_T(opline->result.u.var).var.ptr->is_ref=1; - if (!RETURN_VALUE_USED(opline) || EG(exception)) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *expr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *result = &EX_T(opline->result.u.var).tmp_var; - - *result = *expr; - if (!0) { - zendi_zval_copy_ctor(*result); - } - switch (opline->extended_value) { - case IS_NULL: - convert_to_null(result); - break; - case IS_BOOL: - convert_to_boolean(result); - break; - case IS_LONG: - convert_to_long(result); - break; - case IS_DOUBLE: - convert_to_double(result); - break; - case IS_STRING: { - zval var_copy; - int use_copy; - - zend_make_printable_zval(result, &var_copy, &use_copy); - if (use_copy) { - zval_dtor(result); - *result = var_copy; - } - break; - } - case IS_ARRAY: - convert_to_array(result); - break; - case IS_OBJECT: - convert_to_object(result); - break; - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op_array *new_op_array=NULL; - zval **original_return_value = EG(return_value_ptr_ptr); - int return_value_used; - zend_free_op free_op1; - zval *inc_filename = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval tmp_inc_filename; - zend_bool failure_retval=0; - - if (inc_filename->type!=IS_STRING) { - tmp_inc_filename = *inc_filename; - zval_copy_ctor(&tmp_inc_filename); - convert_to_string(&tmp_inc_filename); - inc_filename = &tmp_inc_filename; - } - - return_value_used = RETURN_VALUE_USED(opline); - - switch (Z_LVAL(opline->op2.u.constant)) { - case ZEND_INCLUDE_ONCE: - case ZEND_REQUIRE_ONCE: { - zend_file_handle file_handle; - char cwd[MAXPATHLEN]; - cwd_state state; - - if (IS_ABSOLUTE_PATH(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename))) { - cwd[0] = '\0'; - } else if (!VCWD_GETCWD(cwd, MAXPATHLEN)) { - cwd[0] = '\0'; - } - - state.cwd_length = strlen(cwd); - state.cwd = zend_strndup(cwd, state.cwd_length); - - failure_retval = (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) && - zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1)); - - free(state.cwd); - - if (failure_retval) { - /* do nothing */ - } else if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename), &file_handle TSRMLS_CC)) { - - if (!file_handle.opened_path) { - file_handle.opened_path = estrndup(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename)); - } - - if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) { - new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC); - zend_destroy_file_handle(&file_handle TSRMLS_CC); - } else { - zend_file_handle_dtor(&file_handle); - failure_retval=1; - } - } else { - if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) { - zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename)); - } else { - zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename)); - } - } - } - break; - case ZEND_INCLUDE: - case ZEND_REQUIRE: - new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), inc_filename TSRMLS_CC); - break; - case ZEND_EVAL: { - char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC); - - new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC); - efree(eval_desc); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - if (inc_filename==&tmp_inc_filename) { - zval_dtor(&tmp_inc_filename); - } - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (new_op_array) { - zval *saved_object; - zend_function *saved_function; - - EG(return_value_ptr_ptr) = EX_T(opline->result.u.var).var.ptr_ptr; - EG(active_op_array) = new_op_array; - EX_T(opline->result.u.var).var.ptr = NULL; - - saved_object = EX(object); - saved_function = EX(function_state).function; - - EX(function_state).function = (zend_function *) new_op_array; - EX(object) = NULL; - - zend_execute(new_op_array TSRMLS_CC); - - EX(function_state).function = saved_function; - EX(object) = saved_object; - - if (!return_value_used) { - if (EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } else { /* return value is used */ - if (!EX_T(opline->result.u.var).var.ptr) { /* there was no return statement */ - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_PZVAL(EX_T(opline->result.u.var).var.ptr); - Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = 1; - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL; - } - } - - EG(opline_ptr) = &EX(opline); - EG(active_op_array) = EX(op_array); - EG(function_state_ptr) = &EX(function_state); - destroy_op_array(new_op_array TSRMLS_CC); - efree(new_op_array); - if (EG(exception)) { - zend_throw_exception_internal(NULL TSRMLS_CC); - } - } else { - if (return_value_used) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*EX_T(opline->result.u.var).var.ptr); - Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = failure_retval; - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL; - } - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - EG(return_value_ptr_ptr) = original_return_value; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval tmp, *varname; - HashTable *target_symbol_table; - zend_free_op free_op1; - - varname = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - varname = &tmp; - } else if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { - varname->refcount++; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname) TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_hash_del(target_symbol_table, varname->value.str.val, varname->value.str.len+1) == SUCCESS) { - zend_execute_data *ex = execute_data; - ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1); - - do { - int i; - - if (ex->op_array) { - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == varname->value.str.len && - !memcmp(ex->op_array->vars[i].name, varname->value.str.val, varname->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - ex = ex->prev_execute_data; - } while (ex && ex->symbol_table == target_symbol_table); - } - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } else if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { - zval_ptr_dtor(&varname); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr, **array_ptr_ptr; - HashTable *fe_ht; - zend_object_iterator *iter = NULL; - zend_class_entry *ce = NULL; - zend_bool is_empty = 0; - - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - array_ptr_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - if (array_ptr_ptr == NULL || array_ptr_ptr == &EG(uninitialized_zval_ptr)) { - ALLOC_INIT_ZVAL(array_ptr); - } else if (Z_TYPE_PP(array_ptr_ptr) == IS_OBJECT) { - if(Z_OBJ_HT_PP(array_ptr_ptr)->get_class_entry == NULL) { - zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class"); - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } - - ce = Z_OBJCE_PP(array_ptr_ptr); - if (!ce || ce->get_iterator == NULL) { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - (*array_ptr_ptr)->refcount++; - } - array_ptr = *array_ptr_ptr; - } else { - if (Z_TYPE_PP(array_ptr_ptr) == IS_ARRAY) { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - } - array_ptr = *array_ptr_ptr; - array_ptr->refcount++; - } - } else { - array_ptr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - if (0) { /* IS_TMP_VAR */ - zval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL_COPY(tmp, array_ptr); - array_ptr = tmp; - } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { - ce = Z_OBJCE_P(array_ptr); - if (!ce || !ce->get_iterator) { - array_ptr->refcount++; - } - } else { - if (IS_VAR == IS_VAR && - free_op1.var == NULL && - !array_ptr->is_ref && - array_ptr->refcount > 1) { - /* non-separated return value from function */ - zval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL_COPY(tmp, array_ptr); - zval_copy_ctor(tmp); - array_ptr = tmp; - } else { - array_ptr->refcount++; - } - } - } - - if (ce && ce->get_iterator) { - iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC); - - if (iter && !EG(exception)) { - array_ptr = zend_iterator_wrap(iter TSRMLS_CC); - } else { - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - if (!EG(exception)) { - zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name); - } - zend_throw_exception_internal(NULL TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - } - - PZVAL_LOCK(array_ptr); - EX_T(opline->result.u.var).var.ptr = array_ptr; - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - - if (iter) { - iter->index = 0; - if (iter->funcs->rewind) { - iter->funcs->rewind(iter TSRMLS_CC); - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - ZEND_VM_NEXT_OPCODE(); - } - } - is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - ZEND_VM_NEXT_OPCODE(); - } - iter->index = -1; /* will be set to 0 before using next handler */ - } else if ((fe_ht = HASH_OF(array_ptr)) != NULL) { - zend_hash_internal_pointer_reset(fe_ht); - if (ce) { - zend_object *zobj = zend_objects_get_address(array_ptr TSRMLS_CC); - while (zend_hash_has_more_elements(fe_ht) == SUCCESS) { - char *str_key; - uint str_key_len; - ulong int_key; - zend_uchar key_type; - - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL); - if (key_type != HASH_KEY_NON_EXISTANT && - zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS) { - break; - } - zend_hash_move_forward(fe_ht); - } - } - is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS; - } else { - zend_error(E_WARNING, "Invalid argument supplied for foreach()"); - is_empty = 1; - } - - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - if (is_empty) { - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } else { - ZEND_VM_NEXT_OPCODE(); - } -} - -static int ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **value; - char *str_key; - uint str_key_len; - ulong int_key; - HashTable *fe_ht; - zend_object_iterator *iter = NULL; - int key_type = 0; - zend_bool use_key = (zend_bool)(opline->extended_value & ZEND_FE_FETCH_WITH_KEY); - - PZVAL_LOCK(array); - - switch (zend_iterator_unwrap(array, &iter TSRMLS_CC)) { - default: - case ZEND_ITER_INVALID: - zend_error(E_WARNING, "Invalid argument supplied for foreach()"); - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - - case ZEND_ITER_PLAIN_OBJECT: { - char *class_name, *prop_name; - zend_object *zobj = zend_objects_get_address(array TSRMLS_CC); - - fe_ht = HASH_OF(array); - do { - if (zend_hash_get_current_data(fe_ht, (void **) &value)==FAILURE) { - /* reached end of iteration */ - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL); - - zend_hash_move_forward(fe_ht); - } while (key_type == HASH_KEY_NON_EXISTANT || zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) != SUCCESS); - if (use_key) { - zend_unmangle_property_name(str_key, str_key_len-1, &class_name, &prop_name); - str_key_len = strlen(prop_name); - str_key = estrndup(prop_name, str_key_len); - str_key_len++; - } - break; - } - - case ZEND_ITER_PLAIN_ARRAY: - fe_ht = HASH_OF(array); - if (zend_hash_get_current_data(fe_ht, (void **) &value)==FAILURE) { - /* reached end of iteration */ - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } - if (use_key) { - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 1, NULL); - } - zend_hash_move_forward(fe_ht); - break; - - case ZEND_ITER_OBJECT: - /* !iter happens from exception */ - if (iter && ++iter->index > 0) { - /* This could cause an endless loop if index becomes zero again. - * In case that ever happens we need an additional flag. */ - iter->funcs->move_forward(iter TSRMLS_CC); - if (EG(exception)) { - array->refcount--; - zval_ptr_dtor(&array); - ZEND_VM_NEXT_OPCODE(); - } - } - /* If index is zero we come from FE_RESET and checked valid() already. */ - if (!iter || (iter->index > 0 && iter->funcs->valid(iter TSRMLS_CC) == FAILURE)) { - /* reached end of iteration */ - if (EG(exception)) { - array->refcount--; - zval_ptr_dtor(&array); - ZEND_VM_NEXT_OPCODE(); - } - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } - iter->funcs->get_current_data(iter, &value TSRMLS_CC); - if (EG(exception)) { - array->refcount--; - zval_ptr_dtor(&array); - ZEND_VM_NEXT_OPCODE(); - } - if (!value) { - /* failure in get_current_data */ - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } - if (use_key) { - if (iter->funcs->get_current_key) { - key_type = iter->funcs->get_current_key(iter, &str_key, &str_key_len, &int_key TSRMLS_CC); - if (EG(exception)) { - array->refcount--; - zval_ptr_dtor(&array); - ZEND_VM_NEXT_OPCODE(); - } - } else { - key_type = HASH_KEY_IS_LONG; - int_key = iter->index; - } - } - break; - } - - if (opline->extended_value & ZEND_FE_FETCH_BYREF) { - SEPARATE_ZVAL_IF_NOT_REF(value); - (*value)->is_ref = 1; - EX_T(opline->result.u.var).var.ptr_ptr = value; - (*value)->refcount++; - } else { - EX_T(opline->result.u.var).var.ptr_ptr = value; - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (use_key) { - zend_op *op_data = opline+1; - zval *key = &EX_T(op_data->result.u.var).tmp_var; - - switch (key_type) { - case HASH_KEY_IS_STRING: - Z_STRVAL_P(key) = str_key; - Z_STRLEN_P(key) = str_key_len-1; - Z_TYPE_P(key) = IS_STRING; - break; - case HASH_KEY_IS_LONG: - Z_LVAL_P(key) = int_key; - Z_TYPE_P(key) = IS_LONG; - break; - default: - case HASH_KEY_NON_EXISTANT: - ZVAL_NULL(key); - break; - } - } - - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval tmp, *varname = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **value; - zend_bool isset = 1; - HashTable *target_symbol_table; - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - varname = &tmp; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - value = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1 TSRMLS_CC); - if (!value) { - isset = 0; - } - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) { - isset = 0; - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0; - } else { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1; - } else { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0; - } - break; - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_EXIT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ -#if 0 || (IS_VAR != IS_UNUSED) - zend_op *opline = EX(opline); - if (IS_VAR != IS_UNUSED) { - zend_free_op free_op1; - zval *ptr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (Z_TYPE_P(ptr) == IS_LONG) { - EG(exit_status) = Z_LVAL_P(ptr); - } else { - zend_print_variable(ptr); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } -#endif - zend_bailout(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_QM_ASSIGN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *value = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - EX_T(opline->result.u.var).tmp_var = *value; - if (!0) { - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INSTANCEOF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *expr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zend_bool result; - - if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->get_class_entry) { - result = instanceof_function(Z_OBJCE_P(expr), EX_T(opline->op2.u.var).class_entry TSRMLS_CC); - } else { - result = 0; - } - ZVAL_BOOL(&EX_T(opline->result.u.var).tmp_var, result); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = &opline->op2.u.constant; - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_VAR_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (IS_VAR != IS_CV && !(free_op1.var != NULL)) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = &opline->op2.u.constant; - var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CONST(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = &opline->op2.u.constant; - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_VAR_CONST(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_VAR_CONST(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = &opline->op2.u.constant; - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - *retval = *EG(uninitialized_zval_ptr); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - zval *z_copy; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_VAR_CONST(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_VAR_CONST(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_R_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = &opline->op2.u.constant; - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_VAR != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_R TSRMLS_CC); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC); - - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_IS TSRMLS_CC); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_CONST == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = &opline->op2.u.constant; - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, type TSRMLS_CC); - - if (IS_VAR == IS_VAR && type == BP_VAR_W && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *dim = &opline->op2.u.constant; - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (IS_VAR == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, 0, BP_VAR_UNSET TSRMLS_CC); - - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_fetch_property_address_read_helper_SPEC_VAR_CONST(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - zend_free_op free_op1; - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - - if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - } - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - - zval *offset = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = &opline->op2.u.constant; - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_VAR != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_CONST(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1; - zval *property = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_VAR_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_res; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *property = &opline->op2.u.constant; - - if (IS_VAR == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_R TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr; - - if (IS_VAR == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op_data1; - zval *value; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *value = &opline->op2.u.constant; - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (0?IS_TMP_VAR:IS_CONST), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = &opline->op2.u.constant; - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1; - - if (IS_VAR==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=&opline->op2.u.constant; - -#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_VAR == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_VAR != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *offset = &opline->op2.u.constant; - long index; - - if (container) { - if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_STRING: - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { - offset->refcount++; - } - if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->op_array && ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset->value.str.len && - !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { - zval_ptr_dtor(&offset); - } - break; - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - break; - case IS_STRING: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - - break; - } - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *offset = &opline->op2.u.constant; - - if (container) { - if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else { - - } - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CONST(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - - zval *offset = &opline->op2.u.constant; - - if (Z_TYPE_PP(container) == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - - } else if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ - zval tmp; - - if (Z_TYPE_P(offset) != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (Z_TYPE_P(offset) == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') { - result = 1; - } - break; - } - } - - } else { - - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result; - break; - case ZEND_ISEMPTY: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result; - break; - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CONST(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CONST(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ADD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1, free_op2, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - zval_dtor(free_op2.var); - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - FREE_OP(free_op_data1); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_VAR_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (IS_VAR != IS_CV && !(free_op1.var != NULL)) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 1, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - zval_dtor(free_op2.var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - zval_dtor(free_op2.var); - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_TMP(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_VAR_TMP(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_dtor(free_op2.var); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_VAR_TMP(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_VAR_TMP(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_VAR_TMP(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_dtor(free_op2.var); - *retval = *EG(uninitialized_zval_ptr); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - zval *z_copy; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_VAR_TMP(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_VAR_TMP(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_R_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_VAR != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 1, BP_VAR_R TSRMLS_CC); - zval_dtor(free_op2.var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_W_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 1, BP_VAR_W TSRMLS_CC); - zval_dtor(free_op2.var); - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 1, BP_VAR_RW TSRMLS_CC); - zval_dtor(free_op2.var); - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 1, BP_VAR_IS TSRMLS_CC); - zval_dtor(free_op2.var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_TMP_VAR == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 1, type TSRMLS_CC); - zval_dtor(free_op2.var); - if (IS_VAR == IS_VAR && type == BP_VAR_W && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (IS_VAR == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, 1, BP_VAR_UNSET TSRMLS_CC); - zval_dtor(free_op2.var); - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_fetch_property_address_read_helper_SPEC_VAR_TMP(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - zend_free_op free_op1; - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - - if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - } - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_TMP(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_VAR != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_RW TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_TMP(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_VAR_TMP(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2, free_res; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (IS_VAR == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_R TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr; - - if (IS_VAR == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op2, free_op_data1; - zval *value; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 1, BP_VAR_W TSRMLS_CC); - zval_dtor(free_op2.var); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *value = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (1?IS_TMP_VAR:IS_TMP_VAR), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1, free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - zval_dtor(free_op2.var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1, free_op2; - - if (IS_VAR==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - -#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - zval_dtor(free_op2.var); - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_VAR == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_VAR != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - long index; - - if (container) { - if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_STRING: - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { - offset->refcount++; - } - if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->op_array && ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset->value.str.len && - !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { - zval_ptr_dtor(&offset); - } - break; - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - zval_dtor(free_op2.var); - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - break; - case IS_STRING: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - zval_dtor(free_op2.var); - break; - } - } else { - zval_dtor(free_op2.var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (container) { - if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } else { - zval_dtor(free_op2.var); - } - } else { - zval_dtor(free_op2.var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_PP(container) == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - zval_dtor(free_op2.var); - } else if (Z_TYPE_PP(container) == IS_OBJECT) { - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ - zval tmp; - - if (Z_TYPE_P(offset) != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (Z_TYPE_P(offset) == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') { - result = 1; - } - break; - } - } - zval_dtor(free_op2.var); - } else { - zval_dtor(free_op2.var); - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result; - break; - case ZEND_ISEMPTY: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result; - break; - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ADD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1, free_op2, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - FREE_OP(free_op_data1); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_VAR_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (IS_VAR != IS_CV && !(free_op1.var != NULL)) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_VAR(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_VAR_VAR(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_VAR_VAR(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_VAR_VAR(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_VAR_VAR(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - *retval = *EG(uninitialized_zval_ptr); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - zval *z_copy; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_VAR_VAR(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_VAR_VAR(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_R_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_VAR != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_R TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_IS_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_IS TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_VAR == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, type TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (IS_VAR == IS_VAR && type == BP_VAR_W && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (IS_VAR == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, 0, BP_VAR_UNSET TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_fetch_property_address_read_helper_SPEC_VAR_VAR(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - zend_free_op free_op1; - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - - if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - } - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_VAR != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_VAR(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_VAR_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2, free_res; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (IS_VAR == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_R TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr; - - if (IS_VAR == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op2, free_op_data1; - zval *value; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *value = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (0?IS_TMP_VAR:IS_VAR), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **variable_ptr_ptr; - zval **value_ptr_ptr = _get_zval_ptr_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (IS_VAR == IS_VAR && - value_ptr_ptr && - !(*value_ptr_ptr)->is_ref && - opline->extended_value == ZEND_RETURNS_FUNCTION && - !EX_T(opline->op2.u.var).var.fcall_returned_reference) { - if (free_op2.var == NULL) { - PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_STRICT, "Only variables should be assigned by reference"); - return ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - if (IS_VAR == IS_VAR && EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - zend_error(E_ERROR, "Cannot assign by reference to overloaded object"); - } - - variable_ptr_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = variable_ptr_ptr; - PZVAL_LOCK(*variable_ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1, free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1, free_op2; - - if (IS_VAR==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - -#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_VAR == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_VAR != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - long index; - - if (container) { - if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_STRING: - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { - offset->refcount++; - } - if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->op_array && ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset->value.str.len && - !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { - zval_ptr_dtor(&offset); - } - break; - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - break; - case IS_STRING: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - break; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (container) { - if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_PP(container) == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ - zval tmp; - - if (Z_TYPE_P(offset) != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (Z_TYPE_P(offset) == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') { - result = 1; - } - break; - } - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result; - break; - case ZEND_ISEMPTY: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result; - break; - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = NULL; - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_VAR_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (IS_VAR != IS_CV && !(free_op1.var != NULL)) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = NULL; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = NULL; - var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_UNUSED(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_W_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = NULL; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC); - - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = NULL; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_UNUSED == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = NULL; - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, type TSRMLS_CC); - - if (IS_VAR == IS_VAR && type == BP_VAR_W && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr; - - if (IS_VAR == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op_data1; - zval *value; - zval *dim = NULL; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=NULL; - -#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_VAR == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_VAR != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_ADD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_VAR_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_VAR_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (IS_VAR != IS_CV && !(free_op1.var != NULL)) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_VAR_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_VAR_CV(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_VAR_CV(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_VAR_CV(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - *retval = *EG(uninitialized_zval_ptr); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - zval *z_copy; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_VAR_CV(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_VAR_CV(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_R_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_VAR != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_R TSRMLS_CC); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC); - - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_IS_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, BP_VAR_IS TSRMLS_CC); - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_CV == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), dim, 0, type TSRMLS_CC); - - if (IS_VAR == IS_VAR && type == BP_VAR_W && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (IS_VAR == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, 0, BP_VAR_UNSET TSRMLS_CC); - - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_fetch_property_address_read_helper_SPEC_VAR_CV(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - zend_free_op free_op1; - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } - - - if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - } - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_CV(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_VAR != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_VAR_CV(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_VAR_CV(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_res; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (IS_VAR == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_R TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_VAR == IS_VAR && (free_op1.var != NULL) && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op1; - zval **object_ptr; - - if (IS_VAR == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op_data1; - zval *value; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *value = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (0?IS_TMP_VAR:IS_CV), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **variable_ptr_ptr; - zval **value_ptr_ptr = _get_zval_ptr_ptr_cv(&opline->op2, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (IS_CV == IS_VAR && - value_ptr_ptr && - !(*value_ptr_ptr)->is_ref && - opline->extended_value == ZEND_RETURNS_FUNCTION && - !EX_T(opline->op2.u.var).var.fcall_returned_reference) { - if (free_op2.var == NULL) { - PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_STRICT, "Only variables should be assigned by reference"); - return ZEND_ASSIGN_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - if (IS_VAR == IS_VAR && EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - zend_error(E_ERROR, "Cannot assign by reference to overloaded object"); - } - - variable_ptr_ptr = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = variable_ptr_ptr; - PZVAL_LOCK(*variable_ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op1; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op1; - - if (IS_VAR==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - -#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_VAR == IS_VAR || IS_VAR == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_VAR == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_VAR != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - long index; - - if (container) { - if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_STRING: - if (IS_CV == IS_CV || IS_CV == IS_VAR) { - offset->refcount++; - } - if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->op_array && ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset->value.str.len && - !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { - zval_ptr_dtor(&offset); - } - break; - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - break; - case IS_STRING: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - - break; - } - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (container) { - if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else { - - } - } else { - - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CV(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_PP(container) == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - - } else if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ - zval tmp; - - if (Z_TYPE_P(offset) != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (Z_TYPE_P(offset) == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') { - result = 1; - } - break; - } - } - - } else { - - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result; - break; - case ZEND_ISEMPTY: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result; - break; - } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CV(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CV(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *obj = _get_obj_zval_ptr_unused(TSRMLS_C); - zend_class_entry *ce; - zend_function *clone; - zend_object_clone_obj_t clone_call; - - if (!obj || Z_TYPE_P(obj) != IS_OBJECT) { - zend_error(E_WARNING, "__clone method called on non-object"); - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - - ZEND_VM_NEXT_OPCODE(); - } - - ce = Z_OBJCE_P(obj); - clone = ce ? ce->clone : NULL; - clone_call = Z_OBJ_HT_P(obj)->clone_obj; - if (!clone_call) { - if (ce) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", ce->name); - } else { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object"); - } - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - } - - if (ce && clone) { - if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) { - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : ""); - } - } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : ""); - } - } - } - - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (!EG(exception)) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - Z_OBJVAL_P(EX_T(opline->result.u.var).var.ptr) = clone_call(obj TSRMLS_CC); - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_OBJECT; - EX_T(opline->result.u.var).var.ptr->refcount=1; - EX_T(opline->result.u.var).var.ptr->is_ref=1; - if (!RETURN_VALUE_USED(opline) || EG(exception)) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_EXIT_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ -#if 0 || (IS_UNUSED != IS_UNUSED) - zend_op *opline = EX(opline); - if (IS_UNUSED != IS_UNUSED) { - - zval *ptr = NULL; - - if (Z_TYPE_P(ptr) == IS_LONG) { - EG(exit_status) = Z_LVAL_P(ptr); - } else { - zend_print_variable(ptr); - } - - } -#endif - zend_bailout(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op_data1; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = &opline->op2.u.constant; - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_UNUSED_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - if (IS_UNUSED != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), NULL, dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = &opline->op2.u.constant; - var_ptr = NULL; - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CONST(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = &opline->op2.u.constant; - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_UNUSED_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = &opline->op2.u.constant; - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - *retval = *EG(uninitialized_zval_ptr); - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - zval *z_copy; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_UNUSED_CONST(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_UNUSED_CONST(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_fetch_property_address_read_helper_SPEC_UNUSED_CONST(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_obj_zval_ptr_unused(TSRMLS_C); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - - if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - } - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - - zval *offset = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = &opline->op2.u.constant; - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_UNUSED != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_CONST(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1; - zval *property = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_UNUSED_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_res; - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *property = &opline->op2.u.constant; - - if (IS_UNUSED == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_R TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = &opline->op2.u.constant; - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_obj_zval_ptr_unused(TSRMLS_C); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_class_entry *ce = NULL; - zval **value; - - if (IS_UNUSED == IS_UNUSED) { -/* This seems to be a reminant of namespaces - if (EG(scope)) { - ce = EG(scope); - if (zend_hash_find(&ce->constants_table, Z_STRVAL(opline->op2.u.constant), Z_STRLEN(opline->op2.u.constant)+1, (void **) &value) == SUCCESS) { - zval_update_constant(value, (void *) 1 TSRMLS_CC); - EX_T(opline->result.u.var).tmp_var = **value; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - ZEND_VM_NEXT_OPCODE(); - } - } -*/ - if (!zend_get_constant(opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len, &EX_T(opline->result.u.var).tmp_var TSRMLS_CC)) { - zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", - opline->op2.u.constant.value.str.val, - opline->op2.u.constant.value.str.val); - EX_T(opline->result.u.var).tmp_var = opline->op2.u.constant; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } - ZEND_VM_NEXT_OPCODE(); - } - - ce = EX_T(opline->op1.u.var).class_entry; - - if (zend_hash_find(&ce->constants_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, (void **) &value) == SUCCESS) { - zval_update_constant(value, (void *) 1 TSRMLS_CC); - EX_T(opline->result.u.var).tmp_var = **value; - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } else { - zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", opline->op2.u.constant.value.str.val); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_UNUSED == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_UNUSED != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *offset = &opline->op2.u.constant; - long index; - - if (container) { - if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_STRING: - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { - offset->refcount++; - } - if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->op_array && ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset->value.str.len && - !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { - zval_ptr_dtor(&offset); - } - break; - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - break; - case IS_STRING: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - - break; - } - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *offset = &opline->op2.u.constant; - - if (container) { - if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else { - - } - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CONST(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - - zval *offset = &opline->op2.u.constant; - - if (Z_TYPE_PP(container) == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - - } else if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ - zval tmp; - - if (Z_TYPE_P(offset) != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (Z_TYPE_P(offset) == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') { - result = 1; - } - break; - } - } - - } else { - - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result; - break; - case ZEND_ISEMPTY: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result; - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CONST(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CONST(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op2, free_op_data1; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - zval_dtor(free_op2.var); - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_UNUSED_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - if (IS_UNUSED != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), NULL, dim, 1, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - var_ptr = NULL; - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - zval_dtor(free_op2.var); - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - zval_dtor(free_op2.var); - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_TMP(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_dtor(free_op2.var); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_UNUSED_TMP(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_dtor(free_op2.var); - *retval = *EG(uninitialized_zval_ptr); - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - zval *z_copy; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_UNUSED_TMP(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_UNUSED_TMP(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_obj_zval_ptr_unused(TSRMLS_C); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - - if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - } - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_UNUSED != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_W TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_RW TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_W TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2, free_res; - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (IS_UNUSED == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_R TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_obj_zval_ptr_unused(TSRMLS_C); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - zval_dtor(free_op2.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_UNUSED == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_UNUSED != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_UNSET_DIM_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - long index; - - if (container) { - if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_STRING: - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { - offset->refcount++; - } - if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->op_array && ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset->value.str.len && - !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { - zval_ptr_dtor(&offset); - } - break; - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - zval_dtor(free_op2.var); - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - break; - case IS_STRING: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - zval_dtor(free_op2.var); - break; - } - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (container) { - if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } else { - zval_dtor(free_op2.var); - } - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_TMP(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_PP(container) == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - zval_dtor(free_op2.var); - } else if (Z_TYPE_PP(container) == IS_OBJECT) { - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ - zval tmp; - - if (Z_TYPE_P(offset) != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (Z_TYPE_P(offset) == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') { - result = 1; - } - break; - } - } - zval_dtor(free_op2.var); - } else { - zval_dtor(free_op2.var); - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result; - break; - case ZEND_ISEMPTY: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result; - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_TMP(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_TMP(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op2, free_op_data1; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_UNUSED_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - if (IS_UNUSED != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), NULL, dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - var_ptr = NULL; - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_VAR(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_UNUSED_VAR(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - *retval = *EG(uninitialized_zval_ptr); - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - zval *z_copy; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_UNUSED_VAR(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_UNUSED_VAR(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_obj_zval_ptr_unused(TSRMLS_C); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - - if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - } - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_UNUSED != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2, free_res; - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (IS_UNUSED == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_R TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_obj_zval_ptr_unused(TSRMLS_C); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_UNUSED == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_UNUSED != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - long index; - - if (container) { - if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_STRING: - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { - offset->refcount++; - } - if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->op_array && ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset->value.str.len && - !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { - zval_ptr_dtor(&offset); - } - break; - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - break; - case IS_STRING: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - break; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (container) { - if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_PP(container) == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ - zval tmp; - - if (Z_TYPE_P(offset) != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (Z_TYPE_P(offset) == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') { - result = 1; - } - break; - } - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result; - break; - case ZEND_ISEMPTY: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result; - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op_data1; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = NULL; - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - if (IS_UNUSED != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = NULL; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), NULL, dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = NULL; - var_ptr = NULL; - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_INIT_ARRAY_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_UNUSED == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_UNUSED != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op_data1; - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_UNUSED_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - if (IS_UNUSED != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), NULL, dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - var_ptr = NULL; - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_UNUSED_CV(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_UNUSED_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_UNUSED_CV(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_UNUSED_CV(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_UNUSED_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - *retval = *EG(uninitialized_zval_ptr); - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - zval *z_copy; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_UNUSED_CV(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_UNUSED_CV(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_fetch_property_address_read_helper_SPEC_UNUSED_CV(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_obj_zval_ptr_unused(TSRMLS_C); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - - if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - } - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_CV(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_UNUSED != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_UNUSED_CV(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_obj_zval_ptr_ptr_unused(TSRMLS_C), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_UNUSED_CV(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_res; - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (IS_UNUSED == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_R TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_UNUSED == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_obj_zval_ptr_unused(TSRMLS_C); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_UNUSED == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_UNUSED != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - long index; - - if (container) { - if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_STRING: - if (IS_CV == IS_CV || IS_CV == IS_VAR) { - offset->refcount++; - } - if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->op_array && ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset->value.str.len && - !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { - zval_ptr_dtor(&offset); - } - break; - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - break; - case IS_STRING: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - - break; - } - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (container) { - if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else { - - } - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CV(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_PP(container) == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - - } else if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ - zval tmp; - - if (Z_TYPE_P(offset) != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (Z_TYPE_P(offset) == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') { - result = 1; - } - break; - } - } - - } else { - - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result; - break; - case ZEND_ISEMPTY: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result; - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CV(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CV(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_BW_NOT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_not_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_NOT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - boolean_not_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - increment_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - increment_function(*var_ptr); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - decrement_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - decrement_function(*var_ptr); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).tmp_var = *EG(uninitialized_zval_ptr); - } - - ZEND_VM_NEXT_OPCODE(); - } - - EX_T(opline->result.u.var).tmp_var = **var_ptr; - zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var); - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - increment_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - increment_function(*var_ptr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); - } - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).tmp_var = *EG(uninitialized_zval_ptr); - } - - ZEND_VM_NEXT_OPCODE(); - } - - EX_T(opline->result.u.var).tmp_var = **var_ptr; - zendi_zval_copy_ctor(EX_T(opline->result.u.var).tmp_var); - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *val = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - val->refcount++; - decrement_function(val); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, val TSRMLS_CC); - zval_ptr_dtor(&val); - } else { - decrement_function(*var_ptr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ECHO_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval z_copy; - zval *z = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL && - zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) { - zend_print_variable(&z_copy); - zval_dtor(&z_copy); - } else { - zend_print_variable(z); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRINT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG; - - return ZEND_ECHO_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_fetch_var_address_helper_SPEC_CV(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *varname = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zval **retval; - zval tmp_varname; - HashTable *target_symbol_table; - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp_varname = *varname; - zval_copy_ctor(&tmp_varname); - convert_to_string(&tmp_varname); - varname = &tmp_varname; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - retval = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0 TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), type, varname TSRMLS_CC); -/* - if (!target_symbol_table) { - ZEND_VM_NEXT_OPCODE(); - } -*/ - if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &retval) == FAILURE) { - switch (type) { - case BP_VAR_R: - case BP_VAR_UNSET: - zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_IS: - retval = &EG(uninitialized_zval_ptr); - break; - case BP_VAR_RW: - zend_error(E_NOTICE,"Undefined variable: %s", Z_STRVAL_P(varname)); - /* break missing intentionally */ - case BP_VAR_W: { - zval *new_zval = &EG(uninitialized_zval); - - new_zval->refcount++; - zend_hash_update(target_symbol_table, varname->value.str.val, varname->value.str.len+1, &new_zval, sizeof(zval *), (void **) &retval); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - } - switch (opline->op2.u.EA.type) { - case ZEND_FETCH_GLOBAL: - if (IS_CV != IS_TMP_VAR) { - - } - break; - case ZEND_FETCH_LOCAL: - - break; - case ZEND_FETCH_STATIC: - zval_update_constant(retval, (void*) 1 TSRMLS_CC); - break; - case ZEND_FETCH_GLOBAL_LOCK: - if (IS_CV == IS_VAR && !free_op1.var) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - break; - } - } - - - if (varname == &tmp_varname) { - zval_dtor(varname); - } - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = retval; - PZVAL_LOCK(*retval); - switch (type) { - case BP_VAR_R: - case BP_VAR_IS: - AI_USE_PTR(EX_T(opline->result.u.var).var); - break; - case BP_VAR_UNSET: { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - break; - } - } - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_R_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CV(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_W_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CV(BP_VAR_W, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_RW_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CV(BP_VAR_RW, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_FUNC_ARG_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CV(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), EX(opline)->extended_value)?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_UNSET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CV(BP_VAR_UNSET, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_IS_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_var_address_helper_SPEC_CV(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_JMPZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int ret = i_zend_is_true(_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC)); - - if (!ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPNZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int ret = i_zend_is_true(_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC)); - - if (ret) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPZNZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int retval = i_zend_is_true(_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC)); - - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on true to %d\n", opline->extended_value); -#endif - ZEND_VM_JMP(&EX(op_array)->opcodes[opline->extended_value]); - } else { -#if DEBUG_ZEND>=2 - printf("Conditional jmp on false to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(&EX(op_array)->opcodes[opline->op2.u.opline_num]); - } -} - -static int ZEND_JMPZ_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int retval = i_zend_is_true(_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC)); - - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - if (!retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_JMPNZ_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - int retval = i_zend_is_true(_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC)); - - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval; - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - if (retval) { -#if DEBUG_ZEND>=2 - printf("Conditional jmp to %d\n", opline->op2.u.opline_num); -#endif - ZEND_VM_JMP(opline->op2.u.jmp_addr); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_RETURN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *retval_ptr; - zval **retval_ptr_ptr; - - - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF) { - - if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) { - /* Not supposed to happen, but we'll allow it */ - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - goto return_by_value; - } - - retval_ptr_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (!retval_ptr_ptr) { - zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference"); - } - - if (IS_CV == IS_VAR && !(*retval_ptr_ptr)->is_ref) { - if (opline->extended_value == ZEND_RETURNS_FUNCTION && - EX_T(opline->op1.u.var).var.fcall_returned_reference) { - } else if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - if (IS_CV == IS_VAR && !0) { - PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_NOTICE, "Only variable references should be returned by reference"); - goto return_by_value; - } - } - - SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr_ptr); - (*retval_ptr_ptr)->refcount++; - - (*EG(return_value_ptr_ptr)) = (*retval_ptr_ptr); - } else { -return_by_value: - - retval_ptr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (EG(ze1_compatibility_mode) && Z_TYPE_P(retval_ptr) == IS_OBJECT) { - zval *ret; - char *class_name; - zend_uint class_name_len; - int dup; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - dup = zend_get_object_classname(retval_ptr, &class_name, &class_name_len TSRMLS_CC); - if (Z_OBJ_HT_P(retval_ptr)->clone_obj == NULL) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", class_name); - } - zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name); - ret->value.obj = Z_OBJ_HT_P(retval_ptr)->clone_obj(retval_ptr TSRMLS_CC); - *EG(return_value_ptr_ptr) = ret; - if (!dup) { - efree(class_name); - } - } else if (!0) { /* Not a temp var */ - if (EG(active_op_array)->return_reference == ZEND_RETURN_REF || - (PZVAL_IS_REF(retval_ptr) && retval_ptr->refcount > 0)) { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - zval_copy_ctor(ret); - *EG(return_value_ptr_ptr) = ret; - } else { - *EG(return_value_ptr_ptr) = retval_ptr; - retval_ptr->refcount++; - } - } else { - zval *ret; - - ALLOC_ZVAL(ret); - INIT_PZVAL_COPY(ret, retval_ptr); - *EG(return_value_ptr_ptr) = ret; - } - } - - ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); -} - -static int ZEND_THROW_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *value; - zval *exception; - - - value = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(value) != IS_OBJECT) { - zend_error_noreturn(E_ERROR, "Can only throw objects"); - } - /* Not sure if a complete copy is what we want here */ - ALLOC_ZVAL(exception); - INIT_PZVAL_COPY(exception, value); - if (!0) { - zval_copy_ctor(exception); - } - - zend_throw_exception_object(exception TSRMLS_CC); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_VAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - if (opline->extended_value==ZEND_DO_FCALL_BY_NAME - && ARG_MUST_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.u.opline_num); - } - { - zval *valptr; - zval *value; - - - value = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - ALLOC_ZVAL(valptr); - INIT_PZVAL_COPY(valptr, value); - if (!0) { - zval_copy_ctor(valptr); - } - zend_ptr_stack_push(&EG(argument_stack), valptr); - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *varptr; - - varptr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (varptr == &EG(uninitialized_zval)) { - ALLOC_ZVAL(varptr); - INIT_ZVAL(*varptr); - varptr->refcount = 0; - } else if (PZVAL_IS_REF(varptr)) { - zval *original_var = varptr; - - ALLOC_ZVAL(varptr); - *varptr = *original_var; - varptr->is_ref = 0; - varptr->refcount = 0; - zval_copy_ctor(varptr); - } - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - ; /* for string offsets */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *varptr; - - if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */ - if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) { - return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - - varptr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) || - EX_T(opline->op1.u.var).var.fcall_returned_reference) && - varptr != &EG(uninitialized_zval) && - (PZVAL_IS_REF(varptr) || - (varptr->refcount == 1 && (IS_CV == IS_CV || free_op1.var)))) { - varptr->is_ref = 1; - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - } else { - zval *valptr; - - zend_error(E_STRICT, "Only variables should be passed by reference"); - ALLOC_ZVAL(valptr); - INIT_PZVAL_COPY(valptr, varptr); - if (!0) { - zval_copy_ctor(valptr); - } - zend_ptr_stack_push(&EG(argument_stack), valptr); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **varptr_ptr; - zval *varptr; - varptr_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (!varptr_ptr) { - zend_error_noreturn(E_ERROR, "Only variables can be passed by reference"); - } - - SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr); - varptr = *varptr_ptr; - varptr->refcount++; - zend_ptr_stack_push(&EG(argument_stack), varptr); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SEND_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if ((opline->extended_value == ZEND_DO_FCALL_BY_NAME) - && ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) { - return ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_BOOL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */ - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = i_zend_is_true(_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC)); - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *obj = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zend_class_entry *ce; - zend_function *clone; - zend_object_clone_obj_t clone_call; - - if (!obj || Z_TYPE_P(obj) != IS_OBJECT) { - zend_error(E_WARNING, "__clone method called on non-object"); - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - - ZEND_VM_NEXT_OPCODE(); - } - - ce = Z_OBJCE_P(obj); - clone = ce ? ce->clone : NULL; - clone_call = Z_OBJ_HT_P(obj)->clone_obj; - if (!clone_call) { - if (ce) { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %s", ce->name); - } else { - zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object"); - } - EX_T(opline->result.u.var).var.ptr = EG(error_zval_ptr); - EX_T(opline->result.u.var).var.ptr->refcount++; - } - - if (ce && clone) { - if (clone->op_array.fn_flags & ZEND_ACC_PRIVATE) { - /* Ensure that if we're calling a private function, we're allowed to do so. - */ - if (ce != EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : ""); - } - } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) { - /* Ensure that if we're calling a protected function, we're allowed to do so. - */ - if (!zend_check_protected(clone->common.scope, EG(scope))) { - zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : ""); - } - } - } - - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (!EG(exception)) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - Z_OBJVAL_P(EX_T(opline->result.u.var).var.ptr) = clone_call(obj TSRMLS_CC); - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_OBJECT; - EX_T(opline->result.u.var).var.ptr->refcount=1; - EX_T(opline->result.u.var).var.ptr->is_ref=1; - if (!RETURN_VALUE_USED(opline) || EG(exception)) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CAST_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *expr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *result = &EX_T(opline->result.u.var).tmp_var; - - *result = *expr; - if (!0) { - zendi_zval_copy_ctor(*result); - } - switch (opline->extended_value) { - case IS_NULL: - convert_to_null(result); - break; - case IS_BOOL: - convert_to_boolean(result); - break; - case IS_LONG: - convert_to_long(result); - break; - case IS_DOUBLE: - convert_to_double(result); - break; - case IS_STRING: { - zval var_copy; - int use_copy; - - zend_make_printable_zval(result, &var_copy, &use_copy); - if (use_copy) { - zval_dtor(result); - *result = var_copy; - } - break; - } - case IS_ARRAY: - convert_to_array(result); - break; - case IS_OBJECT: - convert_to_object(result); - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op_array *new_op_array=NULL; - zval **original_return_value = EG(return_value_ptr_ptr); - int return_value_used; - - zval *inc_filename = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zval tmp_inc_filename; - zend_bool failure_retval=0; - - if (inc_filename->type!=IS_STRING) { - tmp_inc_filename = *inc_filename; - zval_copy_ctor(&tmp_inc_filename); - convert_to_string(&tmp_inc_filename); - inc_filename = &tmp_inc_filename; - } - - return_value_used = RETURN_VALUE_USED(opline); - - switch (Z_LVAL(opline->op2.u.constant)) { - case ZEND_INCLUDE_ONCE: - case ZEND_REQUIRE_ONCE: { - zend_file_handle file_handle; - char cwd[MAXPATHLEN]; - cwd_state state; - - if (IS_ABSOLUTE_PATH(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename))) { - cwd[0] = '\0'; - } else if (!VCWD_GETCWD(cwd, MAXPATHLEN)) { - cwd[0] = '\0'; - } - - state.cwd_length = strlen(cwd); - state.cwd = zend_strndup(cwd, state.cwd_length); - - failure_retval = (!virtual_file_ex(&state, Z_STRVAL_P(inc_filename), NULL, 1) && - zend_hash_exists(&EG(included_files), state.cwd, state.cwd_length+1)); - - free(state.cwd); - - if (failure_retval) { - /* do nothing */ - } else if (SUCCESS == zend_stream_open(Z_STRVAL_P(inc_filename), &file_handle TSRMLS_CC)) { - - if (!file_handle.opened_path) { - file_handle.opened_path = estrndup(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename)); - } - - if (zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1)==SUCCESS) { - new_op_array = zend_compile_file(&file_handle, (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) TSRMLS_CC); - zend_destroy_file_handle(&file_handle TSRMLS_CC); - } else { - zend_file_handle_dtor(&file_handle); - failure_retval=1; - } - } else { - if (Z_LVAL(opline->op2.u.constant)==ZEND_INCLUDE_ONCE) { - zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, Z_STRVAL_P(inc_filename)); - } else { - zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, Z_STRVAL_P(inc_filename)); - } - } - } - break; - case ZEND_INCLUDE: - case ZEND_REQUIRE: - new_op_array = compile_filename(Z_LVAL(opline->op2.u.constant), inc_filename TSRMLS_CC); - break; - case ZEND_EVAL: { - char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC); - - new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC); - efree(eval_desc); - } - break; - EMPTY_SWITCH_DEFAULT_CASE() - } - if (inc_filename==&tmp_inc_filename) { - zval_dtor(&tmp_inc_filename); - } - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - if (new_op_array) { - zval *saved_object; - zend_function *saved_function; - - EG(return_value_ptr_ptr) = EX_T(opline->result.u.var).var.ptr_ptr; - EG(active_op_array) = new_op_array; - EX_T(opline->result.u.var).var.ptr = NULL; - - saved_object = EX(object); - saved_function = EX(function_state).function; - - EX(function_state).function = (zend_function *) new_op_array; - EX(object) = NULL; - - zend_execute(new_op_array TSRMLS_CC); - - EX(function_state).function = saved_function; - EX(object) = saved_object; - - if (!return_value_used) { - if (EX_T(opline->result.u.var).var.ptr) { - zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr); - } - } else { /* return value is used */ - if (!EX_T(opline->result.u.var).var.ptr) { /* there was no return statement */ - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_PZVAL(EX_T(opline->result.u.var).var.ptr); - Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = 1; - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL; - } - } - - EG(opline_ptr) = &EX(opline); - EG(active_op_array) = EX(op_array); - EG(function_state_ptr) = &EX(function_state); - destroy_op_array(new_op_array TSRMLS_CC); - efree(new_op_array); - if (EG(exception)) { - zend_throw_exception_internal(NULL TSRMLS_CC); - } - } else { - if (return_value_used) { - ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr); - INIT_ZVAL(*EX_T(opline->result.u.var).var.ptr); - Z_LVAL_P(EX_T(opline->result.u.var).var.ptr) = failure_retval; - Z_TYPE_P(EX_T(opline->result.u.var).var.ptr) = IS_BOOL; - } - } - - EG(return_value_ptr_ptr) = original_return_value; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval tmp, *varname; - HashTable *target_symbol_table; - - - varname = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - varname = &tmp; - } else if (IS_CV == IS_CV || IS_CV == IS_VAR) { - varname->refcount++; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname) TSRMLS_CC); - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_hash_del(target_symbol_table, varname->value.str.val, varname->value.str.len+1) == SUCCESS) { - zend_execute_data *ex = execute_data; - ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1); - - do { - int i; - - if (ex->op_array) { - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == varname->value.str.len && - !memcmp(ex->op_array->vars[i].name, varname->value.str.val, varname->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - ex = ex->prev_execute_data; - } while (ex && ex->symbol_table == target_symbol_table); - } - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } else if (IS_CV == IS_CV || IS_CV == IS_VAR) { - zval_ptr_dtor(&varname); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array_ptr, **array_ptr_ptr; - HashTable *fe_ht; - zend_object_iterator *iter = NULL; - zend_class_entry *ce = NULL; - zend_bool is_empty = 0; - - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - array_ptr_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - if (array_ptr_ptr == NULL || array_ptr_ptr == &EG(uninitialized_zval_ptr)) { - ALLOC_INIT_ZVAL(array_ptr); - } else if (Z_TYPE_PP(array_ptr_ptr) == IS_OBJECT) { - if(Z_OBJ_HT_PP(array_ptr_ptr)->get_class_entry == NULL) { - zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class"); - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } - - ce = Z_OBJCE_PP(array_ptr_ptr); - if (!ce || ce->get_iterator == NULL) { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - (*array_ptr_ptr)->refcount++; - } - array_ptr = *array_ptr_ptr; - } else { - if (Z_TYPE_PP(array_ptr_ptr) == IS_ARRAY) { - SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr); - } - array_ptr = *array_ptr_ptr; - array_ptr->refcount++; - } - } else { - array_ptr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - if (0) { /* IS_TMP_VAR */ - zval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL_COPY(tmp, array_ptr); - array_ptr = tmp; - } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { - ce = Z_OBJCE_P(array_ptr); - if (!ce || !ce->get_iterator) { - array_ptr->refcount++; - } - } else { - if (IS_CV == IS_VAR && - free_op1.var == NULL && - !array_ptr->is_ref && - array_ptr->refcount > 1) { - /* non-separated return value from function */ - zval *tmp; - - ALLOC_ZVAL(tmp); - INIT_PZVAL_COPY(tmp, array_ptr); - zval_copy_ctor(tmp); - array_ptr = tmp; - } else { - array_ptr->refcount++; - } - } - } - - if (ce && ce->get_iterator) { - iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC); - - if (iter && !EG(exception)) { - array_ptr = zend_iterator_wrap(iter TSRMLS_CC); - } else { - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } else { - - } - if (!EG(exception)) { - zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name); - } - zend_throw_exception_internal(NULL TSRMLS_CC); - ZEND_VM_NEXT_OPCODE(); - } - } - - PZVAL_LOCK(array_ptr); - EX_T(opline->result.u.var).var.ptr = array_ptr; - EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr; - - if (iter) { - iter->index = 0; - if (iter->funcs->rewind) { - iter->funcs->rewind(iter TSRMLS_CC); - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); - } - } - is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; - if (EG(exception)) { - array_ptr->refcount--; - zval_ptr_dtor(&array_ptr); - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); - } - iter->index = -1; /* will be set to 0 before using next handler */ - } else if ((fe_ht = HASH_OF(array_ptr)) != NULL) { - zend_hash_internal_pointer_reset(fe_ht); - if (ce) { - zend_object *zobj = zend_objects_get_address(array_ptr TSRMLS_CC); - while (zend_hash_has_more_elements(fe_ht) == SUCCESS) { - char *str_key; - uint str_key_len; - ulong int_key; - zend_uchar key_type; - - key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL); - if (key_type != HASH_KEY_NON_EXISTANT && - zend_check_property_access(zobj, str_key, str_key_len-1 TSRMLS_CC) == SUCCESS) { - break; - } - zend_hash_move_forward(fe_ht); - } - } - is_empty = zend_hash_has_more_elements(fe_ht) != SUCCESS; - } else { - zend_error(E_WARNING, "Invalid argument supplied for foreach()"); - is_empty = 1; - } - - if (opline->extended_value & ZEND_FE_RESET_VARIABLE) { - - } else { - - } - if (is_empty) { - ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num); - } else { - ZEND_VM_NEXT_OPCODE(); - } -} - -static int ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval tmp, *varname = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC); - zval **value; - zend_bool isset = 1; - HashTable *target_symbol_table; - - if (Z_TYPE_P(varname) != IS_STRING) { - tmp = *varname; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - varname = &tmp; - } - - if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) { - value = zend_std_get_static_property(EX_T(opline->op2.u.var).class_entry, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 1 TSRMLS_CC); - if (!value) { - isset = 0; - } - } else { - target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC); - if (zend_hash_find(target_symbol_table, varname->value.str.val, varname->value.str.len+1, (void **) &value) == FAILURE) { - isset = 0; - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0; - } else { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 1; - } else { - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = 0; - } - break; - } - - if (varname == &tmp) { - zval_dtor(&tmp); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_EXIT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ -#if 0 || (IS_CV != IS_UNUSED) - zend_op *opline = EX(opline); - if (IS_CV != IS_UNUSED) { - - zval *ptr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(ptr) == IS_LONG) { - EG(exit_status) = Z_LVAL_P(ptr); - } else { - zend_print_variable(ptr); - } - - } -#endif - zend_bailout(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_QM_ASSIGN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *value = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - EX_T(opline->result.u.var).tmp_var = *value; - if (!0) { - zval_copy_ctor(&EX_T(opline->result.u.var).tmp_var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INSTANCEOF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *expr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zend_bool result; - - if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->get_class_entry) { - result = instanceof_function(Z_OBJCE_P(expr), EX_T(opline->op2.u.var).class_entry TSRMLS_CC); - } else { - result = 0; - } - ZVAL_BOOL(&EX_T(opline->result.u.var).tmp_var, result); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = &opline->op2.u.constant; - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_CV_CONST(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_CV_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (IS_CV != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_CV_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = &opline->op2.u.constant; - var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CONST(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_CV_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = &opline->op2.u.constant; - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_CV_CONST(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_CV_CONST(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_CV_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = &opline->op2.u.constant; - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - *retval = *EG(uninitialized_zval_ptr); - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - zval *z_copy; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_CV_CONST(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_CV_CONST(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *dim = &opline->op2.u.constant; - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_CV != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), dim, 0, BP_VAR_R TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC); - - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC), dim, 0, BP_VAR_IS TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_CONST == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = &opline->op2.u.constant; - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC), dim, 0, type TSRMLS_CC); - - if (IS_CV == IS_VAR && type == BP_VAR_W && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *dim = &opline->op2.u.constant; - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (IS_CV == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, 0, BP_VAR_UNSET TSRMLS_CC); - - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_fetch_property_address_read_helper_SPEC_CV_CONST(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_zval_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - - if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - } - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - - zval *offset = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = &opline->op2.u.constant; - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_CV != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_CONST(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1; - zval *property = &opline->op2.u.constant; - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_CV_CONST(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_res; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *property = &opline->op2.u.constant; - - if (IS_CV == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_R TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr; - - if (IS_CV == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op_data1; - zval *value; - zval *dim = &opline->op2.u.constant; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *value = &opline->op2.u.constant; - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (0?IS_TMP_VAR:IS_CONST), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = &opline->op2.u.constant; - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - - - if (IS_CV==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - &opline->op2.u.constant TSRMLS_CC); - - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=&opline->op2.u.constant; - -#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_CV == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_CV != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *offset = &opline->op2.u.constant; - long index; - - if (container) { - if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_STRING: - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { - offset->refcount++; - } - if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->op_array && ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset->value.str.len && - !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { - zval_ptr_dtor(&offset); - } - break; - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - break; - case IS_STRING: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - - break; - } - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *offset = &opline->op2.u.constant; - - if (container) { - if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else { - - } - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CONST(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - - zval *offset = &opline->op2.u.constant; - - if (Z_TYPE_PP(container) == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - - } else if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ - zval tmp; - - if (Z_TYPE_P(offset) != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (Z_TYPE_P(offset) == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') { - result = 1; - } - break; - } - } - - } else { - - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result; - break; - case ZEND_ISEMPTY: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result; - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CONST(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CONST(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ADD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op2, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - zval_dtor(free_op2.var); - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_CV_TMP(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_CV_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (IS_CV != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_CV_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 1, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - zval_dtor(free_op2.var); - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - zval_dtor(free_op2.var); - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_TMP(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_CV_TMP(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_dtor(free_op2.var); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_CV_TMP(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_CV_TMP(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_CV_TMP(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - zval_dtor(free_op2.var); - *retval = *EG(uninitialized_zval_ptr); - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - zval *z_copy; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_CV_TMP(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_CV_TMP(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_R_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_CV != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), dim, 1, BP_VAR_R TSRMLS_CC); - zval_dtor(free_op2.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_W_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), dim, 1, BP_VAR_W TSRMLS_CC); - zval_dtor(free_op2.var); - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 1, BP_VAR_RW TSRMLS_CC); - zval_dtor(free_op2.var); - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_IS_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC), dim, 1, BP_VAR_IS TSRMLS_CC); - zval_dtor(free_op2.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_TMP_VAR == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC), dim, 1, type TSRMLS_CC); - zval_dtor(free_op2.var); - if (IS_CV == IS_VAR && type == BP_VAR_W && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_UNSET_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (IS_CV == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, 1, BP_VAR_UNSET TSRMLS_CC); - zval_dtor(free_op2.var); - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_fetch_property_address_read_helper_SPEC_CV_TMP(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_zval_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - - if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - } - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_TMP(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_CV != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), property, BP_VAR_RW TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_TMP(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_CV_TMP(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2, free_res; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *property = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (IS_CV == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (1) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_R TSRMLS_CC); - if (1) { - zval_ptr_dtor(&property); - } else { - zval_dtor(free_op2.var); - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr; - - if (IS_CV == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op2, free_op_data1; - zval *value; - zval *dim = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 1, BP_VAR_W TSRMLS_CC); - zval_dtor(free_op2.var); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *value = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (1?IS_TMP_VAR:IS_TMP_VAR), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - zval_dtor(free_op2.var); - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op2; - - if (IS_CV==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - zval_dtor(free_op2.var); - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - -#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - zval_dtor(free_op2.var); - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_CV == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_CV != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_UNSET_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - long index; - - if (container) { - if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_STRING: - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { - offset->refcount++; - } - if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->op_array && ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset->value.str.len && - !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { - zval_ptr_dtor(&offset); - } - break; - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - zval_dtor(free_op2.var); - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - break; - case IS_STRING: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - zval_dtor(free_op2.var); - break; - } - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (container) { - if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } else { - zval_dtor(free_op2.var); - } - } else { - zval_dtor(free_op2.var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_TMP(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_PP(container) == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - zval_dtor(free_op2.var); - } else if (Z_TYPE_PP(container) == IS_OBJECT) { - if (1) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (1) { - zval_ptr_dtor(&offset); - } else { - zval_dtor(free_op2.var); - } - } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ - zval tmp; - - if (Z_TYPE_P(offset) != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (Z_TYPE_P(offset) == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') { - result = 1; - } - break; - } - } - zval_dtor(free_op2.var); - } else { - zval_dtor(free_op2.var); - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result; - break; - case ZEND_ISEMPTY: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result; - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_TMP(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_TMP(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ADD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op2, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_CV_VAR(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2, free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_CV_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (IS_CV != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_CV_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_VAR(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_CV_VAR(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_CV_VAR(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_CV_VAR(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_CV_VAR(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - *retval = *EG(uninitialized_zval_ptr); - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - zval *z_copy; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_CV_VAR(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_CV_VAR(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_R_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_CV != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), dim, 0, BP_VAR_R TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_IS_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC), dim, 0, BP_VAR_IS TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_VAR == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC), dim, 0, type TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (IS_CV == IS_VAR && type == BP_VAR_W && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (IS_CV == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, 0, BP_VAR_UNSET TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_fetch_property_address_read_helper_SPEC_CV_VAR(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_zval_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - - if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - } - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_CV != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_VAR(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1, free_op2; - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_CV_VAR(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_op2, free_res; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *property = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (IS_CV == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_R TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr; - - if (IS_CV == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op2, free_op_data1; - zval *value; - zval *dim = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *value = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (0?IS_TMP_VAR:IS_VAR), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **variable_ptr_ptr; - zval **value_ptr_ptr = _get_zval_ptr_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (IS_VAR == IS_VAR && - value_ptr_ptr && - !(*value_ptr_ptr)->is_ref && - opline->extended_value == ZEND_RETURNS_FUNCTION && - !EX_T(opline->op2.u.var).var.fcall_returned_reference) { - if (free_op2.var == NULL) { - PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_STRICT, "Only variables should be assigned by reference"); - return ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - if (IS_CV == IS_VAR && EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - zend_error(E_ERROR, "Cannot assign by reference to overloaded object"); - } - - variable_ptr_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = variable_ptr_ptr; - PZVAL_LOCK(*variable_ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - zend_free_op free_op2; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - zend_free_op free_op2; - - if (IS_CV==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC) TSRMLS_CC); - - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - -#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_CV == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_CV != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_UNSET_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - long index; - - if (container) { - if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_STRING: - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { - offset->refcount++; - } - if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->op_array && ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset->value.str.len && - !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { - zval_ptr_dtor(&offset); - } - break; - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - break; - case IS_STRING: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - break; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (container) { - if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - zend_free_op free_op2; - zval *offset = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC); - - if (Z_TYPE_PP(container) == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ - zval tmp; - - if (Z_TYPE_P(offset) != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (Z_TYPE_P(offset) == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') { - result = 1; - } - break; - } - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result; - break; - case ZEND_ISEMPTY: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result; - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = NULL; - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_CV_UNUSED(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (IS_CV != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = NULL; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = NULL; - var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_UNUSED(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_W_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = NULL; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC); - - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = NULL; - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_UNUSED == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = NULL; - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC), dim, 0, type TSRMLS_CC); - - if (IS_CV == IS_VAR && type == BP_VAR_W && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr; - - if (IS_CV == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op_data1; - zval *value; - zval *dim = NULL; - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=NULL; - -#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_CV == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_CV != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_ADD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - add_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SUB_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - sub_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MUL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - mul_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_DIV_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - div_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_MOD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - mod_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - shift_left_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_SR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - shift_right_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CONCAT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - concat_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_IDENTICAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_not_identical_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_NOT_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_not_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_smaller_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_OR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_or_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_AND_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_and_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BW_XOR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_BOOL_XOR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - - boolean_xor_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - zend_free_op free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - znode *result = &opline->result; - zval **retval = &EX_T(result->u.var).var.ptr; - int have_get_ptr = 0; - - EX_T(result->u.var).var.ptr_ptr = NULL; - make_real_object(object_ptr TSRMLS_CC); - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - - FREE_OP(free_op_data1); - - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } else { - /* here we are sure we are dealing with an object */ - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - /* here property is a string */ - if (opline->extended_value == ZEND_ASSIGN_OBJ - && Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - binary_op(*zptr, *zptr, value TSRMLS_CC); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - zval *z = NULL; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - if (Z_OBJ_HT_P(object)->read_property) { - z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - } - break; - case ZEND_ASSIGN_DIM: - if (Z_OBJ_HT_P(object)->read_dimension) { - z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R TSRMLS_CC); - } - break; - } - if (z) { - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - binary_op(z, z, value TSRMLS_CC); - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - break; - case ZEND_ASSIGN_DIM: - Z_OBJ_HT_P(object)->write_dimension(object, property, z TSRMLS_CC); - break; - } - if (!RETURN_VALUE_UNUSED(result)) { - *retval = z; - PZVAL_LOCK(*retval); - } - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (!RETURN_VALUE_UNUSED(result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - FREE_OP(free_op_data1); - } - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_binary_assign_op_helper_SPEC_CV_CV(int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC), ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op_data2, free_op_data1; - zval **var_ptr; - zval *value; - zend_bool increment_opline = 0; - - switch (opline->extended_value) { - case ZEND_ASSIGN_OBJ: - return zend_binary_assign_op_obj_helper_SPEC_CV_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - case ZEND_ASSIGN_DIM: { - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (IS_CV != IS_CV && !0) { - (*object_ptr)->refcount++; /* undo the effect of get_obj_zval_ptr_ptr() */ - } - - if (Z_TYPE_PP(object_ptr) == IS_OBJECT) { - return zend_binary_assign_op_obj_helper_SPEC_CV_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } else { - zend_op *op_data = opline+1; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - var_ptr = get_zval_ptr_ptr(&op_data->op2, EX(Ts), &free_op_data2, BP_VAR_RW); - increment_opline = 1; - } - } - break; - default: - value = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC); - /* do nothing */ - break; - } - - if (!var_ptr) { - zend_error_noreturn(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets"); - } - - if (*var_ptr == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - } - ZEND_VM_NEXT_OPCODE(); - } - - SEPARATE_ZVAL_IF_NOT_REF(var_ptr); - - if(Z_TYPE_PP(var_ptr) == IS_OBJECT && Z_OBJ_HANDLER_PP(var_ptr, get) - && Z_OBJ_HANDLER_PP(var_ptr, set)) { - /* proxy object */ - zval *objval = Z_OBJ_HANDLER_PP(var_ptr, get)(*var_ptr TSRMLS_CC); - objval->refcount++; - binary_op(objval, objval, value TSRMLS_CC); - Z_OBJ_HANDLER_PP(var_ptr, set)(var_ptr, objval TSRMLS_CC); - zval_ptr_dtor(&objval); - } else { - binary_op(*var_ptr, *var_ptr, value TSRMLS_CC); - } - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = var_ptr; - PZVAL_LOCK(*var_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (increment_opline) { - ZEND_VM_INC_OPCODE(); - FREE_OP(free_op_data1); - FREE_OP_VAR_PTR(free_op_data2); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_ADD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(add_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SUB_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(sub_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MUL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(mul_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_DIV_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(div_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_MOD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(mod_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(shift_left_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_SR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(shift_right_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_CONCAT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(concat_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_OR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(bitwise_or_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_AND_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(bitwise_and_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ASSIGN_BW_XOR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_binary_assign_op_helper_SPEC_CV_CV(bitwise_xor_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_pre_incdec_property_helper_SPEC_CV_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval **retval = &EX_T(opline->result.u.var).var.ptr; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - have_get_ptr = 1; - incdec_op(*zptr); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = *zptr; - PZVAL_LOCK(*retval); - } - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - z->refcount++; - SEPARATE_ZVAL_IF_NOT_REF(&z); - incdec_op(z); - *retval = z; - Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(uninitialized_zval_ptr); - PZVAL_LOCK(*retval); - } - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_PRE_INC_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_CV_CV(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_PRE_DEC_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_pre_incdec_property_helper_SPEC_CV_CV(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int zend_post_incdec_property_helper_SPEC_CV_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zval *object; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *retval = &EX_T(opline->result.u.var).tmp_var; - int have_get_ptr = 0; - - make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */ - object = *object_ptr; - - if (Z_TYPE_P(object) != IS_OBJECT) { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - - *retval = *EG(uninitialized_zval_ptr); - - ZEND_VM_NEXT_OPCODE(); - } - - /* here we are sure we are dealing with an object */ - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - - if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { - zval **zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property TSRMLS_CC); - if (zptr != NULL) { /* NULL means no success in getting PTR */ - have_get_ptr = 1; - SEPARATE_ZVAL_IF_NOT_REF(zptr); - - *retval = **zptr; - zendi_zval_copy_ctor(*retval); - - incdec_op(*zptr); - - } - } - - if (!have_get_ptr) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_R TSRMLS_CC); - zval *z_copy; - - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC); - - if (z->refcount == 0) { - zval_dtor(z); - FREE_ZVAL(z); - } - z = value; - } - *retval = *z; - zendi_zval_copy_ctor(*retval); - ALLOC_ZVAL(z_copy); - *z_copy = *z; - zendi_zval_copy_ctor(*z_copy); - INIT_PZVAL(z_copy); - incdec_op(z_copy); - z->refcount++; - Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(&z); - } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - *retval = *EG(uninitialized_zval_ptr); - } - } - - if (0) { - zval_ptr_dtor(&property); - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_POST_INC_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_CV_CV(increment_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_POST_DEC_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_post_incdec_property_helper_SPEC_CV_CV(decrement_function, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_DIM_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_CV != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), dim, 0, BP_VAR_R TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC); - - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_RW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC); - - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_IS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC), dim, 0, BP_VAR_IS TSRMLS_CC); - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R; - zval *dim; - - if (IS_CV == IS_UNUSED && type == BP_VAR_R) { - zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); - } - dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC), dim, 0, type TSRMLS_CC); - - if (IS_CV == IS_VAR && type == BP_VAR_W && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_DIM_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - /* Not needed in DIM_UNSET - if (opline->extended_value == ZEND_FETCH_ADD_LOCK) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - } - */ - if (IS_CV == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, dim, 0, BP_VAR_UNSET TSRMLS_CC); - - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (EX_T(opline->result.u.var).var.ptr_ptr == NULL) { - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - } else { - zend_free_op free_res; - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_fetch_property_address_read_helper_SPEC_CV_CV(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *container; - zval **retval; - - - retval = &EX_T(opline->result.u.var).var.ptr; - EX_T(opline->result.u.var).var.ptr_ptr = retval; - - container = _get_zval_ptr_cv(&opline->op1, EX(Ts), type TSRMLS_CC); - - if (container == EG(error_zval_ptr)) { - if (!RETURN_VALUE_UNUSED(&opline->result)) { - *retval = EG(error_zval_ptr); - PZVAL_LOCK(*retval); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } - - - if (Z_TYPE_P(container) != IS_OBJECT || !Z_OBJ_HT_P(container)->read_property) { - if (type != BP_VAR_IS) { - zend_error(E_NOTICE, "Trying to get property of non-object"); - } - *retval = EG(uninitialized_zval_ptr); - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } else { - - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - - /* here we are sure we are dealing with an object */ - *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC); - - if (RETURN_VALUE_UNUSED(&opline->result) && ((*retval)->refcount == 0)) { - zval_dtor(*retval); - FREE_ZVAL(*retval); - } else { - SELECTIVE_PZVAL_LOCK(*retval, &opline->result); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_CV(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_CV != IS_CV) { - PZVAL_LOCK(*EX_T(opline->op1.u.var).var.ptr_ptr); - EX_T(opline->op1.u.var).var.ptr = *EX_T(opline->op1.u.var).var.ptr_ptr; - } - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_RW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), property, BP_VAR_RW TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_fetch_property_address_read_helper_SPEC_CV_CV(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) { - /* Behave like FETCH_OBJ_W */ - zend_free_op free_op1; - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), property, BP_VAR_W TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_fetch_property_address_read_helper_SPEC_CV_CV(BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } -} - -static int ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op1, free_res; - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (IS_CV == IS_CV) { - if (container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - } - if (0) { - MAKE_REAL_ZVAL_PTR(property); - } - zend_fetch_property_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), container, property, BP_VAR_R TSRMLS_CC); - if (0) { - zval_ptr_dtor(&property); - } else { - - } - if (IS_CV == IS_VAR && 0 && - READY_TO_DESTROY(free_op1.var) && - !RETURN_VALUE_UNUSED(&opline->result)) { - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - PZVAL_UNLOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &free_res); - if (EX_T(opline->result.u.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(EX_T(opline->result.u.var).var.ptr_ptr); - } - PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr); - FREE_OP_VAR_PTR(free_res); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC); - - /* assign_obj has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_op *op_data = opline+1; - - zval **object_ptr; - - if (IS_CV == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) { - /* not an array offset */ - object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - } else { - object_ptr = NULL; - } - - if (object_ptr && Z_TYPE_PP(object_ptr) == IS_OBJECT) { - zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_DIM TSRMLS_CC); - } else { - zend_free_op free_op_data1; - zval *value; - zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_fetch_dimension_address(&EX_T(op_data->op2.u.var), object_ptr, dim, 0, BP_VAR_W TSRMLS_CC); - - value = get_zval_ptr(&op_data->op1, EX(Ts), &free_op_data1, BP_VAR_R); - zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (IS_TMP_FREE(free_op_data1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC); - FREE_OP_IF_VAR(free_op_data1); - } - - /* assign_dim has two opcodes! */ - ZEND_VM_INC_OPCODE(); - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *value = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (0?IS_TMP_VAR:IS_CV), EX(Ts) TSRMLS_CC); - /* zend_assign_to_variable() always takes care of op2, never free it! */ - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zend_free_op free_op2; - zval **variable_ptr_ptr; - zval **value_ptr_ptr = _get_zval_ptr_ptr_cv(&opline->op2, EX(Ts), BP_VAR_W TSRMLS_CC); - - if (IS_CV == IS_VAR && - value_ptr_ptr && - !(*value_ptr_ptr)->is_ref && - opline->extended_value == ZEND_RETURNS_FUNCTION && - !EX_T(opline->op2.u.var).var.fcall_returned_reference) { - if (free_op2.var == NULL) { - PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ - } - zend_error(E_STRICT, "Only variables should be assigned by reference"); - return ZEND_ASSIGN_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - if (IS_CV == IS_VAR && EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) { - zend_error(E_ERROR, "Cannot assign by reference to overloaded object"); - } - - variable_ptr_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC); - - if (!RETURN_VALUE_UNUSED(&opline->result)) { - EX_T(opline->result.u.var).var.ptr_ptr = variable_ptr_ptr; - PZVAL_LOCK(*variable_ptr_ptr); - AI_USE_PTR(EX_T(opline->result.u.var).var); - } - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - zval *function_name; - char *function_name_strval; - int function_name_strlen; - - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL); - - function_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_P(function_name)!=IS_STRING) { - zend_error_noreturn(E_ERROR, "Method name must be a string"); - } - - function_name_strval = Z_STRVAL_P(function_name); - function_name_strlen = Z_STRLEN_P(function_name); - - EX(object) = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (EX(object) && Z_TYPE_P(EX(object)) == IS_OBJECT) { - if (Z_OBJ_HT_P(EX(object))->get_method == NULL) { - zend_error_noreturn(E_ERROR, "Object does not support method calls"); - } - - /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen TSRMLS_CC); - if (!EX(fbc)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); - } - } else { - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); - } - - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; - } else { - if (!PZVAL_IS_REF(EX(object))) { - EX(object)->refcount++; /* For $this pointer */ - } else { - zval *this_ptr; - ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); - zval_copy_ctor(this_ptr); - EX(object) = this_ptr; - } - } - - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_CASE_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - int switch_expr_is_overloaded=0; - - - if (IS_CV==IS_VAR) { - if (EX_T(opline->op1.u.var).var.ptr_ptr) { - PZVAL_LOCK(EX_T(opline->op1.u.var).var.ptr); - } else { - switch_expr_is_overloaded = 1; - EX_T(opline->op1.u.var).str_offset.str->refcount++; - } - } - is_equal_function(&EX_T(opline->result.u.var).tmp_var, - _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC), - _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC); - - if (switch_expr_is_overloaded) { - /* We only free op1 if this is a string offset, - * Since if it is a TMP_VAR, it'll be reused by - * other CASE opcodes (whereas string offsets - * are allocated at each get_zval_ptr()) - */ - - EX_T(opline->op1.u.var).var.ptr_ptr = NULL; - AI_USE_PTR(EX_T(opline->op1.u.var).var); - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval *array_ptr = &EX_T(opline->result.u.var).tmp_var; - zval *expr_ptr; - zval *offset=_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - -#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV - zval **expr_ptr_ptr = NULL; - - if (opline->extended_value) { - expr_ptr_ptr=_get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC); - expr_ptr = *expr_ptr_ptr; - } else { - expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); - } -#else - expr_ptr=_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC); -#endif - - if (0) { /* temporary variable */ - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - } else { -#if 0 || IS_CV == IS_VAR || IS_CV == IS_CV - if (opline->extended_value) { - SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr); - expr_ptr = *expr_ptr_ptr; - expr_ptr->refcount++; - } else -#endif - if (PZVAL_IS_REF(expr_ptr)) { - zval *new_expr; - - ALLOC_ZVAL(new_expr); - INIT_PZVAL_COPY(new_expr, expr_ptr); - expr_ptr = new_expr; - zendi_zval_copy_ctor(*expr_ptr); - } else { - expr_ptr->refcount++; - } - } - if (offset) { - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), (long) Z_DVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_LONG: - case IS_BOOL: - zend_hash_index_update(Z_ARRVAL_P(array_ptr), Z_LVAL_P(offset), &expr_ptr, sizeof(zval *), NULL); - break; - case IS_STRING: - zend_symtable_update(Z_ARRVAL_P(array_ptr), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL); - break; - case IS_NULL: - zend_hash_update(Z_ARRVAL_P(array_ptr), "", sizeof(""), &expr_ptr, sizeof(zval *), NULL); - break; - default: - zend_error(E_WARNING, "Illegal offset type"); - zval_ptr_dtor(&expr_ptr); - /* do nothing */ - break; - } - - } else { - zend_hash_next_index_insert(Z_ARRVAL_P(array_ptr), &expr_ptr, sizeof(zval *), NULL); - } - if (opline->extended_value) { - - } else { - - } - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_INIT_ARRAY_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - array_init(&EX_T(opline->result.u.var).tmp_var); - if (IS_CV == IS_UNUSED) { - ZEND_VM_NEXT_OPCODE(); -#if 0 || IS_CV != IS_UNUSED - } else { - return ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -#endif - } -} - -static int ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - long index; - - if (container) { - if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - switch (Z_TYPE_PP(container)) { - case IS_ARRAY: { - HashTable *ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - zend_hash_index_del(ht, index); - break; - case IS_STRING: - if (IS_CV == IS_CV || IS_CV == IS_VAR) { - offset->refcount++; - } - if (zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1) == SUCCESS && - ht == &EG(symbol_table)) { - zend_execute_data *ex; - ulong hash_value = zend_inline_hash_func(offset->value.str.val, offset->value.str.len+1); - - for (ex = execute_data; ex; ex = ex->prev_execute_data) { - if (ex->op_array && ex->symbol_table == ht) { - int i; - - for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->op_array->vars[i].hash_value == hash_value && - ex->op_array->vars[i].name_len == offset->value.str.len && - !memcmp(ex->op_array->vars[i].name, offset->value.str.val, offset->value.str.len)) { - ex->CVs[i] = NULL; - break; - } - } - } - } - } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { - zval_ptr_dtor(&offset); - } - break; - case IS_NULL: - zend_hash_del(ht, "", sizeof("")); - break; - default: - zend_error(E_WARNING, "Illegal offset type in unset"); - break; - } - - break; - } - case IS_OBJECT: - if (!Z_OBJ_HT_P(*container)->unset_dimension) { - zend_error_noreturn(E_ERROR, "Cannot use object as array"); - } - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - break; - case IS_STRING: - zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); - ZEND_VM_CONTINUE(); /* bailed out before */ - default: - - break; - } - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_UNSET_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC); - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (container) { - if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { - SEPARATE_ZVAL_IF_NOT_REF(container); - } - if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC); - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else { - - } - } else { - - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CV(int prop_dim, ZEND_OPCODE_HANDLER_ARGS) -{ - zend_op *opline = EX(opline); - - zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC); - zval **value = NULL; - int result = 0; - long index; - - if (container) { - - zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC); - - if (Z_TYPE_PP(container) == IS_ARRAY) { - HashTable *ht; - int isset = 0; - - ht = Z_ARRVAL_PP(container); - - switch (Z_TYPE_P(offset)) { - case IS_DOUBLE: - index = (long) Z_DVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_RESOURCE: - case IS_BOOL: - case IS_LONG: - index = Z_LVAL_P(offset); - if (zend_hash_index_find(ht, index, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_STRING: - if (zend_symtable_find(ht, offset->value.str.val, offset->value.str.len+1, (void **) &value) == SUCCESS) { - isset = 1; - } - break; - case IS_NULL: - if (zend_hash_find(ht, "", sizeof(""), (void **) &value) == SUCCESS) { - isset = 1; - } - break; - default: - zend_error(E_WARNING, "Illegal offset type in isset or empty"); - - break; - } - - switch (opline->extended_value) { - case ZEND_ISSET: - if (isset && Z_TYPE_PP(value) == IS_NULL) { - result = 0; - } else { - result = isset; - } - break; - case ZEND_ISEMPTY: - if (!isset || !i_zend_is_true(*value)) { - result = 0; - } else { - result = 1; - } - break; - } - - } else if (Z_TYPE_PP(container) == IS_OBJECT) { - if (0) { - MAKE_REAL_ZVAL_PTR(offset); - } - if (prop_dim) { - result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } else { - result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC); - } - if (0) { - zval_ptr_dtor(&offset); - } else { - - } - } else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */ - zval tmp; - - if (Z_TYPE_P(offset) != IS_LONG) { - tmp = *offset; - zval_copy_ctor(&tmp); - convert_to_long(&tmp); - offset = &tmp; - } - if (Z_TYPE_P(offset) == IS_LONG) { - switch (opline->extended_value) { - case ZEND_ISSET: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) { - result = 1; - } - break; - case ZEND_ISEMPTY: - if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') { - result = 1; - } - break; - } - } - - } else { - - } - } - - Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_BOOL; - - switch (opline->extended_value) { - case ZEND_ISSET: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = result; - break; - case ZEND_ISEMPTY: - Z_LVAL(EX_T(opline->result.u.var).tmp_var) = !result; - break; - } - - ZEND_VM_NEXT_OPCODE(); -} - -static int ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CV(0, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CV(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - -static int ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_error_noreturn(E_ERROR, "Invalid opcode %d/%d/%d.", EX(opline)->opcode, EX(opline)->op1.op_type, EX(opline)->op2.op_type); - ZEND_VM_RETURN_FROM_EXECUTE_LOOP(); -} - - -void zend_init_opcodes_handlers() -{ - static const opcode_handler_t labels[] = { - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_NOP_SPEC_HANDLER, - ZEND_ADD_SPEC_CONST_CONST_HANDLER, - ZEND_ADD_SPEC_CONST_TMP_HANDLER, - ZEND_ADD_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_SPEC_CONST_CV_HANDLER, - ZEND_ADD_SPEC_TMP_CONST_HANDLER, - ZEND_ADD_SPEC_TMP_TMP_HANDLER, - ZEND_ADD_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_SPEC_TMP_CV_HANDLER, - ZEND_ADD_SPEC_VAR_CONST_HANDLER, - ZEND_ADD_SPEC_VAR_TMP_HANDLER, - ZEND_ADD_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_SPEC_CV_CONST_HANDLER, - ZEND_ADD_SPEC_CV_TMP_HANDLER, - ZEND_ADD_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_SPEC_CV_CV_HANDLER, - ZEND_SUB_SPEC_CONST_CONST_HANDLER, - ZEND_SUB_SPEC_CONST_TMP_HANDLER, - ZEND_SUB_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SUB_SPEC_CONST_CV_HANDLER, - ZEND_SUB_SPEC_TMP_CONST_HANDLER, - ZEND_SUB_SPEC_TMP_TMP_HANDLER, - ZEND_SUB_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SUB_SPEC_TMP_CV_HANDLER, - ZEND_SUB_SPEC_VAR_CONST_HANDLER, - ZEND_SUB_SPEC_VAR_TMP_HANDLER, - ZEND_SUB_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SUB_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SUB_SPEC_CV_CONST_HANDLER, - ZEND_SUB_SPEC_CV_TMP_HANDLER, - ZEND_SUB_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SUB_SPEC_CV_CV_HANDLER, - ZEND_MUL_SPEC_CONST_CONST_HANDLER, - ZEND_MUL_SPEC_CONST_TMP_HANDLER, - ZEND_MUL_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MUL_SPEC_CONST_CV_HANDLER, - ZEND_MUL_SPEC_TMP_CONST_HANDLER, - ZEND_MUL_SPEC_TMP_TMP_HANDLER, - ZEND_MUL_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MUL_SPEC_TMP_CV_HANDLER, - ZEND_MUL_SPEC_VAR_CONST_HANDLER, - ZEND_MUL_SPEC_VAR_TMP_HANDLER, - ZEND_MUL_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MUL_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MUL_SPEC_CV_CONST_HANDLER, - ZEND_MUL_SPEC_CV_TMP_HANDLER, - ZEND_MUL_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MUL_SPEC_CV_CV_HANDLER, - ZEND_DIV_SPEC_CONST_CONST_HANDLER, - ZEND_DIV_SPEC_CONST_TMP_HANDLER, - ZEND_DIV_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_DIV_SPEC_CONST_CV_HANDLER, - ZEND_DIV_SPEC_TMP_CONST_HANDLER, - ZEND_DIV_SPEC_TMP_TMP_HANDLER, - ZEND_DIV_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_DIV_SPEC_TMP_CV_HANDLER, - ZEND_DIV_SPEC_VAR_CONST_HANDLER, - ZEND_DIV_SPEC_VAR_TMP_HANDLER, - ZEND_DIV_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_DIV_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_DIV_SPEC_CV_CONST_HANDLER, - ZEND_DIV_SPEC_CV_TMP_HANDLER, - ZEND_DIV_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_DIV_SPEC_CV_CV_HANDLER, - ZEND_MOD_SPEC_CONST_CONST_HANDLER, - ZEND_MOD_SPEC_CONST_TMP_HANDLER, - ZEND_MOD_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MOD_SPEC_CONST_CV_HANDLER, - ZEND_MOD_SPEC_TMP_CONST_HANDLER, - ZEND_MOD_SPEC_TMP_TMP_HANDLER, - ZEND_MOD_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MOD_SPEC_TMP_CV_HANDLER, - ZEND_MOD_SPEC_VAR_CONST_HANDLER, - ZEND_MOD_SPEC_VAR_TMP_HANDLER, - ZEND_MOD_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MOD_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MOD_SPEC_CV_CONST_HANDLER, - ZEND_MOD_SPEC_CV_TMP_HANDLER, - ZEND_MOD_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_MOD_SPEC_CV_CV_HANDLER, - ZEND_SL_SPEC_CONST_CONST_HANDLER, - ZEND_SL_SPEC_CONST_TMP_HANDLER, - ZEND_SL_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SL_SPEC_CONST_CV_HANDLER, - ZEND_SL_SPEC_TMP_CONST_HANDLER, - ZEND_SL_SPEC_TMP_TMP_HANDLER, - ZEND_SL_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SL_SPEC_TMP_CV_HANDLER, - ZEND_SL_SPEC_VAR_CONST_HANDLER, - ZEND_SL_SPEC_VAR_TMP_HANDLER, - ZEND_SL_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SL_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SL_SPEC_CV_CONST_HANDLER, - ZEND_SL_SPEC_CV_TMP_HANDLER, - ZEND_SL_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SL_SPEC_CV_CV_HANDLER, - ZEND_SR_SPEC_CONST_CONST_HANDLER, - ZEND_SR_SPEC_CONST_TMP_HANDLER, - ZEND_SR_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SR_SPEC_CONST_CV_HANDLER, - ZEND_SR_SPEC_TMP_CONST_HANDLER, - ZEND_SR_SPEC_TMP_TMP_HANDLER, - ZEND_SR_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SR_SPEC_TMP_CV_HANDLER, - ZEND_SR_SPEC_VAR_CONST_HANDLER, - ZEND_SR_SPEC_VAR_TMP_HANDLER, - ZEND_SR_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SR_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SR_SPEC_CV_CONST_HANDLER, - ZEND_SR_SPEC_CV_TMP_HANDLER, - ZEND_SR_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SR_SPEC_CV_CV_HANDLER, - ZEND_CONCAT_SPEC_CONST_CONST_HANDLER, - ZEND_CONCAT_SPEC_CONST_TMP_HANDLER, - ZEND_CONCAT_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONCAT_SPEC_CONST_CV_HANDLER, - ZEND_CONCAT_SPEC_TMP_CONST_HANDLER, - ZEND_CONCAT_SPEC_TMP_TMP_HANDLER, - ZEND_CONCAT_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONCAT_SPEC_TMP_CV_HANDLER, - ZEND_CONCAT_SPEC_VAR_CONST_HANDLER, - ZEND_CONCAT_SPEC_VAR_TMP_HANDLER, - ZEND_CONCAT_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONCAT_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONCAT_SPEC_CV_CONST_HANDLER, - ZEND_CONCAT_SPEC_CV_TMP_HANDLER, - ZEND_CONCAT_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONCAT_SPEC_CV_CV_HANDLER, - ZEND_BW_OR_SPEC_CONST_CONST_HANDLER, - ZEND_BW_OR_SPEC_CONST_TMP_HANDLER, - ZEND_BW_OR_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_OR_SPEC_CONST_CV_HANDLER, - ZEND_BW_OR_SPEC_TMP_CONST_HANDLER, - ZEND_BW_OR_SPEC_TMP_TMP_HANDLER, - ZEND_BW_OR_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_OR_SPEC_TMP_CV_HANDLER, - ZEND_BW_OR_SPEC_VAR_CONST_HANDLER, - ZEND_BW_OR_SPEC_VAR_TMP_HANDLER, - ZEND_BW_OR_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_OR_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_OR_SPEC_CV_CONST_HANDLER, - ZEND_BW_OR_SPEC_CV_TMP_HANDLER, - ZEND_BW_OR_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_OR_SPEC_CV_CV_HANDLER, - ZEND_BW_AND_SPEC_CONST_CONST_HANDLER, - ZEND_BW_AND_SPEC_CONST_TMP_HANDLER, - ZEND_BW_AND_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_AND_SPEC_CONST_CV_HANDLER, - ZEND_BW_AND_SPEC_TMP_CONST_HANDLER, - ZEND_BW_AND_SPEC_TMP_TMP_HANDLER, - ZEND_BW_AND_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_AND_SPEC_TMP_CV_HANDLER, - ZEND_BW_AND_SPEC_VAR_CONST_HANDLER, - ZEND_BW_AND_SPEC_VAR_TMP_HANDLER, - ZEND_BW_AND_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_AND_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_AND_SPEC_CV_CONST_HANDLER, - ZEND_BW_AND_SPEC_CV_TMP_HANDLER, - ZEND_BW_AND_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_AND_SPEC_CV_CV_HANDLER, - ZEND_BW_XOR_SPEC_CONST_CONST_HANDLER, - ZEND_BW_XOR_SPEC_CONST_TMP_HANDLER, - ZEND_BW_XOR_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_XOR_SPEC_CONST_CV_HANDLER, - ZEND_BW_XOR_SPEC_TMP_CONST_HANDLER, - ZEND_BW_XOR_SPEC_TMP_TMP_HANDLER, - ZEND_BW_XOR_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_XOR_SPEC_TMP_CV_HANDLER, - ZEND_BW_XOR_SPEC_VAR_CONST_HANDLER, - ZEND_BW_XOR_SPEC_VAR_TMP_HANDLER, - ZEND_BW_XOR_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_XOR_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_XOR_SPEC_CV_CONST_HANDLER, - ZEND_BW_XOR_SPEC_CV_TMP_HANDLER, - ZEND_BW_XOR_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_XOR_SPEC_CV_CV_HANDLER, - ZEND_BW_NOT_SPEC_CONST_HANDLER, - ZEND_BW_NOT_SPEC_CONST_HANDLER, - ZEND_BW_NOT_SPEC_CONST_HANDLER, - ZEND_BW_NOT_SPEC_CONST_HANDLER, - ZEND_BW_NOT_SPEC_CONST_HANDLER, - ZEND_BW_NOT_SPEC_TMP_HANDLER, - ZEND_BW_NOT_SPEC_TMP_HANDLER, - ZEND_BW_NOT_SPEC_TMP_HANDLER, - ZEND_BW_NOT_SPEC_TMP_HANDLER, - ZEND_BW_NOT_SPEC_TMP_HANDLER, - ZEND_BW_NOT_SPEC_VAR_HANDLER, - ZEND_BW_NOT_SPEC_VAR_HANDLER, - ZEND_BW_NOT_SPEC_VAR_HANDLER, - ZEND_BW_NOT_SPEC_VAR_HANDLER, - ZEND_BW_NOT_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BW_NOT_SPEC_CV_HANDLER, - ZEND_BW_NOT_SPEC_CV_HANDLER, - ZEND_BW_NOT_SPEC_CV_HANDLER, - ZEND_BW_NOT_SPEC_CV_HANDLER, - ZEND_BW_NOT_SPEC_CV_HANDLER, - ZEND_BOOL_NOT_SPEC_CONST_HANDLER, - ZEND_BOOL_NOT_SPEC_CONST_HANDLER, - ZEND_BOOL_NOT_SPEC_CONST_HANDLER, - ZEND_BOOL_NOT_SPEC_CONST_HANDLER, - ZEND_BOOL_NOT_SPEC_CONST_HANDLER, - ZEND_BOOL_NOT_SPEC_TMP_HANDLER, - ZEND_BOOL_NOT_SPEC_TMP_HANDLER, - ZEND_BOOL_NOT_SPEC_TMP_HANDLER, - ZEND_BOOL_NOT_SPEC_TMP_HANDLER, - ZEND_BOOL_NOT_SPEC_TMP_HANDLER, - ZEND_BOOL_NOT_SPEC_VAR_HANDLER, - ZEND_BOOL_NOT_SPEC_VAR_HANDLER, - ZEND_BOOL_NOT_SPEC_VAR_HANDLER, - ZEND_BOOL_NOT_SPEC_VAR_HANDLER, - ZEND_BOOL_NOT_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BOOL_NOT_SPEC_CV_HANDLER, - ZEND_BOOL_NOT_SPEC_CV_HANDLER, - ZEND_BOOL_NOT_SPEC_CV_HANDLER, - ZEND_BOOL_NOT_SPEC_CV_HANDLER, - ZEND_BOOL_NOT_SPEC_CV_HANDLER, - ZEND_BOOL_XOR_SPEC_CONST_CONST_HANDLER, - ZEND_BOOL_XOR_SPEC_CONST_TMP_HANDLER, - ZEND_BOOL_XOR_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BOOL_XOR_SPEC_CONST_CV_HANDLER, - ZEND_BOOL_XOR_SPEC_TMP_CONST_HANDLER, - ZEND_BOOL_XOR_SPEC_TMP_TMP_HANDLER, - ZEND_BOOL_XOR_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BOOL_XOR_SPEC_TMP_CV_HANDLER, - ZEND_BOOL_XOR_SPEC_VAR_CONST_HANDLER, - ZEND_BOOL_XOR_SPEC_VAR_TMP_HANDLER, - ZEND_BOOL_XOR_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BOOL_XOR_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BOOL_XOR_SPEC_CV_CONST_HANDLER, - ZEND_BOOL_XOR_SPEC_CV_TMP_HANDLER, - ZEND_BOOL_XOR_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BOOL_XOR_SPEC_CV_CV_HANDLER, - ZEND_IS_IDENTICAL_SPEC_CONST_CONST_HANDLER, - ZEND_IS_IDENTICAL_SPEC_CONST_TMP_HANDLER, - ZEND_IS_IDENTICAL_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_IDENTICAL_SPEC_CONST_CV_HANDLER, - ZEND_IS_IDENTICAL_SPEC_TMP_CONST_HANDLER, - ZEND_IS_IDENTICAL_SPEC_TMP_TMP_HANDLER, - ZEND_IS_IDENTICAL_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_IDENTICAL_SPEC_TMP_CV_HANDLER, - ZEND_IS_IDENTICAL_SPEC_VAR_CONST_HANDLER, - ZEND_IS_IDENTICAL_SPEC_VAR_TMP_HANDLER, - ZEND_IS_IDENTICAL_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_IDENTICAL_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_IDENTICAL_SPEC_CV_CONST_HANDLER, - ZEND_IS_IDENTICAL_SPEC_CV_TMP_HANDLER, - ZEND_IS_IDENTICAL_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_IDENTICAL_SPEC_CV_CV_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CONST_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_CONST_TMP_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CV_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONST_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CV_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONST_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_HANDLER, - ZEND_IS_EQUAL_SPEC_CONST_CONST_HANDLER, - ZEND_IS_EQUAL_SPEC_CONST_TMP_HANDLER, - ZEND_IS_EQUAL_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_EQUAL_SPEC_CONST_CV_HANDLER, - ZEND_IS_EQUAL_SPEC_TMP_CONST_HANDLER, - ZEND_IS_EQUAL_SPEC_TMP_TMP_HANDLER, - ZEND_IS_EQUAL_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_EQUAL_SPEC_TMP_CV_HANDLER, - ZEND_IS_EQUAL_SPEC_VAR_CONST_HANDLER, - ZEND_IS_EQUAL_SPEC_VAR_TMP_HANDLER, - ZEND_IS_EQUAL_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_EQUAL_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_EQUAL_SPEC_CV_CONST_HANDLER, - ZEND_IS_EQUAL_SPEC_CV_TMP_HANDLER, - ZEND_IS_EQUAL_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_EQUAL_SPEC_CV_CV_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_CONST_TMP_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_CONST_CV_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_TMP_CONST_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_TMP_TMP_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_TMP_CV_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_VAR_CONST_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_VAR_TMP_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_CV_TMP_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_NOT_EQUAL_SPEC_CV_CV_HANDLER, - ZEND_IS_SMALLER_SPEC_CONST_CONST_HANDLER, - ZEND_IS_SMALLER_SPEC_CONST_TMP_HANDLER, - ZEND_IS_SMALLER_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_SPEC_CONST_CV_HANDLER, - ZEND_IS_SMALLER_SPEC_TMP_CONST_HANDLER, - ZEND_IS_SMALLER_SPEC_TMP_TMP_HANDLER, - ZEND_IS_SMALLER_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_SPEC_TMP_CV_HANDLER, - ZEND_IS_SMALLER_SPEC_VAR_CONST_HANDLER, - ZEND_IS_SMALLER_SPEC_VAR_TMP_HANDLER, - ZEND_IS_SMALLER_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_SPEC_CV_CONST_HANDLER, - ZEND_IS_SMALLER_SPEC_CV_TMP_HANDLER, - ZEND_IS_SMALLER_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_SPEC_CV_CV_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMP_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CV_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_CONST_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_TMP_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_CV_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CONST_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_TMP_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_CONST_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_TMP_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_CV_HANDLER, - ZEND_CAST_SPEC_CONST_HANDLER, - ZEND_CAST_SPEC_CONST_HANDLER, - ZEND_CAST_SPEC_CONST_HANDLER, - ZEND_CAST_SPEC_CONST_HANDLER, - ZEND_CAST_SPEC_CONST_HANDLER, - ZEND_CAST_SPEC_TMP_HANDLER, - ZEND_CAST_SPEC_TMP_HANDLER, - ZEND_CAST_SPEC_TMP_HANDLER, - ZEND_CAST_SPEC_TMP_HANDLER, - ZEND_CAST_SPEC_TMP_HANDLER, - ZEND_CAST_SPEC_VAR_HANDLER, - ZEND_CAST_SPEC_VAR_HANDLER, - ZEND_CAST_SPEC_VAR_HANDLER, - ZEND_CAST_SPEC_VAR_HANDLER, - ZEND_CAST_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CAST_SPEC_CV_HANDLER, - ZEND_CAST_SPEC_CV_HANDLER, - ZEND_CAST_SPEC_CV_HANDLER, - ZEND_CAST_SPEC_CV_HANDLER, - ZEND_CAST_SPEC_CV_HANDLER, - ZEND_QM_ASSIGN_SPEC_CONST_HANDLER, - ZEND_QM_ASSIGN_SPEC_CONST_HANDLER, - ZEND_QM_ASSIGN_SPEC_CONST_HANDLER, - ZEND_QM_ASSIGN_SPEC_CONST_HANDLER, - ZEND_QM_ASSIGN_SPEC_CONST_HANDLER, - ZEND_QM_ASSIGN_SPEC_TMP_HANDLER, - ZEND_QM_ASSIGN_SPEC_TMP_HANDLER, - ZEND_QM_ASSIGN_SPEC_TMP_HANDLER, - ZEND_QM_ASSIGN_SPEC_TMP_HANDLER, - ZEND_QM_ASSIGN_SPEC_TMP_HANDLER, - ZEND_QM_ASSIGN_SPEC_VAR_HANDLER, - ZEND_QM_ASSIGN_SPEC_VAR_HANDLER, - ZEND_QM_ASSIGN_SPEC_VAR_HANDLER, - ZEND_QM_ASSIGN_SPEC_VAR_HANDLER, - ZEND_QM_ASSIGN_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_QM_ASSIGN_SPEC_CV_HANDLER, - ZEND_QM_ASSIGN_SPEC_CV_HANDLER, - ZEND_QM_ASSIGN_SPEC_CV_HANDLER, - ZEND_QM_ASSIGN_SPEC_CV_HANDLER, - ZEND_QM_ASSIGN_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_ADD_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_ADD_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_ADD_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_ADD_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_ADD_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_ADD_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_ADD_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_ADD_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_ADD_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_ADD_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_ADD_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_ADD_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_ADD_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_ADD_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_ADD_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_SUB_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_SUB_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_SUB_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_SUB_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_SUB_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_SUB_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_SUB_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_SUB_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_SUB_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_SUB_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_SUB_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_SUB_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_SUB_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_SUB_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_SUB_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_MUL_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_MUL_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_MUL_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_MUL_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_MUL_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_MUL_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_MUL_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_MUL_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_MUL_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_MUL_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_MUL_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_MUL_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_MUL_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_MUL_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_MUL_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_DIV_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_DIV_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_DIV_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_DIV_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_DIV_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_DIV_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_DIV_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_DIV_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_DIV_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_DIV_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_DIV_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_DIV_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_DIV_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_DIV_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_DIV_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_MOD_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_MOD_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_MOD_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_MOD_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_MOD_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_MOD_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_MOD_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_MOD_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_MOD_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_MOD_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_MOD_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_MOD_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_MOD_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_MOD_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_MOD_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_SL_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_SL_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_SL_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_SL_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_SL_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_SL_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_SL_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_SL_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_SL_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_SL_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_SL_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_SL_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_SL_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_SL_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_SL_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_SR_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_SR_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_SR_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_SR_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_SR_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_SR_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_SR_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_SR_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_SR_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_SR_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_SR_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_SR_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_SR_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_SR_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_SR_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_CONCAT_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_BW_OR_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_BW_AND_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_VAR_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_BW_XOR_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_INC_SPEC_VAR_HANDLER, - ZEND_PRE_INC_SPEC_VAR_HANDLER, - ZEND_PRE_INC_SPEC_VAR_HANDLER, - ZEND_PRE_INC_SPEC_VAR_HANDLER, - ZEND_PRE_INC_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_INC_SPEC_CV_HANDLER, - ZEND_PRE_INC_SPEC_CV_HANDLER, - ZEND_PRE_INC_SPEC_CV_HANDLER, - ZEND_PRE_INC_SPEC_CV_HANDLER, - ZEND_PRE_INC_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_DEC_SPEC_VAR_HANDLER, - ZEND_PRE_DEC_SPEC_VAR_HANDLER, - ZEND_PRE_DEC_SPEC_VAR_HANDLER, - ZEND_PRE_DEC_SPEC_VAR_HANDLER, - ZEND_PRE_DEC_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_DEC_SPEC_CV_HANDLER, - ZEND_PRE_DEC_SPEC_CV_HANDLER, - ZEND_PRE_DEC_SPEC_CV_HANDLER, - ZEND_PRE_DEC_SPEC_CV_HANDLER, - ZEND_PRE_DEC_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_INC_SPEC_VAR_HANDLER, - ZEND_POST_INC_SPEC_VAR_HANDLER, - ZEND_POST_INC_SPEC_VAR_HANDLER, - ZEND_POST_INC_SPEC_VAR_HANDLER, - ZEND_POST_INC_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_INC_SPEC_CV_HANDLER, - ZEND_POST_INC_SPEC_CV_HANDLER, - ZEND_POST_INC_SPEC_CV_HANDLER, - ZEND_POST_INC_SPEC_CV_HANDLER, - ZEND_POST_INC_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_DEC_SPEC_VAR_HANDLER, - ZEND_POST_DEC_SPEC_VAR_HANDLER, - ZEND_POST_DEC_SPEC_VAR_HANDLER, - ZEND_POST_DEC_SPEC_VAR_HANDLER, - ZEND_POST_DEC_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_DEC_SPEC_CV_HANDLER, - ZEND_POST_DEC_SPEC_CV_HANDLER, - ZEND_POST_DEC_SPEC_CV_HANDLER, - ZEND_POST_DEC_SPEC_CV_HANDLER, - ZEND_POST_DEC_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER, - ZEND_ECHO_SPEC_CONST_HANDLER, - ZEND_ECHO_SPEC_CONST_HANDLER, - ZEND_ECHO_SPEC_CONST_HANDLER, - ZEND_ECHO_SPEC_CONST_HANDLER, - ZEND_ECHO_SPEC_CONST_HANDLER, - ZEND_ECHO_SPEC_TMP_HANDLER, - ZEND_ECHO_SPEC_TMP_HANDLER, - ZEND_ECHO_SPEC_TMP_HANDLER, - ZEND_ECHO_SPEC_TMP_HANDLER, - ZEND_ECHO_SPEC_TMP_HANDLER, - ZEND_ECHO_SPEC_VAR_HANDLER, - ZEND_ECHO_SPEC_VAR_HANDLER, - ZEND_ECHO_SPEC_VAR_HANDLER, - ZEND_ECHO_SPEC_VAR_HANDLER, - ZEND_ECHO_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ECHO_SPEC_CV_HANDLER, - ZEND_ECHO_SPEC_CV_HANDLER, - ZEND_ECHO_SPEC_CV_HANDLER, - ZEND_ECHO_SPEC_CV_HANDLER, - ZEND_ECHO_SPEC_CV_HANDLER, - ZEND_PRINT_SPEC_CONST_HANDLER, - ZEND_PRINT_SPEC_CONST_HANDLER, - ZEND_PRINT_SPEC_CONST_HANDLER, - ZEND_PRINT_SPEC_CONST_HANDLER, - ZEND_PRINT_SPEC_CONST_HANDLER, - ZEND_PRINT_SPEC_TMP_HANDLER, - ZEND_PRINT_SPEC_TMP_HANDLER, - ZEND_PRINT_SPEC_TMP_HANDLER, - ZEND_PRINT_SPEC_TMP_HANDLER, - ZEND_PRINT_SPEC_TMP_HANDLER, - ZEND_PRINT_SPEC_VAR_HANDLER, - ZEND_PRINT_SPEC_VAR_HANDLER, - ZEND_PRINT_SPEC_VAR_HANDLER, - ZEND_PRINT_SPEC_VAR_HANDLER, - ZEND_PRINT_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRINT_SPEC_CV_HANDLER, - ZEND_PRINT_SPEC_CV_HANDLER, - ZEND_PRINT_SPEC_CV_HANDLER, - ZEND_PRINT_SPEC_CV_HANDLER, - ZEND_PRINT_SPEC_CV_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMP_SPEC_HANDLER, - ZEND_JMPZ_SPEC_CONST_HANDLER, - ZEND_JMPZ_SPEC_CONST_HANDLER, - ZEND_JMPZ_SPEC_CONST_HANDLER, - ZEND_JMPZ_SPEC_CONST_HANDLER, - ZEND_JMPZ_SPEC_CONST_HANDLER, - ZEND_JMPZ_SPEC_TMP_HANDLER, - ZEND_JMPZ_SPEC_TMP_HANDLER, - ZEND_JMPZ_SPEC_TMP_HANDLER, - ZEND_JMPZ_SPEC_TMP_HANDLER, - ZEND_JMPZ_SPEC_TMP_HANDLER, - ZEND_JMPZ_SPEC_VAR_HANDLER, - ZEND_JMPZ_SPEC_VAR_HANDLER, - ZEND_JMPZ_SPEC_VAR_HANDLER, - ZEND_JMPZ_SPEC_VAR_HANDLER, - ZEND_JMPZ_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_JMPZ_SPEC_CV_HANDLER, - ZEND_JMPZ_SPEC_CV_HANDLER, - ZEND_JMPZ_SPEC_CV_HANDLER, - ZEND_JMPZ_SPEC_CV_HANDLER, - ZEND_JMPZ_SPEC_CV_HANDLER, - ZEND_JMPNZ_SPEC_CONST_HANDLER, - ZEND_JMPNZ_SPEC_CONST_HANDLER, - ZEND_JMPNZ_SPEC_CONST_HANDLER, - ZEND_JMPNZ_SPEC_CONST_HANDLER, - ZEND_JMPNZ_SPEC_CONST_HANDLER, - ZEND_JMPNZ_SPEC_TMP_HANDLER, - ZEND_JMPNZ_SPEC_TMP_HANDLER, - ZEND_JMPNZ_SPEC_TMP_HANDLER, - ZEND_JMPNZ_SPEC_TMP_HANDLER, - ZEND_JMPNZ_SPEC_TMP_HANDLER, - ZEND_JMPNZ_SPEC_VAR_HANDLER, - ZEND_JMPNZ_SPEC_VAR_HANDLER, - ZEND_JMPNZ_SPEC_VAR_HANDLER, - ZEND_JMPNZ_SPEC_VAR_HANDLER, - ZEND_JMPNZ_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_JMPNZ_SPEC_CV_HANDLER, - ZEND_JMPNZ_SPEC_CV_HANDLER, - ZEND_JMPNZ_SPEC_CV_HANDLER, - ZEND_JMPNZ_SPEC_CV_HANDLER, - ZEND_JMPNZ_SPEC_CV_HANDLER, - ZEND_JMPZNZ_SPEC_CONST_HANDLER, - ZEND_JMPZNZ_SPEC_CONST_HANDLER, - ZEND_JMPZNZ_SPEC_CONST_HANDLER, - ZEND_JMPZNZ_SPEC_CONST_HANDLER, - ZEND_JMPZNZ_SPEC_CONST_HANDLER, - ZEND_JMPZNZ_SPEC_TMP_HANDLER, - ZEND_JMPZNZ_SPEC_TMP_HANDLER, - ZEND_JMPZNZ_SPEC_TMP_HANDLER, - ZEND_JMPZNZ_SPEC_TMP_HANDLER, - ZEND_JMPZNZ_SPEC_TMP_HANDLER, - ZEND_JMPZNZ_SPEC_VAR_HANDLER, - ZEND_JMPZNZ_SPEC_VAR_HANDLER, - ZEND_JMPZNZ_SPEC_VAR_HANDLER, - ZEND_JMPZNZ_SPEC_VAR_HANDLER, - ZEND_JMPZNZ_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_JMPZNZ_SPEC_CV_HANDLER, - ZEND_JMPZNZ_SPEC_CV_HANDLER, - ZEND_JMPZNZ_SPEC_CV_HANDLER, - ZEND_JMPZNZ_SPEC_CV_HANDLER, - ZEND_JMPZNZ_SPEC_CV_HANDLER, - ZEND_JMPZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPZ_EX_SPEC_VAR_HANDLER, - ZEND_JMPZ_EX_SPEC_VAR_HANDLER, - ZEND_JMPZ_EX_SPEC_VAR_HANDLER, - ZEND_JMPZ_EX_SPEC_VAR_HANDLER, - ZEND_JMPZ_EX_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_JMPZ_EX_SPEC_CV_HANDLER, - ZEND_JMPZ_EX_SPEC_CV_HANDLER, - ZEND_JMPZ_EX_SPEC_CV_HANDLER, - ZEND_JMPZ_EX_SPEC_CV_HANDLER, - ZEND_JMPZ_EX_SPEC_CV_HANDLER, - ZEND_JMPNZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPNZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPNZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPNZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPNZ_EX_SPEC_CONST_HANDLER, - ZEND_JMPNZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPNZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPNZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPNZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPNZ_EX_SPEC_TMP_HANDLER, - ZEND_JMPNZ_EX_SPEC_VAR_HANDLER, - ZEND_JMPNZ_EX_SPEC_VAR_HANDLER, - ZEND_JMPNZ_EX_SPEC_VAR_HANDLER, - ZEND_JMPNZ_EX_SPEC_VAR_HANDLER, - ZEND_JMPNZ_EX_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_JMPNZ_EX_SPEC_CV_HANDLER, - ZEND_JMPNZ_EX_SPEC_CV_HANDLER, - ZEND_JMPNZ_EX_SPEC_CV_HANDLER, - ZEND_JMPNZ_EX_SPEC_CV_HANDLER, - ZEND_JMPNZ_EX_SPEC_CV_HANDLER, - ZEND_CASE_SPEC_CONST_CONST_HANDLER, - ZEND_CASE_SPEC_CONST_TMP_HANDLER, - ZEND_CASE_SPEC_CONST_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CASE_SPEC_CONST_CV_HANDLER, - ZEND_CASE_SPEC_TMP_CONST_HANDLER, - ZEND_CASE_SPEC_TMP_TMP_HANDLER, - ZEND_CASE_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CASE_SPEC_TMP_CV_HANDLER, - ZEND_CASE_SPEC_VAR_CONST_HANDLER, - ZEND_CASE_SPEC_VAR_TMP_HANDLER, - ZEND_CASE_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CASE_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CASE_SPEC_CV_CONST_HANDLER, - ZEND_CASE_SPEC_CV_TMP_HANDLER, - ZEND_CASE_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CASE_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SWITCH_FREE_SPEC_TMP_HANDLER, - ZEND_SWITCH_FREE_SPEC_TMP_HANDLER, - ZEND_SWITCH_FREE_SPEC_TMP_HANDLER, - ZEND_SWITCH_FREE_SPEC_TMP_HANDLER, - ZEND_SWITCH_FREE_SPEC_TMP_HANDLER, - ZEND_SWITCH_FREE_SPEC_VAR_HANDLER, - ZEND_SWITCH_FREE_SPEC_VAR_HANDLER, - ZEND_SWITCH_FREE_SPEC_VAR_HANDLER, - ZEND_SWITCH_FREE_SPEC_VAR_HANDLER, - ZEND_SWITCH_FREE_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BRK_SPEC_CONST_HANDLER, - ZEND_BRK_SPEC_TMP_HANDLER, - ZEND_BRK_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BRK_SPEC_CV_HANDLER, - ZEND_BRK_SPEC_CONST_HANDLER, - ZEND_BRK_SPEC_TMP_HANDLER, - ZEND_BRK_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BRK_SPEC_CV_HANDLER, - ZEND_BRK_SPEC_CONST_HANDLER, - ZEND_BRK_SPEC_TMP_HANDLER, - ZEND_BRK_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BRK_SPEC_CV_HANDLER, - ZEND_BRK_SPEC_CONST_HANDLER, - ZEND_BRK_SPEC_TMP_HANDLER, - ZEND_BRK_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BRK_SPEC_CV_HANDLER, - ZEND_BRK_SPEC_CONST_HANDLER, - ZEND_BRK_SPEC_TMP_HANDLER, - ZEND_BRK_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BRK_SPEC_CV_HANDLER, - ZEND_CONT_SPEC_CONST_HANDLER, - ZEND_CONT_SPEC_TMP_HANDLER, - ZEND_CONT_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONT_SPEC_CV_HANDLER, - ZEND_CONT_SPEC_CONST_HANDLER, - ZEND_CONT_SPEC_TMP_HANDLER, - ZEND_CONT_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONT_SPEC_CV_HANDLER, - ZEND_CONT_SPEC_CONST_HANDLER, - ZEND_CONT_SPEC_TMP_HANDLER, - ZEND_CONT_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONT_SPEC_CV_HANDLER, - ZEND_CONT_SPEC_CONST_HANDLER, - ZEND_CONT_SPEC_TMP_HANDLER, - ZEND_CONT_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONT_SPEC_CV_HANDLER, - ZEND_CONT_SPEC_CONST_HANDLER, - ZEND_CONT_SPEC_TMP_HANDLER, - ZEND_CONT_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_CONT_SPEC_CV_HANDLER, - ZEND_BOOL_SPEC_CONST_HANDLER, - ZEND_BOOL_SPEC_CONST_HANDLER, - ZEND_BOOL_SPEC_CONST_HANDLER, - ZEND_BOOL_SPEC_CONST_HANDLER, - ZEND_BOOL_SPEC_CONST_HANDLER, - ZEND_BOOL_SPEC_TMP_HANDLER, - ZEND_BOOL_SPEC_TMP_HANDLER, - ZEND_BOOL_SPEC_TMP_HANDLER, - ZEND_BOOL_SPEC_TMP_HANDLER, - ZEND_BOOL_SPEC_TMP_HANDLER, - ZEND_BOOL_SPEC_VAR_HANDLER, - ZEND_BOOL_SPEC_VAR_HANDLER, - ZEND_BOOL_SPEC_VAR_HANDLER, - ZEND_BOOL_SPEC_VAR_HANDLER, - ZEND_BOOL_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BOOL_SPEC_CV_HANDLER, - ZEND_BOOL_SPEC_CV_HANDLER, - ZEND_BOOL_SPEC_CV_HANDLER, - ZEND_BOOL_SPEC_CV_HANDLER, - ZEND_BOOL_SPEC_CV_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_INIT_STRING_SPEC_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_CHAR_SPEC_TMP_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_STRING_SPEC_TMP_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_VAR_SPEC_TMP_TMP_HANDLER, - ZEND_ADD_VAR_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_VAR_SPEC_TMP_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_BEGIN_SILENCE_SPEC_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_END_SILENCE_SPEC_TMP_HANDLER, - ZEND_END_SILENCE_SPEC_TMP_HANDLER, - ZEND_END_SILENCE_SPEC_TMP_HANDLER, - ZEND_END_SILENCE_SPEC_TMP_HANDLER, - ZEND_END_SILENCE_SPEC_TMP_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER, - ZEND_DO_FCALL_SPEC_CONST_HANDLER, - ZEND_DO_FCALL_SPEC_CONST_HANDLER, - ZEND_DO_FCALL_SPEC_CONST_HANDLER, - ZEND_DO_FCALL_SPEC_CONST_HANDLER, - ZEND_DO_FCALL_SPEC_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER, - ZEND_RETURN_SPEC_CONST_HANDLER, - ZEND_RETURN_SPEC_CONST_HANDLER, - ZEND_RETURN_SPEC_CONST_HANDLER, - ZEND_RETURN_SPEC_CONST_HANDLER, - ZEND_RETURN_SPEC_CONST_HANDLER, - ZEND_RETURN_SPEC_TMP_HANDLER, - ZEND_RETURN_SPEC_TMP_HANDLER, - ZEND_RETURN_SPEC_TMP_HANDLER, - ZEND_RETURN_SPEC_TMP_HANDLER, - ZEND_RETURN_SPEC_TMP_HANDLER, - ZEND_RETURN_SPEC_VAR_HANDLER, - ZEND_RETURN_SPEC_VAR_HANDLER, - ZEND_RETURN_SPEC_VAR_HANDLER, - ZEND_RETURN_SPEC_VAR_HANDLER, - ZEND_RETURN_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_RETURN_SPEC_CV_HANDLER, - ZEND_RETURN_SPEC_CV_HANDLER, - ZEND_RETURN_SPEC_CV_HANDLER, - ZEND_RETURN_SPEC_CV_HANDLER, - ZEND_RETURN_SPEC_CV_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_SPEC_HANDLER, - ZEND_RECV_INIT_SPEC_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_RECV_INIT_SPEC_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_RECV_INIT_SPEC_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_RECV_INIT_SPEC_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_RECV_INIT_SPEC_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SEND_VAL_SPEC_CONST_HANDLER, - ZEND_SEND_VAL_SPEC_CONST_HANDLER, - ZEND_SEND_VAL_SPEC_CONST_HANDLER, - ZEND_SEND_VAL_SPEC_CONST_HANDLER, - ZEND_SEND_VAL_SPEC_CONST_HANDLER, - ZEND_SEND_VAL_SPEC_TMP_HANDLER, - ZEND_SEND_VAL_SPEC_TMP_HANDLER, - ZEND_SEND_VAL_SPEC_TMP_HANDLER, - ZEND_SEND_VAL_SPEC_TMP_HANDLER, - ZEND_SEND_VAL_SPEC_TMP_HANDLER, - ZEND_SEND_VAL_SPEC_VAR_HANDLER, - ZEND_SEND_VAL_SPEC_VAR_HANDLER, - ZEND_SEND_VAL_SPEC_VAR_HANDLER, - ZEND_SEND_VAL_SPEC_VAR_HANDLER, - ZEND_SEND_VAL_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SEND_VAL_SPEC_CV_HANDLER, - ZEND_SEND_VAL_SPEC_CV_HANDLER, - ZEND_SEND_VAL_SPEC_CV_HANDLER, - ZEND_SEND_VAL_SPEC_CV_HANDLER, - ZEND_SEND_VAL_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SEND_VAR_SPEC_VAR_HANDLER, - ZEND_SEND_VAR_SPEC_VAR_HANDLER, - ZEND_SEND_VAR_SPEC_VAR_HANDLER, - ZEND_SEND_VAR_SPEC_VAR_HANDLER, - ZEND_SEND_VAR_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SEND_VAR_SPEC_CV_HANDLER, - ZEND_SEND_VAR_SPEC_CV_HANDLER, - ZEND_SEND_VAR_SPEC_CV_HANDLER, - ZEND_SEND_VAR_SPEC_CV_HANDLER, - ZEND_SEND_VAR_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SEND_REF_SPEC_VAR_HANDLER, - ZEND_SEND_REF_SPEC_VAR_HANDLER, - ZEND_SEND_REF_SPEC_VAR_HANDLER, - ZEND_SEND_REF_SPEC_VAR_HANDLER, - ZEND_SEND_REF_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SEND_REF_SPEC_CV_HANDLER, - ZEND_SEND_REF_SPEC_CV_HANDLER, - ZEND_SEND_REF_SPEC_CV_HANDLER, - ZEND_SEND_REF_SPEC_CV_HANDLER, - ZEND_SEND_REF_SPEC_CV_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NEW_SPEC_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FREE_SPEC_TMP_HANDLER, - ZEND_FREE_SPEC_TMP_HANDLER, - ZEND_FREE_SPEC_TMP_HANDLER, - ZEND_FREE_SPEC_TMP_HANDLER, - ZEND_FREE_SPEC_TMP_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_ARRAY_SPEC_CONST_CONST_HANDLER, - ZEND_INIT_ARRAY_SPEC_CONST_TMP_HANDLER, - ZEND_INIT_ARRAY_SPEC_CONST_VAR_HANDLER, - ZEND_INIT_ARRAY_SPEC_CONST_UNUSED_HANDLER, - ZEND_INIT_ARRAY_SPEC_CONST_CV_HANDLER, - ZEND_INIT_ARRAY_SPEC_TMP_CONST_HANDLER, - ZEND_INIT_ARRAY_SPEC_TMP_TMP_HANDLER, - ZEND_INIT_ARRAY_SPEC_TMP_VAR_HANDLER, - ZEND_INIT_ARRAY_SPEC_TMP_UNUSED_HANDLER, - ZEND_INIT_ARRAY_SPEC_TMP_CV_HANDLER, - ZEND_INIT_ARRAY_SPEC_VAR_CONST_HANDLER, - ZEND_INIT_ARRAY_SPEC_VAR_TMP_HANDLER, - ZEND_INIT_ARRAY_SPEC_VAR_VAR_HANDLER, - ZEND_INIT_ARRAY_SPEC_VAR_UNUSED_HANDLER, - ZEND_INIT_ARRAY_SPEC_VAR_CV_HANDLER, - ZEND_INIT_ARRAY_SPEC_UNUSED_CONST_HANDLER, - ZEND_INIT_ARRAY_SPEC_UNUSED_TMP_HANDLER, - ZEND_INIT_ARRAY_SPEC_UNUSED_VAR_HANDLER, - ZEND_INIT_ARRAY_SPEC_UNUSED_UNUSED_HANDLER, - ZEND_INIT_ARRAY_SPEC_UNUSED_CV_HANDLER, - ZEND_INIT_ARRAY_SPEC_CV_CONST_HANDLER, - ZEND_INIT_ARRAY_SPEC_CV_TMP_HANDLER, - ZEND_INIT_ARRAY_SPEC_CV_VAR_HANDLER, - ZEND_INIT_ARRAY_SPEC_CV_UNUSED_HANDLER, - ZEND_INIT_ARRAY_SPEC_CV_CV_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER, - ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER, - ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER, - ZEND_UNSET_VAR_SPEC_CONST_HANDLER, - ZEND_UNSET_VAR_SPEC_CONST_HANDLER, - ZEND_UNSET_VAR_SPEC_CONST_HANDLER, - ZEND_UNSET_VAR_SPEC_CONST_HANDLER, - ZEND_UNSET_VAR_SPEC_CONST_HANDLER, - ZEND_UNSET_VAR_SPEC_TMP_HANDLER, - ZEND_UNSET_VAR_SPEC_TMP_HANDLER, - ZEND_UNSET_VAR_SPEC_TMP_HANDLER, - ZEND_UNSET_VAR_SPEC_TMP_HANDLER, - ZEND_UNSET_VAR_SPEC_TMP_HANDLER, - ZEND_UNSET_VAR_SPEC_VAR_HANDLER, - ZEND_UNSET_VAR_SPEC_VAR_HANDLER, - ZEND_UNSET_VAR_SPEC_VAR_HANDLER, - ZEND_UNSET_VAR_SPEC_VAR_HANDLER, - ZEND_UNSET_VAR_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_VAR_SPEC_CV_HANDLER, - ZEND_UNSET_VAR_SPEC_CV_HANDLER, - ZEND_UNSET_VAR_SPEC_CV_HANDLER, - ZEND_UNSET_VAR_SPEC_CV_HANDLER, - ZEND_UNSET_VAR_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER, - ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER, - ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER, - ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER, - ZEND_UNSET_DIM_SPEC_UNUSED_TMP_HANDLER, - ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER, - ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER, - ZEND_UNSET_DIM_SPEC_CV_TMP_HANDLER, - ZEND_UNSET_DIM_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER, - ZEND_UNSET_OBJ_SPEC_VAR_TMP_HANDLER, - ZEND_UNSET_OBJ_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER, - ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HANDLER, - ZEND_UNSET_OBJ_SPEC_UNUSED_TMP_HANDLER, - ZEND_UNSET_OBJ_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDLER, - ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLER, - ZEND_UNSET_OBJ_SPEC_CV_TMP_HANDLER, - ZEND_UNSET_OBJ_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_UNSET_OBJ_SPEC_CV_CV_HANDLER, - ZEND_FE_RESET_SPEC_CONST_HANDLER, - ZEND_FE_RESET_SPEC_CONST_HANDLER, - ZEND_FE_RESET_SPEC_CONST_HANDLER, - ZEND_FE_RESET_SPEC_CONST_HANDLER, - ZEND_FE_RESET_SPEC_CONST_HANDLER, - ZEND_FE_RESET_SPEC_TMP_HANDLER, - ZEND_FE_RESET_SPEC_TMP_HANDLER, - ZEND_FE_RESET_SPEC_TMP_HANDLER, - ZEND_FE_RESET_SPEC_TMP_HANDLER, - ZEND_FE_RESET_SPEC_TMP_HANDLER, - ZEND_FE_RESET_SPEC_VAR_HANDLER, - ZEND_FE_RESET_SPEC_VAR_HANDLER, - ZEND_FE_RESET_SPEC_VAR_HANDLER, - ZEND_FE_RESET_SPEC_VAR_HANDLER, - ZEND_FE_RESET_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FE_RESET_SPEC_CV_HANDLER, - ZEND_FE_RESET_SPEC_CV_HANDLER, - ZEND_FE_RESET_SPEC_CV_HANDLER, - ZEND_FE_RESET_SPEC_CV_HANDLER, - ZEND_FE_RESET_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FE_FETCH_SPEC_VAR_HANDLER, - ZEND_FE_FETCH_SPEC_VAR_HANDLER, - ZEND_FE_FETCH_SPEC_VAR_HANDLER, - ZEND_FE_FETCH_SPEC_VAR_HANDLER, - ZEND_FE_FETCH_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_EXIT_SPEC_CONST_HANDLER, - ZEND_EXIT_SPEC_CONST_HANDLER, - ZEND_EXIT_SPEC_CONST_HANDLER, - ZEND_EXIT_SPEC_CONST_HANDLER, - ZEND_EXIT_SPEC_CONST_HANDLER, - ZEND_EXIT_SPEC_TMP_HANDLER, - ZEND_EXIT_SPEC_TMP_HANDLER, - ZEND_EXIT_SPEC_TMP_HANDLER, - ZEND_EXIT_SPEC_TMP_HANDLER, - ZEND_EXIT_SPEC_TMP_HANDLER, - ZEND_EXIT_SPEC_VAR_HANDLER, - ZEND_EXIT_SPEC_VAR_HANDLER, - ZEND_EXIT_SPEC_VAR_HANDLER, - ZEND_EXIT_SPEC_VAR_HANDLER, - ZEND_EXIT_SPEC_VAR_HANDLER, - ZEND_EXIT_SPEC_UNUSED_HANDLER, - ZEND_EXIT_SPEC_UNUSED_HANDLER, - ZEND_EXIT_SPEC_UNUSED_HANDLER, - ZEND_EXIT_SPEC_UNUSED_HANDLER, - ZEND_EXIT_SPEC_UNUSED_HANDLER, - ZEND_EXIT_SPEC_CV_HANDLER, - ZEND_EXIT_SPEC_CV_HANDLER, - ZEND_EXIT_SPEC_CV_HANDLER, - ZEND_EXIT_SPEC_CV_HANDLER, - ZEND_EXIT_SPEC_CV_HANDLER, - ZEND_FETCH_R_SPEC_CONST_HANDLER, - ZEND_FETCH_R_SPEC_CONST_HANDLER, - ZEND_FETCH_R_SPEC_CONST_HANDLER, - ZEND_FETCH_R_SPEC_CONST_HANDLER, - ZEND_FETCH_R_SPEC_CONST_HANDLER, - ZEND_FETCH_R_SPEC_TMP_HANDLER, - ZEND_FETCH_R_SPEC_TMP_HANDLER, - ZEND_FETCH_R_SPEC_TMP_HANDLER, - ZEND_FETCH_R_SPEC_TMP_HANDLER, - ZEND_FETCH_R_SPEC_TMP_HANDLER, - ZEND_FETCH_R_SPEC_VAR_HANDLER, - ZEND_FETCH_R_SPEC_VAR_HANDLER, - ZEND_FETCH_R_SPEC_VAR_HANDLER, - ZEND_FETCH_R_SPEC_VAR_HANDLER, - ZEND_FETCH_R_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_R_SPEC_CV_HANDLER, - ZEND_FETCH_R_SPEC_CV_HANDLER, - ZEND_FETCH_R_SPEC_CV_HANDLER, - ZEND_FETCH_R_SPEC_CV_HANDLER, - ZEND_FETCH_R_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_R_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_DIM_R_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_DIM_R_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_R_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_DIM_R_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_DIM_R_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_R_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_VAR_CV_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMP_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER, - ZEND_FETCH_W_SPEC_CONST_HANDLER, - ZEND_FETCH_W_SPEC_CONST_HANDLER, - ZEND_FETCH_W_SPEC_CONST_HANDLER, - ZEND_FETCH_W_SPEC_CONST_HANDLER, - ZEND_FETCH_W_SPEC_CONST_HANDLER, - ZEND_FETCH_W_SPEC_TMP_HANDLER, - ZEND_FETCH_W_SPEC_TMP_HANDLER, - ZEND_FETCH_W_SPEC_TMP_HANDLER, - ZEND_FETCH_W_SPEC_TMP_HANDLER, - ZEND_FETCH_W_SPEC_TMP_HANDLER, - ZEND_FETCH_W_SPEC_VAR_HANDLER, - ZEND_FETCH_W_SPEC_VAR_HANDLER, - ZEND_FETCH_W_SPEC_VAR_HANDLER, - ZEND_FETCH_W_SPEC_VAR_HANDLER, - ZEND_FETCH_W_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_W_SPEC_CV_HANDLER, - ZEND_FETCH_W_SPEC_CV_HANDLER, - ZEND_FETCH_W_SPEC_CV_HANDLER, - ZEND_FETCH_W_SPEC_CV_HANDLER, - ZEND_FETCH_W_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_W_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_DIM_W_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_DIM_W_SPEC_VAR_VAR_HANDLER, - ZEND_FETCH_DIM_W_SPEC_VAR_UNUSED_HANDLER, - ZEND_FETCH_DIM_W_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_W_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_DIM_W_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_DIM_W_SPEC_CV_VAR_HANDLER, - ZEND_FETCH_DIM_W_SPEC_CV_UNUSED_HANDLER, - ZEND_FETCH_DIM_W_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMP_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER, - ZEND_FETCH_RW_SPEC_CONST_HANDLER, - ZEND_FETCH_RW_SPEC_CONST_HANDLER, - ZEND_FETCH_RW_SPEC_CONST_HANDLER, - ZEND_FETCH_RW_SPEC_CONST_HANDLER, - ZEND_FETCH_RW_SPEC_CONST_HANDLER, - ZEND_FETCH_RW_SPEC_TMP_HANDLER, - ZEND_FETCH_RW_SPEC_TMP_HANDLER, - ZEND_FETCH_RW_SPEC_TMP_HANDLER, - ZEND_FETCH_RW_SPEC_TMP_HANDLER, - ZEND_FETCH_RW_SPEC_TMP_HANDLER, - ZEND_FETCH_RW_SPEC_VAR_HANDLER, - ZEND_FETCH_RW_SPEC_VAR_HANDLER, - ZEND_FETCH_RW_SPEC_VAR_HANDLER, - ZEND_FETCH_RW_SPEC_VAR_HANDLER, - ZEND_FETCH_RW_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_RW_SPEC_CV_HANDLER, - ZEND_FETCH_RW_SPEC_CV_HANDLER, - ZEND_FETCH_RW_SPEC_CV_HANDLER, - ZEND_FETCH_RW_SPEC_CV_HANDLER, - ZEND_FETCH_RW_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_VAR_VAR_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_VAR_UNUSED_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_CV_VAR_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_CV_UNUSED_HANDLER, - ZEND_FETCH_DIM_RW_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_VAR_CV_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CONST_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMP_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CV_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_RW_SPEC_CV_CV_HANDLER, - ZEND_FETCH_IS_SPEC_CONST_HANDLER, - ZEND_FETCH_IS_SPEC_CONST_HANDLER, - ZEND_FETCH_IS_SPEC_CONST_HANDLER, - ZEND_FETCH_IS_SPEC_CONST_HANDLER, - ZEND_FETCH_IS_SPEC_CONST_HANDLER, - ZEND_FETCH_IS_SPEC_TMP_HANDLER, - ZEND_FETCH_IS_SPEC_TMP_HANDLER, - ZEND_FETCH_IS_SPEC_TMP_HANDLER, - ZEND_FETCH_IS_SPEC_TMP_HANDLER, - ZEND_FETCH_IS_SPEC_TMP_HANDLER, - ZEND_FETCH_IS_SPEC_VAR_HANDLER, - ZEND_FETCH_IS_SPEC_VAR_HANDLER, - ZEND_FETCH_IS_SPEC_VAR_HANDLER, - ZEND_FETCH_IS_SPEC_VAR_HANDLER, - ZEND_FETCH_IS_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_IS_SPEC_CV_HANDLER, - ZEND_FETCH_IS_SPEC_CV_HANDLER, - ZEND_FETCH_IS_SPEC_CV_HANDLER, - ZEND_FETCH_IS_SPEC_CV_HANDLER, - ZEND_FETCH_IS_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_IS_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_DIM_IS_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_DIM_IS_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_IS_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_IS_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_DIM_IS_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_DIM_IS_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_IS_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_VAR_CV_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMP_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CONST_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CONST_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CONST_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CONST_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CONST_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_TMP_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_TMP_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_TMP_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_TMP_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_TMP_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_VAR_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_VAR_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_VAR_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_VAR_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CV_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CV_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CV_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CV_HANDLER, - ZEND_FETCH_FUNC_ARG_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_VAR_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_VAR_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED_HANDLER, - ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMP_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV_HANDLER, - ZEND_FETCH_UNSET_SPEC_CONST_HANDLER, - ZEND_FETCH_UNSET_SPEC_CONST_HANDLER, - ZEND_FETCH_UNSET_SPEC_CONST_HANDLER, - ZEND_FETCH_UNSET_SPEC_CONST_HANDLER, - ZEND_FETCH_UNSET_SPEC_CONST_HANDLER, - ZEND_FETCH_UNSET_SPEC_TMP_HANDLER, - ZEND_FETCH_UNSET_SPEC_TMP_HANDLER, - ZEND_FETCH_UNSET_SPEC_TMP_HANDLER, - ZEND_FETCH_UNSET_SPEC_TMP_HANDLER, - ZEND_FETCH_UNSET_SPEC_TMP_HANDLER, - ZEND_FETCH_UNSET_SPEC_VAR_HANDLER, - ZEND_FETCH_UNSET_SPEC_VAR_HANDLER, - ZEND_FETCH_UNSET_SPEC_VAR_HANDLER, - ZEND_FETCH_UNSET_SPEC_VAR_HANDLER, - ZEND_FETCH_UNSET_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_UNSET_SPEC_CV_HANDLER, - ZEND_FETCH_UNSET_SPEC_CV_HANDLER, - ZEND_FETCH_UNSET_SPEC_CV_HANDLER, - ZEND_FETCH_UNSET_SPEC_CV_HANDLER, - ZEND_FETCH_UNSET_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_DIM_UNSET_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_UNSET_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_DIM_UNSET_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_DIM_UNSET_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_UNSET_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMP_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CONST_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TMP_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMP_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_DIM_TMP_VAR_SPEC_TMP_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_STMT_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_FCALL_END_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_EXT_NOP_SPEC_HANDLER, - ZEND_TICKS_SPEC_CONST_HANDLER, - ZEND_TICKS_SPEC_CONST_HANDLER, - ZEND_TICKS_SPEC_CONST_HANDLER, - ZEND_TICKS_SPEC_CONST_HANDLER, - ZEND_TICKS_SPEC_CONST_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER, - ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_CATCH_SPEC_HANDLER, - ZEND_THROW_SPEC_CONST_HANDLER, - ZEND_THROW_SPEC_CONST_HANDLER, - ZEND_THROW_SPEC_CONST_HANDLER, - ZEND_THROW_SPEC_CONST_HANDLER, - ZEND_THROW_SPEC_CONST_HANDLER, - ZEND_THROW_SPEC_TMP_HANDLER, - ZEND_THROW_SPEC_TMP_HANDLER, - ZEND_THROW_SPEC_TMP_HANDLER, - ZEND_THROW_SPEC_TMP_HANDLER, - ZEND_THROW_SPEC_TMP_HANDLER, - ZEND_THROW_SPEC_VAR_HANDLER, - ZEND_THROW_SPEC_VAR_HANDLER, - ZEND_THROW_SPEC_VAR_HANDLER, - ZEND_THROW_SPEC_VAR_HANDLER, - ZEND_THROW_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_THROW_SPEC_CV_HANDLER, - ZEND_THROW_SPEC_CV_HANDLER, - ZEND_THROW_SPEC_CV_HANDLER, - ZEND_THROW_SPEC_CV_HANDLER, - ZEND_THROW_SPEC_CV_HANDLER, - ZEND_FETCH_CLASS_SPEC_CONST_HANDLER, - ZEND_FETCH_CLASS_SPEC_TMP_HANDLER, - ZEND_FETCH_CLASS_SPEC_VAR_HANDLER, - ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER, - ZEND_FETCH_CLASS_SPEC_CV_HANDLER, - ZEND_FETCH_CLASS_SPEC_CONST_HANDLER, - ZEND_FETCH_CLASS_SPEC_TMP_HANDLER, - ZEND_FETCH_CLASS_SPEC_VAR_HANDLER, - ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER, - ZEND_FETCH_CLASS_SPEC_CV_HANDLER, - ZEND_FETCH_CLASS_SPEC_CONST_HANDLER, - ZEND_FETCH_CLASS_SPEC_TMP_HANDLER, - ZEND_FETCH_CLASS_SPEC_VAR_HANDLER, - ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER, - ZEND_FETCH_CLASS_SPEC_CV_HANDLER, - ZEND_FETCH_CLASS_SPEC_CONST_HANDLER, - ZEND_FETCH_CLASS_SPEC_TMP_HANDLER, - ZEND_FETCH_CLASS_SPEC_VAR_HANDLER, - ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER, - ZEND_FETCH_CLASS_SPEC_CV_HANDLER, - ZEND_FETCH_CLASS_SPEC_CONST_HANDLER, - ZEND_FETCH_CLASS_SPEC_TMP_HANDLER, - ZEND_FETCH_CLASS_SPEC_VAR_HANDLER, - ZEND_FETCH_CLASS_SPEC_UNUSED_HANDLER, - ZEND_FETCH_CLASS_SPEC_CV_HANDLER, - ZEND_CLONE_SPEC_CONST_HANDLER, - ZEND_CLONE_SPEC_CONST_HANDLER, - ZEND_CLONE_SPEC_CONST_HANDLER, - ZEND_CLONE_SPEC_CONST_HANDLER, - ZEND_CLONE_SPEC_CONST_HANDLER, - ZEND_CLONE_SPEC_TMP_HANDLER, - ZEND_CLONE_SPEC_TMP_HANDLER, - ZEND_CLONE_SPEC_TMP_HANDLER, - ZEND_CLONE_SPEC_TMP_HANDLER, - ZEND_CLONE_SPEC_TMP_HANDLER, - ZEND_CLONE_SPEC_VAR_HANDLER, - ZEND_CLONE_SPEC_VAR_HANDLER, - ZEND_CLONE_SPEC_VAR_HANDLER, - ZEND_CLONE_SPEC_VAR_HANDLER, - ZEND_CLONE_SPEC_VAR_HANDLER, - ZEND_CLONE_SPEC_UNUSED_HANDLER, - ZEND_CLONE_SPEC_UNUSED_HANDLER, - ZEND_CLONE_SPEC_UNUSED_HANDLER, - ZEND_CLONE_SPEC_UNUSED_HANDLER, - ZEND_CLONE_SPEC_UNUSED_HANDLER, - ZEND_CLONE_SPEC_CV_HANDLER, - ZEND_CLONE_SPEC_CV_HANDLER, - ZEND_CLONE_SPEC_CV_HANDLER, - ZEND_CLONE_SPEC_CV_HANDLER, - ZEND_CLONE_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_TMP_CONST_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_TMP_TMP_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_TMP_CV_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_VAR_CONST_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_VAR_TMP_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_VAR_CV_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMP_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_CV_CONST_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_CV_TMP_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_TMP_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CV_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_TMP_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CV_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_TMP_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CV_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_TMP_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CV_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_TMP_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_UNUSED_HANDLER, - ZEND_INIT_STATIC_METHOD_CALL_SPEC_CV_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_HANDLER, - ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_VAR_CV_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_CV_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_VAR_CONST_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_VAR_TMP_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_VAR_CV_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_UNUSED_CONST_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_UNUSED_TMP_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_UNUSED_CV_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_CV_CONST_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_CV_TMP_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_INC_OBJ_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_VAR_CONST_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_VAR_TMP_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_VAR_CV_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_UNUSED_CONST_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_UNUSED_TMP_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_UNUSED_CV_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_CV_CONST_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_CV_TMP_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_PRE_DEC_OBJ_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_INC_OBJ_SPEC_VAR_CONST_HANDLER, - ZEND_POST_INC_OBJ_SPEC_VAR_TMP_HANDLER, - ZEND_POST_INC_OBJ_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_INC_OBJ_SPEC_VAR_CV_HANDLER, - ZEND_POST_INC_OBJ_SPEC_UNUSED_CONST_HANDLER, - ZEND_POST_INC_OBJ_SPEC_UNUSED_TMP_HANDLER, - ZEND_POST_INC_OBJ_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_INC_OBJ_SPEC_UNUSED_CV_HANDLER, - ZEND_POST_INC_OBJ_SPEC_CV_CONST_HANDLER, - ZEND_POST_INC_OBJ_SPEC_CV_TMP_HANDLER, - ZEND_POST_INC_OBJ_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_INC_OBJ_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_VAR_CONST_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_VAR_TMP_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_VAR_CV_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_UNUSED_CONST_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_UNUSED_TMP_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_UNUSED_CV_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_CV_CONST_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_CV_TMP_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_POST_DEC_OBJ_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_VAR_CV_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMP_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_OBJ_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INSTANCEOF_SPEC_TMP_HANDLER, - ZEND_INSTANCEOF_SPEC_TMP_HANDLER, - ZEND_INSTANCEOF_SPEC_TMP_HANDLER, - ZEND_INSTANCEOF_SPEC_TMP_HANDLER, - ZEND_INSTANCEOF_SPEC_TMP_HANDLER, - ZEND_INSTANCEOF_SPEC_VAR_HANDLER, - ZEND_INSTANCEOF_SPEC_VAR_HANDLER, - ZEND_INSTANCEOF_SPEC_VAR_HANDLER, - ZEND_INSTANCEOF_SPEC_VAR_HANDLER, - ZEND_INSTANCEOF_SPEC_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_INSTANCEOF_SPEC_CV_HANDLER, - ZEND_INSTANCEOF_SPEC_CV_HANDLER, - ZEND_INSTANCEOF_SPEC_CV_HANDLER, - ZEND_INSTANCEOF_SPEC_CV_HANDLER, - ZEND_INSTANCEOF_SPEC_CV_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_INHERITED_CLASS_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_DECLARE_FUNCTION_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_RAISE_ABSTRACT_ERROR_SPEC_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_ADD_INTERFACE_SPEC_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_VERIFY_ABSTRACT_CLASS_SPEC_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER, - ZEND_ASSIGN_DIM_SPEC_VAR_TMP_HANDLER, - ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER, - ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HANDLER, - ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER, - ZEND_ASSIGN_DIM_SPEC_CV_TMP_HANDLER, - ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER, - ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HANDLER, - ZEND_ASSIGN_DIM_SPEC_CV_CV_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_VAR_CV_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CV_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CONST_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_TMP_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_VAR_HANDLER, - ZEND_NULL_HANDLER, - ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV_CV_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_HANDLE_EXCEPTION_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_USER_OPCODE_SPEC_HANDLER, - ZEND_NULL_HANDLER - }; - zend_opcode_handlers = (opcode_handler_t*)labels; -} -static opcode_handler_t zend_vm_get_opcode_handler(zend_uchar opcode, zend_op* op) -{ - static const int zend_vm_decode[] = { - _UNUSED_CODE, /* 0 */ - _CONST_CODE, /* 1 = IS_CONST */ - _TMP_CODE, /* 2 = IS_TMP_VAR */ - _UNUSED_CODE, /* 3 */ - _VAR_CODE, /* 4 = IS_VAR */ - _UNUSED_CODE, /* 5 */ - _UNUSED_CODE, /* 6 */ - _UNUSED_CODE, /* 7 */ - _UNUSED_CODE, /* 8 = IS_UNUSED */ - _UNUSED_CODE, /* 9 */ - _UNUSED_CODE, /* 10 */ - _UNUSED_CODE, /* 11 */ - _UNUSED_CODE, /* 12 */ - _UNUSED_CODE, /* 13 */ - _UNUSED_CODE, /* 14 */ - _UNUSED_CODE, /* 15 */ - _CV_CODE /* 16 = IS_CV */ - }; - return zend_opcode_handlers[opcode * 25 + zend_vm_decode[op->op1.op_type] * 5 + zend_vm_decode[op->op2.op_type]]; -} - -ZEND_API void zend_vm_set_opcode_handler(zend_op* op) -{ - op->handler = zend_vm_get_opcode_handler(zend_user_opcodes[op->opcode], op); -} - -ZEND_API int zend_do_fcall(ZEND_OPCODE_HANDLER_ARGS) -{ - return zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); -} - diff --git a/Zend/zend_vm_execute.skl b/Zend/zend_vm_execute.skl deleted file mode 100644 index 9a3bd5038d..0000000000 --- a/Zend/zend_vm_execute.skl +++ /dev/null @@ -1,77 +0,0 @@ -{%DEFINES%} - -ZEND_API void {%EXECUTOR_NAME%}(zend_op_array *op_array TSRMLS_DC) -{ - zend_execute_data execute_data; - {%HELPER_VARS%} - - {%INTERNAL_LABELS%} - - if (EG(exception)) { - return; - } - - /* Initialize execute_data */ - EX(fbc) = NULL; - EX(object) = NULL; - EX(old_error_reporting) = NULL; - if (op_array->T < TEMP_VAR_STACK_LIMIT) { - EX(Ts) = (temp_variable *) do_alloca(sizeof(temp_variable) * op_array->T); - } else { - EX(Ts) = (temp_variable *) safe_emalloc(sizeof(temp_variable), op_array->T, 0); - } - EX(CVs) = (zval***)do_alloca(sizeof(zval**) * op_array->last_var); - memset(EX(CVs), 0, sizeof(zval**) * op_array->last_var); - EX(op_array) = op_array; - EX(original_in_execution) = EG(in_execution); - EX(symbol_table) = EG(active_symbol_table); - EX(prev_execute_data) = EG(current_execute_data); - EG(current_execute_data) = &execute_data; - - EG(in_execution) = 1; - if (op_array->start_op) { - ZEND_VM_SET_OPCODE(op_array->start_op); - } else { - ZEND_VM_SET_OPCODE(op_array->opcodes); - } - - if (op_array->uses_this && EG(This)) { - EG(This)->refcount++; /* For $this pointer */ - if (zend_hash_add(EG(active_symbol_table), "this", sizeof("this"), &EG(This), sizeof(zval *), NULL)==FAILURE) { - EG(This)->refcount--; - } - } - - EG(opline_ptr) = &EX(opline); - - EX(function_state).function = (zend_function *) op_array; - EG(function_state_ptr) = &EX(function_state); -#if ZEND_DEBUG - /* function_state.function_symbol_table is saved as-is to a stack, - * which is an intentional UMR. Shut it up if we're in DEBUG. - */ - EX(function_state).function_symbol_table = NULL; -#endif - - while (1) { - {%ZEND_VM_CONTINUE_LABEL%} -#ifdef ZEND_WIN32 - if (EG(timed_out)) { - zend_timeout(0); - } -#endif - - {%ZEND_VM_DISPATCH%} { - {%INTERNAL_EXECUTOR%} - } - - } - zend_error_noreturn(E_ERROR, "Arrived at end of main loop which shouldn't happen"); -} - -{%EXTERNAL_EXECUTOR%} - -void {%INITIALIZER_NAME%}() -{ - {%EXTERNAL_LABELS%} -} diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php deleted file mode 100644 index a6ce7f737f..0000000000 --- a/Zend/zend_vm_gen.php +++ /dev/null @@ -1,1302 +0,0 @@ - | - +----------------------------------------------------------------------+ - - $Id$ -*/ - -$header_text = <<< DATA -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - | Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ - - -DATA; - -/* - This script creates zend_vm_execute.h and zend_vm_opcodes.h - from existing zend_vm_def.h and zend_vm_execute.skl -*/ - -error_reporting(E_ALL); - -define("ZEND_VM_KIND_CALL", 1); -define("ZEND_VM_KIND_SWITCH", 2); -define("ZEND_VM_KIND_GOTO", 3); - -$op_types = array( - "ANY", - "CONST", - "TMP", - "VAR", - "UNUSED", - "CV" -); - -$prefix = array( - "ANY" => "", - "TMP" => "_TMP", - "VAR" => "_VAR", - "CONST" => "_CONST", - "UNUSED" => "_UNUSED", - "CV" => "_CV", -); - -$typecode = array( - "ANY" => 0, - "TMP" => 1, - "VAR" => 2, - "CONST" => 0, - "UNUSED" => 3, - "CV" => 4, -); - -$op1_type = array( - "ANY" => "opline->op1.op_type", - "TMP" => "IS_TMP_VAR", - "VAR" => "IS_VAR", - "CONST" => "IS_CONST", - "UNUSED" => "IS_UNUSED", - "CV" => "IS_CV", -); - -$op2_type = array( - "ANY" => "opline->op2.op_type", - "TMP" => "IS_TMP_VAR", - "VAR" => "IS_VAR", - "CONST" => "IS_CONST", - "UNUSED" => "IS_UNUSED", - "CV" => "IS_CV", -); - -$op1_free = array( - "ANY" => "(free_op1.var != NULL)", - "TMP" => "1", - "VAR" => "(free_op1.var != NULL)", - "CONST" => "0", - "UNUSED" => "0", - "CV" => "0", -); - -$op2_free = array( - "ANY" => "(free_op2.var != NULL)", - "TMP" => "1", - "VAR" => "(free_op2.var != NULL)", - "CONST" => "0", - "UNUSED" => "0", - "CV" => "0", -); - -$op1_get_zval_ptr = array( - "ANY" => "get_zval_ptr(&opline->op1, EX(Ts), &free_op1, \\1)", - "TMP" => "_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)", - "VAR" => "_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)", - "CONST" => "&opline->op1.u.constant", - "UNUSED" => "NULL", - "CV" => "_get_zval_ptr_cv(&opline->op1, EX(Ts), \\1 TSRMLS_CC)", -); - -$op2_get_zval_ptr = array( - "ANY" => "get_zval_ptr(&opline->op2, EX(Ts), &free_op2, \\1)", - "TMP" => "_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC)", - "VAR" => "_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC)", - "CONST" => "&opline->op2.u.constant", - "UNUSED" => "NULL", - "CV" => "_get_zval_ptr_cv(&opline->op2, EX(Ts), \\1 TSRMLS_CC)", -); - -$op1_get_zval_ptr_ptr = array( - "ANY" => "get_zval_ptr_ptr(&opline->op1, EX(Ts), &free_op1, \\1)", - "TMP" => "NULL", - "VAR" => "_get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)", - "CONST" => "NULL", - "UNUSED" => "NULL", - "CV" => "_get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), \\1 TSRMLS_CC)", -); - -$op2_get_zval_ptr_ptr = array( - "ANY" => "get_zval_ptr_ptr(&opline->op2, EX(Ts), &free_op2, \\1)", - "TMP" => "NULL", - "VAR" => "_get_zval_ptr_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC)", - "CONST" => "NULL", - "UNUSED" => "NULL", - "CV" => "_get_zval_ptr_ptr_cv(&opline->op2, EX(Ts), \\1 TSRMLS_CC)", -); - -$op1_get_obj_zval_ptr = array( - "ANY" => "get_obj_zval_ptr(&opline->op1, EX(Ts), &free_op1, \\1)", - "TMP" => "_get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)", - "VAR" => "_get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)", - "CONST" => "&opline->op1.u.constant", - "UNUSED" => "_get_obj_zval_ptr_unused(TSRMLS_C)", - "CV" => "_get_zval_ptr_cv(&opline->op1, EX(Ts), \\1 TSRMLS_CC)", -); - -$op2_get_obj_zval_ptr = array( - "ANY" => "get_obj_zval_ptr(&opline->op2, EX(Ts), &free_op2, \\1)", - "TMP" => "_get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC)", - "VAR" => "_get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC)", - "CONST" => "&opline->op2.u.constant", - "UNUSED" => "_get_obj_zval_ptr_unused(TSRMLS_C)", - "CV" => "_get_zval_ptr_cv(&opline->op2, EX(Ts), \\1 TSRMLS_CC)", -); - -$op1_get_obj_zval_ptr_ptr = array( - "ANY" => "get_obj_zval_ptr_ptr(&opline->op1, EX(Ts), &free_op1, \\1)", - "TMP" => "NULL", - "VAR" => "_get_zval_ptr_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC)", - "CONST" => "NULL", - "UNUSED" => "_get_obj_zval_ptr_ptr_unused(TSRMLS_C)", - "CV" => "_get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), \\1 TSRMLS_CC)", -); - -$op2_get_obj_zval_ptr_ptr = array( - "ANY" => "get_obj_zval_ptr_ptr(&opline->op2, EX(Ts), &free_op2, \\1)", - "TMP" => "NULL", - "VAR" => "_get_zval_ptr_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC)", - "CONST" => "NULL", - "UNUSED" => "_get_obj_zval_ptr_ptr_unused(TSRMLS_C)", - "CV" => "_get_zval_ptr_ptr_cv(&opline->op2, EX(Ts), \\1 TSRMLS_CC)", -); - -$op1_is_tmp_free = array( - "ANY" => "IS_TMP_FREE(free_op1)", - "TMP" => "1", - "VAR" => "0", - "CONST" => "0", - "UNUSED" => "0", - "CV" => "0", -); - -$op2_is_tmp_free = array( - "ANY" => "IS_TMP_FREE(free_op2)", - "TMP" => "1", - "VAR" => "0", - "CONST" => "0", - "UNUSED" => "0", - "CV" => "0", -); - -$op1_free_op = array( - "ANY" => "FREE_OP(free_op1)", - "TMP" => "zval_dtor(free_op1.var)", - "VAR" => "if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}", - "CONST" => "", - "UNUSED" => "", - "CV" => "", -); - -$op2_free_op = array( - "ANY" => "FREE_OP(free_op2)", - "TMP" => "zval_dtor(free_op2.var)", - "VAR" => "if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}", - "CONST" => "", - "UNUSED" => "", - "CV" => "", -); - -$op1_free_op_if_var = array( - "ANY" => "FREE_OP_IF_VAR(free_op1)", - "TMP" => "", - "VAR" => "if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}", - "CONST" => "", - "UNUSED" => "", - "CV" => "", -); - -$op2_free_op_if_var = array( - "ANY" => "FREE_OP_IF_VAR(free_op2)", - "TMP" => "", - "VAR" => "if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}", - "CONST" => "", - "UNUSED" => "", - "CV" => "", -); - -$op1_free_op_var_ptr = array( - "ANY" => "if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}", - "TMP" => "", - "VAR" => "if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}", - "CONST" => "", - "UNUSED" => "", - "CV" => "", -); - -$op2_free_op_var_ptr = array( - "ANY" => "if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}", - "TMP" => "", - "VAR" => "if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}", - "CONST" => "", - "UNUSED" => "", - "CV" => "", -); - -$list = array(); // list of opcode handlers and helpers in original order -$opcodes = array(); // opcode handlers by code -$helpers = array(); // opcode helpers by name -$params = array(); // parameters of helpers -$opnames = array(); // opcode name to code mapping -$line_no = 1; - -// Writes $s into resulting executor -function out($f, $s) { - global $line_no; - - fputs($f,$s); - $line_no += substr_count($s, "\n"); -} - -// Resets #line directives in resulting executor -function out_line($f) { - global $line_no, $executor_file; - - fputs($f,"#line ".($line_no+1)." \"".$executor_file."\"\n"); - ++$line_no; -} - -// Returns name of specialized helper -function helper_name($name, $spec, $op1, $op2) { - global $prefix, $helpers; - - if (isset($helpers[$name])) { - // If we haven't helper with specified spicialized operands then - // using unspecialized helper - if (!isset($helpers[$name]["op1"][$op1]) && - isset($helpers[$name]["op1"]["ANY"])) { - $op1 = "ANY"; - } - if (!isset($helpers[$name]["op2"][$op2]) && - isset($helpers[$name]["op2"]["ANY"])) { - $op2 = "ANY"; - } - } - return $name.($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]; -} - -// Generates code for opcode handler or helper -function gen_code($f, $spec, $kind, $code, $op1, $op2) { - global $op1_type, $op2_type, $op1_get_zval_ptr, $op2_get_zval_ptr, - $op1_get_zval_ptr_ptr, $op2_get_zval_ptr_ptr, - $op1_get_obj_zval_ptr, $op2_get_obj_zval_ptr, - $op1_get_obj_zval_ptr_ptr, $op2_get_obj_zval_ptr_ptr, - $op1_is_tmp_free, $op2_is_tmp_free, $op1_free, $op2_free, - $op1_free_op, $op2_free_op, $op1_free_op_if_var, $op2_free_op_if_var, - $op1_free_op_var_ptr, $op2_free_op_var_ptr, $prefix; - - // Specializing - $code = preg_replace( - array( - "/OP1_TYPE/", - "/OP2_TYPE/", - "/OP1_FREE/", - "/OP2_FREE/", - "/GET_OP1_ZVAL_PTR\(([^)]*)\)/", - "/GET_OP2_ZVAL_PTR\(([^)]*)\)/", - "/GET_OP1_ZVAL_PTR_PTR\(([^)]*)\)/", - "/GET_OP2_ZVAL_PTR_PTR\(([^)]*)\)/", - "/GET_OP1_OBJ_ZVAL_PTR\(([^)]*)\)/", - "/GET_OP2_OBJ_ZVAL_PTR\(([^)]*)\)/", - "/GET_OP1_OBJ_ZVAL_PTR_PTR\(([^)]*)\)/", - "/GET_OP2_OBJ_ZVAL_PTR_PTR\(([^)]*)\)/", - "/IS_OP1_TMP_FREE\(\)/", - "/IS_OP2_TMP_FREE\(\)/", - "/FREE_OP1\(\)/", - "/FREE_OP2\(\)/", - "/FREE_OP1_IF_VAR\(\)/", - "/FREE_OP2_IF_VAR\(\)/", - "/FREE_OP1_VAR_PTR\(\)/", - "/FREE_OP2_VAR_PTR\(\)/", - "/^#ifdef\s+ZEND_VM_SPEC\s*\n/m", - "/^#ifndef\s+ZEND_VM_SPEC\s*\n/m", - "/\!defined\(ZEND_VM_SPEC\)/m", - "/defined\(ZEND_VM_SPEC\)/m", - "/ZEND_VM_C_LABEL\(\s*([A-Za-z_]*)\s*\)/m", - "/ZEND_VM_C_GOTO\(\s*([A-Za-z_]*)\s*\)/m", - "/^#if\s+1\s*\\|\\|.*[^\\\\]$/m", - "/^#if\s+0\s*&&.*[^\\\\]$/m" - ), - array( - $op1_type[$op1], - $op2_type[$op2], - $op1_free[$op1], - $op2_free[$op2], - $op1_get_zval_ptr[$op1], - $op2_get_zval_ptr[$op2], - $op1_get_zval_ptr_ptr[$op1], - $op2_get_zval_ptr_ptr[$op2], - $op1_get_obj_zval_ptr[$op1], - $op2_get_obj_zval_ptr[$op2], - $op1_get_obj_zval_ptr_ptr[$op1], - $op2_get_obj_zval_ptr_ptr[$op2], - $op1_is_tmp_free[$op1], - $op2_is_tmp_free[$op2], - $op1_free_op[$op1], - $op2_free_op[$op2], - $op1_free_op_if_var[$op1], - $op2_free_op_if_var[$op2], - $op1_free_op_var_ptr[$op1], - $op2_free_op_var_ptr[$op2], - ($op1!="ANY"||$op2!="ANY")?"#if 1\n":"#if 0\n", - ($op1!="ANY"||$op2!="ANY")?"#if 0\n":"#if 1\n", - ($op1!="ANY"||$op2!="ANY")?"0":"1", - ($op1!="ANY"||$op2!="ANY")?"1":"0", - "\\1".(($spec && $kind != ZEND_VM_KIND_CALL)?("_SPEC".$prefix[$op1].$prefix[$op2]):""), - "goto \\1".(($spec && $kind != ZEND_VM_KIND_CALL)?("_SPEC".$prefix[$op1].$prefix[$op2]):""), - "#if 1", - "#if 0", - ), - $code); - - // Updating code according to selected threading model - switch($kind) { - case ZEND_VM_KIND_CALL: - $code = preg_replace( - array( - "/EXECUTE_DATA/m", - "/ZEND_VM_DISPATCH_TO_HANDLER\(\s*([A-Z_]*)\s*\)/m", - "/ZEND_VM_DISPATCH_TO_HELPER\(\s*([A-Za-z_]*)\s*\)/me", - "/ZEND_VM_DISPATCH_TO_HELPER_EX\(\s*([A-Za-z_]*)\s*,\s*[A-Za-z_]*\s*,\s*(.*)\s*\);/me", - ), - array( - "execute_data", - "return \\1".($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]."_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)", - "'return '.helper_name('\\1',$spec,'$op1','$op2').'(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU)'", - "'return '.helper_name('\\1',$spec,'$op1','$op2').'(\\2, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);'", - ), - $code); - break; - case ZEND_VM_KIND_SWITCH: - $code = preg_replace( - array( - "/EXECUTE_DATA/m", - "/ZEND_VM_DISPATCH_TO_HANDLER\(\s*([A-Z_]*)\s*\)/m", - "/ZEND_VM_DISPATCH_TO_HELPER\(\s*([A-Za-z_]*)\s*\)/me", - "/ZEND_VM_DISPATCH_TO_HELPER_EX\(\s*([A-Za-z_]*)\s*,\s*([A-Za-z_]*)\s*,\s*(.*)\s*\);/me", - ), - array( - "&execute_data", - "goto \\1".($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]."_LABEL", - "'goto '.helper_name('\\1',$spec,'$op1','$op2')", - "'\\2 = \\3; goto '.helper_name('\\1',$spec,'$op1','$op2').';'", - ), - $code); - break; - case ZEND_VM_KIND_GOTO: - $code = preg_replace( - array( - "/EXECUTE_DATA/m", - "/ZEND_VM_DISPATCH_TO_HANDLER\(\s*([A-Z_]*)\s*\)/m", - "/ZEND_VM_DISPATCH_TO_HELPER\(\s*([A-Za-z_]*)\s*\)/me", - "/ZEND_VM_DISPATCH_TO_HELPER_EX\(\s*([A-Za-z_]*)\s*,\s*([A-Za-z_]*)\s*,\s*(.*)\s*\);/me", - ), - array( - "&execute_data", - "goto \\1".($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]."_HANDLER", - "'goto '.helper_name('\\1',$spec,'$op1','$op2')", - "'\\2 = \\3; goto '.helper_name('\\1',$spec,'$op1','$op2').';'", - ), - $code); - break; - } - - /* Remove unused free_op1 and free_op2 declarations */ - if ($spec && preg_match_all('/^\s*zend_free_op\s+[^;]+;\s*$/me', $code, $matches, PREG_SET_ORDER)) { - $n = 0; - foreach ($matches as $match) { - $code = preg_replace('/'.preg_quote($match[0],'/').'/', "\$D$n", $code); - ++$n; - } - $del_free_op1 = (strpos($code, "free_op1") === false); - $del_free_op2 = (strpos($code, "free_op2") === false); - $n = 0; - foreach ($matches as $match) { - $dcl = $match[0]; - $changed = 0; - if ($del_free_op1 && strpos($dcl, "free_op1") !== false) { - $dcl = preg_replace("/free_op1\s*,\s*/", "", $dcl); - $dcl = preg_replace("/free_op1\s*;/", ";", $dcl); - $changed = 1; - } - if ($del_free_op2 && strpos($dcl, "free_op2") !== false) { - $dcl = preg_replace("/free_op2\s*,\s*/", "", $dcl); - $dcl = preg_replace("/free_op2\s*;/", ";", $dcl); - $changed = 1; - } - if ($changed) { - $dcl = preg_replace("/,\s*;/", ";", $dcl); - $dcl = preg_replace("/zend_free_op\s*;/", "", $dcl); - } - $code = preg_replace("/\\\$D$n/", $dcl, $code); - ++$n; - } - } - - /* Remove unnecessary ';' */ - $code = preg_replace('/^\s*;\s*$/m', '', $code); - - /* Remove WS */ - $code = preg_replace('/[ \t]+\n/m', "\n", $code); - - out($f, $code); -} - -// Generates opcode handler -function gen_handler($f, $spec, $kind, $name, $op1, $op2, $use, $code, $lineno) { - global $definition_file, $prefix, $typecode, $opnames; - - if (ZEND_VM_LINES) { - out($f, "#line $lineno \"$definition_file\"\n"); - } - - // Generate opcode handler's entry point according to selected threading model - switch($kind) { - case ZEND_VM_KIND_CALL: - out($f,"static int ".$name.($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]."_HANDLER(ZEND_OPCODE_HANDLER_ARGS)\n"); - break; - case ZEND_VM_KIND_SWITCH: - if ($spec) { - out($f,"case ".((string)($opnames[$name]*25+($typecode[$op1]*5)+$typecode[$op2])).": /*".$name."_SPEC".$prefix[$op1].$prefix[$op2]."_HANDLER*/"); - } else { - out($f,"case ".$name.":"); - } - if ($use) { - // This handler is used by other handlers. We will add label to call it. - out($f," ".$name.($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]."_LABEL:\n"); - } else { - out($f,"\n"); - } - break; - case ZEND_VM_KIND_GOTO: - out($f,$name.($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]."_HANDLER:\n"); - break; - } - - // Generate opcode handler's code - gen_code($f, $spec, $kind, $code, $op1, $op2); -} - -// Generates helper -function gen_helper($f, $spec, $kind, $name, $op1, $op2, $param, $code, $lineno) { - global $definition_file, $prefix; - - if (ZEND_VM_LINES) { - out($f, "#line $lineno \"$definition_file\"\n"); - } - - // Generate helper's entry point according to selected threading model - switch($kind) { - case ZEND_VM_KIND_CALL: - if ($param == null) { - // Helper without parameters - out($f, "static int ".$name.($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]."(ZEND_OPCODE_HANDLER_ARGS)\n"); - } else { - // Helper with parameter - out($f, "static int ".$name.($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2]."(".$param.", ZEND_OPCODE_HANDLER_ARGS)\n"); - } - break; - case ZEND_VM_KIND_SWITCH: - out($f, $name.($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2].":\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f, $name.($spec?"_SPEC":"").$prefix[$op1].$prefix[$op2].":\n"); - break; - } - - // Generate helper's code - gen_code($f, $spec, $kind, $code, $op1, $op2); -} - -// Generates array of opcode handlers (specialized or unspecialized) -function gen_labels($f, $spec, $kind, $prolog) { - global $opcodes, $op_types, $prefix, $typecode; - - $next = 0; - if ($spec) { - // Emit labels for specialized executor - - // For each opcode in opcode number order - foreach($opcodes as $num => $dsc) { - while ($next != $num) { - // If some opcode numbers are not used then fill hole with pointers - // to handler of undefined opcode - $op1t = $op_types; - // For each op1.op_type except ANY - foreach($op1t as $op1) { - if ($op1 != "ANY") { - $op2t = $op_types; - // For each op2.op_type except ANY - foreach($op2t as $op2) { - if ($op2 != "ANY") { - // Emit pointer to handler of undefined opcode - switch ($kind) { - case ZEND_VM_KIND_CALL: - out($f,$prolog."ZEND_NULL_HANDLER,\n"); - break; - case ZEND_VM_KIND_SWITCH: - out($f,$prolog."(opcode_handler_t)-1,\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f,$prolog."(opcode_handler_t)&&ZEND_NULL_HANDLER,\n"); - break; - } - } - } - } - } - $next++; - } - $next = $num + 1; - $op1t = $op_types; - // For each op1.op_type except ANY - foreach($op1t as $op1) { - if ($op1 != "ANY") { - if (!isset($dsc["op1"][$op1])) { - // Try to use unspecialized handler - $op1 = "ANY"; - } - $op2t = $op_types; - // For each op2.op_type except ANY - foreach($op2t as $op2) { - if ($op2 != "ANY") { - if (!isset($dsc["op2"][$op2])) { - // Try to use unspecialized handler - $op2 = "ANY"; - } - // Check if specialized handler is defined - if (isset($dsc["op1"][$op1]) && - isset($dsc["op2"][$op2])) { - // Emit pointer to specialized handler - switch ($kind) { - case ZEND_VM_KIND_CALL: - out($f,$prolog.$dsc["op"]."_SPEC".$prefix[$op1].$prefix[$op2]."_HANDLER,\n"); - break; - case ZEND_VM_KIND_SWITCH: - out($f,$prolog."(opcode_handler_t)".((string)($num*25+$typecode[$op1]*5+$typecode[$op2])).",\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f,$prolog."(opcode_handler_t)&&".$dsc["op"]."_SPEC".$prefix[$op1].$prefix[$op2]."_HANDLER,\n"); - break; - } - } else { - // Emit pinter to handler of undefined opcode - switch ($kind) { - case ZEND_VM_KIND_CALL: - out($f,$prolog."ZEND_NULL_HANDLER,\n"); - break; - case ZEND_VM_KIND_SWITCH: - out($f,$prolog."(opcode_handler_t)-1,\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f,$prolog."(opcode_handler_t)&&ZEND_NULL_HANDLER,\n"); - break; - } - } - } - } - } - } - } - } else { - // Emit labels for unspecialized executor - - // For each opcode in opcode number order - foreach($opcodes as $num => $dsc) { - while ($next != $num) { - // If some opcode numbers are not used then fill hole with pointers - // to handler of undefined opcode - switch ($kind) { - case ZEND_VM_KIND_CALL: - out($f,$prolog."ZEND_NULL_HANDLER,\n"); - break; - case ZEND_VM_KIND_SWITCH: - out($f,$prolog."(opcode_handler_t)-1,\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f,$prolog."(opcode_handler_t)&&ZEND_NULL_HANDLER,\n"); - break; - } - $next++; - } - $next = $num+1; - // Emit pointer to unspecialized handler - switch ($kind) { - case ZEND_VM_KIND_CALL: - out($f,$prolog.$dsc["op"]."_HANDLER,\n"); - break; - case ZEND_VM_KIND_SWITCH: - out($f,$prolog."(opcode_handler_t)".((string)$num).",\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f,$prolog."(opcode_handler_t)&&".$dsc["op"]."_HANDLER,\n"); - break; - } - } - } - - // Emit last handler's label (undefined opcode) - switch ($kind) { - case ZEND_VM_KIND_CALL: - out($f,$prolog."ZEND_NULL_HANDLER\n"); - break; - case ZEND_VM_KIND_SWITCH: - out($f,$prolog."(opcode_handler_t)-1\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f,$prolog."(opcode_handler_t)&&ZEND_NULL_HANDLER\n"); - break; - } -} - -// Generates handler for undefined opcodes (CALL threading model) -function gen_null_handler($f) { - static $done = 0; - - // New and all executors with CALL threading model can use the same handler - // for undefined opcodes, do we emit code for it only once - if (!$done) { - $done = 1; - out($f,"static int ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS)\n"); - out($f,"{\n"); - out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", EX(opline)->opcode, EX(opline)->op1.op_type, EX(opline)->op2.op_type);\n"); - out($f,"\tZEND_VM_RETURN_FROM_EXECUTE_LOOP();\n"); - out($f,"}\n\n"); - } -} - -// Generates all opcode handlers and helpers (specialized or unspecilaized) -function gen_executor_code($f, $spec, $kind, $prolog) { - global $list, $opcodes, $helpers, $op_types; - - if ($spec) { - // Produce specialized executor - $op1t = $op_types; - // for each op1.op_type - foreach($op1t as $op1) { - $op2t = $op_types; - // for each op2.op_type - foreach($op2t as $op2) { - // for each handlers in helpers in original order - foreach ($list as $lineno => $dsc) { - if (isset($dsc["handler"])) { - $num = $dsc["handler"]; - // Check if handler accepts such types of operands (op1 and op2) - if (isset($opcodes[$num]["op1"][$op1]) && - isset($opcodes[$num]["op2"][$op2])) { - // Generate handler code - gen_handler($f, 1, $kind, $opcodes[$num]["op"], $op1, $op2, isset($opcodes[$num]["use"]), $opcodes[$num]["code"], $lineno); - } - } else if (isset($dsc["helper"])) { - $num = $dsc["helper"]; - // Check if handler accepts such types of operands (op1 and op2) - if (isset($helpers[$num]["op1"][$op1]) && - isset($helpers[$num]["op2"][$op2])) { - // Generate helper code - gen_helper($f, 1, $kind, $num, $op1, $op2, $helpers[$num]["param"], $helpers[$num]["code"], $lineno); - } - } else { - var_dump($dsc); - die("??? $kind:$num\n"); - } - } - } - } - } else { - // Produce unspecialized executor - - // for each handlers in helpers in original order - foreach ($list as $lineno => $dsc) { - if (isset($dsc["handler"])) { - $num = $dsc["handler"]; - // Generate handler code - gen_handler($f, 0, $kind, $opcodes[$num]["op"], "ANY", "ANY", isset($opcodes[$num]["use"]), $opcodes[$num]["code"], $lineno); - } else if (isset($dsc["helper"])) { - $num = $dsc["helper"]; - // Generate helper code - gen_helper($f, 0, $kind, $num, "ANY", "ANY", $helpers[$num]["param"], $helpers[$num]["code"], $lineno); - } else { - var_dump($dsc); - die("??? $kind:$num\n"); - } - } - } - - if (ZEND_VM_LINES) { - // Reset #line directives - out_line($f); - } - - // Generate handler for undefined opcodes - switch ($kind) { - case ZEND_VM_KIND_CALL: - gen_null_handler($f); - break; - case ZEND_VM_KIND_SWITCH: - out($f,"default:\n"); - out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", EX(opline)->opcode, EX(opline)->op1.op_type, EX(opline)->op2.op_type);\n"); - out($f,"\tZEND_VM_RETURN_FROM_EXECUTE_LOOP();\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f,"ZEND_NULL_HANDLER:\n"); - out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", EX(opline)->opcode, EX(opline)->op1.op_type, EX(opline)->op2.op_type);\n"); - out($f,"\tZEND_VM_RETURN_FROM_EXECUTE_LOOP();\n"); - break; - } -} - -function skip_blanks($f, $prolog, $epilog) { - if (trim($prolog) != "" || trim($epilog) != "") { - out($f, $prolog.$epilog); - } -} - -// Generates executor from skeleton file and definition (specialized or unspecialized) -function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name, $old) { - global $params, $skeleton_file, $line_no; - - $lineno = 0; - foreach ($skl as $line) { - // Skeleton file contains special markers in form %NAME% those are - // substituted by custom code - if (preg_match("/(.*)[{][%]([A-Z_]*)[%][}](.*)/", $line, $m)) { - switch ($m[2]) { - case "DEFINES": - if (ZEND_VM_OLD_EXECUTOR) { - out($f,"static int zend_vm_old_executor = 0;\n\n"); - } - out($f,"static opcode_handler_t zend_vm_get_opcode_handler(zend_uchar opcode, zend_op* op);\n\n"); - switch ($kind) { - case ZEND_VM_KIND_CALL: - out($f,"\n"); - out($f,"#define ZEND_VM_CONTINUE() return 0\n"); - out($f,"#define ZEND_VM_RETURN() return 1\n"); - out($f,"#define ZEND_VM_DISPATCH(opcode, opline) return zend_vm_get_opcode_handler(opcode, opline)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n\n"); - out($f,"#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data TSRMLS_CC\n"); - break; - case ZEND_VM_KIND_SWITCH: - out($f,"\n"); - out($f,"#define ZEND_VM_CONTINUE() goto zend_vm_continue\n"); - out($f,"#define ZEND_VM_RETURN() return\n"); - out($f,"#define ZEND_VM_DISPATCH(opcode, opline) dispatch_handler = zend_vm_get_opcode_handler(opcode, opline); goto zend_vm_dispatch;\n\n"); - out($f,"#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL &execute_data TSRMLS_CC\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f,"\n"); - out($f,"#define ZEND_VM_CONTINUE() goto *(void**)(EX(opline)->handler)\n"); - out($f,"#define ZEND_VM_RETURN() return\n"); - out($f,"#define ZEND_VM_DISPATCH(opcode, opline) goto *(void**)(zend_vm_get_opcode_handler(opcode, opline));\n\n"); - out($f,"#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL &execute_data TSRMLS_CC\n"); - break; - } - break; - case "EXECUTOR_NAME": - out($f, $m[1].$executor_name.$m[3]."\n"); - break; - case "HELPER_VARS": - if ($kind != ZEND_VM_KIND_CALL) { - if ($kind == ZEND_VM_KIND_SWITCH) { - out($f,$m[1]."opcode_handler_t dispatch_handler;\n"); - } - // Emit local variables those are used for helpers' parameters - foreach ($params as $param => $x) { - out($f,$m[1].$param.";\n"); - } - } else { - skip_blanks($f, $m[1], $m[3]."\n"); - } - break; - case "INTERNAL_LABELS": - if ($kind == ZEND_VM_KIND_GOTO) { - // Emit array of labels of opcode handlers and code for - // zend_opcode_handlers initialization - $prolog = $m[1]; - out($f,$prolog."if (op_array == NULL) {\n"); - out($f,$prolog."\tstatic const opcode_handler_t labels[] = {\n"); - gen_labels($f, $spec, $kind, $prolog."\t\t"); - out($f,$prolog."\t};\n"); - out($f,$prolog."\tzend_opcode_handlers = (opcode_handler_t*)labels;\n"); - out($f,$prolog."\treturn;\n"); - out($f,$prolog."}\n"); - } else { - skip_blanks($f, $m[1], $m[3]); - } - break; - case "ZEND_VM_CONTINUE_LABEL": - if ($kind == ZEND_VM_KIND_SWITCH) { - // Only SWITCH dispatch method use it - out($f,"zend_vm_continue:".$m[3]."\n"); - } else { - skip_blanks($f, $m[1], $m[3]); - } - break; - case "ZEND_VM_DISPATCH": - // Emit code that dispatches to opcode handler - switch ($kind) { - case ZEND_VM_KIND_CALL: - out($f, $m[1]."if (EX(opline)->handler(&execute_data TSRMLS_CC) > 0)".$m[3]."\n"); - break; - case ZEND_VM_KIND_SWITCH: - out($f, $m[1]."dispatch_handler = EX(opline)->handler;\nzend_vm_dispatch:\n".$m[1]."switch ((int)dispatch_handler)".$m[3]."\n"); - break; - case ZEND_VM_KIND_GOTO: - out($f, $m[1]."goto *(void**)(EX(opline)->handler);".$m[3]."\n"); - break; - } - break; - case "INTERNAL_EXECUTOR": - if ($kind == ZEND_VM_KIND_CALL) { - // Executor is defined as a set of functions - out($f, $m[1]."return;".$m[3]."\n"); - } else { - // Emit executor code - gen_executor_code($f, $spec, $kind, $m[1]); - } - break; - case "EXTERNAL_EXECUTOR": - if ($kind == ZEND_VM_KIND_CALL) { - // Unspecialized executor with CALL threading is the same as the - // old one, so we don't need to produce code twitch - if (!$old || ZEND_VM_SPEC || (ZEND_VM_KIND != ZEND_VM_KIND_CALL)) { - out($f,"#undef EX\n"); - out($f,"#define EX(element) execute_data->element\n\n"); - // Emit executor code - gen_executor_code($f, $spec, $kind, $m[1]); - } - } - break; - case "INITIALIZER_NAME": - out($f, $m[1].$initializer_name.$m[3]."\n"); - break; - case "EXTERNAL_LABELS": - // Emit code that initializes zend_opcode_handlers array - $prolog = $m[1]; - if ($kind == ZEND_VM_KIND_GOTO) { - // Labels are defined in the executor itself, so we call it - // with op_array NULL and it sets zend_opcode_handlers array - out($f,$prolog."TSRMLS_FETCH();\n"); - out($f,$prolog."zend_execute(NULL TSRMLS_CC);\n"); - } else { - if ($old) { - // Reserving space for user-defined opcodes - out($f,$prolog."static opcode_handler_t labels[512] = {\n"); - } else { - out($f,$prolog."static const opcode_handler_t labels[] = {\n"); - } - gen_labels($f, $spec, $kind, $prolog."\t"); - out($f,$prolog."};\n"); - out($f,$prolog."zend_opcode_handlers = (opcode_handler_t*)labels;\n"); - if ($old) { - // Setup old executor - out($f,$prolog."zend_vm_old_executor = 1;\n"); - out($f,$prolog."zend_execute = old_execute;\n"); - } - } - break; - default: - die("ERROR: Unknown keyword ".$m[2]." in skeleton file.\n"); - } - } else { - // Copy the line as is - out($f, $line); - } - } -} - -function gen_vm($def, $skel) { - global $definition_file, $skeleton_file, $executor_file, - $op_types, $list, $opcodes, $helpers, $params, $opnames; - - // Load definition file - $in = @file($def); - if (!$in) { - die("ERROR: Can not open definition file '$def'\n"); - } - // We need absolute path to definition file to use it in #line directives - $definition_file = realpath($def); - - // Load skeleton file - $skl = @file($skel); - if (!$skl) { - die("ERROR: Can not open skeleton file '$skel'\n"); - } - // We need absolute path to skeleton file to use it in #line directives - $skeleton_file = realpath($skel); - - // Parse definition file into tree - $lineno = 0; - $handler = null; - $helper = null; - $max_opcode_len = 0; - $max_opcode = 0; - $export = array(); - foreach ($in as $line) { - ++$lineno; - if (strpos($line,"ZEND_VM_HANDLER(") === 0) { - // Parsing opcode handler's definition - if (preg_match( - "/^ZEND_VM_HANDLER\(\s*([0-9]+)\s*,\s*([A-Z_]+)\s*,\s*([A-Z|]+)\s*,\s*([A-Z|]+)\s*\)/", - $line, - $m) == 0) { - die("ERROR ($def:$lineno): Invalid ZEND_VM_HANDLER definition.\n"); - } - $code = (int)$m[1]; - $op = $m[2]; - $len = strlen($op); - $op1 = array_flip(explode("|",$m[3])); - $op2 = array_flip(explode("|",$m[4])); - - if ($len > $max_opcode_len) { - $max_opcode_len = $len; - } - if ($code > $max_opcode) { - $max_opcode = $code; - } - if (isset($opcodes[$code])) { - die("ERROR ($def:$lineno): Opcode with code '$code' is already defined.\n"); - } - if (isset($opnames[$op])) { - die("ERROR ($def:$lineno): Opcode with name '$op' is already defined.\n"); - } - $opcodes[$code] = array("op"=>$op,"op1"=>$op1,"op2"=>$op2,"code"=>""); - $opnames[$op] = $code; - $handler = $code; - $helper = null; - $list[$lineno] = array("handler"=>$handler); - } else if (strpos($line,"ZEND_VM_HELPER(") === 0) { - // Parsing helper's definition - if (preg_match( - "/^ZEND_VM_HELPER\(\s*([A-Za-z_]+)\s*,\s*([A-Z|]+)\s*,\s*([A-Z|]+)\s*\)/", - $line, - $m) == 0) { - die("ERROR ($def:$lineno): Invalid ZEND_VM_HELPER definition.\n"); - } - $helper = $m[1]; - $op1 = array_flip(explode("|",$m[2])); - $op2 = array_flip(explode("|",$m[3])); - if (isset($helpers[$helper])) { - die("ERROR ($def:$lineno): Helper with name '$helper' is already defined.\n"); - } - $helpers[$helper] = array("op1"=>$op1,"op2"=>$op2,"param"=>null,"code"=>""); - $handler = null; - $list[$lineno] = array("helper"=>$helper); - } else if (strpos($line,"ZEND_VM_HELPER_EX(") === 0) { - // Parsing helper with parameter definition - if (preg_match( - "/^ZEND_VM_HELPER_EX\(\s*([A-Za-z_]+)\s*,\s*([A-Z|]+)\s*,\s*([A-Z|]+)\s*,\s*(.*)\s*\)/", - $line, - $m) == 0) { - die("ERROR ($def:$lineno): Invalid ZEND_VM_HELPER definition.\n"); - } - $helper = $m[1]; - $op1 = array_flip(explode("|",$m[2])); - $op2 = array_flip(explode("|",$m[3])); - $param = $m[4]; - if (isset($helpers[$helper])) { - die("ERROR ($def:$lineno): Helper with name '$helper' is already defined.\n"); - } - - // Store parameter - $params[$param] = 1; - - $helpers[$helper] = array("op1"=>$op1,"op2"=>$op2,"param"=>$param,"code"=>""); - $handler = null; - $list[$lineno] = array("helper"=>$helper); - } else if (strpos($line,"ZEND_VM_EXPORT_HANDLER(") === 0) { - if (preg_match( - "/^ZEND_VM_EXPORT_HANDLER\(\s*([A-Za-z_]+)\s*,\s*([A-Z_]+)\s*\)/", - $line, - $m) == 0) { - die("ERROR ($def:$lineno): Invalid ZEND_VM_EXPORT_HANDLER definition.\n"); - } - if (!isset($opnames[$m[2]])) { - die("ERROR ($def:$lineno): opcode '{$m[2]}' is not defined.\n"); - } - $export[] = array("handler",$m[1],$m[2]); - } else if (strpos($line,"ZEND_VM_EXPORT_HELPER(") === 0) { - if (preg_match( - "/^ZEND_VM_EXPORT_HELPER\(\s*([A-Za-z_]+)\s*,\s*([A-Za-z_]+)\s*\)/", - $line, - $m) == 0) { - die("ERROR ($def:$lineno): Invalid ZEND_VM_EXPORT_HELPER definition.\n"); - } - if (!isset($helpers[$m[2]])) { - die("ERROR ($def:$lineno): helper '{$m[2]}' is not defined.\n"); - } - $export[] = array("helper",$m[1],$m[2]); - } else if ($handler !== null) { - // Add line of code to current opcode handler - $opcodes[$handler]["code"] .= $line; - } else if ($helper !== null) { - // Add line of code to current helper - $helpers[$helper]["code"] .= $line; - } - } - - ksort($opcodes); - - // Search for opcode handlers those are used by other opcode handlers - foreach ($opcodes as $dsc) { - if (preg_match("/ZEND_VM_DISPATCH_TO_HANDLER\(\s*([A-Z_]*)\s*\)/m", $dsc["code"], $m)) { - $op = $m[1]; - if (!isset($opnames[$op])) { - die("ERROR ($def:$lineno): Opcode with name '$op' is not defined.\n"); - } - $code = $opnames[$op]; - $opcodes[$code]['use'] = 1; - } - } - - // Generate opcode #defines (zend_vm_opcodes.h) - $code_len = strlen((string)$max_opcode); - $f = fopen("zend_vm_opcodes.h", "w+") or die("ERROR: Cannot create zend_vm_opcodes.h\n"); - - // Insert header - out($f, $GLOBALS['header_text']); - - foreach ($opcodes as $code => $dsc) { - $code = str_pad((string)$code,$code_len," ",STR_PAD_LEFT); - $op = str_pad($dsc["op"],$max_opcode_len); - fputs($f,"#define $op $code\n"); - } - fclose($f); - echo "zend_vm_opcodes.h generated successfully.\n"; - - // Generate zend_vm_execute.h - $f = fopen("zend_vm_execute.h", "w+") or die("ERROR: Cannot create zend_vm_execute.h\n"); - $executor_file = realpath("zend_vm_execute.h"); - - // Insert header - out($f, $GLOBALS['header_text']); - - // Support for ZEND_USER_OPCODE - out($f, "static opcode_handler_t zend_user_opcode_handlers[256] = {"); - for ($i = 0; $i < 255; ++$i) { - out($f, "(opcode_handler_t)NULL,"); - } - out($f, "(opcode_handler_t)NULL};\n\n"); - - out($f, "static zend_uchar zend_user_opcodes[256] = {"); - for ($i = 0; $i < 255; ++$i) { - out($f, "$i,"); - } - out($f, "255};\n\n"); - - // Generate specialized executor - gen_executor($f, $skl, ZEND_VM_SPEC, ZEND_VM_KIND, "execute", "zend_init_opcodes_handlers", 0); - - // Generate un-specialized executor - if (ZEND_VM_OLD_EXECUTOR) { - out($f,"\n/* Old executor */\n\n"); - out($f,"#undef EX\n"); - out($f,"#define EX(element) execute_data.element\n\n"); - out($f,"#undef ZEND_VM_CONTINUE\n\n"); - out($f,"#undef ZEND_VM_RETURN\n\n"); - out($f,"#undef ZEND_VM_DISPATCH\n\n"); - out($f,"#undef ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL\n\n"); - gen_executor($f, $skl, 0, ZEND_VM_KIND_CALL, "old_execute", "zend_vm_use_old_executor", 1); - } - - // Generate zend_vm_get_opcode_handler() function - out($f, "static opcode_handler_t zend_vm_get_opcode_handler(zend_uchar opcode, zend_op* op)\n"); - out($f, "{\n"); - if (!ZEND_VM_SPEC) { - out($f, "\treturn zend_opcode_handlers[opcode];\n"); - } else { - if (ZEND_VM_OLD_EXECUTOR) { - out($f, "\tif (zend_vm_old_executor) {\n"); - out($f, "\t\treturn zend_opcode_handlers[opcode];\n"); - out($f, "\t} else {\n"); - } - out($f, "\t\tstatic const int zend_vm_decode[] = {\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 0 */\n"); - out($f, "\t\t\t_CONST_CODE, /* 1 = IS_CONST */\n"); - out($f, "\t\t\t_TMP_CODE, /* 2 = IS_TMP_VAR */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 3 */\n"); - out($f, "\t\t\t_VAR_CODE, /* 4 = IS_VAR */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 5 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 6 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 7 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 8 = IS_UNUSED */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 9 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 10 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 11 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 12 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 13 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 14 */\n"); - out($f, "\t\t\t_UNUSED_CODE, /* 15 */\n"); - out($f, "\t\t\t_CV_CODE /* 16 = IS_CV */\n"); - out($f, "\t\t};\n"); - out($f, "\t\treturn zend_opcode_handlers[opcode * 25 + zend_vm_decode[op->op1.op_type] * 5 + zend_vm_decode[op->op2.op_type]];\n"); - if (ZEND_VM_OLD_EXECUTOR) { - out($f, "\t}\n"); - } - } - out($f, "}\n\n"); - - // Generate zend_vm_get_opcode_handler() function - out($f, "ZEND_API void zend_vm_set_opcode_handler(zend_op* op)\n"); - out($f, "{\n"); - out($f, "\top->handler = zend_vm_get_opcode_handler(zend_user_opcodes[op->opcode], op);\n"); - out($f, "}\n\n"); - - // Export handlers and helpers - if (count($export) > 0 && - !ZEND_VM_OLD_EXECUTOR && - ZEND_VM_KIND != ZEND_VM_KIND_CALL) { - out($f,"#undef EX\n"); - out($f,"#define EX(element) execute_data->element\n\n"); - out($f,"#undef ZEND_VM_CONTINUE\n"); - out($f,"#undef ZEND_VM_RETURN\n"); - out($f,"#undef ZEND_VM_DISPATCH\n"); - out($f,"#undef ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL\n\n"); - out($f,"#define ZEND_VM_CONTINUE() return 0\n"); - out($f,"#define ZEND_VM_RETURN() return 1\n"); - out($f,"#define ZEND_VM_DISPATCH(opcode, opline) return zend_vm_get_opcode_handler(opcode, opline)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n\n"); - out($f,"#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data TSRMLS_CC\n\n"); - } - foreach ($export as $dsk) { - list($kind, $func, $name) = $dsk; - out($f, "ZEND_API int $func("); - if ($kind == "handler") { - out($f, "ZEND_OPCODE_HANDLER_ARGS)\n"); - $code = $opcodes[$opnames[$name]]['code']; - } else { - $h = $helpers[$name]; - if ($h['param'] == null) { - out($f, "ZEND_OPCODE_HANDLER_ARGS)\n"); - } else { - out($f, $h['param']. ", ZEND_OPCODE_HANDLER_ARGS)\n"); - } - $code = $h['code']; - } - $done = 0; - if (ZEND_VM_OLD_EXECUTOR) { - if ($kind == "handler") { - out($f, "{\n\treturn ".$name."_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n}\n\n"); - $done = 1; - } else if ($helpers[$name]["param"] == null) { - out($f, "{\n\treturn ".$name."(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n}\n\n"); - $done = 1; - } - } else if (ZEND_VM_KIND == ZEND_VM_KIND_CALL) { - if ($kind == "handler") { - $op = $opcodes[$opnames[$name]]; - if (isset($op['op1']["ANY"]) && isset($op['op2']["ANY"])) { - out($f, "{\n\treturn ".$name.(ZEND_VM_SPEC?"_SPEC":"")."_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n}\n\n"); - $done = 1; - } - } else if ($helpers[$name]["param"] == null) { - $h = $helpers[$name]; - if (isset($h['op1']["ANY"]) && isset($h['op2']["ANY"])) { - out($f, "{\n\treturn ".$name.(ZEND_VM_SPEC?"_SPEC":"")."(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n}\n\n"); - $done = 1; - } - } - } - if (!$done) { - gen_code($f, 0, ZEND_VM_KIND_CALL, $code, 'ANY', 'ANY'); - } - } - - fclose($f); - echo "zend_vm_execute.h generated successfully.\n"; -} - -function usage() { - echo("\nUsage: php zend_vm_gen.php [options]\n". - "\nOptions:". - "\n --with-vm-kind=CALL|SWITCH|GOTO - select threading model (default is CALL)". - "\n --without-specializer - disable executor specialization". - "\n --with-old-executor - enable old executor". - "\n --with-lines - enable #line directives". - "\n\n"); -} - -// Parse arguments -for ($i = 1; $i < $argc; $i++) { - if (strpos($argv[$i],"--with-vm-kind=") === 0) { - $kind = substr($argv[$i], strlen("--with-vm-kind=")); - switch ($kind) { - case "CALL": - define("ZEND_VM_KIND", ZEND_VM_KIND_CALL); - break; - case "SWITCH": - define("ZEND_VM_KIND", ZEND_VM_KIND_SWITCH); - break; - case "GOTO": - define("ZEND_VM_KIND", ZEND_VM_KIND_GOTO); - break; - default: - echo("ERROR: Invalid vm kind '$kind'\n"); - usage(); - die(); - } - } else if ($argv[$i] == "--without-specializer") { - // Disabling specialization - define("ZEND_VM_SPEC", 0); - } else if ($argv[$i] == "--with-old-executor") { - // Disabling code for old-style executor - define("ZEND_VM_OLD_EXECUTOR", 1); - } else if ($argv[$i] == "--with-lines") { - // Enabling debuging using original zend_vm_def.h - define("ZEND_VM_LINES", 1); - } else if ($argv[$i] == "--help") { - usage(); - exit(); - } else { - echo("ERROR: Invalid option '".$argv[$i]."'\n"); - usage(); - die(); - } -} - -// Using defaults -if (!defined("ZEND_VM_KIND")) { - // Using CALL threading by default - define("ZEND_VM_KIND", ZEND_VM_KIND_CALL); -} -if (!defined("ZEND_VM_SPEC")) { - // Using specialized executor by default - define("ZEND_VM_SPEC", 1); -} -if (!defined("ZEND_VM_OLD_EXECUTOR")) { - // Include old-style executor by default - define("ZEND_VM_OLD_EXECUTOR", 0); -} -if (!defined("ZEND_VM_LINES")) { - // Disabling #line directives - define("ZEND_VM_LINES", 0); -} - -gen_vm("zend_vm_def.h", "zend_vm_execute.skl"); - -?> diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h deleted file mode 100644 index 31f17e1b75..0000000000 --- a/Zend/zend_vm_opcodes.h +++ /dev/null @@ -1,149 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Andi Gutmans | - | Zeev Suraski | - | Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ - -#define ZEND_NOP 0 -#define ZEND_ADD 1 -#define ZEND_SUB 2 -#define ZEND_MUL 3 -#define ZEND_DIV 4 -#define ZEND_MOD 5 -#define ZEND_SL 6 -#define ZEND_SR 7 -#define ZEND_CONCAT 8 -#define ZEND_BW_OR 9 -#define ZEND_BW_AND 10 -#define ZEND_BW_XOR 11 -#define ZEND_BW_NOT 12 -#define ZEND_BOOL_NOT 13 -#define ZEND_BOOL_XOR 14 -#define ZEND_IS_IDENTICAL 15 -#define ZEND_IS_NOT_IDENTICAL 16 -#define ZEND_IS_EQUAL 17 -#define ZEND_IS_NOT_EQUAL 18 -#define ZEND_IS_SMALLER 19 -#define ZEND_IS_SMALLER_OR_EQUAL 20 -#define ZEND_CAST 21 -#define ZEND_QM_ASSIGN 22 -#define ZEND_ASSIGN_ADD 23 -#define ZEND_ASSIGN_SUB 24 -#define ZEND_ASSIGN_MUL 25 -#define ZEND_ASSIGN_DIV 26 -#define ZEND_ASSIGN_MOD 27 -#define ZEND_ASSIGN_SL 28 -#define ZEND_ASSIGN_SR 29 -#define ZEND_ASSIGN_CONCAT 30 -#define ZEND_ASSIGN_BW_OR 31 -#define ZEND_ASSIGN_BW_AND 32 -#define ZEND_ASSIGN_BW_XOR 33 -#define ZEND_PRE_INC 34 -#define ZEND_PRE_DEC 35 -#define ZEND_POST_INC 36 -#define ZEND_POST_DEC 37 -#define ZEND_ASSIGN 38 -#define ZEND_ASSIGN_REF 39 -#define ZEND_ECHO 40 -#define ZEND_PRINT 41 -#define ZEND_JMP 42 -#define ZEND_JMPZ 43 -#define ZEND_JMPNZ 44 -#define ZEND_JMPZNZ 45 -#define ZEND_JMPZ_EX 46 -#define ZEND_JMPNZ_EX 47 -#define ZEND_CASE 48 -#define ZEND_SWITCH_FREE 49 -#define ZEND_BRK 50 -#define ZEND_CONT 51 -#define ZEND_BOOL 52 -#define ZEND_INIT_STRING 53 -#define ZEND_ADD_CHAR 54 -#define ZEND_ADD_STRING 55 -#define ZEND_ADD_VAR 56 -#define ZEND_BEGIN_SILENCE 57 -#define ZEND_END_SILENCE 58 -#define ZEND_INIT_FCALL_BY_NAME 59 -#define ZEND_DO_FCALL 60 -#define ZEND_DO_FCALL_BY_NAME 61 -#define ZEND_RETURN 62 -#define ZEND_RECV 63 -#define ZEND_RECV_INIT 64 -#define ZEND_SEND_VAL 65 -#define ZEND_SEND_VAR 66 -#define ZEND_SEND_REF 67 -#define ZEND_NEW 68 -#define ZEND_FREE 70 -#define ZEND_INIT_ARRAY 71 -#define ZEND_ADD_ARRAY_ELEMENT 72 -#define ZEND_INCLUDE_OR_EVAL 73 -#define ZEND_UNSET_VAR 74 -#define ZEND_UNSET_DIM 75 -#define ZEND_UNSET_OBJ 76 -#define ZEND_FE_RESET 77 -#define ZEND_FE_FETCH 78 -#define ZEND_EXIT 79 -#define ZEND_FETCH_R 80 -#define ZEND_FETCH_DIM_R 81 -#define ZEND_FETCH_OBJ_R 82 -#define ZEND_FETCH_W 83 -#define ZEND_FETCH_DIM_W 84 -#define ZEND_FETCH_OBJ_W 85 -#define ZEND_FETCH_RW 86 -#define ZEND_FETCH_DIM_RW 87 -#define ZEND_FETCH_OBJ_RW 88 -#define ZEND_FETCH_IS 89 -#define ZEND_FETCH_DIM_IS 90 -#define ZEND_FETCH_OBJ_IS 91 -#define ZEND_FETCH_FUNC_ARG 92 -#define ZEND_FETCH_DIM_FUNC_ARG 93 -#define ZEND_FETCH_OBJ_FUNC_ARG 94 -#define ZEND_FETCH_UNSET 95 -#define ZEND_FETCH_DIM_UNSET 96 -#define ZEND_FETCH_OBJ_UNSET 97 -#define ZEND_FETCH_DIM_TMP_VAR 98 -#define ZEND_FETCH_CONSTANT 99 -#define ZEND_EXT_STMT 101 -#define ZEND_EXT_FCALL_BEGIN 102 -#define ZEND_EXT_FCALL_END 103 -#define ZEND_EXT_NOP 104 -#define ZEND_TICKS 105 -#define ZEND_SEND_VAR_NO_REF 106 -#define ZEND_CATCH 107 -#define ZEND_THROW 108 -#define ZEND_FETCH_CLASS 109 -#define ZEND_CLONE 110 -#define ZEND_INIT_METHOD_CALL 112 -#define ZEND_INIT_STATIC_METHOD_CALL 113 -#define ZEND_ISSET_ISEMPTY_VAR 114 -#define ZEND_ISSET_ISEMPTY_DIM_OBJ 115 -#define ZEND_PRE_INC_OBJ 132 -#define ZEND_PRE_DEC_OBJ 133 -#define ZEND_POST_INC_OBJ 134 -#define ZEND_POST_DEC_OBJ 135 -#define ZEND_ASSIGN_OBJ 136 -#define ZEND_INSTANCEOF 138 -#define ZEND_DECLARE_CLASS 139 -#define ZEND_DECLARE_INHERITED_CLASS 140 -#define ZEND_DECLARE_FUNCTION 141 -#define ZEND_RAISE_ABSTRACT_ERROR 142 -#define ZEND_ADD_INTERFACE 144 -#define ZEND_VERIFY_ABSTRACT_CLASS 146 -#define ZEND_ASSIGN_DIM 147 -#define ZEND_ISSET_ISEMPTY_PROP_OBJ 148 -#define ZEND_HANDLE_EXCEPTION 149 -#define ZEND_USER_OPCODE 150 -- cgit v1.2.1