diff options
Diffstat (limited to 'Zend')
115 files changed, 13786 insertions, 9570 deletions
diff --git a/Zend/Makefile.am b/Zend/Makefile.am index 6417f3eb14..d9ce4c61ba 100644 --- a/Zend/Makefile.am +++ b/Zend/Makefile.am @@ -18,7 +18,7 @@ libZend_la_SOURCES=\ zend_default_classes.c \ zend_iterators.c zend_interfaces.c zend_exceptions.c \ zend_strtod.c zend_closures.c zend_float.c zend_string.c zend_signal.c \ - zend_generators.c + zend_generators.c zend_virtual_cwd.c zend_ast.c libZend_la_LDFLAGS = libZend_la_LIBADD = @ZEND_EXTRA_LIBS@ diff --git a/Zend/RFCs/003.txt b/Zend/RFCs/003.txt index 30fb4cec49..ac042183d4 100644 --- a/Zend/RFCs/003.txt +++ b/Zend/RFCs/003.txt @@ -9,11 +9,11 @@ Modified: 2001-09-17 1. Background/Need ================== -Many internal function of PHP will reject parameters because of their +Many internal functions of PHP will reject parameters because of their type (the array and variable function come to mind). For userland this is not an easy task as there is no uniform way to do it. An addition to the engine for requiring loose types would allow -delevopers to know that the data passed to their functions is of the +developers to know that the data passed to their functions are of the correct type and reduce the need for duplicating the same code in every function to check for the type of data. @@ -57,7 +57,7 @@ function foo (array $var){ =========== Mis-matches in type should be reported as fatal errors and should halt -the execution of a script as that function can not be run and code +the execution of a script as that function cannot be run and code following could not reliably run. diff --git a/Zend/Zend.dsp b/Zend/Zend.dsp index 23ebd4532b..d8bb03b9e8 100644 --- a/Zend/Zend.dsp +++ b/Zend/Zend.dsp @@ -119,6 +119,10 @@ SOURCE=.\zend_API.c # End Source File
# Begin Source File
+SOURCE=.\zend_ast.c
+# End Source File
+# Begin Source File
+
SOURCE=.\zend_builtin_functions.c
# End Source File
# Begin Source File
@@ -429,6 +433,10 @@ SOURCE=.\zend_ts_hash.h SOURCE=.\zend_variables.h
# End Source File
+# Begin Source File
+
+SOURCE=.\zend_virtual_cwd.c
+# End Source File
# End Group
# Begin Group "Parsers"
diff --git a/Zend/ZendTS.dsp b/Zend/ZendTS.dsp index 3be2c58bed..5dfa24d5b9 100644 --- a/Zend/ZendTS.dsp +++ b/Zend/ZendTS.dsp @@ -140,6 +140,10 @@ SOURCE=.\zend_alloc.c # End Source File
# Begin Source File
+SOURCE=.\zend_ast.c
+# End Source File
+# Begin Source File
+
SOURCE=.\zend_API.c
# End Source File
# Begin Source File
diff --git a/Zend/acinclude.m4 b/Zend/acinclude.m4 index 5a521dc98c..7fa8c99940 100644 --- a/Zend/acinclude.m4 +++ b/Zend/acinclude.m4 @@ -3,8 +3,13 @@ dnl dnl This file contains local autoconf functions. AC_DEFUN([LIBZEND_BISON_CHECK],[ - # we only support certain bison versions - bison_version_list="2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.7" + # we only support certain bison versions; + # min: 2.4 (i.e. 204, major * 100 + minor for easier comparison) + bison_version_min="204" + # non-working versions, e.g. "3.0 3.2"; + # remove "none" when introducing the first incompatible bison version an + # separate any following additions by spaces + bison_version_exclude="3.0" # for standalone build of Zend Engine test -z "$SED" && SED=sed @@ -17,18 +22,22 @@ AC_DEFUN([LIBZEND_BISON_CHECK],[ if test -n "$bison_version_vars"; then set $bison_version_vars bison_version="${1}.${2}" - for bison_check_version in $bison_version_list; do - if test "$bison_version" = "$bison_check_version"; then - php_cv_bison_version="$bison_check_version (ok)" - break - fi - done + bison_version_num="`expr ${1} \* 100 + ${2}`" + if test $bison_version_num -ge $bison_version_min; then + php_cv_bison_version="$bison_version (ok)" + for bison_check_version in $bison_version_exclude; do + if test "$bison_version" = "$bison_check_version"; then + php_cv_bison_version=invalid + break + fi + done + fi fi ]) fi case $php_cv_bison_version in ""|invalid[)] - bison_msg="bison versions supported for regeneration of the Zend/PHP parsers: $bison_version_list (found: $bison_version)." + bison_msg="This bison version is not supported for regeneration of the Zend/PHP parsers (found: $bison_version, min: $bison_version_min, excluded: $bison_version_exclude)." AC_MSG_WARN([$bison_msg]) YACC="exit 0;" ;; diff --git a/Zend/tests/bug30820.phpt b/Zend/tests/bug30820.phpt index 97e46e9287..a0f71e72a7 100644 --- a/Zend/tests/bug30820.phpt +++ b/Zend/tests/bug30820.phpt @@ -2,6 +2,7 @@ Bug #30820 (static member conflict with $this->member silently ignored) --INI-- error_reporting=4095 +opcache.optimization_level=0 --FILE-- <?php class Blah { diff --git a/Zend/tests/bug65784.phpt b/Zend/tests/bug65784.phpt index adc34113a5..29f086b5e3 100644 --- a/Zend/tests/bug65784.phpt +++ b/Zend/tests/bug65784.phpt @@ -1,7 +1,5 @@ --TEST-- Fixed Bug #65784 (Segfault with finally) ---XFAIL-- -This bug is not fixed in 5.5 due to ABI BC --FILE-- <?php function foo1() { diff --git a/Zend/tests/bug66252.phpt b/Zend/tests/bug66252.phpt new file mode 100644 index 0000000000..e692a8e706 --- /dev/null +++ b/Zend/tests/bug66252.phpt @@ -0,0 +1,14 @@ +--TEST-- +Bug #66252 (Problems in AST evaluation invalidating valid parent:: reference) +--FILE-- +<?php +class A { + const HW = "this is A"; +} +class B extends A { + const BHW = parent::HW . " extended by B"; +} +const C = B::BHW; +echo C, "\n"; +--EXPECT-- +this is A extended by B diff --git a/Zend/tests/class_properties_dynamic.phpt b/Zend/tests/class_properties_dynamic.phpt new file mode 100644 index 0000000000..8a1fc6f029 --- /dev/null +++ b/Zend/tests/class_properties_dynamic.phpt @@ -0,0 +1,13 @@ +--TEST-- +Class Property Expressions +--FILE-- +<?php +class Foo { + const BAR = 1 << 0; + const BAZ = 1 << 1; + public $bar = self::BAR | self::BAZ; +} +echo (new Foo)->bar; +?> +--EXPECTF-- +3 diff --git a/Zend/tests/class_properties_static.phpt b/Zend/tests/class_properties_static.phpt new file mode 100644 index 0000000000..9a56466340 --- /dev/null +++ b/Zend/tests/class_properties_static.phpt @@ -0,0 +1,20 @@ +--TEST-- +Static Class Property Expressions +--FILE-- +<?php +class Foo { + public $b1 = 1 + 1; + public $b2 = 1 << 2; + public $b3 = "foo " . " bar " . " baz"; +} +$f = new Foo; +var_dump( + $f->b1, + $f->b2, + $f->b3 +); +?> +--EXPECT-- +int(2) +int(4) +string(13) "foo bar baz" diff --git a/Zend/tests/closure_018.phpt b/Zend/tests/closure_018.phpt index d98c78aeac..2dcf15c6aa 100644 --- a/Zend/tests/closure_018.phpt +++ b/Zend/tests/closure_018.phpt @@ -21,8 +21,11 @@ var_dump($x = $test->test($y)); var_dump($y, $x); ?> ---EXPECT-- +--EXPECTF-- +Notice: Only variable references should be returned by reference in %sclosure_018.php on line 7 int(4) + +Notice: Only variable references should be returned by reference in %sclosure_018.php on line 7 int(16) int(16) int(16) diff --git a/Zend/tests/closure_019.phpt b/Zend/tests/closure_019.phpt index 0c4c34e163..57aa2dec17 100644 --- a/Zend/tests/closure_019.phpt +++ b/Zend/tests/closure_019.phpt @@ -20,7 +20,10 @@ test(); ?> --EXPECTF-- +Notice: Only variable references should be returned by reference in %sclosure_019.php on line 4 int(9) + +Notice: Only variable references should be returned by reference in %sclosure_019.php on line 4 int(81) Fatal error: Cannot pass parameter 1 by reference in %s on line %d diff --git a/Zend/tests/constant_expressions.phpt b/Zend/tests/constant_expressions.phpt new file mode 100644 index 0000000000..7dea0d83f7 --- /dev/null +++ b/Zend/tests/constant_expressions.phpt @@ -0,0 +1,91 @@ +--TEST-- +Constant Expressions +--FILE-- +<?php +const T_1 = 1 << 1; +const T_2 = 1 / 2; +const T_3 = 1.5 + 1.5; +const T_4 = "foo" . "bar"; +const T_5 = (1.5 + 1.5) * 2; +const T_6 = "foo" . 2 . 3 . 4.0; +const T_7 = __LINE__; +const T_8 = <<<ENDOFSTRING +This is a test string +ENDOFSTRING; +const T_9 = ~-1; +const T_10 = (-1?:1) + (0?2:3); +const T_11 = 1 && 0; +const T_12 = 1 and 1; +const T_13 = 0 || 0; +const T_14 = 1 or 0; +const T_15 = 1 xor 1; +const T_16 = 1 xor 0; +const T_17 = 1 < 0; +const T_18 = 0 <= 0; +const T_19 = 1 > 0; +const T_20 = 1 >= 0; +const T_21 = 1 === 1; +const T_22 = 1 !== 1; +const T_23 = 0 != "0"; +const T_24 = 1 == "1"; + +// Test order of operations +const T_25 = 1 + 2 * 3; + +// Test for memory leaks +const T_26 = "1" + 2 + "3"; + +var_dump(T_1); +var_dump(T_2); +var_dump(T_3); +var_dump(T_4); +var_dump(T_5); +var_dump(T_6); +var_dump(T_7); +var_dump(T_8); +var_dump(T_9); +var_dump(T_10); +var_dump(T_11); +var_dump(T_12); +var_dump(T_13); +var_dump(T_14); +var_dump(T_15); +var_dump(T_16); +var_dump(T_17); +var_dump(T_18); +var_dump(T_19); +var_dump(T_20); +var_dump(T_21); +var_dump(T_22); +var_dump(T_23); +var_dump(T_24); +var_dump(T_25); +var_dump(T_26); +?> +--EXPECT-- +int(2) +float(0.5) +float(3) +string(6) "foobar" +float(6) +string(6) "foo234" +int(8) +string(21) "This is a test string" +int(0) +int(2) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(true) +bool(true) +bool(true) +bool(false) +bool(false) +bool(true) +int(7) +int(6) diff --git a/Zend/tests/constant_expressions_classes.phpt b/Zend/tests/constant_expressions_classes.phpt new file mode 100644 index 0000000000..6298ff66d6 --- /dev/null +++ b/Zend/tests/constant_expressions_classes.phpt @@ -0,0 +1,43 @@ +--TEST-- +Constant scalar expressions with autoloading and classes +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.optimization_level=-1 +--SKIPIF-- +<?php if (!extension_loaded('Zend OPcache') || php_sapi_name() != "cli") die("skip CLI only"); ?> +--FILE-- +<?php + +# This test validates that autoloading works for common const expression (AST) use cases +$classlist = [ + 'A'=> 'class A { const HW = "this is A"; }', + 'B'=> 'class B extends A { const HW = parent::HW." extended by B"; }', + 'space1\C' => 'namespace space1; class C { const HW = "this is space1\C"; }', + 'D' => 'class D { const HW = \space1\C::HW." extented by D"; }', + 'trE' => 'trait trE { public static function getHW() { return parent::HW; } }', + 'E' => 'class E extends B { use trE; }', + 'F' => 'class F { const XX = "this is F"; }', + 'G' => 'class G extends F { const XX = parent::XX." extended by G"; public static function get_me($x = "got ".self::XX) { return $x; } }', +]; + +spl_autoload_register(function ($class) use ($classlist) { + if (isset($classlist[$class])) { + eval($classlist[$class]); + } else { + die("Cannot autoload $class\n"); + } +}); + +printf("B::HW = %s\n", B::HW); +printf("D::HW = %s\n", D::HW); + +printf("E::getHW() = %s\n", E::getHW()); +printf("G::get_me() = %s\n", G::get_me()); + +?> +--EXPECT-- +B::HW = this is A extended by B +D::HW = this is space1\C extented by D +E::getHW() = this is A extended by B +G::get_me() = got this is F extended by G diff --git a/Zend/tests/constant_expressions_dynamic.phpt b/Zend/tests/constant_expressions_dynamic.phpt new file mode 100644 index 0000000000..21c9216cc1 --- /dev/null +++ b/Zend/tests/constant_expressions_dynamic.phpt @@ -0,0 +1,11 @@ +--TEST-- +Dynamic Constant Expressions +--FILE-- +<?php +const FOO = 1; +const BAR = FOO | 2; + +echo BAR; +?> +--EXPECTF-- +3 diff --git a/Zend/tests/finally_goto_001.phpt b/Zend/tests/finally_goto_001.phpt new file mode 100644 index 0000000000..990f78d4c7 --- /dev/null +++ b/Zend/tests/finally_goto_001.phpt @@ -0,0 +1,14 @@ +--TEST-- +jmp into a finally block 01 +--FILE-- +<?php +function foo() { + goto test; + try { + } finally { +test: + } +} +?> +--EXPECTF-- +Fatal error: jump into a finally block is disallowed in %sfinally_goto_001.php on line %d diff --git a/Zend/tests/finally_goto_002.phpt b/Zend/tests/finally_goto_002.phpt new file mode 100644 index 0000000000..a6bd9e307f --- /dev/null +++ b/Zend/tests/finally_goto_002.phpt @@ -0,0 +1,14 @@ +--TEST-- +jmp into a finally block 02 +--FILE-- +<?php +function foo() { + try { + goto test; + } finally { +test: + } +} +?> +--EXPECTF-- +Fatal error: jump into a finally block is disallowed in %sfinally_goto_002.php on line %d diff --git a/Zend/tests/finally_goto_003.phpt b/Zend/tests/finally_goto_003.phpt new file mode 100644 index 0000000000..8529ff7865 --- /dev/null +++ b/Zend/tests/finally_goto_003.phpt @@ -0,0 +1,15 @@ +--TEST-- +jmp into a finally block 03 +--FILE-- +<?php +function foo() { + try { + } finally { + goto test; +test: + } +} +echo "okey"; +?> +--EXPECTF-- +okey diff --git a/Zend/tests/finally_goto_004.phpt b/Zend/tests/finally_goto_004.phpt new file mode 100644 index 0000000000..d88ceedf52 --- /dev/null +++ b/Zend/tests/finally_goto_004.phpt @@ -0,0 +1,14 @@ +--TEST-- +jmp into a finally block 03 +--FILE-- +<?php +function foo() { + try { + } finally { +test: + } + goto test; +} +?> +--EXPECTF-- +Fatal error: jump into a finally block is disallowed in %sfinally_goto_004.php on line %d diff --git a/Zend/tests/function_arguments_003.phpt b/Zend/tests/function_arguments_003.phpt new file mode 100644 index 0000000000..b882476d1d --- /dev/null +++ b/Zend/tests/function_arguments_003.phpt @@ -0,0 +1,17 @@ +--TEST-- +Function Argument Parsing #003 +--FILE-- +<?php +const a = 10; + +function t1($a = 1 + 1, $b = 1 << 2, $c = "foo" . "bar", $d = a * 10) { + var_dump($a, $b, $c, $d); +} + +t1(); +?> +--EXPECT-- +int(2) +int(4) +string(6) "foobar" +int(100) diff --git a/Zend/tests/incompat_ctx_user.phpt b/Zend/tests/incompat_ctx_user.phpt new file mode 100644 index 0000000000..2d9b59c1e8 --- /dev/null +++ b/Zend/tests/incompat_ctx_user.phpt @@ -0,0 +1,20 @@ +--TEST-- +Incompatible context call (non-internal function) +--INI-- +error_reporting=E_ALL +--FILE-- +<?php + +class A { + function foo() { var_dump(get_class($this)); } +} +class B { + function bar() { A::foo(); } +} +$b = new B; +$b->bar(); + +?> +--EXPECTF-- +Deprecated: Non-static method A::foo() should not be called statically, assuming $this from incompatible context in %s on line %d +string(1) "B" diff --git a/Zend/tests/static_variable.phpt b/Zend/tests/static_variable.phpt new file mode 100644 index 0000000000..62ca565ffe --- /dev/null +++ b/Zend/tests/static_variable.phpt @@ -0,0 +1,29 @@ +--TEST-- +Static Variable Expressions +--FILE-- +<?php +const bar = 2, baz = bar + 1; + +function foo() { + static $a = 1 + 1; + static $b = [bar => 1 + 1, baz * 2 => 1 << 2]; + static $c = [1 => bar, 3 => baz]; + var_dump($a, $b, $c); +} + +foo(); +?> +--EXPECT-- +int(2) +array(2) { + [2]=> + int(2) + [6]=> + int(4) +} +array(2) { + [1]=> + int(2) + [3]=> + int(3) +} diff --git a/Zend/tests/use_const/alias.phpt b/Zend/tests/use_const/alias.phpt new file mode 100644 index 0000000000..f179393006 --- /dev/null +++ b/Zend/tests/use_const/alias.phpt @@ -0,0 +1,26 @@ +--TEST-- +aliasing imported constants to resolve naming conflicts +--FILE-- +<?php + +namespace foo { + const baz = 42; +} + +namespace bar { + const baz = 43; +} + +namespace { + use const foo\baz as foo_baz, + bar\baz as bar_baz; + var_dump(foo_baz); + var_dump(bar_baz); + echo "Done\n"; +} + +?> +--EXPECT-- +int(42) +int(43) +Done diff --git a/Zend/tests/use_const/basic.phpt b/Zend/tests/use_const/basic.phpt new file mode 100644 index 0000000000..6eaed7f27d --- /dev/null +++ b/Zend/tests/use_const/basic.phpt @@ -0,0 +1,22 @@ +--TEST-- +import namespaced constant +--FILE-- +<?php + +namespace foo\bar { + const baz = 42; + const qux = 43; +} + +namespace { + use const foo\bar\baz, foo\bar\qux; + var_dump(baz); + var_dump(qux); + echo "Done\n"; +} + +?> +--EXPECT-- +int(42) +int(43) +Done diff --git a/Zend/tests/use_const/case_sensivity.phpt b/Zend/tests/use_const/case_sensivity.phpt new file mode 100644 index 0000000000..1977daa93b --- /dev/null +++ b/Zend/tests/use_const/case_sensivity.phpt @@ -0,0 +1,12 @@ +--TEST-- +importing const with same name but different case +--FILE-- +<?php + +namespace { + use const foo\bar; + use const foo\BAR; +} + +?> +--EXPECT-- diff --git a/Zend/tests/use_const/conflicting_use.phpt b/Zend/tests/use_const/conflicting_use.phpt new file mode 100644 index 0000000000..3b3c4b3262 --- /dev/null +++ b/Zend/tests/use_const/conflicting_use.phpt @@ -0,0 +1,21 @@ +--TEST-- +use const statements with conflicting names +--FILE-- +<?php + +namespace foo { + const baz = 42; +} + +namespace bar { + const baz = 42; +} + +namespace { + use const foo\baz, bar\baz; + echo "Done\n"; +} + +?> +--EXPECTF-- +Fatal error: Cannot use const bar\baz as baz because the name is already in use in %s on line %d diff --git a/Zend/tests/use_const/conflicting_use_alias.phpt b/Zend/tests/use_const/conflicting_use_alias.phpt new file mode 100644 index 0000000000..8b563a4ca9 --- /dev/null +++ b/Zend/tests/use_const/conflicting_use_alias.phpt @@ -0,0 +1,18 @@ +--TEST-- +use and use const with the same alias +--FILE-- +<?php + +namespace { + const foo = 'foo'; +} + +namespace x { + use foo as bar; + use const foo as bar; + var_dump(bar); +} + +?> +--EXPECT-- +string(3) "foo" diff --git a/Zend/tests/use_const/define_imported.phpt b/Zend/tests/use_const/define_imported.phpt new file mode 100644 index 0000000000..5eb44be64a --- /dev/null +++ b/Zend/tests/use_const/define_imported.phpt @@ -0,0 +1,14 @@ +--TEST-- +defining const with same name as imported should fail +--FILE-- +<?php + +namespace { + use const foo\bar; + + const bar = 42; +} + +?> +--EXPECTF-- +Fatal error: Cannot declare const bar because the name is already in use in %s on line %d diff --git a/Zend/tests/use_const/define_imported_before.phpt b/Zend/tests/use_const/define_imported_before.phpt new file mode 100644 index 0000000000..f674ce81e8 --- /dev/null +++ b/Zend/tests/use_const/define_imported_before.phpt @@ -0,0 +1,18 @@ +--TEST-- +using const with same name as defined should fail +--FILE-- +<?php + +namespace { + const bar = 42; + + use const foo\bar; +} + +namespace { + echo "Done"; +} + +?> +--EXPECTF-- +Fatal error: Cannot use const foo\bar as bar because the name is already in use in %s on line %d diff --git a/Zend/tests/use_const/includes/foo_bar.php b/Zend/tests/use_const/includes/foo_bar.php new file mode 100644 index 0000000000..90ed451f36 --- /dev/null +++ b/Zend/tests/use_const/includes/foo_bar.php @@ -0,0 +1,5 @@ +<?php + +namespace foo; + +const bar = 'local bar'; diff --git a/Zend/tests/use_const/includes/foo_php_version.php b/Zend/tests/use_const/includes/foo_php_version.php new file mode 100644 index 0000000000..08f9fd150e --- /dev/null +++ b/Zend/tests/use_const/includes/foo_php_version.php @@ -0,0 +1,5 @@ +<?php + +namespace foo; + +const PHP_VERSION = 42; diff --git a/Zend/tests/use_const/includes/global_bar.php b/Zend/tests/use_const/includes/global_bar.php new file mode 100644 index 0000000000..609d17b7b5 --- /dev/null +++ b/Zend/tests/use_const/includes/global_bar.php @@ -0,0 +1,3 @@ +<?php + +const bar = 'global bar'; diff --git a/Zend/tests/use_const/includes/global_baz.php b/Zend/tests/use_const/includes/global_baz.php new file mode 100644 index 0000000000..8b6fba97b3 --- /dev/null +++ b/Zend/tests/use_const/includes/global_baz.php @@ -0,0 +1,3 @@ +<?php + +const baz = NULL; diff --git a/Zend/tests/use_const/no_global_fallback.phpt b/Zend/tests/use_const/no_global_fallback.phpt new file mode 100644 index 0000000000..a128f353ed --- /dev/null +++ b/Zend/tests/use_const/no_global_fallback.phpt @@ -0,0 +1,14 @@ +--TEST-- +non-existent imported constants should not be looked up in the global table +--FILE-- +<?php + +require 'includes/global_baz.php'; + +use const foo\bar\baz; +var_dump(baz); + +?> +--EXPECTF-- +Notice: Use of undefined constant baz - assumed 'baz' in %s on line %d +string(3) "baz" diff --git a/Zend/tests/use_const/self_parent.phpt b/Zend/tests/use_const/self_parent.phpt new file mode 100644 index 0000000000..b71f2ecc81 --- /dev/null +++ b/Zend/tests/use_const/self_parent.phpt @@ -0,0 +1,12 @@ +--TEST-- +Allow self and parent in use const statement +--FILE-- +<?php + +namespace { + use const self as foo; + use const parent as bar; +} + +?> +--EXPECT-- diff --git a/Zend/tests/use_const/shadow_core.phpt b/Zend/tests/use_const/shadow_core.phpt new file mode 100644 index 0000000000..7d8bcbd189 --- /dev/null +++ b/Zend/tests/use_const/shadow_core.phpt @@ -0,0 +1,16 @@ +--TEST-- +shadowing a global core constant with a local version +--FILE-- +<?php + +require 'includes/foo_php_version.php'; + +use const foo\PHP_VERSION; + +var_dump(PHP_VERSION); +echo "Done\n"; + +?> +--EXPECTF-- +int(42) +Done diff --git a/Zend/tests/use_const/shadow_global.phpt b/Zend/tests/use_const/shadow_global.phpt new file mode 100644 index 0000000000..930cc9f0b8 --- /dev/null +++ b/Zend/tests/use_const/shadow_global.phpt @@ -0,0 +1,25 @@ +--TEST-- +shadowing a global constant with a local version +--FILE-- +<?php + +namespace { + require 'includes/global_bar.php'; + require 'includes/foo_bar.php'; +} + +namespace { + var_dump(bar); +} + +namespace { + use const foo\bar; + var_dump(bar); + echo "Done\n"; +} + +?> +--EXPECT-- +string(10) "global bar" +string(9) "local bar" +Done diff --git a/Zend/tests/use_function/alias.phpt b/Zend/tests/use_function/alias.phpt new file mode 100644 index 0000000000..5f7e97fff8 --- /dev/null +++ b/Zend/tests/use_function/alias.phpt @@ -0,0 +1,30 @@ +--TEST-- +aliasing imported functions to resolve naming conflicts +--FILE-- +<?php + +namespace foo { + function baz() { + return 'foo.baz'; + } +} + +namespace bar { + function baz() { + return 'bar.baz'; + } +} + +namespace { + use function foo\baz as foo_baz, + bar\baz as bar_baz; + var_dump(foo_baz()); + var_dump(bar_baz()); + echo "Done\n"; +} + +?> +--EXPECT-- +string(7) "foo.baz" +string(7) "bar.baz" +Done diff --git a/Zend/tests/use_function/basic.phpt b/Zend/tests/use_function/basic.phpt new file mode 100644 index 0000000000..513a96620c --- /dev/null +++ b/Zend/tests/use_function/basic.phpt @@ -0,0 +1,26 @@ +--TEST-- +import namespaced function +--FILE-- +<?php + +namespace foo\bar { + function baz() { + return 'foo.bar.baz'; + } + function qux() { + return baz(); + } +} + +namespace { + use function foo\bar\baz, foo\bar\qux; + var_dump(baz()); + var_dump(qux()); + echo "Done\n"; +} + +?> +--EXPECT-- +string(11) "foo.bar.baz" +string(11) "foo.bar.baz" +Done diff --git a/Zend/tests/use_function/case_insensivity.phpt b/Zend/tests/use_function/case_insensivity.phpt new file mode 100644 index 0000000000..ba6e3a7e4b --- /dev/null +++ b/Zend/tests/use_function/case_insensivity.phpt @@ -0,0 +1,13 @@ +--TEST-- +importing function with same name but different case should fail +--FILE-- +<?php + +namespace { + use function foo\bar; + use function foo\BAR; +} + +?> +--EXPECTF-- +Fatal error: Cannot use function foo\BAR as BAR because the name is already in use in %s on line %d diff --git a/Zend/tests/use_function/conditional_function_declaration.phpt b/Zend/tests/use_function/conditional_function_declaration.phpt new file mode 100644 index 0000000000..ccfb96103a --- /dev/null +++ b/Zend/tests/use_function/conditional_function_declaration.phpt @@ -0,0 +1,17 @@ +--TEST-- +function that is conditionally defined at runtime should not cause compiler error +--FILE-- +<?php + +if (0) { + function foo() { + } +} + +use function bar\foo; + +echo "Done"; + +?> +--EXPECT-- +Done diff --git a/Zend/tests/use_function/conflicting_use.phpt b/Zend/tests/use_function/conflicting_use.phpt new file mode 100644 index 0000000000..0221fbdebb --- /dev/null +++ b/Zend/tests/use_function/conflicting_use.phpt @@ -0,0 +1,25 @@ +--TEST-- +use function statements with conflicting names +--FILE-- +<?php + +namespace foo { + function baz() { + return 'foo.baz'; + } +} + +namespace bar { + function baz() { + return 'bar.baz'; + } +} + +namespace { + use function foo\baz, bar\baz; + echo "Done\n"; +} + +?> +--EXPECTF-- +Fatal error: Cannot use function bar\baz as baz because the name is already in use in %s on line %d diff --git a/Zend/tests/use_function/conflicting_use_alias.phpt b/Zend/tests/use_function/conflicting_use_alias.phpt new file mode 100644 index 0000000000..2870512014 --- /dev/null +++ b/Zend/tests/use_function/conflicting_use_alias.phpt @@ -0,0 +1,20 @@ +--TEST-- +use and use function with the same alias +--FILE-- +<?php + +namespace { + function foo() { + return 'foo'; + } +} + +namespace x { + use foo as bar; + use function foo as bar; + var_dump(bar()); +} + +?> +--EXPECT-- +string(3) "foo" diff --git a/Zend/tests/use_function/conflicting_use_const_alias.phpt b/Zend/tests/use_function/conflicting_use_const_alias.phpt new file mode 100644 index 0000000000..2e0faf0da2 --- /dev/null +++ b/Zend/tests/use_function/conflicting_use_const_alias.phpt @@ -0,0 +1,23 @@ +--TEST-- +use const and use function with the same alias +--FILE-- +<?php + +namespace { + const foo = 'foo.const'; + function foo() { + return 'foo.function'; + } +} + +namespace x { + use const foo as bar; + use function foo as bar; + var_dump(bar); + var_dump(bar()); +} + +?> +--EXPECT-- +string(9) "foo.const" +string(12) "foo.function" diff --git a/Zend/tests/use_function/define_imported.phpt b/Zend/tests/use_function/define_imported.phpt new file mode 100644 index 0000000000..c542a4d549 --- /dev/null +++ b/Zend/tests/use_function/define_imported.phpt @@ -0,0 +1,14 @@ +--TEST-- +defining function with same name as imported should fail +--FILE-- +<?php + +namespace { + use function foo\bar; + + function bar() {} +} + +?> +--EXPECTF-- +Fatal error: Cannot declare function bar because the name is already in use in %s on line %d diff --git a/Zend/tests/use_function/define_imported_before.phpt b/Zend/tests/use_function/define_imported_before.phpt new file mode 100644 index 0000000000..91974e0783 --- /dev/null +++ b/Zend/tests/use_function/define_imported_before.phpt @@ -0,0 +1,18 @@ +--TEST-- +using function with same name as defined should fail +--FILE-- +<?php + +namespace { + function bar() {} + + use function foo\bar; +} + +namespace { + echo "Done"; +} + +?> +--EXPECTF-- +Fatal error: Cannot use function foo\bar as bar because the name is already in use in %s on line %d diff --git a/Zend/tests/use_function/ignore_constants.phpt b/Zend/tests/use_function/ignore_constants.phpt new file mode 100644 index 0000000000..c50ff7357a --- /dev/null +++ b/Zend/tests/use_function/ignore_constants.phpt @@ -0,0 +1,23 @@ +--TEST-- +use function should ignore namespaced constants +--FILE-- +<?php + +namespace foo { + const bar = 42; +} + +namespace { + const bar = 43; +} + +namespace { + use function foo\bar; + var_dump(bar); + echo "Done\n"; +} + +?> +--EXPECT-- +int(43) +Done diff --git a/Zend/tests/use_function/includes/foo_bar.php b/Zend/tests/use_function/includes/foo_bar.php new file mode 100644 index 0000000000..6d2f8cab45 --- /dev/null +++ b/Zend/tests/use_function/includes/foo_bar.php @@ -0,0 +1,7 @@ +<?php + +namespace foo; + +function bar() { + return 'local bar'; +} diff --git a/Zend/tests/use_function/includes/foo_strlen.php b/Zend/tests/use_function/includes/foo_strlen.php new file mode 100644 index 0000000000..d2df2aa2b4 --- /dev/null +++ b/Zend/tests/use_function/includes/foo_strlen.php @@ -0,0 +1,7 @@ +<?php + +namespace foo; + +function strlen($str) { + return 4; +} diff --git a/Zend/tests/use_function/includes/global_bar.php b/Zend/tests/use_function/includes/global_bar.php new file mode 100644 index 0000000000..6d7d91f805 --- /dev/null +++ b/Zend/tests/use_function/includes/global_bar.php @@ -0,0 +1,5 @@ +<?php + +function bar() { + return 'global bar'; +} diff --git a/Zend/tests/use_function/includes/global_baz.php b/Zend/tests/use_function/includes/global_baz.php new file mode 100644 index 0000000000..6383b9dd38 --- /dev/null +++ b/Zend/tests/use_function/includes/global_baz.php @@ -0,0 +1,4 @@ +<?php + +function baz() { +} diff --git a/Zend/tests/use_function/no_global_fallback.phpt b/Zend/tests/use_function/no_global_fallback.phpt new file mode 100644 index 0000000000..6597d0d301 --- /dev/null +++ b/Zend/tests/use_function/no_global_fallback.phpt @@ -0,0 +1,13 @@ +--TEST-- +non-existent imported functions should not be looked up in the global table +--FILE-- +<?php + +require 'includes/global_baz.php'; + +use function foo\bar\baz; +var_dump(baz()); + +?> +--EXPECTF-- +Fatal error: Call to undefined function foo\bar\baz() in %s on line %d diff --git a/Zend/tests/use_function/no_global_fallback2.phpt b/Zend/tests/use_function/no_global_fallback2.phpt new file mode 100644 index 0000000000..5d012c10e5 --- /dev/null +++ b/Zend/tests/use_function/no_global_fallback2.phpt @@ -0,0 +1,18 @@ +--TEST-- +non-existent imported functions should not be looked up in the global table +--FILE-- +<?php + +namespace { + function test() { + echo "NO!"; + } +} +namespace foo { + use function bar\test; + test(); +} + +?> +--EXPECTF-- +Fatal error: Call to undefined function bar\test() in %s on line %d diff --git a/Zend/tests/use_function/self_parent.phpt b/Zend/tests/use_function/self_parent.phpt new file mode 100644 index 0000000000..f1e1fa84f1 --- /dev/null +++ b/Zend/tests/use_function/self_parent.phpt @@ -0,0 +1,12 @@ +--TEST-- +Allow self and parent in use function statement +--FILE-- +<?php + +namespace { + use function self as foo; + use function parent as bar; +} + +?> +--EXPECT-- diff --git a/Zend/tests/use_function/shadow_core.phpt b/Zend/tests/use_function/shadow_core.phpt new file mode 100644 index 0000000000..8f92ff1e1b --- /dev/null +++ b/Zend/tests/use_function/shadow_core.phpt @@ -0,0 +1,16 @@ +--TEST-- +shadowing a global core function with a local version +--FILE-- +<?php + +require 'includes/foo_strlen.php'; + +use function foo\strlen; + +var_dump(strlen('foo bar baz')); +echo "Done\n"; + +?> +--EXPECT-- +int(4) +Done diff --git a/Zend/tests/use_function/shadow_global.phpt b/Zend/tests/use_function/shadow_global.phpt new file mode 100644 index 0000000000..791bcdf4d5 --- /dev/null +++ b/Zend/tests/use_function/shadow_global.phpt @@ -0,0 +1,25 @@ +--TEST-- +shadowing a global function with a local version +--FILE-- +<?php + +namespace { + require 'includes/global_bar.php'; + require 'includes/foo_bar.php'; +} + +namespace { + var_dump(bar()); +} + +namespace { + use function foo\bar; + var_dump(bar()); + echo "Done\n"; +} + +?> +--EXPECT-- +string(10) "global bar" +string(9) "local bar" +Done diff --git a/Zend/tests/variadic/adding_additional_optional_parameter.phpt b/Zend/tests/variadic/adding_additional_optional_parameter.phpt new file mode 100644 index 0000000000..b4e797803d --- /dev/null +++ b/Zend/tests/variadic/adding_additional_optional_parameter.phpt @@ -0,0 +1,17 @@ +--TEST-- +It's possible to add additional optional arguments with matching signature +--FILE-- +<?php + +interface DB { + public function query($query, string ...$params); +} + +class MySQL implements DB { + public function query($query, string $extraParam = null, string ...$params) { } +} + +?> +===DONE=== +--EXPECT-- +===DONE=== diff --git a/Zend/tests/variadic/adding_additional_optional_parameter_error.phpt b/Zend/tests/variadic/adding_additional_optional_parameter_error.phpt new file mode 100644 index 0000000000..2f31d47dc6 --- /dev/null +++ b/Zend/tests/variadic/adding_additional_optional_parameter_error.phpt @@ -0,0 +1,16 @@ +--TEST-- +Additional optional parameters must have a matching prototype +--FILE-- +<?php + +interface DB { + public function query($query, string ...$params); +} + +class MySQL implements DB { + public function query($query, int $extraParam = null, string ...$params) { } +} + +?> +--EXPECTF-- +Fatal error: Declaration of MySQL::query() must be compatible with DB::query($query, string ...$params) in %s on line %d diff --git a/Zend/tests/variadic/basic.phpt b/Zend/tests/variadic/basic.phpt new file mode 100644 index 0000000000..810d4756aa --- /dev/null +++ b/Zend/tests/variadic/basic.phpt @@ -0,0 +1,57 @@ +--TEST-- +Basic variadic function +--FILE-- +<?php + +function test1(... $args) { + var_dump($args); +} + +test1(); +test1(1); +test1(1, 2, 3); + +function test2($arg1, $arg2, ...$args) { + var_dump($arg1, $arg2, $args); +} + +test2(1, 2); +test2(1, 2, 3); +test2(1, 2, 3, 4, 5); + +?> +--EXPECT-- +array(0) { +} +array(1) { + [0]=> + int(1) +} +array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) +} +int(1) +int(2) +array(0) { +} +int(1) +int(2) +array(1) { + [0]=> + int(3) +} +int(1) +int(2) +array(3) { + [0]=> + int(3) + [1]=> + int(4) + [2]=> + int(5) +} diff --git a/Zend/tests/variadic/by_ref.phpt b/Zend/tests/variadic/by_ref.phpt new file mode 100644 index 0000000000..e1635f4ecf --- /dev/null +++ b/Zend/tests/variadic/by_ref.phpt @@ -0,0 +1,24 @@ +--TEST-- +Variadic arguments with by-reference passing +--FILE-- +<?php + +function test(&... $args) { + $i = 0; + foreach ($args as &$arg) { + $arg = $i++; + } +} + +test(); +test($a); +var_dump($a); +test($b, $c, $d); +var_dump($b, $c, $d); + +?> +--EXPECT-- +int(0) +int(0) +int(1) +int(2) diff --git a/Zend/tests/variadic/by_ref_error.phpt b/Zend/tests/variadic/by_ref_error.phpt new file mode 100644 index 0000000000..7f21014146 --- /dev/null +++ b/Zend/tests/variadic/by_ref_error.phpt @@ -0,0 +1,12 @@ +--TEST-- +By-ref variadics enforce the reference +--FILE-- +<?php + +function test(&... $args) { } + +test(1); + +?> +--EXPECTF-- +Fatal error: Only variables can be passed by reference in %s on line %d diff --git a/Zend/tests/variadic/no_default_error.phpt b/Zend/tests/variadic/no_default_error.phpt new file mode 100644 index 0000000000..427ebed028 --- /dev/null +++ b/Zend/tests/variadic/no_default_error.phpt @@ -0,0 +1,10 @@ +--TEST-- +Variadic argument cannot have a default value +--FILE-- +<?php + +function test(...$args = 123) {} + +?> +--EXPECTF-- +Fatal error: Variadic parameter cannot have a default value in %s on line %d diff --git a/Zend/tests/variadic/non_variadic_implements_variadic_error.phpt b/Zend/tests/variadic/non_variadic_implements_variadic_error.phpt new file mode 100644 index 0000000000..f447837ca4 --- /dev/null +++ b/Zend/tests/variadic/non_variadic_implements_variadic_error.phpt @@ -0,0 +1,16 @@ +--TEST-- +It's not possible to turn a variadic function into a non-variadic one +--FILE-- +<?php + +interface DB { + public function query($query, ...$params); +} + +class MySQL implements DB { + public function query($query, $params) { } +} + +?> +--EXPECTF-- +Fatal error: Declaration of MySQL::query() must be compatible with DB::query($query, ...$params) in %s on line %d diff --git a/Zend/tests/variadic/only_last_error.phpt b/Zend/tests/variadic/only_last_error.phpt new file mode 100644 index 0000000000..ee6ff3f777 --- /dev/null +++ b/Zend/tests/variadic/only_last_error.phpt @@ -0,0 +1,10 @@ +--TEST-- +Only the last argument can be variadic +--FILE-- +<?php + +function test($foo, ...$bar, $baz) {} + +?> +--EXPECTF-- +Fatal error: Only the last parameter can be variadic in %s on line %d diff --git a/Zend/tests/variadic/optional_params.phpt b/Zend/tests/variadic/optional_params.phpt new file mode 100644 index 0000000000..ba965e538c --- /dev/null +++ b/Zend/tests/variadic/optional_params.phpt @@ -0,0 +1,49 @@ +--TEST-- +Optional parameter before variadic parameter +--FILE-- +<?php + +function fn($reqParam, $optParam = null, ...$params) { + var_dump($reqParam, $optParam, $params); +} + +fn(1); +fn(1, 2); +fn(1, 2, 3); +fn(1, 2, 3, 4); +fn(1, 2, 3, 4, 5); + +?> +--EXPECT-- +int(1) +NULL +array(0) { +} +int(1) +int(2) +array(0) { +} +int(1) +int(2) +array(1) { + [0]=> + int(3) +} +int(1) +int(2) +array(2) { + [0]=> + int(3) + [1]=> + int(4) +} +int(1) +int(2) +array(3) { + [0]=> + int(3) + [1]=> + int(4) + [2]=> + int(5) +} diff --git a/Zend/tests/variadic/removing_parameter_error.phpt b/Zend/tests/variadic/removing_parameter_error.phpt new file mode 100644 index 0000000000..a189e5cf09 --- /dev/null +++ b/Zend/tests/variadic/removing_parameter_error.phpt @@ -0,0 +1,20 @@ +--TEST-- +It's not possible to remove required parameter before a variadic parameter +--FILE-- +<?php + +/* Theoretically this should be valid because it weakens the constraint, but + * PHP does not allow this (for non-variadics), so I'm not allowing it here, too, + * to stay consistent. */ + +interface DB { + public function query($query, ...$params); +} + +class MySQL implements DB { + public function query(...$params) { } +} + +?> +--EXPECTF-- +Fatal error: Declaration of MySQL::query() must be compatible with DB::query($query, ...$params) in %s on line %d diff --git a/Zend/tests/variadic/typehint_error.phpt b/Zend/tests/variadic/typehint_error.phpt new file mode 100644 index 0000000000..3006b99957 --- /dev/null +++ b/Zend/tests/variadic/typehint_error.phpt @@ -0,0 +1,36 @@ +--TEST-- +Variadic arguments enforce typehints +--FILE-- +<?php + +function test(array... $args) { + var_dump($args); +} + +test(); +test([0], [1], [2]); +test([0], [1], 2); + +?> +--EXPECTF-- +array(0) { +} +array(3) { + [0]=> + array(1) { + [0]=> + int(0) + } + [1]=> + array(1) { + [0]=> + int(1) + } + [2]=> + array(1) { + [0]=> + int(2) + } +} + +Catchable fatal error: Argument 3 passed to test() must be of the type array, integer given, called in %s on line %d diff --git a/Zend/tests/variadic/typehint_suppressed_error.phpt b/Zend/tests/variadic/typehint_suppressed_error.phpt new file mode 100644 index 0000000000..5048e1c1bb --- /dev/null +++ b/Zend/tests/variadic/typehint_suppressed_error.phpt @@ -0,0 +1,33 @@ +--TEST-- +Error suppression for typehints on variadic arguments works +--FILE-- +<?php + +function test(array... $args) { + var_dump($args); +} + +set_error_handler(function($errno, $errstr) { + var_dump($errstr); + return true; +}); + +test([0], [1], 2); + +?> +--EXPECTF-- +string(%d) "Argument 3 passed to test() must be of the type array, integer given, called in %s on line %d and defined" +array(3) { + [0]=> + array(1) { + [0]=> + int(0) + } + [1]=> + array(1) { + [0]=> + int(1) + } + [2]=> + int(2) +} diff --git a/Zend/tests/variadic/variadic_changed_byref_error.phpt b/Zend/tests/variadic/variadic_changed_byref_error.phpt new file mode 100644 index 0000000000..14fb6ae5eb --- /dev/null +++ b/Zend/tests/variadic/variadic_changed_byref_error.phpt @@ -0,0 +1,16 @@ +--TEST-- +Variadic arguments must have compatible passing modes +--FILE-- +<?php + +interface DB { + public function query($query, &...$params); +} + +class MySQL implements DB { + public function query($query, ...$params) { } +} + +?> +--EXPECTF-- +Fatal error: Declaration of MySQL::query() must be compatible with DB::query($query, &...$params) in %s on line %d diff --git a/Zend/tests/variadic/variadic_changed_typehint_error.phpt b/Zend/tests/variadic/variadic_changed_typehint_error.phpt new file mode 100644 index 0000000000..00df33a042 --- /dev/null +++ b/Zend/tests/variadic/variadic_changed_typehint_error.phpt @@ -0,0 +1,16 @@ +--TEST-- +Typehints for variadic arguments have to be compatible +--FILE-- +<?php + +interface DB { + public function query($query, string ...$params); +} + +class MySQL implements DB { + public function query($query, int ...$params) { } +} + +?> +--EXPECTF-- +Fatal error: Declaration of MySQL::query() must be compatible with DB::query($query, string ...$params) in %s on line %d diff --git a/Zend/tests/variadic/variadic_implements_non_variadic.phpt b/Zend/tests/variadic/variadic_implements_non_variadic.phpt new file mode 100644 index 0000000000..a66ec280b8 --- /dev/null +++ b/Zend/tests/variadic/variadic_implements_non_variadic.phpt @@ -0,0 +1,17 @@ +--TEST-- +A non-variadic function can be turned into a variadic one +--FILE-- +<?php + +interface DB { + public function query($query); +} + +class MySQL implements DB { + public function query($query, ...$params) { } +} + +?> +===DONE=== +--EXPECT-- +===DONE=== diff --git a/Zend/tests/zend_signed_multiply-32bit.phpt b/Zend/tests/zend_signed_multiply-32bit.phpt new file mode 100644 index 0000000000..3f37cbac19 --- /dev/null +++ b/Zend/tests/zend_signed_multiply-32bit.phpt @@ -0,0 +1,14 @@ +--TEST-- +Zend signed multiply 32-bit +--SKIPIF-- +<?php if ((1 << 31) > 0) print "skip Running on 64-bit target"; ?> +--FILE-- +<?php +var_dump(0x8000 * -0xffff); +var_dump(0x8001 * 0xfffe); +var_dump(0x8001 * -0xffff); +?> +--EXPECTF-- +int(-2147450880) +int(2147483646) +float(-2147516415) diff --git a/Zend/tests/zend_signed_multiply-64bit.phpt b/Zend/tests/zend_signed_multiply-64bit.phpt new file mode 100644 index 0000000000..94a6e035fa --- /dev/null +++ b/Zend/tests/zend_signed_multiply-64bit.phpt @@ -0,0 +1,14 @@ +--TEST-- +Zend signed multiply 64-bit +--SKIPIF-- +<?php if ((1 << 31) < 0) print "skip Running on 32-bit target"; ?> +--FILE-- +<?php +var_dump(0x80000000 * -0xffffffff); +var_dump(0x80000001 * 0xfffffffe); +var_dump(0x80000001 * -0xffffffff); +?> +--EXPECTF-- +int(-9223372034707292160) +int(9223372036854775806) +float(-9.2233720390023E+18) diff --git a/Zend/zend.c b/Zend/zend.c index 11baf34c93..33161f79e3 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -30,6 +30,7 @@ #include "zend_ini.h" #include "zend_vm.h" #include "zend_dtrace.h" +#include "zend_virtual_cwd.h" #ifdef ZTS # define GLOBAL_FUNCTION_TABLE global_function_table @@ -652,6 +653,8 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions TS start_memory_manager(TSRMLS_C); + virtual_cwd_startup(); /* Could use shutdown to free the main cwd but it would just slow it down for CGI */ + #if defined(__FreeBSD__) || defined(__DragonFly__) /* FreeBSD and DragonFly floating point precision fix */ fpsetmask(0); @@ -802,9 +805,14 @@ void zend_post_startup(TSRMLS_D) /* {{{ */ compiler_globals_ctor(compiler_globals, tsrm_ls); } free(EG(zend_constants)); + + virtual_cwd_deactivate(TSRMLS_C); + executor_globals_ctor(executor_globals, tsrm_ls); global_persistent_list = &EG(persistent_list); zend_copy_ini_directives(TSRMLS_C); +#else + virtual_cwd_deactivate(TSRMLS_C); #endif } /* }}} */ @@ -820,6 +828,9 @@ void zend_shutdown(TSRMLS_D) /* {{{ */ zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC); zend_destroy_modules(); + virtual_cwd_deactivate(TSRMLS_C); + virtual_cwd_shutdown(); + zend_hash_destroy(GLOBAL_FUNCTION_TABLE); zend_hash_destroy(GLOBAL_CLASS_TABLE); @@ -908,8 +919,11 @@ ZEND_API char *get_zend_version(void) /* {{{ */ } /* }}} */ -void zend_activate(TSRMLS_D) /* {{{ */ +ZEND_API void zend_activate(TSRMLS_D) /* {{{ */ { +#ifdef ZTS + virtual_cwd_activate(TSRMLS_C); +#endif gc_reset(TSRMLS_C); init_compiler(TSRMLS_C); init_executor(TSRMLS_C); @@ -925,7 +939,7 @@ void zend_call_destructors(TSRMLS_D) /* {{{ */ } /* }}} */ -void zend_deactivate(TSRMLS_D) /* {{{ */ +ZEND_API void zend_deactivate(TSRMLS_D) /* {{{ */ { /* we're no longer executing anything */ EG(opline_ptr) = NULL; diff --git a/Zend/zend.h b/Zend/zend.h index af653b15eb..3ac559e05c 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -22,7 +22,7 @@ #ifndef ZEND_H #define ZEND_H -#define ZEND_VERSION "2.5.0" +#define ZEND_VERSION "2.6.0-dev" #define ZEND_ENGINE_2 @@ -193,7 +193,7 @@ char *alloca (); #endif #define restrict __restrict__ -#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(ZEND_WIN32)) && !(defined(ZTS) && defined(NETWARE)) && !(defined(ZTS) && defined(HPUX)) && !defined(DARWIN) +#if (HAVE_ALLOCA || (defined (__GNUC__) && __GNUC__ >= 2)) && !(defined(ZTS) && defined(NETWARE)) && !(defined(ZTS) && defined(HPUX)) && !defined(DARWIN) # define ZEND_ALLOCA_MAX_SIZE (32 * 1024) # define ALLOCA_FLAG(name) \ zend_bool name; @@ -317,6 +317,7 @@ typedef struct _zend_object { } zend_object; #include "zend_object_handlers.h" +#include "zend_ast.h" typedef union _zvalue_value { long lval; /* long value */ @@ -327,6 +328,7 @@ typedef union _zvalue_value { } str; HashTable *ht; /* hash table value */ zend_object_value obj; + zend_ast *ast; } zvalue_value; struct _zval_struct { @@ -587,7 +589,8 @@ typedef int (*zend_write_func_t)(const char *str, uint str_length); #define IS_RESOURCE 7 #define IS_CONSTANT 8 #define IS_CONSTANT_ARRAY 9 -#define IS_CALLABLE 10 +#define IS_CONSTANT_AST 10 +#define IS_CALLABLE 11 /* Ugly hack to support constants as static array indices */ #define IS_CONSTANT_TYPE_MASK 0x00f @@ -597,6 +600,8 @@ typedef int (*zend_write_func_t)(const char *str, uint str_length); #define IS_LEXICAL_REF 0x040 #define IS_CONSTANT_IN_NAMESPACE 0x100 +#define IS_CONSTANT_TYPE(type) (((type) & IS_CONSTANT_TYPE_MASK) >= IS_CONSTANT && ((type) & IS_CONSTANT_TYPE_MASK) <= IS_CONSTANT_AST) + /* overloaded elements data types */ #define OE_IS_ARRAY (1<<0) #define OE_IS_OBJECT (1<<1) @@ -651,12 +656,14 @@ ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int ZEND_API void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3); END_EXTERN_C() -void zend_activate(TSRMLS_D); -void zend_deactivate(TSRMLS_D); -void zend_call_destructors(TSRMLS_D); -void zend_activate_modules(TSRMLS_D); -void zend_deactivate_modules(TSRMLS_D); -void zend_post_deactivate_modules(TSRMLS_D); +BEGIN_EXTERN_C() +ZEND_API void zend_activate(TSRMLS_D); +ZEND_API void zend_deactivate(TSRMLS_D); +ZEND_API void zend_call_destructors(TSRMLS_D); +ZEND_API void zend_activate_modules(TSRMLS_D); +ZEND_API void zend_deactivate_modules(TSRMLS_D); +ZEND_API void zend_post_deactivate_modules(TSRMLS_D); +END_EXTERN_C() #if ZEND_DEBUG #define Z_DBG(expr) (expr) @@ -670,8 +677,8 @@ END_EXTERN_C() /* FIXME: Check if we can save if (ptr) too */ -#define STR_FREE(ptr) if (ptr && !IS_INTERNED(ptr)) { efree(ptr); } -#define STR_FREE_REL(ptr) if (ptr && !IS_INTERNED(ptr)) { efree_rel(ptr); } +#define STR_FREE(ptr) if (ptr) { str_efree(ptr); } +#define STR_FREE_REL(ptr) if (ptr) { str_efree_rel(ptr); } #define STR_EMPTY_ALLOC() estrndup("", sizeof("")-1) @@ -683,7 +690,7 @@ END_EXTERN_C() #define ZEND_WRITE_EX(str, str_len) write_func((str), (str_len)) #define ZEND_PUTS(str) zend_write((str), strlen((str))) #define ZEND_PUTS_EX(str) write_func((str), strlen((str))) -#define ZEND_PUTC(c) zend_write(&(c), 1), (c) +#define ZEND_PUTC(c) zend_write(&(c), 1) BEGIN_EXTERN_C() extern ZEND_API int (*zend_printf)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2); diff --git a/Zend/zend_API.c b/Zend/zend_API.c index b59faab284..18f151e0ef 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -1010,7 +1010,7 @@ ZEND_API int _array_init(zval *arg, uint size ZEND_FILE_LINE_DC) /* {{{ */ { ALLOC_HASHTABLE_REL(Z_ARRVAL_P(arg)); - _zend_hash_init(Z_ARRVAL_P(arg), size, NULL, ZVAL_PTR_DTOR, 0 ZEND_FILE_LINE_RELAY_CC); + _zend_hash_init(Z_ARRVAL_P(arg), size, ZVAL_PTR_DTOR, 0 ZEND_FILE_LINE_RELAY_CC); Z_TYPE_P(arg) = IS_ARRAY; return SUCCESS; } @@ -1053,8 +1053,7 @@ ZEND_API void zend_merge_properties(zval *obj, HashTable *properties, int destro static int zval_update_class_constant(zval **pp, int is_static, int offset TSRMLS_DC) /* {{{ */ { - if ((Z_TYPE_PP(pp) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT || - (Z_TYPE_PP(pp) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT_ARRAY) { + if (IS_CONSTANT_TYPE(Z_TYPE_PP(pp))) { zend_class_entry **scope = EG(in_execution)?&EG(scope):&CG(active_class_entry); if ((*scope)->parent) { @@ -1078,7 +1077,7 @@ static int zval_update_class_constant(zval **pp, int is_static, int offset TSRML } ce = ce->parent; } while (ce); - + } return zval_update_constant(pp, (void*)1 TSRMLS_CC); } @@ -2029,7 +2028,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio const zend_function_entry *ptr = functions; zend_function function, *reg_function; zend_internal_function *internal_function = (zend_internal_function *)&function; - int count=0, unload=0, result=0; + int count=0, unload=0; HashTable *target_function_table = function_table; int error_type; zend_function *ctor = NULL, *dtor = NULL, *clone = NULL, *__get = NULL, *__set = NULL, *__unset = NULL, *__isset = NULL, *__call = NULL, *__callstatic = NULL, *__tostring = NULL; @@ -2037,6 +2036,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio int fname_len; const char *lc_class_name = NULL; int class_name_len = 0; + zend_ulong hash; if (type==MODULE_PERSISTENT) { error_type = E_CORE_WARNING; @@ -2089,16 +2089,12 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio } else { internal_function->required_num_args = info->required_num_args; } - if (info->pass_rest_by_reference) { - if (info->pass_rest_by_reference == ZEND_SEND_PREFER_REF) { - internal_function->fn_flags |= ZEND_ACC_PASS_REST_PREFER_REF; - } else { - internal_function->fn_flags |= ZEND_ACC_PASS_REST_BY_REFERENCE; - } - } if (info->return_reference) { internal_function->fn_flags |= ZEND_ACC_RETURN_REFERENCE; } + if (ptr->arg_info[ptr->num_args].is_variadic) { + internal_function->fn_flags |= ZEND_ACC_VARIADIC; + } } else { internal_function->arg_info = NULL; internal_function->num_args = 0; @@ -2135,16 +2131,25 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio } fname_len = strlen(ptr->fname); lowercase_name = zend_new_interned_string(zend_str_tolower_dup(ptr->fname, fname_len), fname_len + 1, 1 TSRMLS_CC); - if (IS_INTERNED(lowercase_name)) { - result = zend_hash_quick_add(target_function_table, lowercase_name, fname_len+1, INTERNED_HASH(lowercase_name), &function, sizeof(zend_function), (void**)®_function); - } else { - result = zend_hash_add(target_function_table, lowercase_name, fname_len+1, &function, sizeof(zend_function), (void**)®_function); - } - if (result == FAILURE) { + hash = str_hash(lowercase_name, fname_len); + if (zend_hash_quick_add(target_function_table, lowercase_name, fname_len+1, hash, &function, sizeof(zend_function), (void**)®_function) == FAILURE) { unload=1; str_efree(lowercase_name); break; } + + /* If types of arguments have to be checked */ + if (reg_function->common.arg_info && reg_function->common.num_args) { + int i; + for (i = 0; i < reg_function->common.num_args; i++) { + if (reg_function->common.arg_info[i].class_name || + reg_function->common.arg_info[i].type_hint) { + reg_function->common.fn_flags |= ZEND_ACC_HAS_TYPE_HINTS; + break; + } + } + } + if (scope) { /* Look for ctor, dtor, clone * If it's an old-style constructor, store it only if we don't have @@ -2388,7 +2393,7 @@ void module_destructor(zend_module_entry *module) /* {{{ */ } /* }}} */ -void zend_activate_modules(TSRMLS_D) /* {{{ */ +ZEND_API void zend_activate_modules(TSRMLS_D) /* {{{ */ { zend_module_entry **p = module_request_startup_handlers; @@ -2417,7 +2422,7 @@ int module_registry_cleanup(zend_module_entry *module TSRMLS_DC) /* {{{ */ } /* }}} */ -void zend_deactivate_modules(TSRMLS_D) /* {{{ */ +ZEND_API void zend_deactivate_modules(TSRMLS_D) /* {{{ */ { EG(opline_ptr) = NULL; /* we're no longer executing anything */ @@ -2464,7 +2469,7 @@ static int exec_done_cb(zend_module_entry *module TSRMLS_DC) /* {{{ */ } /* }}} */ -void zend_post_deactivate_modules(TSRMLS_D) /* {{{ */ +ZEND_API void zend_post_deactivate_modules(TSRMLS_D) /* {{{ */ { if (EG(full_tables_cleanup)) { zend_hash_apply(&module_registry, (apply_func_t) exec_done_cb TSRMLS_CC); @@ -2493,6 +2498,7 @@ static zend_class_entry *do_register_internal_class(zend_class_entry *orig_class { zend_class_entry *class_entry = malloc(sizeof(zend_class_entry)); char *lowercase_name = emalloc(orig_class_entry->name_length + 1); + zend_ulong hash; *class_entry = *orig_class_entry; class_entry->type = ZEND_INTERNAL_CLASS; @@ -2506,11 +2512,8 @@ static zend_class_entry *do_register_internal_class(zend_class_entry *orig_class zend_str_tolower_copy(lowercase_name, orig_class_entry->name, class_entry->name_length); lowercase_name = (char*)zend_new_interned_string(lowercase_name, class_entry->name_length + 1, 1 TSRMLS_CC); - if (IS_INTERNED(lowercase_name)) { - zend_hash_quick_update(CG(class_table), lowercase_name, class_entry->name_length+1, INTERNED_HASH(lowercase_name), &class_entry, sizeof(zend_class_entry *), NULL); - } else { - zend_hash_update(CG(class_table), lowercase_name, class_entry->name_length+1, &class_entry, sizeof(zend_class_entry *), NULL); - } + hash = str_hash(lowercase_name, class_entry->name_length); + zend_hash_quick_update(CG(class_table), lowercase_name, class_entry->name_length+1, hash, &class_entry, sizeof(zend_class_entry *), NULL); str_efree(lowercase_name); return class_entry; } diff --git a/Zend/zend_API.h b/Zend/zend_API.h index ecc8d9acd9..007d989609 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -98,16 +98,18 @@ typedef struct _zend_fcall_info_cache { #define ZEND_FE_END { NULL, NULL, NULL, 0, 0 } -#define ZEND_ARG_INFO(pass_by_ref, name) { #name, sizeof(#name)-1, NULL, 0, 0, 0, pass_by_ref}, -#define ZEND_ARG_PASS_INFO(pass_by_ref) { NULL, 0, NULL, 0, 0, 0, pass_by_ref}, -#define ZEND_ARG_OBJ_INFO(pass_by_ref, name, classname, allow_null) { #name, sizeof(#name)-1, #classname, sizeof(#classname)-1, IS_OBJECT, allow_null, pass_by_ref}, -#define ZEND_ARG_ARRAY_INFO(pass_by_ref, name, allow_null) { #name, sizeof(#name)-1, NULL, 0, IS_ARRAY, allow_null, pass_by_ref}, -#define ZEND_ARG_TYPE_INFO(pass_by_ref, name, type_hint, allow_null) { #name, sizeof(#name)-1, NULL, 0, type_hint, allow_null, pass_by_ref}, -#define ZEND_BEGIN_ARG_INFO_EX(name, pass_rest_by_reference, return_reference, required_num_args) \ +#define ZEND_ARG_INFO(pass_by_ref, name) { #name, sizeof(#name)-1, NULL, 0, 0, pass_by_ref, 0, 0 }, +#define ZEND_ARG_PASS_INFO(pass_by_ref) { NULL, 0, NULL, 0, 0, pass_by_ref, 0, 0 }, +#define ZEND_ARG_OBJ_INFO(pass_by_ref, name, classname, allow_null) { #name, sizeof(#name)-1, #classname, sizeof(#classname)-1, IS_OBJECT, pass_by_ref, allow_null, 0 }, +#define ZEND_ARG_ARRAY_INFO(pass_by_ref, name, allow_null) { #name, sizeof(#name)-1, NULL, 0, IS_ARRAY, pass_by_ref, allow_null, 0 }, +#define ZEND_ARG_TYPE_INFO(pass_by_ref, name, type_hint, allow_null) { #name, sizeof(#name)-1, NULL, 0, type_hint, pass_by_ref, allow_null, 0 }, +#define ZEND_ARG_VARIADIC_INFO(pass_by_ref, name) { #name, sizeof(#name)-1, NULL, 0, 0, pass_by_ref, 0, 1 }, + +#define ZEND_BEGIN_ARG_INFO_EX(name, _unused, return_reference, required_num_args) \ static const zend_arg_info name[] = { \ - { NULL, 0, NULL, required_num_args, 0, return_reference, pass_rest_by_reference}, -#define ZEND_BEGIN_ARG_INFO(name, pass_rest_by_reference) \ - ZEND_BEGIN_ARG_INFO_EX(name, pass_rest_by_reference, ZEND_RETURN_VALUE, -1) + { NULL, 0, NULL, required_num_args, 0, return_reference, 0, 0 }, +#define ZEND_BEGIN_ARG_INFO(name, _unused) \ + ZEND_BEGIN_ARG_INFO_EX(name, 0, ZEND_RETURN_VALUE, -1) #define ZEND_END_ARG_INFO() }; /* Name macros */ @@ -594,22 +596,20 @@ END_EXTERN_C() Z_TYPE_P(__z) = IS_STRING; \ } while (0) -#define ZVAL_ZVAL(z, zv, copy, dtor) { \ - zend_uchar is_ref = Z_ISREF_P(z); \ - zend_uint refcount = Z_REFCOUNT_P(z); \ - ZVAL_COPY_VALUE(z, zv); \ +#define ZVAL_ZVAL(z, zv, copy, dtor) do { \ + zval *__z = (z); \ + zval *__zv = (zv); \ + ZVAL_COPY_VALUE(__z, __zv); \ if (copy) { \ - zval_copy_ctor(z); \ + zval_copy_ctor(__z); \ } \ if (dtor) { \ if (!copy) { \ - ZVAL_NULL(zv); \ + ZVAL_NULL(__zv); \ } \ - zval_ptr_dtor(&zv); \ + zval_ptr_dtor(&__zv); \ } \ - Z_SET_ISREF_TO_P(z, is_ref); \ - Z_SET_REFCOUNT_P(z, refcount); \ - } + } while (0) #define ZVAL_FALSE(z) ZVAL_BOOL(z, 0) #define ZVAL_TRUE(z) ZVAL_BOOL(z, 1) @@ -638,6 +638,18 @@ END_EXTERN_C() #define RETURN_FALSE { RETVAL_FALSE; return; } #define RETURN_TRUE { RETVAL_TRUE; return; } +#define RETVAL_ZVAL_FAST(z) do { \ + zval *_z = (z); \ + if (Z_ISREF_P(_z)) { \ + RETVAL_ZVAL(_z, 1, 0); \ + } else { \ + zval_ptr_dtor(&return_value); \ + Z_ADDREF_P(_z); \ + *return_value_ptr = _z; \ + } \ +} while (0) +#define RETURN_ZVAL_FAST(z) { RETVAL_ZVAL_FAST(z); return; } + #define SET_VAR_STRING(n, v) { \ { \ zval *var; \ diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c new file mode 100644 index 0000000000..66330d597b --- /dev/null +++ b/Zend/zend_ast.c @@ -0,0 +1,329 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) 1998-2013 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: Bob Weinand <bwoebi@php.net> | + | Dmitry Stogov <dmitry@zend.com> | + +----------------------------------------------------------------------+ +*/ + +/* $Id$ */ + +#include "zend_ast.h" +#include "zend_API.h" +#include "zend_operators.h" + +ZEND_API zend_ast *zend_ast_create_constant(zval *zv) +{ + zend_ast *ast = emalloc(sizeof(zend_ast) + sizeof(zval)); + ast->kind = ZEND_CONST; + ast->children = 0; + ast->u.val = (zval*)(ast + 1); + INIT_PZVAL_COPY(ast->u.val, zv); + return ast; +} + +ZEND_API zend_ast* zend_ast_create_unary(uint kind, zend_ast *op0) +{ + zend_ast *ast = emalloc(sizeof(zend_ast)); + ast->kind = kind; + ast->children = 1; + (&ast->u.child)[0] = op0; + return ast; +} + +ZEND_API zend_ast* zend_ast_create_binary(uint kind, zend_ast *op0, zend_ast *op1) +{ + zend_ast *ast = emalloc(sizeof(zend_ast) + sizeof(zend_ast*)); + ast->kind = kind; + ast->children = 2; + (&ast->u.child)[0] = op0; + (&ast->u.child)[1] = op1; + return ast; +} + +ZEND_API zend_ast* zend_ast_create_ternary(uint kind, zend_ast *op0, zend_ast *op1, zend_ast *op2) +{ + zend_ast *ast = emalloc(sizeof(zend_ast) + sizeof(zend_ast*) * 2); + ast->kind = kind; + ast->children = 3; + (&ast->u.child)[0] = op0; + (&ast->u.child)[1] = op1; + (&ast->u.child)[2] = op2; + return ast; +} + +ZEND_API int zend_ast_is_ct_constant(zend_ast *ast) +{ + int i; + + if (ast->kind == ZEND_CONST) { + return !IS_CONSTANT_TYPE(Z_TYPE_P(ast->u.val)); + } else { + for (i = 0; i < ast->children; i++) { + if ((&ast->u.child)[i]) { + if (!zend_ast_is_ct_constant((&ast->u.child)[i])) { + return 0; + } + } + } + return 1; + } +} + +ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *scope TSRMLS_DC) +{ + zval op1, op2; + + switch (ast->kind) { + case ZEND_ADD: + zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); + zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC); + add_function(result, &op1, &op2 TSRMLS_CC); + zval_dtor(&op1); + zval_dtor(&op2); + break; + case ZEND_SUB: + zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); + zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC); + sub_function(result, &op1, &op2 TSRMLS_CC); + zval_dtor(&op1); + zval_dtor(&op2); + break; + case ZEND_MUL: + zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); + zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC); + mul_function(result, &op1, &op2 TSRMLS_CC); + zval_dtor(&op1); + zval_dtor(&op2); + break; + case ZEND_DIV: + zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); + zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC); + div_function(result, &op1, &op2 TSRMLS_CC); + zval_dtor(&op1); + zval_dtor(&op2); + break; + case ZEND_MOD: + zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); + zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC); + mod_function(result, &op1, &op2 TSRMLS_CC); + zval_dtor(&op1); + zval_dtor(&op2); + break; + case ZEND_SL: + zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); + zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC); + shift_left_function(result, &op1, &op2 TSRMLS_CC); + zval_dtor(&op1); + zval_dtor(&op2); + break; + case ZEND_SR: + zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); + zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC); + shift_right_function(result, &op1, &op2 TSRMLS_CC); + zval_dtor(&op1); + zval_dtor(&op2); + break; + case ZEND_CONCAT: + zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); + zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC); + concat_function(result, &op1, &op2 TSRMLS_CC); + zval_dtor(&op1); + zval_dtor(&op2); + break; + case ZEND_BW_OR: + zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); + zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC); + bitwise_or_function(result, &op1, &op2 TSRMLS_CC); + zval_dtor(&op1); + zval_dtor(&op2); + break; + case ZEND_BW_AND: + zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); + zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC); + bitwise_and_function(result, &op1, &op2 TSRMLS_CC); + zval_dtor(&op1); + zval_dtor(&op2); + break; + case ZEND_BW_XOR: + zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); + zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC); + bitwise_xor_function(result, &op1, &op2 TSRMLS_CC); + zval_dtor(&op1); + zval_dtor(&op2); + break; + case ZEND_BW_NOT: + zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); + bitwise_not_function(result, &op1 TSRMLS_CC); + zval_dtor(&op1); + break; + case ZEND_BOOL_NOT: + zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); + boolean_not_function(result, &op1 TSRMLS_CC); + zval_dtor(&op1); + break; + case ZEND_BOOL_XOR: + zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); + zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC); + boolean_xor_function(result, &op1, &op2 TSRMLS_CC); + zval_dtor(&op1); + zval_dtor(&op2); + break; + case ZEND_IS_IDENTICAL: + zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); + zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC); + is_identical_function(result, &op1, &op2 TSRMLS_CC); + zval_dtor(&op1); + zval_dtor(&op2); + break; + case ZEND_IS_NOT_IDENTICAL: + zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); + zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC); + is_not_identical_function(result, &op1, &op2 TSRMLS_CC); + zval_dtor(&op1); + zval_dtor(&op2); + break; + case ZEND_IS_EQUAL: + zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); + zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC); + is_equal_function(result, &op1, &op2 TSRMLS_CC); + zval_dtor(&op1); + zval_dtor(&op2); + break; + case ZEND_IS_NOT_EQUAL: + zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); + zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC); + is_not_equal_function(result, &op1, &op2 TSRMLS_CC); + zval_dtor(&op1); + zval_dtor(&op2); + break; + case ZEND_IS_SMALLER: + zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); + zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC); + is_smaller_function(result, &op1, &op2 TSRMLS_CC); + zval_dtor(&op1); + zval_dtor(&op2); + break; + case ZEND_IS_SMALLER_OR_EQUAL: + zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); + zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC); + is_smaller_or_equal_function(result, &op1, &op2 TSRMLS_CC); + zval_dtor(&op1); + zval_dtor(&op2); + break; + case ZEND_CONST: + *result = *ast->u.val; + zval_copy_ctor(result); + if (IS_CONSTANT_TYPE(Z_TYPE_P(result))) { + zval_update_constant_ex(&result, (void *) 1, scope TSRMLS_CC); + } + break; + case ZEND_BOOL_AND: + zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); + if (zend_is_true(&op1)) { + zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC); + ZVAL_BOOL(result, zend_is_true(&op2)); + zval_dtor(&op2); + } else { + ZVAL_BOOL(result, 0); + } + zval_dtor(&op1); + break; + case ZEND_BOOL_OR: + zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); + if (zend_is_true(&op1)) { + ZVAL_BOOL(result, 1); + } else { + zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC); + ZVAL_BOOL(result, zend_is_true(&op2)); + zval_dtor(&op2); + } + zval_dtor(&op1); + break; + case ZEND_SELECT: + zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC); + if (zend_is_true(&op1)) { + if (!(&ast->u.child)[1]) { + *result = op1; + } else { + zend_ast_evaluate(result, (&ast->u.child)[1], scope TSRMLS_CC); + zval_dtor(&op1); + } + } else { + zend_ast_evaluate(result, (&ast->u.child)[2], scope TSRMLS_CC); + zval_dtor(&op1); + } + break; + case ZEND_UNARY_PLUS: + ZVAL_LONG(&op1, 0); + zend_ast_evaluate(&op2, (&ast->u.child)[0], scope TSRMLS_CC); + add_function(result, &op1, &op2 TSRMLS_CC); + zval_dtor(&op2); + break; + case ZEND_UNARY_MINUS: + ZVAL_LONG(&op1, 0); + zend_ast_evaluate(&op2, (&ast->u.child)[0], scope TSRMLS_CC); + sub_function(result, &op1, &op2 TSRMLS_CC); + zval_dtor(&op2); + break; + default: + zend_error(E_ERROR, "Unsupported constant expression"); + } +} + +ZEND_API zend_ast *zend_ast_copy(zend_ast *ast) +{ + if (ast == NULL) { + return NULL; + } else if (ast->kind == ZEND_CONST) { + zend_ast *copy = zend_ast_create_constant(ast->u.val); + zval_copy_ctor(copy->u.val); + return copy; + } else { + switch (ast->children) { + case 1: + return zend_ast_create_unary( + ast->kind, + zend_ast_copy((&ast->u.child)[0])); + case 2: + return zend_ast_create_binary( + ast->kind, + zend_ast_copy((&ast->u.child)[0]), + zend_ast_copy((&ast->u.child)[1])); + case 3: + return zend_ast_create_ternary( + ast->kind, + zend_ast_copy((&ast->u.child)[0]), + zend_ast_copy((&ast->u.child)[1]), + zend_ast_copy((&ast->u.child)[2])); + } + } + return NULL; +} + +ZEND_API void zend_ast_destroy(zend_ast *ast) +{ + int i; + + if (ast->kind == ZEND_CONST) { + zval_dtor(ast->u.val); + } else { + for (i = 0; i < ast->children; i++) { + if ((&ast->u.child)[i]) { + zend_ast_destroy((&ast->u.child)[i]); + } + } + } + efree(ast); +} diff --git a/Zend/zend_ast.h b/Zend/zend_ast.h new file mode 100644 index 0000000000..49908cebbe --- /dev/null +++ b/Zend/zend_ast.h @@ -0,0 +1,61 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) 1998-2013 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: Bob Weinand <bwoebi@php.net> | + | Dmitry Stogov <dmitry@zend.com> | + +----------------------------------------------------------------------+ +*/ + +/* $Id$ */ + +#ifndef ZEND_AST_H +#define ZEND_AST_H + +typedef struct _zend_ast zend_ast; + +#include "zend.h" + +typedef enum _zend_ast_kind { + /* first 256 kinds are reserved for opcodes */ + ZEND_CONST = 256, + ZEND_BOOL_AND, + ZEND_BOOL_OR, + ZEND_SELECT, + ZEND_UNARY_PLUS, + ZEND_UNARY_MINUS, +} zend_ast_kind; + +struct _zend_ast { + unsigned short kind; + unsigned short children; + union { + zval *val; + zend_ast *child; + } u; +}; + +ZEND_API zend_ast *zend_ast_create_constant(zval *zv); + +ZEND_API zend_ast *zend_ast_create_unary(uint kind, zend_ast *op0); +ZEND_API zend_ast *zend_ast_create_binary(uint kind, zend_ast *op0, zend_ast *op1); +ZEND_API zend_ast *zend_ast_create_ternary(uint kind, zend_ast *op0, zend_ast *op1, zend_ast *op2); + +ZEND_API int zend_ast_is_ct_constant(zend_ast *ast); + +ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *scope TSRMLS_DC); + +ZEND_API zend_ast *zend_ast_copy(zend_ast *ast); +ZEND_API void zend_ast_destroy(zend_ast *ast); + +#endif diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index b2eb941fd8..0a478a7532 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -435,9 +435,7 @@ ZEND_FUNCTION(func_get_arg) } arg = *(p-(arg_count-requested_offset)); - *return_value = *arg; - zval_copy_ctor(return_value); - INIT_PZVAL(return_value); + RETURN_ZVAL_FAST(arg); } /* }}} */ @@ -461,12 +459,17 @@ ZEND_FUNCTION(func_get_args) array_init_size(return_value, arg_count); for (i=0; i<arg_count; i++) { - zval *element; + zval *element, *arg; - ALLOC_ZVAL(element); - *element = **((zval **) (p-(arg_count-i))); - zval_copy_ctor(element); - INIT_PZVAL(element); + arg = *((zval **) (p-(arg_count-i))); + if (!Z_ISREF_P(arg)) { + element = arg; + Z_ADDREF_P(element); + } else { + ALLOC_ZVAL(element); + INIT_PZVAL_COPY(element, arg); + zval_copy_ctor(element); + } zend_hash_next_index_insert(return_value->value.ht, &element, sizeof(zval *), NULL); } } @@ -606,9 +609,9 @@ ZEND_FUNCTION(each) Z_ADDREF_P(entry); /* add the key elements */ - switch (zend_hash_get_current_key_ex(target_hash, &string_key, &string_key_len, &num_key, 1, NULL)) { + switch (zend_hash_get_current_key_ex(target_hash, &string_key, &string_key_len, &num_key, 0, NULL)) { case HASH_KEY_IS_STRING: - add_get_index_stringl(return_value, 0, string_key, string_key_len-1, (void **) &inserted_pointer, 0); + add_get_index_stringl(return_value, 0, string_key, string_key_len-1, (void **) &inserted_pointer, !IS_INTERNED(string_key)); break; case HASH_KEY_IS_LONG: add_get_index_long(return_value, 0, num_key, (void **) &inserted_pointer); @@ -706,7 +709,7 @@ repeat: zval_ptr_dtor(&val_free); } c.flags = case_sensitive; /* non persistent */ - c.name = IS_INTERNED(name) ? name : zend_strndup(name, name_len); + c.name = str_strndup(name, name_len); if(c.name == NULL) { RETURN_FALSE; } @@ -943,11 +946,11 @@ static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value /* this is necessary to make it able to work with default array * properties, returned to user */ - if (Z_TYPE_P(prop_copy) == IS_CONSTANT_ARRAY || (Z_TYPE_P(prop_copy) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) { + if (IS_CONSTANT_TYPE(Z_TYPE_P(prop_copy))) { zval_update_constant(&prop_copy, 0 TSRMLS_CC); } - add_assoc_zval(return_value, key, prop_copy); + zend_hash_update(Z_ARRVAL_P(return_value), key, key_len, &prop_copy, sizeof(zval*), NULL); } } /* }}} */ @@ -1017,7 +1020,14 @@ ZEND_FUNCTION(get_object_vars) zend_unmangle_property_name_ex(key, key_len - 1, &class_name, &prop_name, (int*) &prop_len); /* Not separating references */ Z_ADDREF_PP(value); - add_assoc_zval_ex(return_value, prop_name, prop_len + 1, *value); + if (IS_INTERNED(key) && prop_name != key) { + /* we can't use substring of interned string as a new key */ + char *tmp = estrndup(prop_name, prop_len); + add_assoc_zval_ex(return_value, tmp, prop_len + 1, *value); + efree(tmp); + } else { + add_assoc_zval_ex(return_value, prop_name, prop_len + 1, *value); + } } } zend_hash_move_forward_ex(properties, &pos); @@ -1388,12 +1398,11 @@ ZEND_FUNCTION(function_exists) Creates an alias for user defined class */ ZEND_FUNCTION(class_alias) { - char *class_name, *lc_name, *alias_name; + char *class_name, *alias_name; zend_class_entry **ce; int class_name_len, alias_name_len; int found; zend_bool autoload = 1; - ALLOCA_FLAG(use_heap) if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", &class_name, &class_name_len, &alias_name, &alias_name_len, &autoload) == FAILURE) { return; @@ -1474,6 +1483,7 @@ ZEND_FUNCTION(crash) ZEND_FUNCTION(get_included_files) { char *entry; + uint entry_len; if (zend_parse_parameters_none() == FAILURE) { return; @@ -1481,8 +1491,8 @@ ZEND_FUNCTION(get_included_files) array_init(return_value); zend_hash_internal_pointer_reset(&EG(included_files)); - while (zend_hash_get_current_key(&EG(included_files), &entry, NULL, 1) == HASH_KEY_IS_STRING) { - add_next_index_string(return_value, entry, 0); + while (zend_hash_get_current_key_ex(&EG(included_files), &entry, &entry_len, NULL, 0, NULL) == HASH_KEY_IS_STRING) { + add_next_index_stringl(return_value, entry, entry_len-1, !IS_INTERNED(entry)); zend_hash_move_forward(&EG(included_files)); } } diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index 5faefbd224..fcad86f171 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -59,14 +59,8 @@ ZEND_METHOD(Closure, __invoke) /* {{{ */ } else if (call_user_function_ex(CG(function_table), NULL, this_ptr, &closure_result_ptr, ZEND_NUM_ARGS(), arguments, 1, NULL TSRMLS_CC) == FAILURE) { RETVAL_FALSE; } else if (closure_result_ptr) { - if (Z_ISREF_P(closure_result_ptr) && return_value_ptr) { - if (return_value) { - zval_ptr_dtor(&return_value); - } - *return_value_ptr = closure_result_ptr; - } else { - RETVAL_ZVAL(closure_result_ptr, 1, 1); - } + zval_ptr_dtor(&return_value); + *return_value_ptr = closure_result_ptr; } efree(arguments); diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index c5f3769216..d979d17f54 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -26,7 +26,7 @@ #include "zend_llist.h" #include "zend_API.h" #include "zend_exceptions.h" -#include "tsrm_virtual_cwd.h" +#include "zend_virtual_cwd.h" #include "zend_multibyte.h" #include "zend_language_scanner.h" @@ -61,11 +61,8 @@ } while (0) #define CALCULATE_LITERAL_HASH(num) do { \ - if (IS_INTERNED(Z_STRVAL(CONSTANT(num)))) { \ - Z_HASH_P(&CONSTANT(num)) = INTERNED_HASH(Z_STRVAL(CONSTANT(num))); \ - } else { \ - Z_HASH_P(&CONSTANT(num)) = zend_hash_func(Z_STRVAL(CONSTANT(num)), Z_STRLEN(CONSTANT(num))+1); \ - } \ + zval *c = &CONSTANT(num); \ + Z_HASH_P(c) = str_hash(Z_STRVAL_P(c), Z_STRLEN_P(c)); \ } while (0) #define GET_CACHE_SLOT(literal) do { \ @@ -107,9 +104,7 @@ ZEND_API zend_executor_globals executor_globals; static void zend_duplicate_property_info(zend_property_info *property_info) /* {{{ */ { - if (!IS_INTERNED(property_info->name)) { - property_info->name = estrndup(property_info->name, property_info->name_length); - } + property_info->name = str_estrndup(property_info->name, property_info->name_length); if (property_info->doc_comment) { property_info->doc_comment = estrndup(property_info->doc_comment, property_info->doc_comment_len); } @@ -118,9 +113,7 @@ static void zend_duplicate_property_info(zend_property_info *property_info) /* { static void zend_duplicate_property_info_internal(zend_property_info *property_info) /* {{{ */ { - if (!IS_INTERNED(property_info->name)) { - property_info->name = zend_strndup(property_info->name, property_info->name_length); - } + property_info->name = str_strndup(property_info->name, property_info->name_length); } /* }}} */ @@ -153,12 +146,12 @@ static void build_runtime_defined_function_key(zval *result, const char *name, i } /* NULL, name length, filename length, last accepting char position length */ - result->value.str.len = 1+name_length+strlen(filename)+char_pos_len; + Z_STRLEN_P(result) = 1+name_length+strlen(filename)+char_pos_len; /* must be binary safe */ - result->value.str.val = (char *) safe_emalloc(result->value.str.len, 1, 1); - result->value.str.val[0] = '\0'; - sprintf(result->value.str.val+1, "%s%s%s", name, filename, char_pos_buf); + Z_STRVAL_P(result) = (char *) safe_emalloc(Z_STRLEN_P(result), 1, 1); + Z_STRVAL_P(result)[0] = '\0'; + sprintf(Z_STRVAL_P(result)+1, "%s%s%s", name, filename, char_pos_buf); result->type = IS_STRING; Z_SET_REFCOUNT_P(result, 1); @@ -204,6 +197,9 @@ void zend_init_compiler_data_structures(TSRMLS_D) /* {{{ */ CG(in_namespace) = 0; CG(has_bracketed_namespaces) = 0; CG(current_import) = NULL; + CG(current_import_function) = NULL; + CG(current_import_const) = NULL; + zend_hash_init(&CG(const_filenames), 0, NULL, NULL, 0); init_compiler_declarables(TSRMLS_C); zend_stack_init(&CG(context_stack)); @@ -242,6 +238,7 @@ void shutdown_compiler(TSRMLS_D) /* {{{ */ zend_stack_destroy(&CG(list_stack)); zend_hash_destroy(&CG(filenames_table)); zend_llist_destroy(&CG(open_files)); + zend_hash_destroy(&CG(const_filenames)); zend_stack_destroy(&CG(context_stack)); } /* }}} */ @@ -424,12 +421,16 @@ int zend_add_ns_func_name_literal(zend_op_array *op_array, const zval *zv TSRMLS lc_literal = zend_add_literal(CG(active_op_array), &c TSRMLS_CC); CALCULATE_LITERAL_HASH(lc_literal); - ns_separator = (const char*)zend_memrchr(Z_STRVAL_P(zv), '\\', Z_STRLEN_P(zv)) + 1; - lc_len = Z_STRLEN_P(zv) - (ns_separator - Z_STRVAL_P(zv)); - lc_name = zend_str_tolower_dup(ns_separator, lc_len); - ZVAL_STRINGL(&c, lc_name, lc_len, 0); - lc_literal = zend_add_literal(CG(active_op_array), &c TSRMLS_CC); - CALCULATE_LITERAL_HASH(lc_literal); + ns_separator = (const char*)zend_memrchr(Z_STRVAL_P(zv), '\\', Z_STRLEN_P(zv)); + + if (ns_separator != NULL) { + ns_separator += 1; + lc_len = Z_STRLEN_P(zv) - (ns_separator - Z_STRVAL_P(zv)); + lc_name = zend_str_tolower_dup(ns_separator, lc_len); + ZVAL_STRINGL(&c, lc_name, lc_len, 0); + lc_literal = zend_add_literal(CG(active_op_array), &c TSRMLS_CC); + CALCULATE_LITERAL_HASH(lc_literal); + } return ret; } @@ -657,21 +658,21 @@ void fetch_simple_variable_ex(znode *result, znode *varname, int bp, zend_uchar zend_llist *fetch_list_ptr; if (varname->op_type == IS_CONST) { - ulong hash = 0; + ulong hash; if (Z_TYPE(varname->u.constant) != IS_STRING) { convert_to_string(&varname->u.constant); - } else if (IS_INTERNED(Z_STRVAL(varname->u.constant))) { - hash = INTERNED_HASH(Z_STRVAL(varname->u.constant)); } - if (!zend_is_auto_global_quick(varname->u.constant.value.str.val, varname->u.constant.value.str.len, hash TSRMLS_CC) && - !(varname->u.constant.value.str.len == (sizeof("this")-1) && - !memcmp(varname->u.constant.value.str.val, "this", sizeof("this"))) && + + hash = str_hash(Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant)); + if (!zend_is_auto_global_quick(Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant), hash TSRMLS_CC) && + !(Z_STRLEN(varname->u.constant) == (sizeof("this")-1) && + !memcmp(Z_STRVAL(varname->u.constant), "this", sizeof("this"))) && (CG(active_op_array)->last == 0 || CG(active_op_array)->opcodes[CG(active_op_array)->last-1].opcode != ZEND_BEGIN_SILENCE)) { result->op_type = IS_CV; - result->u.op.var = lookup_cv(CG(active_op_array), varname->u.constant.value.str.val, varname->u.constant.value.str.len, hash TSRMLS_CC); - varname->u.constant.value.str.val = (char*)CG(active_op_array)->vars[result->u.op.var].name; + result->u.op.var = lookup_cv(CG(active_op_array), Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant), hash TSRMLS_CC); + Z_STRVAL(varname->u.constant) = (char*)CG(active_op_array)->vars[result->u.op.var].name; result->EA = 0; return; } @@ -694,7 +695,7 @@ void fetch_simple_variable_ex(znode *result, znode *varname, int bp, zend_uchar if (varname->op_type == IS_CONST) { CALCULATE_LITERAL_HASH(opline_ptr->op1.constant); - if (zend_is_auto_global_quick(varname->u.constant.value.str.val, varname->u.constant.value.str.len, Z_HASH_P(&CONSTANT(opline_ptr->op1.constant)) TSRMLS_CC)) { + if (zend_is_auto_global_quick(Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant), Z_HASH_P(&CONSTANT(opline_ptr->op1.constant)) TSRMLS_CC)) { opline_ptr->extended_value = ZEND_FETCH_GLOBAL; } } @@ -723,7 +724,7 @@ void zend_do_fetch_static_member(znode *result, znode *class_name TSRMLS_DC) /* if (class_name->op_type == IS_CONST && ZEND_FETCH_CLASS_DEFAULT == zend_get_class_fetch_type(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant))) { - zend_resolve_class_name(class_name, ZEND_FETCH_CLASS_GLOBAL, 1 TSRMLS_CC); + zend_resolve_class_name(class_name TSRMLS_CC); class_node = *class_name; } else { zend_do_fetch_class(&class_node, class_name TSRMLS_CC); @@ -882,9 +883,9 @@ void zend_do_abstract_method(const znode *function_name, znode *modifiers, const method_type = "Abstract"; } - if (modifiers->u.constant.value.lval & ZEND_ACC_ABSTRACT) { - if(modifiers->u.constant.value.lval & ZEND_ACC_PRIVATE) { - zend_error(E_COMPILE_ERROR, "%s function %s::%s() cannot be declared private", method_type, CG(active_class_entry)->name, function_name->u.constant.value.str.val); + if (Z_LVAL(modifiers->u.constant) & ZEND_ACC_ABSTRACT) { + if(Z_LVAL(modifiers->u.constant) & ZEND_ACC_PRIVATE) { + zend_error_noreturn(E_COMPILE_ERROR, "%s function %s::%s() cannot be declared private", method_type, CG(active_class_entry)->name, Z_STRVAL(function_name->u.constant)); } if (Z_LVAL(body->u.constant) == ZEND_ACC_ABSTRACT) { zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); @@ -894,11 +895,11 @@ void zend_do_abstract_method(const znode *function_name, znode *modifiers, const SET_UNUSED(opline->op2); } else { /* we had code in the function body */ - zend_error(E_COMPILE_ERROR, "%s function %s::%s() cannot contain body", method_type, CG(active_class_entry)->name, function_name->u.constant.value.str.val); + zend_error_noreturn(E_COMPILE_ERROR, "%s function %s::%s() cannot contain body", method_type, CG(active_class_entry)->name, Z_STRVAL(function_name->u.constant)); } } else { - if (body->u.constant.value.lval == ZEND_ACC_ABSTRACT) { - zend_error(E_COMPILE_ERROR, "Non-abstract method %s::%s() must contain body", CG(active_class_entry)->name, function_name->u.constant.value.str.val); + if (Z_LVAL(body->u.constant) == ZEND_ACC_ABSTRACT) { + zend_error_noreturn(E_COMPILE_ERROR, "Non-abstract method %s::%s() must contain body", CG(active_class_entry)->name, Z_STRVAL(function_name->u.constant)); } } } @@ -958,7 +959,7 @@ void zend_do_assign(znode *result, znode *variable, znode *value TSRMLS_DC) /* { if (variable->op_type == IS_CV) { if (variable->u.op.var == CG(active_op_array)->this_var) { - zend_error(E_COMPILE_ERROR, "Cannot re-assign $this"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot re-assign $this"); } } else if (variable->op_type == IS_VAR) { int n = 0; @@ -1004,7 +1005,7 @@ void zend_do_assign(znode *result, znode *variable, znode *value TSRMLS_DC) /* { GET_NODE(result, last_op->result); return; } else if (opline_is_fetch_this(last_op TSRMLS_CC)) { - zend_error(E_COMPILE_ERROR, "Cannot re-assign $this"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot re-assign $this"); } else { break; } @@ -1028,7 +1029,7 @@ void zend_do_assign_ref(znode *result, const znode *lvar, const znode *rvar TSRM if (lvar->op_type == IS_CV) { if (lvar->u.op.var == CG(active_op_array)->this_var) { - zend_error(E_COMPILE_ERROR, "Cannot re-assign $this"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot re-assign $this"); } } else if (lvar->op_type == IS_VAR) { int last_op_number = get_next_op_number(CG(active_op_array)); @@ -1036,7 +1037,7 @@ void zend_do_assign_ref(znode *result, const znode *lvar, const znode *rvar TSRM if (last_op_number > 0) { opline = &CG(active_op_array)->opcodes[last_op_number-1]; if (opline_is_fetch_this(opline TSRMLS_CC)) { - zend_error(E_COMPILE_ERROR, "Cannot re-assign $this"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot re-assign $this"); } } } @@ -1278,10 +1279,10 @@ void zend_check_writable_variable(const znode *variable) /* {{{ */ zend_uint type = variable->EA; if (type & ZEND_PARSED_METHOD_CALL) { - zend_error(E_COMPILE_ERROR, "Can't use method return value in write context"); + zend_error_noreturn(E_COMPILE_ERROR, "Can't use method return value in write context"); } if (type == ZEND_PARSED_FUNCTION_CALL) { - zend_error(E_COMPILE_ERROR, "Can't use function return value in write context"); + zend_error_noreturn(E_COMPILE_ERROR, "Can't use function return value in write context"); } } /* }}} */ @@ -1354,7 +1355,7 @@ void zend_do_end_variable_parse(znode *variable, int type, int arg_offset TSRMLS switch (type) { case BP_VAR_R: if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2_type == IS_UNUSED) { - zend_error(E_COMPILE_ERROR, "Cannot use [] for reading"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use [] for reading"); } opline->opcode -= 3; break; @@ -1365,7 +1366,7 @@ void zend_do_end_variable_parse(znode *variable, int type, int arg_offset TSRMLS break; case BP_VAR_IS: if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2_type == IS_UNUSED) { - zend_error(E_COMPILE_ERROR, "Cannot use [] for reading"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use [] for reading"); } opline->opcode += 6; /* 3+3 */ break; @@ -1375,7 +1376,7 @@ void zend_do_end_variable_parse(znode *variable, int type, int arg_offset TSRMLS break; case BP_VAR_UNSET: if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2_type == IS_UNUSED) { - zend_error(E_COMPILE_ERROR, "Cannot use [] for unsetting"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use [] for unsetting"); } opline->opcode += 12; /* 3+3+3+3 */ break; @@ -1503,22 +1504,22 @@ int zend_do_verify_access_types(const znode *current_access_type, const znode *n { if ((Z_LVAL(current_access_type->u.constant) & ZEND_ACC_PPP_MASK) && (Z_LVAL(new_modifier->u.constant) & ZEND_ACC_PPP_MASK)) { - zend_error(E_COMPILE_ERROR, "Multiple access type modifiers are not allowed"); + zend_error_noreturn(E_COMPILE_ERROR, "Multiple access type modifiers are not allowed"); } if ((Z_LVAL(current_access_type->u.constant) & ZEND_ACC_ABSTRACT) && (Z_LVAL(new_modifier->u.constant) & ZEND_ACC_ABSTRACT)) { - zend_error(E_COMPILE_ERROR, "Multiple abstract modifiers are not allowed"); + zend_error_noreturn(E_COMPILE_ERROR, "Multiple abstract modifiers are not allowed"); } if ((Z_LVAL(current_access_type->u.constant) & ZEND_ACC_STATIC) && (Z_LVAL(new_modifier->u.constant) & ZEND_ACC_STATIC)) { - zend_error(E_COMPILE_ERROR, "Multiple static modifiers are not allowed"); + zend_error_noreturn(E_COMPILE_ERROR, "Multiple static modifiers are not allowed"); } if ((Z_LVAL(current_access_type->u.constant) & ZEND_ACC_FINAL) && (Z_LVAL(new_modifier->u.constant) & ZEND_ACC_FINAL)) { - zend_error(E_COMPILE_ERROR, "Multiple final modifiers are not allowed"); + zend_error_noreturn(E_COMPILE_ERROR, "Multiple final modifiers are not allowed"); } if (((Z_LVAL(current_access_type->u.constant) | Z_LVAL(new_modifier->u.constant)) & (ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL)) == (ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL)) { - zend_error(E_COMPILE_ERROR, "Cannot use the final modifier on an abstract class member"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use the final modifier on an abstract class member"); } return (Z_LVAL(current_access_type->u.constant) | Z_LVAL(new_modifier->u.constant)); } @@ -1527,8 +1528,8 @@ int zend_do_verify_access_types(const znode *current_access_type, const znode *n void zend_do_begin_function_declaration(znode *function_token, znode *function_name, int is_method, int return_reference, znode *fn_flags_znode TSRMLS_DC) /* {{{ */ { zend_op_array op_array; - char *name = function_name->u.constant.value.str.val; - int name_len = function_name->u.constant.value.str.len; + char *name = Z_STRVAL(function_name->u.constant); + int name_len = Z_STRLEN(function_name->u.constant); int function_begin_line = function_token->u.op.opline_num; zend_uint fn_flags; const char *lcname; @@ -1538,7 +1539,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n if (is_method) { if (CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE) { if ((Z_LVAL(fn_flags_znode->u.constant) & ~(ZEND_ACC_STATIC|ZEND_ACC_PUBLIC))) { - zend_error(E_COMPILE_ERROR, "Access type for interface method %s::%s() must be omitted", CG(active_class_entry)->name, function_name->u.constant.value.str.val); + zend_error_noreturn(E_COMPILE_ERROR, "Access type for interface method %s::%s() must be omitted", CG(active_class_entry)->name, Z_STRVAL(function_name->u.constant)); } Z_LVAL(fn_flags_znode->u.constant) |= ZEND_ACC_ABSTRACT; /* propagates to the rest of the parser */ } @@ -1569,17 +1570,12 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n op_array.line_start = zend_get_compiled_lineno(TSRMLS_C); if (is_method) { - int result; + zend_ulong hash; lcname = zend_new_interned_string(zend_str_tolower_dup(name, name_len), name_len + 1, 1 TSRMLS_CC); - - if (IS_INTERNED(lcname)) { - result = zend_hash_quick_add(&CG(active_class_entry)->function_table, lcname, name_len+1, INTERNED_HASH(lcname), &op_array, sizeof(zend_op_array), (void **) &CG(active_op_array)); - } else { - result = zend_hash_add(&CG(active_class_entry)->function_table, lcname, name_len+1, &op_array, sizeof(zend_op_array), (void **) &CG(active_op_array)); - } - if (result == FAILURE) { - zend_error(E_COMPILE_ERROR, "Cannot redeclare %s::%s()", CG(active_class_entry)->name, name); + hash = str_hash(lcname, name_len); + if (zend_hash_quick_add(&CG(active_class_entry)->function_table, lcname, name_len+1, hash, &op_array, sizeof(zend_op_array), (void **) &CG(active_op_array)) == FAILURE) { + zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare %s::%s()", CG(active_class_entry)->name, name); } zend_stack_push(&CG(context_stack), (void *) &CG(context), sizeof(CG(context))); @@ -1696,6 +1692,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n } else { zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); zval key; + zval **ns_name; if (CG(current_namespace)) { /* Prefix function name with current namespace name */ @@ -1711,18 +1708,32 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n lcname = zend_str_tolower_dup(name, name_len); } + /* Function name must not conflict with import names */ + if (CG(current_import_function) && + zend_hash_find(CG(current_import_function), lcname, Z_STRLEN(function_name->u.constant)+1, (void**)&ns_name) == SUCCESS) { + + char *tmp = zend_str_tolower_dup(Z_STRVAL_PP(ns_name), Z_STRLEN_PP(ns_name)); + + if (Z_STRLEN_PP(ns_name) != Z_STRLEN(function_name->u.constant) || + memcmp(tmp, lcname, Z_STRLEN(function_name->u.constant))) { + zend_error(E_COMPILE_ERROR, "Cannot declare function %s because the name is already in use", Z_STRVAL(function_name->u.constant)); + } + efree(tmp); + } + opline->opcode = ZEND_DECLARE_FUNCTION; opline->op1_type = IS_CONST; build_runtime_defined_function_key(&key, lcname, name_len TSRMLS_CC); opline->op1.constant = zend_add_literal(CG(active_op_array), &key TSRMLS_CC); Z_HASH_P(&CONSTANT(opline->op1.constant)) = zend_hash_func(Z_STRVAL(CONSTANT(opline->op1.constant)), Z_STRLEN(CONSTANT(opline->op1.constant))); opline->op2_type = IS_CONST; - LITERAL_STRINGL(opline->op2, lcname, name_len, 0); + LITERAL_STRINGL(opline->op2, lcname, name_len, 1); CALCULATE_LITERAL_HASH(opline->op2.constant); opline->extended_value = ZEND_DECLARE_FUNCTION; zend_hash_quick_update(CG(function_table), Z_STRVAL(key), Z_STRLEN(key), Z_HASH_P(&CONSTANT(opline->op1.constant)), &op_array, sizeof(zend_op_array), (void **) &CG(active_op_array)); zend_stack_push(&CG(context_stack), (void *) &CG(context), sizeof(CG(context))); zend_init_compiler_context(TSRMLS_C); + str_efree(lcname); } if (CG(compiler_options) & ZEND_COMPILE_EXTENDED_INFO) { @@ -1820,7 +1831,7 @@ void zend_do_end_function_declaration(const znode *function_token TSRMLS_DC) /* zend_str_tolower_copy(lcname, CG(active_op_array)->function_name, MIN(name_len, sizeof(lcname)-1)); lcname[sizeof(lcname)-1] = '\0'; /* zend_str_tolower_copy won't necessarily set the zero byte */ if (name_len == sizeof(ZEND_AUTOLOAD_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_AUTOLOAD_FUNC_NAME, sizeof(ZEND_AUTOLOAD_FUNC_NAME)) && CG(active_op_array)->num_args != 1) { - zend_error(E_COMPILE_ERROR, "%s() must take exactly 1 argument", ZEND_AUTOLOAD_FUNC_NAME); + zend_error_noreturn(E_COMPILE_ERROR, "%s() must take exactly 1 argument", ZEND_AUTOLOAD_FUNC_NAME); } } @@ -1834,26 +1845,17 @@ void zend_do_end_function_declaration(const znode *function_token TSRMLS_DC) /* } /* }}} */ -void zend_do_receive_arg(zend_uchar op, znode *varname, const znode *offset, const znode *initialization, znode *class_type, zend_uchar pass_by_reference TSRMLS_DC) /* {{{ */ +void zend_do_receive_param(zend_uchar op, znode *varname, const znode *initialization, znode *class_type, zend_uchar pass_by_reference, zend_bool is_variadic TSRMLS_DC) /* {{{ */ { zend_op *opline; zend_arg_info *cur_arg_info; znode var; - if (class_type->op_type == IS_CONST && - Z_TYPE(class_type->u.constant) == IS_STRING && - Z_STRLEN(class_type->u.constant) == 0) { - /* Usage of namespace as class name not in namespace */ - zval_dtor(&class_type->u.constant); - zend_error(E_COMPILE_ERROR, "Cannot use 'namespace' as a class name"); - return; - } - - if (zend_is_auto_global_quick(Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant), 0 TSRMLS_CC)) { - zend_error(E_COMPILE_ERROR, "Cannot re-assign auto-global variable %s", Z_STRVAL(varname->u.constant)); + if (zend_is_auto_global(Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant) TSRMLS_CC)) { + zend_error_noreturn(E_COMPILE_ERROR, "Cannot re-assign auto-global variable %s", Z_STRVAL(varname->u.constant)); } else { var.op_type = IS_CV; - var.u.op.var = lookup_cv(CG(active_op_array), varname->u.constant.value.str.val, varname->u.constant.value.str.len, 0 TSRMLS_CC); + var.u.op.var = lookup_cv(CG(active_op_array), Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant), 0 TSRMLS_CC); Z_STRVAL(varname->u.constant) = (char*)CG(active_op_array)->vars[var.u.op.var].name; var.EA = 0; if (CG(active_op_array)->vars[var.u.op.var].hash_value == THIS_HASHVAL && @@ -1861,30 +1863,47 @@ void zend_do_receive_arg(zend_uchar op, znode *varname, const znode *offset, con !memcmp(Z_STRVAL(varname->u.constant), "this", sizeof("this")-1)) { if (CG(active_op_array)->scope && (CG(active_op_array)->fn_flags & ZEND_ACC_STATIC) == 0) { - zend_error(E_COMPILE_ERROR, "Cannot re-assign $this"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot re-assign $this"); } CG(active_op_array)->this_var = var.u.op.var; } } + if (CG(active_op_array)->fn_flags & ZEND_ACC_VARIADIC) { + zend_error_noreturn(E_COMPILE_ERROR, "Only the last parameter can be variadic"); + } + + if (is_variadic) { + if (op == ZEND_RECV_INIT) { + zend_error_noreturn(E_COMPILE_ERROR, "Variadic parameter cannot have a default value"); + } + + op = ZEND_RECV_VARIADIC; + CG(active_op_array)->fn_flags |= ZEND_ACC_VARIADIC; + } + opline = get_next_op(CG(active_op_array) TSRMLS_CC); CG(active_op_array)->num_args++; opline->opcode = op; SET_NODE(opline->result, &var); - SET_NODE(opline->op1, offset); + opline->op1_type = IS_UNUSED; + opline->op1.num = CG(active_op_array)->num_args; if (op == ZEND_RECV_INIT) { SET_NODE(opline->op2, initialization); } else { - CG(active_op_array)->required_num_args = CG(active_op_array)->num_args; SET_UNUSED(opline->op2); + if (!is_variadic) { + CG(active_op_array)->required_num_args = CG(active_op_array)->num_args; + } } CG(active_op_array)->arg_info = erealloc(CG(active_op_array)->arg_info, sizeof(zend_arg_info)*(CG(active_op_array)->num_args)); cur_arg_info = &CG(active_op_array)->arg_info[CG(active_op_array)->num_args-1]; - cur_arg_info->name = zend_new_interned_string(estrndup(varname->u.constant.value.str.val, varname->u.constant.value.str.len), varname->u.constant.value.str.len + 1, 1 TSRMLS_CC); - cur_arg_info->name_len = varname->u.constant.value.str.len; + cur_arg_info->name = zend_new_interned_string(estrndup(Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant)), Z_STRLEN(varname->u.constant) + 1, 1 TSRMLS_CC); + cur_arg_info->name_len = Z_STRLEN(varname->u.constant); cur_arg_info->type_hint = 0; - cur_arg_info->allow_null = 1; cur_arg_info->pass_by_reference = pass_by_reference; + cur_arg_info->allow_null = 1; + cur_arg_info->is_variadic = is_variadic; cur_arg_info->class_name = NULL; cur_arg_info->class_name_len = 0; @@ -1895,34 +1914,34 @@ void zend_do_receive_arg(zend_uchar op, znode *varname, const znode *offset, con if (class_type->u.constant.type == IS_ARRAY) { cur_arg_info->type_hint = IS_ARRAY; if (op == ZEND_RECV_INIT) { - if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL"))) { + if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL")) || Z_TYPE(initialization->u.constant) == IS_CONSTANT_AST) { cur_arg_info->allow_null = 1; } else if (Z_TYPE(initialization->u.constant) != IS_ARRAY && Z_TYPE(initialization->u.constant) != IS_CONSTANT_ARRAY) { - zend_error(E_COMPILE_ERROR, "Default value for parameters with array type hint can only be an array or NULL"); + zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters with array type hint can only be an array or NULL"); } } } else if (class_type->u.constant.type == IS_CALLABLE) { cur_arg_info->type_hint = IS_CALLABLE; if (op == ZEND_RECV_INIT) { - if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL"))) { + if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL")) || Z_TYPE(initialization->u.constant) == IS_CONSTANT_AST) { cur_arg_info->allow_null = 1; } else { - zend_error(E_COMPILE_ERROR, "Default value for parameters with callable type hint can only be NULL"); + zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters with callable type hint can only be NULL"); } } } else { cur_arg_info->type_hint = IS_OBJECT; if (ZEND_FETCH_CLASS_DEFAULT == zend_get_class_fetch_type(Z_STRVAL(class_type->u.constant), Z_STRLEN(class_type->u.constant))) { - zend_resolve_class_name(class_type, opline->extended_value, 1 TSRMLS_CC); + zend_resolve_class_name(class_type TSRMLS_CC); } - Z_STRVAL(class_type->u.constant) = (char*)zend_new_interned_string(class_type->u.constant.value.str.val, class_type->u.constant.value.str.len + 1, 1 TSRMLS_CC); - cur_arg_info->class_name = class_type->u.constant.value.str.val; - cur_arg_info->class_name_len = class_type->u.constant.value.str.len; + Z_STRVAL(class_type->u.constant) = (char*)zend_new_interned_string(Z_STRVAL(class_type->u.constant), Z_STRLEN(class_type->u.constant) + 1, 1 TSRMLS_CC); + cur_arg_info->class_name = Z_STRVAL(class_type->u.constant); + cur_arg_info->class_name_len = Z_STRLEN(class_type->u.constant); if (op == ZEND_RECV_INIT) { - if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL"))) { + if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL")) || Z_TYPE(initialization->u.constant) == IS_CONSTANT_AST) { cur_arg_info->allow_null = 1; } else { - zend_error(E_COMPILE_ERROR, "Default value for parameters with a class type hint can only be NULL"); + zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters with a class type hint can only be NULL"); } } } @@ -1937,7 +1956,7 @@ int zend_do_begin_function_call(znode *function_name, zend_bool check_namespace char *lcname; char *is_compound = memchr(Z_STRVAL(function_name->u.constant), '\\', Z_STRLEN(function_name->u.constant)); - zend_resolve_non_class_name(function_name, check_namespace TSRMLS_CC); + zend_resolve_function_name(function_name, &check_namespace TSRMLS_CC); if (check_namespace && CG(current_namespace) && !is_compound) { /* We assume we call function from the current namespace @@ -1949,16 +1968,16 @@ int zend_do_begin_function_call(znode *function_name, zend_bool check_namespace return 1; } - lcname = zend_str_tolower_dup(function_name->u.constant.value.str.val, function_name->u.constant.value.str.len); - if ((zend_hash_find(CG(function_table), lcname, function_name->u.constant.value.str.len+1, (void **) &function)==FAILURE) || + lcname = zend_str_tolower_dup(Z_STRVAL(function_name->u.constant), Z_STRLEN(function_name->u.constant)); + if ((zend_hash_find(CG(function_table), lcname, Z_STRLEN(function_name->u.constant)+1, (void **) &function)==FAILURE) || ((CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_FUNCTIONS) && (function->type == ZEND_INTERNAL_FUNCTION))) { zend_do_begin_dynamic_function_call(function_name, 0 TSRMLS_CC); efree(lcname); return 1; /* Dynamic */ } - efree(function_name->u.constant.value.str.val); - function_name->u.constant.value.str.val = lcname; + efree(Z_STRVAL(function_name->u.constant)); + Z_STRVAL(function_name->u.constant) = lcname; zend_stack_push(&CG(function_call_stack), (void *) &function, sizeof(zend_function *)); if (CG(context).nested_calls + 1 > CG(active_op_array)->nested_calls) { @@ -1983,7 +2002,7 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC) /* {{{ */ if ((last_op->op2_type == IS_CONST) && (Z_TYPE(CONSTANT(last_op->op2.constant)) == IS_STRING) && (Z_STRLEN(CONSTANT(last_op->op2.constant)) == sizeof(ZEND_CLONE_FUNC_NAME)-1) && !zend_binary_strcasecmp(Z_STRVAL(CONSTANT(last_op->op2.constant)), Z_STRLEN(CONSTANT(last_op->op2.constant)), ZEND_CLONE_FUNC_NAME, sizeof(ZEND_CLONE_FUNC_NAME)-1)) { - zend_error(E_COMPILE_ERROR, "Cannot call __clone() method on objects - use 'clone $obj' instead"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot call __clone() method on objects - use 'clone $obj' instead"); } if (last_op->opcode == ZEND_FETCH_OBJ_R) { @@ -1991,11 +2010,9 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC) /* {{{ */ zval name; name = CONSTANT(last_op->op2.constant); if (Z_TYPE(name) != IS_STRING) { - zend_error(E_COMPILE_ERROR, "Method name must be a string"); - } - if (!IS_INTERNED(Z_STRVAL(name))) { - Z_STRVAL(name) = estrndup(Z_STRVAL(name), Z_STRLEN(name)); + zend_error_noreturn(E_COMPILE_ERROR, "Method name must be a string"); } + Z_STRVAL(name) = str_estrndup(Z_STRVAL(name), Z_STRLEN(name)); FREE_POLYMORPHIC_CACHE_SLOT(last_op->op2.constant); last_op->op2.constant = zend_add_func_name_literal(CG(active_op_array), &name TSRMLS_CC); @@ -2076,12 +2093,12 @@ void zend_do_begin_dynamic_function_call(znode *function_name, int ns_call TSRML } /* }}} */ -void zend_resolve_non_class_name(znode *element_name, zend_bool check_namespace TSRMLS_DC) /* {{{ */ +void zend_resolve_non_class_name(znode *element_name, zend_bool *check_namespace, zend_bool case_sensitive, HashTable *current_import_sub TSRMLS_DC) /* {{{ */ { znode tmp; int len; zval **ns; - char *lcname, *compound = memchr(Z_STRVAL(element_name->u.constant), '\\', Z_STRLEN(element_name->u.constant)); + char *lookup_name, *compound = memchr(Z_STRVAL(element_name->u.constant), '\\', Z_STRLEN(element_name->u.constant)); if (Z_STRVAL(element_name->u.constant)[0] == '\\') { /* name starts with \ so it is known and unambiguos, nothing to do here but shorten it */ @@ -2090,15 +2107,35 @@ void zend_resolve_non_class_name(znode *element_name, zend_bool check_namespace return; } - if(!check_namespace) { + if(!*check_namespace) { return; } + if (current_import_sub) { + len = Z_STRLEN(element_name->u.constant)+1; + if (case_sensitive) { + lookup_name = estrndup(Z_STRVAL(element_name->u.constant), len); + } else { + lookup_name = zend_str_tolower_dup(Z_STRVAL(element_name->u.constant), len); + } + /* Check if function/const matches imported name */ + if (zend_hash_find(current_import_sub, lookup_name, len, (void**)&ns) == SUCCESS) { + zval_dtor(&element_name->u.constant); + element_name->u.constant = **ns; + zval_copy_ctor(&element_name->u.constant); + efree(lookup_name); + *check_namespace = 0; + return; + } + efree(lookup_name); + } + if (compound && CG(current_import)) { len = compound - Z_STRVAL(element_name->u.constant); - lcname = zend_str_tolower_dup(Z_STRVAL(element_name->u.constant), len); + /* namespace is always lowercase */ + lookup_name = zend_str_tolower_dup(Z_STRVAL(element_name->u.constant), len); /* Check if first part of compound name is an import name */ - if (zend_hash_find(CG(current_import), lcname, len+1, (void**)&ns) == SUCCESS) { + if (zend_hash_find(CG(current_import), lookup_name, len+1, (void**)&ns) == SUCCESS) { /* Substitute import name */ tmp.op_type = IS_CONST; tmp.u.constant = **ns; @@ -2108,10 +2145,11 @@ void zend_resolve_non_class_name(znode *element_name, zend_bool check_namespace memmove(Z_STRVAL(element_name->u.constant), Z_STRVAL(element_name->u.constant)+len, Z_STRLEN(element_name->u.constant)+1); zend_do_build_namespace_name(&tmp, &tmp, element_name TSRMLS_CC); *element_name = tmp; - efree(lcname); + efree(lookup_name); + *check_namespace = 0; return; } - efree(lcname); + efree(lookup_name); } if (CG(current_namespace)) { @@ -2121,24 +2159,36 @@ void zend_resolve_non_class_name(znode *element_name, zend_bool check_namespace memcpy(Z_STRVAL(tmp.u.constant), Z_STRVAL_P(CG(current_namespace)), Z_STRLEN_P(CG(current_namespace))); memcpy(&(Z_STRVAL(tmp.u.constant)[Z_STRLEN_P(CG(current_namespace))]), "\\", sizeof("\\")-1); memcpy(&(Z_STRVAL(tmp.u.constant)[Z_STRLEN_P(CG(current_namespace)) + sizeof("\\")-1]), Z_STRVAL(element_name->u.constant), Z_STRLEN(element_name->u.constant)+1); - STR_FREE(Z_STRVAL(element_name->u.constant)); + str_efree(Z_STRVAL(element_name->u.constant)); *element_name = tmp; } } /* }}} */ +void zend_resolve_function_name(znode *element_name, zend_bool *check_namespace TSRMLS_DC) /* {{{ */ +{ + zend_resolve_non_class_name(element_name, check_namespace, 0, CG(current_import_function) TSRMLS_CC); +} +/* }}} */ + +void zend_resolve_const_name(znode *element_name, zend_bool *check_namespace TSRMLS_DC) /* {{{ */ +{ + zend_resolve_non_class_name(element_name, check_namespace, 1, CG(current_import_const) TSRMLS_CC); +} +/* }}} */ + void zend_do_resolve_class_name(znode *result, znode *class_name, int is_static TSRMLS_DC) /* {{{ */ { char *lcname; int lctype; znode constant_name; - lcname = zend_str_tolower_dup(Z_STRVAL(class_name->u.constant), class_name->u.constant.value.str.len); + lcname = zend_str_tolower_dup(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant)); lctype = zend_get_class_fetch_type(lcname, strlen(lcname)); switch (lctype) { case ZEND_FETCH_CLASS_SELF: if (!CG(active_class_entry)) { - zend_error(E_COMPILE_ERROR, "Cannot access self::class when no class scope is active"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot access self::class when no class scope is active"); } zval_dtor(&class_name->u.constant); class_name->op_type = IS_CONST; @@ -2148,13 +2198,13 @@ void zend_do_resolve_class_name(znode *result, znode *class_name, int is_static case ZEND_FETCH_CLASS_STATIC: case ZEND_FETCH_CLASS_PARENT: if (is_static) { - zend_error(E_COMPILE_ERROR, + zend_error_noreturn(E_COMPILE_ERROR, "%s::class cannot be used for compile-time class name resolution", lctype == ZEND_FETCH_CLASS_STATIC ? "static" : "parent" ); } if (!CG(active_class_entry)) { - zend_error(E_COMPILE_ERROR, + zend_error_noreturn(E_COMPILE_ERROR, "Cannot access %s::class when no class scope is active", lctype == ZEND_FETCH_CLASS_STATIC ? "static" : "parent" ); @@ -2164,7 +2214,7 @@ void zend_do_resolve_class_name(znode *result, znode *class_name, int is_static zend_do_fetch_constant(result, class_name, &constant_name, ZEND_RT, 1 TSRMLS_CC); break; case ZEND_FETCH_CLASS_DEFAULT: - zend_resolve_class_name(class_name, ZEND_FETCH_CLASS_GLOBAL, 1 TSRMLS_CC); + zend_resolve_class_name(class_name TSRMLS_CC); *result = *class_name; break; } @@ -2174,7 +2224,7 @@ void zend_do_resolve_class_name(znode *result, znode *class_name, int is_static } /* }}} */ -void zend_resolve_class_name(znode *class_name, ulong fetch_type, int check_ns_name TSRMLS_DC) /* {{{ */ +void zend_resolve_class_name(znode *class_name TSRMLS_DC) /* {{{ */ { char *compound; char *lcname; @@ -2194,7 +2244,7 @@ void zend_resolve_class_name(znode *class_name, ulong fetch_type, int check_ns_n Z_STRLEN(class_name->u.constant) + 1); if (ZEND_FETCH_CLASS_DEFAULT != zend_get_class_fetch_type(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant))) { - zend_error(E_COMPILE_ERROR, "'\\%s' is an invalid class name", Z_STRVAL(class_name->u.constant)); + zend_error_noreturn(E_COMPILE_ERROR, "'\\%s' is an invalid class name", Z_STRVAL(class_name->u.constant)); } } else { if (CG(current_import)) { @@ -2253,26 +2303,17 @@ void zend_do_fetch_class(znode *result, znode *class_name TSRMLS_DC) /* {{{ */ long fetch_class_op_number; zend_op *opline; - if (class_name->op_type == IS_CONST && - Z_TYPE(class_name->u.constant) == IS_STRING && - Z_STRLEN(class_name->u.constant) == 0) { - /* Usage of namespace as class name not in namespace */ - zval_dtor(&class_name->u.constant); - zend_error(E_COMPILE_ERROR, "Cannot use 'namespace' as a class name"); - return; - } - fetch_class_op_number = get_next_op_number(CG(active_op_array)); opline = get_next_op(CG(active_op_array) TSRMLS_CC); opline->opcode = ZEND_FETCH_CLASS; SET_UNUSED(opline->op1); - opline->extended_value = ZEND_FETCH_CLASS_GLOBAL; + opline->extended_value = ZEND_FETCH_CLASS_DEFAULT; CG(catch_begin) = fetch_class_op_number; if (class_name->op_type == IS_CONST) { int fetch_type; - fetch_type = zend_get_class_fetch_type(class_name->u.constant.value.str.val, class_name->u.constant.value.str.len); + fetch_type = zend_get_class_fetch_type(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant)); switch (fetch_type) { case ZEND_FETCH_CLASS_SELF: case ZEND_FETCH_CLASS_PARENT: @@ -2282,7 +2323,7 @@ void zend_do_fetch_class(znode *result, znode *class_name TSRMLS_DC) /* {{{ */ zval_dtor(&class_name->u.constant); break; default: - zend_resolve_class_name(class_name, opline->extended_value, 0 TSRMLS_CC); + zend_resolve_class_name(class_name TSRMLS_CC); opline->op2_type = IS_CONST; opline->op2.constant = zend_add_class_name_literal(CG(active_op_array), &class_name->u.constant TSRMLS_CC); @@ -2311,7 +2352,7 @@ void zend_do_label(znode *label TSRMLS_DC) /* {{{ */ dest.opline_num = get_next_op_number(CG(active_op_array)); if (zend_hash_add(CG(context).labels, Z_STRVAL(label->u.constant), Z_STRLEN(label->u.constant) + 1, (void**)&dest, sizeof(zend_label), NULL) == FAILURE) { - zend_error(E_COMPILE_ERROR, "Label '%s' already defined", Z_STRVAL(label->u.constant)); + zend_error_noreturn(E_COMPILE_ERROR, "Label '%s' already defined", Z_STRVAL(label->u.constant)); } /* Done with label now */ @@ -2337,7 +2378,7 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline, int pass2 CG(in_compilation) = 1; CG(active_op_array) = op_array; CG(zend_lineno) = opline->lineno; - zend_error(E_COMPILE_ERROR, "'goto' to undefined label '%s'", Z_STRVAL_P(label)); + zend_error_noreturn(E_COMPILE_ERROR, "'goto' to undefined label '%s'", Z_STRVAL_P(label)); } else { /* Label is not defined. Delay to pass 2. */ INC_BPC(op_array); @@ -2358,7 +2399,7 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline, int pass2 CG(active_op_array) = op_array; CG(zend_lineno) = opline->lineno; } - zend_error(E_COMPILE_ERROR, "'goto' into loop or switch statement is disallowed"); + zend_error_noreturn(E_COMPILE_ERROR, "'goto' into loop or switch statement is disallowed"); } current = op_array->brk_cont_array[current].parent; } @@ -2419,19 +2460,19 @@ void zend_do_build_full_name(znode *result, znode *prefix, znode *name, int is_c } if (is_class_member) { - length = sizeof("::")-1 + result->u.constant.value.str.len + name->u.constant.value.str.len; - result->u.constant.value.str.val = erealloc(result->u.constant.value.str.val, length+1); - memcpy(&result->u.constant.value.str.val[result->u.constant.value.str.len], "::", sizeof("::")-1); - memcpy(&result->u.constant.value.str.val[result->u.constant.value.str.len + sizeof("::")-1], name->u.constant.value.str.val, name->u.constant.value.str.len+1); - STR_FREE(name->u.constant.value.str.val); - result->u.constant.value.str.len = length; + length = sizeof("::")-1 + Z_STRLEN(result->u.constant) + Z_STRLEN(name->u.constant); + Z_STRVAL(result->u.constant) = erealloc(Z_STRVAL(result->u.constant), length+1); + memcpy(&Z_STRVAL(result->u.constant)[Z_STRLEN(result->u.constant)], "::", sizeof("::")-1); + memcpy(&Z_STRVAL(result->u.constant)[Z_STRLEN(result->u.constant) + sizeof("::")-1], Z_STRVAL(name->u.constant), Z_STRLEN(name->u.constant)+1); + str_efree(Z_STRVAL(name->u.constant)); + Z_STRLEN(result->u.constant) = length; } else { - length = sizeof("\\")-1 + result->u.constant.value.str.len + name->u.constant.value.str.len; - result->u.constant.value.str.val = erealloc(result->u.constant.value.str.val, length+1); - memcpy(&result->u.constant.value.str.val[result->u.constant.value.str.len], "\\", sizeof("\\")-1); - memcpy(&result->u.constant.value.str.val[result->u.constant.value.str.len + sizeof("\\")-1], name->u.constant.value.str.val, name->u.constant.value.str.len+1); - STR_FREE(name->u.constant.value.str.val); - result->u.constant.value.str.len = length; + length = sizeof("\\")-1 + Z_STRLEN(result->u.constant) + Z_STRLEN(name->u.constant); + Z_STRVAL(result->u.constant) = erealloc(Z_STRVAL(result->u.constant), length+1); + memcpy(&Z_STRVAL(result->u.constant)[Z_STRLEN(result->u.constant)], "\\", sizeof("\\")-1); + memcpy(&Z_STRVAL(result->u.constant)[Z_STRLEN(result->u.constant) + sizeof("\\")-1], Z_STRVAL(name->u.constant), Z_STRLEN(name->u.constant)+1); + str_efree(Z_STRVAL(name->u.constant)); + Z_STRLEN(result->u.constant) = length; } } /* }}} */ @@ -2445,7 +2486,7 @@ int zend_do_begin_class_member_function_call(znode *class_name, znode *method_na if (method_name->op_type == IS_CONST) { char *lcname; if (Z_TYPE(method_name->u.constant) != IS_STRING) { - zend_error(E_COMPILE_ERROR, "Method name must be a string"); + zend_error_noreturn(E_COMPILE_ERROR, "Method name must be a string"); } lcname = zend_str_tolower_dup(Z_STRVAL(method_name->u.constant), Z_STRLEN(method_name->u.constant)); if ((sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) == Z_STRLEN(method_name->u.constant) && @@ -2458,7 +2499,7 @@ int zend_do_begin_class_member_function_call(znode *class_name, znode *method_na if (class_name->op_type == IS_CONST && ZEND_FETCH_CLASS_DEFAULT == zend_get_class_fetch_type(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant))) { - zend_resolve_class_name(class_name, ZEND_FETCH_CLASS_GLOBAL, 1 TSRMLS_CC); + zend_resolve_class_name(class_name TSRMLS_CC); class_node = *class_name; opline = get_next_op(CG(active_op_array) TSRMLS_CC); } else { @@ -2554,12 +2595,12 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC) /* {{ function_ptr->common.function_name && function_ptr->common.type == ZEND_USER_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset)) { - zend_error(E_COMPILE_ERROR, + zend_error_noreturn(E_COMPILE_ERROR, "Call-time pass-by-reference has been removed; " "If you would like to pass argument by reference, modify the declaration of %s().", function_ptr->common.function_name); } else { - zend_error(E_COMPILE_ERROR, "Call-time pass-by-reference has been removed"); + zend_error_noreturn(E_COMPILE_ERROR, "Call-time pass-by-reference has been removed"); } return; } @@ -2600,7 +2641,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC) /* {{ op = ZEND_SEND_REF; break; default: - zend_error(E_COMPILE_ERROR, "Only variables can be passed by reference"); + zend_error_noreturn(E_COMPILE_ERROR, "Only variables can be passed by reference"); break; } } @@ -2732,7 +2773,9 @@ void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC) /* {{{ */ if (expr) { SET_NODE(opline->op1, expr); - if (do_end_vparse && zend_is_function_or_method_call(expr)) { + if (!do_end_vparse) { + opline->extended_value = ZEND_RETURNS_VALUE; + } else if (zend_is_function_or_method_call(expr)) { opline->extended_value = ZEND_RETURNS_FUNCTION; } } else { @@ -2749,7 +2792,7 @@ void zend_do_yield(znode *result, znode *value, const znode *key, zend_bool is_v zend_op *opline; if (!CG(active_op_array)->function_name) { - zend_error(E_COMPILE_ERROR, "The \"yield\" expression can only be used inside a function"); + zend_error_noreturn(E_COMPILE_ERROR, "The \"yield\" expression can only be used inside a function"); } CG(active_op_array)->fn_flags |= ZEND_ACC_GENERATOR; @@ -2886,10 +2929,10 @@ void zend_do_begin_catch(znode *catch_token, znode *class_name, znode *catch_var if (class_name->op_type == IS_CONST && ZEND_FETCH_CLASS_DEFAULT == zend_get_class_fetch_type(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant))) { - zend_resolve_class_name(class_name, ZEND_FETCH_CLASS_GLOBAL, 1 TSRMLS_CC); + zend_resolve_class_name(class_name TSRMLS_CC); catch_class = *class_name; } else { - zend_error(E_COMPILE_ERROR, "Bad class name in the catch statement"); + zend_error_noreturn(E_COMPILE_ERROR, "Bad class name in the catch statement"); } catch_op_number = get_next_op_number(CG(active_op_array)); @@ -2902,7 +2945,7 @@ void zend_do_begin_catch(znode *catch_token, znode *class_name, znode *catch_var opline->op1_type = IS_CONST; opline->op1.constant = zend_add_class_name_literal(CG(active_op_array), &catch_class.u.constant TSRMLS_CC); opline->op2_type = IS_CV; - opline->op2.var = lookup_cv(CG(active_op_array), catch_var->u.constant.value.str.val, catch_var->u.constant.value.str.len, 0 TSRMLS_CC); + opline->op2.var = lookup_cv(CG(active_op_array), Z_STRVAL(catch_var->u.constant), Z_STRLEN(catch_var->u.constant), 0 TSRMLS_CC); Z_STRVAL(catch_var->u.constant) = (char*)CG(active_op_array)->vars[opline->op2.var].name; opline->result.num = 0; /* 1 means it's the last catch in the block */ @@ -2938,7 +2981,7 @@ void zend_do_bind_catch(znode *try_token, znode *catch_token TSRMLS_DC) /* {{{ * void zend_do_end_finally(znode *try_token, znode* catch_token, znode *finally_token TSRMLS_DC) /* {{{ */ { if (catch_token->op_type == IS_UNUSED && finally_token->op_type == IS_UNUSED) { - zend_error(E_COMPILE_ERROR, "Cannot use try without catch or finally"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use try without catch or finally"); } if (finally_token->op_type != IS_UNUSED) { zend_op *opline; @@ -3105,7 +3148,7 @@ static void do_inherit_method(zend_function *function) /* {{{ */ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, const zend_function *proto TSRMLS_DC) /* {{{ */ { - zend_uint i; + zend_uint i, num_args; /* If it's a user function then arg_info == NULL means we don't have any parameters but * we still need to do the arg number checks. We are only willing to ignore this for internal @@ -3135,48 +3178,66 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c return 0; } - if (fe->common.type != ZEND_USER_FUNCTION - && (proto->common.fn_flags & ZEND_ACC_PASS_REST_BY_REFERENCE) != 0 - && (fe->common.fn_flags & ZEND_ACC_PASS_REST_BY_REFERENCE) == 0) { - return 0; - } - /* by-ref constraints on return values are covariant */ if ((proto->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) && !(fe->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)) { return 0; } - for (i=0; i < proto->common.num_args; i++) { - if (ZEND_LOG_XOR(fe->common.arg_info[i].class_name, proto->common.arg_info[i].class_name)) { + if ((proto->common.fn_flags & ZEND_ACC_VARIADIC) + && !(fe->common.fn_flags & ZEND_ACC_VARIADIC)) { + return 0; + } + + /* For variadic functions any additional (optional) arguments that were added must be + * checked against the signature of the variadic argument, so in this case we have to + * go through all the parameters of the function and not just those present in the + * prototype. */ + num_args = proto->common.num_args; + if ((fe->common.fn_flags & ZEND_ACC_VARIADIC) + && fe->common.num_args > proto->common.num_args) { + num_args = fe->common.num_args; + } + + for (i = 0; i < num_args; i++) { + zend_arg_info *fe_arg_info = &fe->common.arg_info[i]; + + zend_arg_info *proto_arg_info; + if (i < proto->common.num_args) { + proto_arg_info = &proto->common.arg_info[i]; + } else { + proto_arg_info = &proto->common.arg_info[proto->common.num_args-1]; + } + + if (ZEND_LOG_XOR(fe_arg_info->class_name, proto_arg_info->class_name)) { /* Only one has a type hint and the other one doesn't */ return 0; } - if (fe->common.arg_info[i].class_name) { + if (fe_arg_info->class_name) { const char *fe_class_name, *proto_class_name; zend_uint fe_class_name_len, proto_class_name_len; - if (!strcasecmp(fe->common.arg_info[i].class_name, "parent") && proto->common.scope) { + if (!strcasecmp(fe_arg_info->class_name, "parent") && proto->common.scope) { fe_class_name = proto->common.scope->name; fe_class_name_len = proto->common.scope->name_length; - } else if (!strcasecmp(fe->common.arg_info[i].class_name, "self") && fe->common.scope) { + } else if (!strcasecmp(fe_arg_info->class_name, "self") && fe->common.scope) { fe_class_name = fe->common.scope->name; fe_class_name_len = fe->common.scope->name_length; } else { - fe_class_name = fe->common.arg_info[i].class_name; - fe_class_name_len = fe->common.arg_info[i].class_name_len; + fe_class_name = fe_arg_info->class_name; + fe_class_name_len = fe_arg_info->class_name_len; } - if (!strcasecmp(proto->common.arg_info[i].class_name, "parent") && proto->common.scope && proto->common.scope->parent) { + if (!strcasecmp(proto_arg_info->class_name, "parent") && proto->common.scope && proto->common.scope->parent) { proto_class_name = proto->common.scope->parent->name; proto_class_name_len = proto->common.scope->parent->name_length; - } else if (!strcasecmp(proto->common.arg_info[i].class_name, "self") && proto->common.scope) { + } else if (!strcasecmp(proto_arg_info->class_name, "self") && proto->common.scope) { proto_class_name = proto->common.scope->name; proto_class_name_len = proto->common.scope->name_length; } else { - proto_class_name = proto->common.arg_info[i].class_name; - proto_class_name_len = proto->common.arg_info[i].class_name_len; + proto_class_name = proto_arg_info->class_name; + proto_class_name_len = proto_arg_info->class_name_len; } if (strcasecmp(fe_class_name, proto_class_name)!=0) { @@ -3203,24 +3264,17 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c } } } - if (fe->common.arg_info[i].type_hint != proto->common.arg_info[i].type_hint) { + if (fe_arg_info->type_hint != proto_arg_info->type_hint) { /* Incompatible type hint */ return 0; } /* by-ref constraints on arguments are invariant */ - if (fe->common.arg_info[i].pass_by_reference != proto->common.arg_info[i].pass_by_reference) { + if (fe_arg_info->pass_by_reference != proto_arg_info->pass_by_reference) { return 0; } } - if (proto->common.fn_flags & ZEND_ACC_PASS_REST_BY_REFERENCE) { - for (i=proto->common.num_args; i < fe->common.num_args; i++) { - if (!fe->common.arg_info[i].pass_by_reference) { - return 0; - } - } - } return 1; } /* }}} */ @@ -3293,6 +3347,13 @@ static char * zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{ if (arg_info->pass_by_reference) { *(offset++) = '&'; } + + if (arg_info->is_variadic) { + *(offset++) = '.'; + *(offset++) = '.'; + *(offset++) = '.'; + } + *(offset++) = '$'; if (arg_info->name) { @@ -3308,7 +3369,7 @@ static char * zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{ idx /= 10; } while (idx > 0); } - if (i >= required) { + if (i >= required && !arg_info->is_variadic) { *(offset++) = ' '; *(offset++) = '='; *(offset++) = ' '; @@ -3403,14 +3464,14 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function * && parent->common.fn_flags & ZEND_ACC_ABSTRACT && parent->common.scope != (child->common.prototype ? child->common.prototype->common.scope : child->common.scope) && child->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_IMPLEMENTED_ABSTRACT)) { - zend_error(E_COMPILE_ERROR, "Can't inherit abstract function %s::%s() (previously declared abstract in %s)", + zend_error_noreturn(E_COMPILE_ERROR, "Can't inherit abstract function %s::%s() (previously declared abstract in %s)", parent->common.scope->name, child->common.function_name, child->common.prototype ? child->common.prototype->common.scope->name : child->common.scope->name); } if (parent_flags & ZEND_ACC_FINAL) { - zend_error(E_COMPILE_ERROR, "Cannot override final method %s::%s()", ZEND_FN_SCOPE_NAME(parent), child->common.function_name); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot override final method %s::%s()", ZEND_FN_SCOPE_NAME(parent), child->common.function_name); } child_flags = child->common.fn_flags; @@ -3418,15 +3479,15 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function * */ if ((child_flags & ZEND_ACC_STATIC) != (parent_flags & ZEND_ACC_STATIC)) { if (child->common.fn_flags & ZEND_ACC_STATIC) { - zend_error(E_COMPILE_ERROR, "Cannot make non static method %s::%s() static in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name, ZEND_FN_SCOPE_NAME(child)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot make non static method %s::%s() static in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name, ZEND_FN_SCOPE_NAME(child)); } else { - zend_error(E_COMPILE_ERROR, "Cannot make static method %s::%s() non static in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name, ZEND_FN_SCOPE_NAME(child)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot make static method %s::%s() non static in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name, ZEND_FN_SCOPE_NAME(child)); } } /* Disallow making an inherited method abstract. */ if ((child_flags & ZEND_ACC_ABSTRACT) && !(parent_flags & ZEND_ACC_ABSTRACT)) { - zend_error(E_COMPILE_ERROR, "Cannot make non abstract method %s::%s() abstract in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name, ZEND_FN_SCOPE_NAME(child)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot make non abstract method %s::%s() abstract in class %s", ZEND_FN_SCOPE_NAME(parent), child->common.function_name, ZEND_FN_SCOPE_NAME(child)); } if (parent_flags & ZEND_ACC_CHANGED) { @@ -3435,7 +3496,7 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function * /* Prevent derived classes from restricting access that was available in parent classes */ if ((child_flags & ZEND_ACC_PPP_MASK) > (parent_flags & ZEND_ACC_PPP_MASK)) { - zend_error(E_COMPILE_ERROR, "Access level to %s::%s() must be %s (as in class %s)%s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_visibility_string(parent_flags), ZEND_FN_SCOPE_NAME(parent), (parent_flags&ZEND_ACC_PUBLIC) ? "" : " or weaker"); + zend_error_noreturn(E_COMPILE_ERROR, "Access level to %s::%s() must be %s (as in class %s)%s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_visibility_string(parent_flags), ZEND_FN_SCOPE_NAME(parent), (parent_flags&ZEND_ACC_PUBLIC) ? "" : " or weaker"); } else if (((child_flags & ZEND_ACC_PPP_MASK) < (parent_flags & ZEND_ACC_PPP_MASK)) && ((parent_flags & ZEND_ACC_PPP_MASK) & ZEND_ACC_PRIVATE)) { child->common.fn_flags |= ZEND_ACC_CHANGED; @@ -3454,7 +3515,7 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function * if (child->common.prototype && (child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) { if (!zend_do_perform_implementation_check(child, child->common.prototype TSRMLS_CC)) { - zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_get_function_declaration(child->common.prototype TSRMLS_CC)); + zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_get_function_declaration(child->common.prototype TSRMLS_CC)); } } else if (EG(error_reporting) & E_STRICT || EG(user_error_handler)) { /* Check E_STRICT (or custom error handler) before the check so that we save some time */ if (!zend_do_perform_implementation_check(child, parent TSRMLS_CC)) { @@ -3508,7 +3569,7 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro if (zend_hash_quick_find(&ce->properties_info, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void **) &child_info)==SUCCESS) { if ((parent_info->flags & ZEND_ACC_STATIC) != (child_info->flags & ZEND_ACC_STATIC)) { - zend_error(E_COMPILE_ERROR, "Cannot redeclare %s%s::$%s as %s%s::$%s", + zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare %s%s::$%s as %s%s::$%s", (parent_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ", parent_ce->name, hash_key->arKey, (child_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ", ce->name, hash_key->arKey); @@ -3519,7 +3580,7 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro } if ((child_info->flags & ZEND_ACC_PPP_MASK) > (parent_info->flags & ZEND_ACC_PPP_MASK)) { - zend_error(E_COMPILE_ERROR, "Access level to %s::$%s must be %s (as in class %s)%s", ce->name, hash_key->arKey, zend_visibility_string(parent_info->flags), parent_ce->name, (parent_info->flags&ZEND_ACC_PUBLIC) ? "" : " or weaker"); + zend_error_noreturn(E_COMPILE_ERROR, "Access level to %s::$%s must be %s (as in class %s)%s", ce->name, hash_key->arKey, zend_visibility_string(parent_info->flags), parent_ce->name, (parent_info->flags&ZEND_ACC_PUBLIC) ? "" : " or weaker"); } else if ((child_info->flags & ZEND_ACC_STATIC) == 0) { zval_ptr_dtor(&(ce->default_properties_table[parent_info->offset])); ce->default_properties_table[parent_info->offset] = ce->default_properties_table[child_info->offset]; @@ -3604,10 +3665,10 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent if ((ce->ce_flags & ZEND_ACC_INTERFACE) && !(parent_ce->ce_flags & ZEND_ACC_INTERFACE)) { - zend_error(E_COMPILE_ERROR, "Interface %s may not inherit from class (%s)", ce->name, parent_ce->name); + zend_error_noreturn(E_COMPILE_ERROR, "Interface %s may not inherit from class (%s)", ce->name, parent_ce->name); } if (parent_ce->ce_flags & ZEND_ACC_FINAL_CLASS) { - zend_error(E_COMPILE_ERROR, "Class %s may not inherit from final class (%s)", ce->name, parent_ce->name); + zend_error_noreturn(E_COMPILE_ERROR, "Class %s may not inherit from final class (%s)", ce->name, parent_ce->name); } ce->parent = parent_ce; @@ -3729,7 +3790,7 @@ static zend_bool do_inherit_constant_check(HashTable *child_constants_table, con if (zend_hash_quick_find(child_constants_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void**)&old_constant) == SUCCESS) { if (*old_constant != *parent_constant) { - zend_error(E_COMPILE_ERROR, "Cannot inherit previously-inherited or override constant %s from interface %s", hash_key->arKey, iface->name); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot inherit previously-inherited or override constant %s from interface %s", hash_key->arKey, iface->name); } return 0; } @@ -3761,7 +3822,7 @@ ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry if (i < parent_iface_num) { ignore = 1; } else { - zend_error(E_COMPILE_ERROR, "Class %s cannot implement previously implemented interface %s", ce->name, iface->name); + zend_error_noreturn(E_COMPILE_ERROR, "Class %s cannot implement previously implemented interface %s", ce->name, iface->name); } } } @@ -3834,7 +3895,7 @@ static void zend_add_magic_methods(zend_class_entry* ce, const char* mname, uint ce->clone = fe; fe->common.fn_flags |= ZEND_ACC_CLONE; } else if (!strncmp(mname, ZEND_CONSTRUCTOR_FUNC_NAME, mname_len)) { if (ce->constructor) { - zend_error(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ce->name); + zend_error_noreturn(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ce->name); } ce->constructor = fe; fe->common.fn_flags |= ZEND_ACC_CTOR; } else if (!strncmp(mname, ZEND_DESTRUCTOR_FUNC_NAME, mname_len)) { @@ -3859,7 +3920,7 @@ static void zend_add_magic_methods(zend_class_entry* ce, const char* mname, uint lowercase_name = (char*)zend_new_interned_string(lowercase_name, ce->name_length + 1, 1 TSRMLS_CC); if (!memcmp(mname, lowercase_name, mname_len)) { if (ce->constructor) { - zend_error(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ce->name); + zend_error_noreturn(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ce->name); } ce->constructor = fe; fe->common.fn_flags |= ZEND_ACC_CTOR; @@ -3883,14 +3944,14 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, const if (existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) { /* Make sure the trait method is compatible with previosly declared abstract method */ if (!zend_traits_method_compatibility_check(fn, existing_fn TSRMLS_CC)) { - zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", + zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", zend_get_function_declaration(fn TSRMLS_CC), zend_get_function_declaration(existing_fn TSRMLS_CC)); } } else if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) { /* Make sure the abstract declaration is compatible with previous declaration */ if (!zend_traits_method_compatibility_check(existing_fn, fn TSRMLS_CC)) { - zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", + zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", zend_get_function_declaration(fn TSRMLS_CC), zend_get_function_declaration(existing_fn TSRMLS_CC)); } @@ -3906,25 +3967,25 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, const } else if (existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) { /* Make sure the trait method is compatible with previosly declared abstract method */ if (!zend_traits_method_compatibility_check(fn, existing_fn TSRMLS_CC)) { - zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", + zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", zend_get_function_declaration(fn TSRMLS_CC), zend_get_function_declaration(existing_fn TSRMLS_CC)); } } else if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) { /* Make sure the abstract declaration is compatible with previous declaration */ if (!zend_traits_method_compatibility_check(existing_fn, fn TSRMLS_CC)) { - zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", + zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", zend_get_function_declaration(fn TSRMLS_CC), zend_get_function_declaration(existing_fn TSRMLS_CC)); } return; } else if ((existing_fn->common.scope->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) { - /* two trais can't define the same non-abstract method */ + /* two traits can't define the same non-abstract method */ #if 1 - zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because there are collisions with other trait methods on %s", + zend_error_noreturn(E_COMPILE_ERROR, "Trait method %s has not been applied, because there are collisions with other trait methods on %s", name, ce->name); -#else /* TODO: better errot message */ - zend_error(E_COMPILE_ERROR, "Trait method %s::%s has not been applied as %s::%s, because of collision with %s::%s", +#else /* TODO: better error message */ + zend_error_noreturn(E_COMPILE_ERROR, "Trait method %s::%s has not been applied as %s::%s, because of collision with %s::%s", fn->common.scope->name, fn->common.function_name, ce->name, name, existing_fn->common.scope->name, existing_fn->common.function_name); @@ -4007,7 +4068,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args, } } - lcname = hash_key->arKey; + lcname = (char *) hash_key->arKey; if (exclude_table == NULL || zend_hash_find(exclude_table, lcname, fnname_len, &dummy) == FAILURE) { /* is not in hashtable, thus, function is not to be excluded */ @@ -4048,7 +4109,7 @@ static void zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *trait zend_uint i; if ((trait->ce_flags & ZEND_ACC_TRAIT) != ZEND_ACC_TRAIT) { - zend_error(E_COMPILE_ERROR, "Class %s is not a trait, Only traits may be used in 'as' and 'insteadof' statements", trait->name); + zend_error_noreturn(E_COMPILE_ERROR, "Class %s is not a trait, Only traits may be used in 'as' and 'insteadof' statements", trait->name); } for (i = 0; i < ce->num_traits; i++) { @@ -4056,7 +4117,7 @@ static void zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *trait return; } } - zend_error(E_COMPILE_ERROR, "Required Trait %s wasn't added to %s", trait->name, ce->name); + zend_error_noreturn(E_COMPILE_ERROR, "Required Trait %s wasn't added to %s", trait->name, ce->name); } /* }}} */ @@ -4077,7 +4138,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* cur_method_ref = cur_precedence->trait_method; if (!(cur_precedence->trait_method->ce = zend_fetch_class(cur_method_ref->class_name, cur_method_ref->cname_len, ZEND_FETCH_CLASS_TRAIT|ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) { - zend_error(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name); + zend_error_noreturn(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name); } zend_check_trait_usage(ce, cur_precedence->trait_method->ce TSRMLS_CC); @@ -4089,7 +4150,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* cur_method_ref->mname_len + 1); efree(lcname); if (!method_exists) { - zend_error(E_COMPILE_ERROR, + zend_error_noreturn(E_COMPILE_ERROR, "A precedence rule was defined for %s::%s but this method does not exist", cur_method_ref->ce->name, cur_method_ref->method_name); @@ -4107,14 +4168,14 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* zend_uint name_length = strlen(class_name); if (!(cur_precedence->exclude_from_classes[j] = zend_fetch_class(class_name, name_length, ZEND_FETCH_CLASS_TRAIT |ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) { - zend_error(E_COMPILE_ERROR, "Could not find trait %s", class_name); + zend_error_noreturn(E_COMPILE_ERROR, "Could not find trait %s", class_name); } zend_check_trait_usage(ce, cur_precedence->exclude_from_classes[j] TSRMLS_CC); /* make sure that the trait method is not from a class mentioned in exclude_from_classes, for consistency */ if (cur_precedence->trait_method->ce == cur_precedence->exclude_from_classes[i]) { - zend_error(E_COMPILE_ERROR, + zend_error_noreturn(E_COMPILE_ERROR, "Inconsistent insteadof definition. " "The method %s is to be used from %s, but %s is also on the exclude list", cur_method_ref->method_name, @@ -4137,7 +4198,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* if (ce->trait_aliases[i]->trait_method->class_name) { cur_method_ref = ce->trait_aliases[i]->trait_method; if (!(cur_method_ref->ce = zend_fetch_class(cur_method_ref->class_name, cur_method_ref->cname_len, ZEND_FETCH_CLASS_TRAIT|ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC))) { - zend_error(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name); + zend_error_noreturn(E_COMPILE_ERROR, "Could not find trait %s", cur_method_ref->class_name); } zend_check_trait_usage(ce, cur_method_ref->ce TSRMLS_CC); @@ -4149,7 +4210,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* efree(lcname); if (!method_exists) { - zend_error(E_COMPILE_ERROR, "An alias was defined for %s::%s but this method does not exist", cur_method_ref->ce->name, cur_method_ref->method_name); + zend_error_noreturn(E_COMPILE_ERROR, "An alias was defined for %s::%s but this method does not exist", cur_method_ref->ce->name, cur_method_ref->method_name); } } i++; @@ -4175,7 +4236,7 @@ static void zend_traits_compile_exclude_table(HashTable* exclude_table, zend_tra if (zend_hash_add(exclude_table, lcname, lcname_len, NULL, 0, NULL) == FAILURE) { efree(lcname); - zend_error(E_COMPILE_ERROR, "Failed to evaluate a trait precedence (%s). Method of trait %s was defined to be excluded multiple times", precedences[i]->trait_method->method_name, trait->name); + zend_error_noreturn(E_COMPILE_ERROR, "Failed to evaluate a trait precedence (%s). Method of trait %s was defined to be excluded multiple times", precedences[i]->trait_method->method_name, trait->name); } efree(lcname); } @@ -4300,7 +4361,7 @@ static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* { } if (not_compatible) { - zend_error(E_COMPILE_ERROR, + zend_error_noreturn(E_COMPILE_ERROR, "%s and %s define the same property ($%s) in the composition of %s. However, the definition differs and is considered incompatible. Class was composed", find_first_definition(ce, i, prop_name, prop_name_length, prop_hash, coliding_prop->ce)->name, property_info->ce->name, @@ -4349,7 +4410,7 @@ static void zend_do_check_for_inconsistent_traits_aliasing(zend_class_entry *ce if (!cur_alias->trait_method->ce) { if (cur_alias->alias) { /** Plain old inconsistency/typo/bug */ - zend_error(E_COMPILE_ERROR, + zend_error_noreturn(E_COMPILE_ERROR, "An alias (%s) was defined for method %s(), but this method does not exist", cur_alias->alias, cur_alias->trait_method->method_name); @@ -4368,12 +4429,12 @@ static void zend_do_check_for_inconsistent_traits_aliasing(zend_class_entry *ce lc_method_name, cur_alias->trait_method->mname_len+1)) { efree(lc_method_name); - zend_error(E_COMPILE_ERROR, + zend_error_noreturn(E_COMPILE_ERROR, "The modifiers for the trait alias %s() need to be changed in the same statment in which the alias is defined. Error", cur_alias->trait_method->method_name); } else { efree(lc_method_name); - zend_error(E_COMPILE_ERROR, + zend_error_noreturn(E_COMPILE_ERROR, "The modifiers of the trait method %s() are changed, but this method does not exist. Error", cur_alias->trait_method->method_name); @@ -4460,7 +4521,7 @@ void zend_prepare_reference(znode *result, znode *class_name, znode *method_name /* REM: There should not be a need for copying, zend_do_begin_class_declaration is also just using that string */ if (class_name) { - zend_resolve_class_name(class_name, ZEND_FETCH_CLASS_GLOBAL, 1 TSRMLS_CC); + zend_resolve_class_name(class_name TSRMLS_CC); method_ref->class_name = Z_STRVAL(class_name->u.constant); method_ref->cname_len = Z_STRLEN(class_name->u.constant); } else { @@ -4482,13 +4543,13 @@ void zend_add_trait_alias(znode *method_reference, znode *modifiers, znode *alia zend_trait_alias *trait_alias; if (Z_LVAL(modifiers->u.constant) == ZEND_ACC_STATIC) { - zend_error(E_COMPILE_ERROR, "Cannot use 'static' as method modifier"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use 'static' as method modifier"); return; } else if (Z_LVAL(modifiers->u.constant) == ZEND_ACC_ABSTRACT) { - zend_error(E_COMPILE_ERROR, "Cannot use 'abstract' as method modifier"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use 'abstract' as method modifier"); return; } else if (Z_LVAL(modifiers->u.constant) == ZEND_ACC_FINAL) { - zend_error(E_COMPILE_ERROR, "Cannot use 'final' as method modifier"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use 'final' as method modifier"); return; } @@ -4530,7 +4591,7 @@ ZEND_API zend_class_entry *do_bind_class(const zend_op_array* op_array, const ze op2 = opline->op2.zv; } if (zend_hash_quick_find(class_table, Z_STRVAL_P(op1), Z_STRLEN_P(op1), Z_HASH_P(op1), (void **) &pce)==FAILURE) { - zend_error(E_COMPILE_ERROR, "Internal Zend error - Missing class information for %s", Z_STRVAL_P(op1)); + zend_error_noreturn(E_COMPILE_ERROR, "Internal Zend error - Missing class information for %s", Z_STRVAL_P(op1)); return NULL; } else { ce = *pce; @@ -4544,7 +4605,7 @@ ZEND_API zend_class_entry *do_bind_class(const zend_op_array* op_array, const ze * so we shut up about it. This allows the if (!defined('FOO')) { return; } * approach to work. */ - zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", ce->name); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare class %s", ce->name); } return NULL; } else { @@ -4579,7 +4640,7 @@ ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op_array *op_array * so we shut up about it. This allows the if (!defined('FOO')) { return; } * approach to work. */ - zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", Z_STRVAL_P(op2)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare class %s", Z_STRVAL_P(op2)); } return NULL; } else { @@ -4587,9 +4648,9 @@ ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op_array *op_array } if (parent_ce->ce_flags & ZEND_ACC_INTERFACE) { - zend_error(E_COMPILE_ERROR, "Class %s cannot extend from interface %s", ce->name, parent_ce->name); + zend_error_noreturn(E_COMPILE_ERROR, "Class %s cannot extend from interface %s", ce->name, parent_ce->name); } else if ((parent_ce->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) { - zend_error(E_COMPILE_ERROR, "Class %s cannot extend from trait %s", ce->name, parent_ce->name); + zend_error_noreturn(E_COMPILE_ERROR, "Class %s cannot extend from trait %s", ce->name, parent_ce->name); } zend_do_inheritance(ce, parent_ce TSRMLS_CC); @@ -4598,7 +4659,7 @@ ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op_array *op_array /* Register the derived class */ if (zend_hash_quick_add(class_table, Z_STRVAL_P(op2), Z_STRLEN_P(op2)+1, Z_HASH_P(op2), pce, sizeof(zend_class_entry *), NULL)==FAILURE) { - zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", ce->name); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare class %s", ce->name); } return ce; } @@ -4667,7 +4728,7 @@ void zend_do_early_binding(TSRMLS_D) /* {{{ */ /* Classes with traits are handled exactly the same, no early-bind here */ return; default: - zend_error(E_COMPILE_ERROR, "Invalid binding type"); + zend_error_noreturn(E_COMPILE_ERROR, "Invalid binding type"); return; } @@ -4798,9 +4859,9 @@ void zend_do_brk_cont(zend_uchar op, const znode *expr TSRMLS_DC) /* {{{ */ SET_UNUSED(opline->op1); if (expr) { if (expr->op_type != IS_CONST) { - zend_error(E_COMPILE_ERROR, "'%s' operator with non-constant operand is no longer supported", op == ZEND_BRK ? "break" : "continue"); + zend_error_noreturn(E_COMPILE_ERROR, "'%s' operator with non-constant operand is no longer supported", op == ZEND_BRK ? "break" : "continue"); } else if (Z_TYPE(expr->u.constant) != IS_LONG || Z_LVAL(expr->u.constant) < 1) { - zend_error(E_COMPILE_ERROR, "'%s' operator accepts only positive numbers", op == ZEND_BRK ? "break" : "continue"); + zend_error_noreturn(E_COMPILE_ERROR, "'%s' operator accepts only positive numbers", op == ZEND_BRK ? "break" : "continue"); } SET_NODE(opline->op2, expr); } else { @@ -4959,15 +5020,15 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name zval **ns_name, key; if (CG(active_class_entry)) { - zend_error(E_COMPILE_ERROR, "Class declarations may not be nested"); + zend_error_noreturn(E_COMPILE_ERROR, "Class declarations may not be nested"); return; } - lcname = zend_str_tolower_dup(class_name->u.constant.value.str.val, class_name->u.constant.value.str.len); + lcname = zend_str_tolower_dup(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant)); if (!(strcmp(lcname, "self") && strcmp(lcname, "parent"))) { efree(lcname); - zend_error(E_COMPILE_ERROR, "Cannot use '%s' as class name as it is reserved", Z_STRVAL(class_name->u.constant)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use '%s' as class name as it is reserved", Z_STRVAL(class_name->u.constant)); } /* Class name must not conflict with import names */ @@ -4994,7 +5055,7 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name if (Z_STRLEN_PP(ns_name) != Z_STRLEN(class_name->u.constant) || memcmp(tmp, lcname, Z_STRLEN(class_name->u.constant))) { - zend_error(E_COMPILE_ERROR, "Cannot declare class %s because the name is already in use", Z_STRVAL(class_name->u.constant)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare class %s because the name is already in use", Z_STRVAL(class_name->u.constant)); } efree(tmp); } @@ -5012,13 +5073,13 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name if (parent_class_name && parent_class_name->op_type != IS_UNUSED) { switch (parent_class_name->EA) { case ZEND_FETCH_CLASS_SELF: - zend_error(E_COMPILE_ERROR, "Cannot use 'self' as class name as it is reserved"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use 'self' as class name as it is reserved"); break; case ZEND_FETCH_CLASS_PARENT: - zend_error(E_COMPILE_ERROR, "Cannot use 'parent' as class name as it is reserved"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use 'parent' as class name as it is reserved"); break; case ZEND_FETCH_CLASS_STATIC: - zend_error(E_COMPILE_ERROR, "Cannot use 'static' as class name as it is reserved"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use 'static' as class name as it is reserved"); break; default: break; @@ -5037,7 +5098,7 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name if (doing_inheritance) { /* Make sure a trait does not try to extend a class */ if ((new_class_entry->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) { - zend_error(E_COMPILE_ERROR, "A trait (%s) cannot extend a class. Traits can only be composed from other traits with the 'use' keyword. Error", new_class_entry->name); + zend_error_noreturn(E_COMPILE_ERROR, "A trait (%s) cannot extend a class. Traits can only be composed from other traits with the 'use' keyword. Error", new_class_entry->name); } opline->extended_value = parent_class_name->u.op.var; @@ -5082,19 +5143,19 @@ void zend_do_end_class_declaration(const znode *class_token, const znode *parent if (ce->constructor) { ce->constructor->common.fn_flags |= ZEND_ACC_CTOR; if (ce->constructor->common.fn_flags & ZEND_ACC_STATIC) { - zend_error(E_COMPILE_ERROR, "Constructor %s::%s() cannot be static", ce->name, ce->constructor->common.function_name); + zend_error_noreturn(E_COMPILE_ERROR, "Constructor %s::%s() cannot be static", ce->name, ce->constructor->common.function_name); } } if (ce->destructor) { ce->destructor->common.fn_flags |= ZEND_ACC_DTOR; if (ce->destructor->common.fn_flags & ZEND_ACC_STATIC) { - zend_error(E_COMPILE_ERROR, "Destructor %s::%s() cannot be static", ce->name, ce->destructor->common.function_name); + zend_error_noreturn(E_COMPILE_ERROR, "Destructor %s::%s() cannot be static", ce->name, ce->destructor->common.function_name); } } if (ce->clone) { ce->clone->common.fn_flags |= ZEND_ACC_CLONE; if (ce->clone->common.fn_flags & ZEND_ACC_STATIC) { - zend_error(E_COMPILE_ERROR, "Clone method %s::%s() cannot be static", ce->name, ce->clone->common.function_name); + zend_error_noreturn(E_COMPILE_ERROR, "Clone method %s::%s() cannot be static", ce->name, ce->clone->common.function_name); } } @@ -5143,7 +5204,7 @@ void zend_do_implements_interface(znode *interface_name TSRMLS_DC) /* {{{ */ /* Traits can not implement interfaces */ if ((CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) { - zend_error(E_COMPILE_ERROR, "Cannot use '%s' as interface on '%s' since it is a Trait", + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use '%s' as interface on '%s' since it is a Trait", Z_STRVAL(interface_name->u.constant), CG(active_class_entry)->name); } @@ -5152,7 +5213,7 @@ void zend_do_implements_interface(znode *interface_name TSRMLS_DC) /* {{{ */ case ZEND_FETCH_CLASS_SELF: case ZEND_FETCH_CLASS_PARENT: case ZEND_FETCH_CLASS_STATIC: - zend_error(E_COMPILE_ERROR, "Cannot use '%s' as interface name as it is reserved", Z_STRVAL(interface_name->u.constant)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use '%s' as interface name as it is reserved", Z_STRVAL(interface_name->u.constant)); break; default: break; @@ -5161,7 +5222,7 @@ void zend_do_implements_interface(znode *interface_name TSRMLS_DC) /* {{{ */ opline = get_next_op(CG(active_op_array) TSRMLS_CC); opline->opcode = ZEND_ADD_INTERFACE; SET_NODE(opline->op1, &CG(implementing_class)); - zend_resolve_class_name(interface_name, opline->extended_value, 0 TSRMLS_CC); + zend_resolve_class_name(interface_name TSRMLS_CC); opline->extended_value = (opline->extended_value & ~ZEND_FETCH_CLASS_MASK) | ZEND_FETCH_CLASS_INTERFACE; opline->op2_type = IS_CONST; opline->op2.constant = zend_add_class_name_literal(CG(active_op_array), &interface_name->u.constant TSRMLS_CC); @@ -5174,7 +5235,7 @@ void zend_do_use_trait(znode *trait_name TSRMLS_DC) /* {{{ */ zend_op *opline; if ((CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE)) { - zend_error(E_COMPILE_ERROR, + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use traits inside of interfaces. %s is used in %s", Z_STRVAL(trait_name->u.constant), CG(active_class_entry)->name); } @@ -5184,7 +5245,7 @@ void zend_do_use_trait(znode *trait_name TSRMLS_DC) /* {{{ */ case ZEND_FETCH_CLASS_SELF: case ZEND_FETCH_CLASS_PARENT: case ZEND_FETCH_CLASS_STATIC: - zend_error(E_COMPILE_ERROR, "Cannot use '%s' as trait name as it is reserved", Z_STRVAL(trait_name->u.constant)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use '%s' as trait name as it is reserved", Z_STRVAL(trait_name->u.constant)); break; default: break; @@ -5193,7 +5254,7 @@ void zend_do_use_trait(znode *trait_name TSRMLS_DC) /* {{{ */ opline = get_next_op(CG(active_op_array) TSRMLS_CC); opline->opcode = ZEND_ADD_TRAIT; SET_NODE(opline->op1, &CG(implementing_class)); - zend_resolve_class_name(trait_name, opline->extended_value, 0 TSRMLS_CC); + zend_resolve_class_name(trait_name TSRMLS_CC); opline->extended_value = ZEND_FETCH_CLASS_TRAIT; opline->op2_type = IS_CONST; opline->op2.constant = zend_add_class_name_literal(CG(active_op_array), &trait_name->u.constant TSRMLS_CC); @@ -5273,20 +5334,20 @@ void zend_do_declare_property(const znode *var_name, const znode *value, zend_ui int comment_len = 0; if (CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE) { - zend_error(E_COMPILE_ERROR, "Interfaces may not include member variables"); + zend_error_noreturn(E_COMPILE_ERROR, "Interfaces may not include member variables"); } if (access_type & ZEND_ACC_ABSTRACT) { - zend_error(E_COMPILE_ERROR, "Properties cannot be declared abstract"); + zend_error_noreturn(E_COMPILE_ERROR, "Properties cannot be declared abstract"); } if (access_type & ZEND_ACC_FINAL) { - zend_error(E_COMPILE_ERROR, "Cannot declare property %s::$%s final, the final modifier is allowed only for methods and classes", - CG(active_class_entry)->name, var_name->u.constant.value.str.val); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare property %s::$%s final, the final modifier is allowed only for methods and classes", + CG(active_class_entry)->name, Z_STRVAL(var_name->u.constant)); } - if (zend_hash_find(&CG(active_class_entry)->properties_info, var_name->u.constant.value.str.val, var_name->u.constant.value.str.len+1, (void **) &existing_property_info)==SUCCESS) { - zend_error(E_COMPILE_ERROR, "Cannot redeclare %s::$%s", CG(active_class_entry)->name, var_name->u.constant.value.str.val); + if (zend_hash_find(&CG(active_class_entry)->properties_info, Z_STRVAL(var_name->u.constant), Z_STRLEN(var_name->u.constant)+1, (void **) &existing_property_info)==SUCCESS) { + zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare %s::$%s", CG(active_class_entry)->name, Z_STRVAL(var_name->u.constant)); } ALLOC_ZVAL(property); @@ -5304,8 +5365,8 @@ void zend_do_declare_property(const znode *var_name, const znode *value, zend_ui CG(doc_comment_len) = 0; } - zend_declare_property_ex(CG(active_class_entry), zend_new_interned_string(var_name->u.constant.value.str.val, var_name->u.constant.value.str.len + 1, 0 TSRMLS_CC), var_name->u.constant.value.str.len, property, access_type, comment, comment_len TSRMLS_CC); - efree(var_name->u.constant.value.str.val); + zend_declare_property_ex(CG(active_class_entry), zend_new_interned_string(Z_STRVAL(var_name->u.constant), Z_STRLEN(var_name->u.constant) + 1, 0 TSRMLS_CC), Z_STRLEN(var_name->u.constant), property, access_type, comment, comment_len TSRMLS_CC); + efree(Z_STRVAL(var_name->u.constant)); } /* }}} */ @@ -5313,30 +5374,25 @@ void zend_do_declare_class_constant(znode *var_name, const znode *value TSRMLS_D { zval *property; const char *cname = NULL; - int result; + zend_ulong hash; if(Z_TYPE(value->u.constant) == IS_CONSTANT_ARRAY) { - zend_error(E_COMPILE_ERROR, "Arrays are not allowed in class constants"); + zend_error_noreturn(E_COMPILE_ERROR, "Arrays are not allowed in class constants"); return; } if ((CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) { - zend_error(E_COMPILE_ERROR, "Traits cannot have constants"); + zend_error_noreturn(E_COMPILE_ERROR, "Traits cannot have constants"); return; } ALLOC_ZVAL(property); *property = value->u.constant; - cname = zend_new_interned_string(var_name->u.constant.value.str.val, var_name->u.constant.value.str.len+1, 0 TSRMLS_CC); - - if (IS_INTERNED(cname)) { - result = zend_hash_quick_add(&CG(active_class_entry)->constants_table, cname, var_name->u.constant.value.str.len+1, INTERNED_HASH(cname), &property, sizeof(zval *), NULL); - } else { - result = zend_hash_add(&CG(active_class_entry)->constants_table, cname, var_name->u.constant.value.str.len+1, &property, sizeof(zval *), NULL); - } - if (result == FAILURE) { + cname = zend_new_interned_string(Z_STRVAL(var_name->u.constant), Z_STRLEN(var_name->u.constant)+1, 0 TSRMLS_CC); + hash = str_hash(cname, Z_STRLEN(var_name->u.constant)); + if (zend_hash_quick_add(&CG(active_class_entry)->constants_table, cname, Z_STRLEN(var_name->u.constant)+1, hash, &property, sizeof(zval *), NULL) == FAILURE) { FREE_ZVAL(property); - zend_error(E_COMPILE_ERROR, "Cannot redefine class constant %s::%s", CG(active_class_entry)->name, var_name->u.constant.value.str.val); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot redefine class constant %s::%s", CG(active_class_entry)->name, Z_STRVAL(var_name->u.constant)); } FREE_PNODE(var_name); @@ -5430,7 +5486,7 @@ void zend_do_halt_compiler_register(TSRMLS_D) /* {{{ */ int len, clen; if (CG(has_bracketed_namespaces) && CG(in_namespace)) { - zend_error(E_COMPILE_ERROR, "__HALT_COMPILER() can only be used from the outermost scope"); + zend_error_noreturn(E_COMPILE_ERROR, "__HALT_COMPILER() can only be used from the outermost scope"); } cfilename = zend_get_compiled_filename(TSRMLS_C); @@ -5531,8 +5587,7 @@ static zend_constant* zend_get_ct_const(const zval *const_name, int all_internal if (all_internal_constants_substitution && (c->flags & CONST_PERSISTENT) && !(CG(compiler_options) & ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION) && - Z_TYPE(c->value) != IS_CONSTANT && - Z_TYPE(c->value) != IS_CONSTANT_ARRAY) { + !IS_CONSTANT_TYPE(Z_TYPE(c->value))) { return c; } return NULL; @@ -5572,7 +5627,7 @@ void zend_do_fetch_constant(znode *result, znode *constant_container, znode *con if (ZEND_FETCH_CLASS_STATIC == type) { zend_error(E_ERROR, "\"static::\" is not allowed in compile-time constants"); } else if (ZEND_FETCH_CLASS_DEFAULT == type) { - zend_resolve_class_name(constant_container, fetch_type, 1 TSRMLS_CC); + zend_resolve_class_name(constant_container TSRMLS_CC); } zend_do_build_full_name(NULL, constant_container, constant_name, 1 TSRMLS_CC); *result = *constant_container; @@ -5581,7 +5636,7 @@ void zend_do_fetch_constant(znode *result, znode *constant_container, znode *con case ZEND_RT: if (constant_container->op_type == IS_CONST && ZEND_FETCH_CLASS_DEFAULT == zend_get_class_fetch_type(Z_STRVAL(constant_container->u.constant), Z_STRLEN(constant_container->u.constant))) { - zend_resolve_class_name(constant_container, fetch_type, 1 TSRMLS_CC); + zend_resolve_class_name(constant_container TSRMLS_CC); } else { zend_do_fetch_class(&tmp, constant_container TSRMLS_CC); constant_container = &tmp; @@ -5619,7 +5674,7 @@ void zend_do_fetch_constant(znode *result, znode *constant_container, znode *con break; } - zend_resolve_non_class_name(constant_name, check_namespace TSRMLS_CC); + zend_resolve_const_name(constant_name, &check_namespace TSRMLS_CC); if(!compound) { fetch_type |= IS_CONSTANT_UNQUALIFIED; @@ -5631,7 +5686,7 @@ void zend_do_fetch_constant(znode *result, znode *constant_container, znode *con case ZEND_RT: compound = memchr(Z_STRVAL(constant_name->u.constant), '\\', Z_STRLEN(constant_name->u.constant)); - zend_resolve_non_class_name(constant_name, check_namespace TSRMLS_CC); + zend_resolve_const_name(constant_name, &check_namespace TSRMLS_CC); if(zend_constant_ct_subst(result, &constant_name->u.constant, 1 TSRMLS_CC)) { break; @@ -5774,18 +5829,32 @@ void zend_do_add_static_array_element(znode *result, znode *offset, const znode ALLOC_ZVAL(element); *element = expr->u.constant; if (offset) { - switch (offset->u.constant.type & IS_CONSTANT_TYPE_MASK) { + switch (Z_TYPE(offset->u.constant) & IS_CONSTANT_TYPE_MASK) { case IS_CONSTANT: /* Ugly hack to denote that this value has a constant index */ Z_TYPE_P(element) |= IS_CONSTANT_INDEX; Z_STRVAL(offset->u.constant) = erealloc(Z_STRVAL(offset->u.constant), Z_STRLEN(offset->u.constant)+3); Z_STRVAL(offset->u.constant)[Z_STRLEN(offset->u.constant)+1] = Z_TYPE(offset->u.constant); Z_STRVAL(offset->u.constant)[Z_STRLEN(offset->u.constant)+2] = 0; - zend_symtable_update(result->u.constant.value.ht, Z_STRVAL(offset->u.constant), Z_STRLEN(offset->u.constant)+3, &element, sizeof(zval *), NULL); + zend_symtable_update(Z_ARRVAL(result->u.constant), Z_STRVAL(offset->u.constant), Z_STRLEN(offset->u.constant)+3, &element, sizeof(zval *), NULL); zval_dtor(&offset->u.constant); break; + case IS_CONSTANT_AST: { + /* Another ugly hack to store the data about the AST in the array */ + char* key; + int len = sizeof(zend_ast *); + Z_TYPE_P(element) |= IS_CONSTANT_INDEX; + + key = emalloc(len + 2); + *(zend_ast **)key = Z_AST(offset->u.constant); + key[len] = Z_TYPE(offset->u.constant); + key[len + 1] = 0; + zend_symtable_update(Z_ARRVAL(result->u.constant), key, len + 2, &element, sizeof(zval *), NULL); + efree(key); + break; + } case IS_STRING: - zend_symtable_update(result->u.constant.value.ht, offset->u.constant.value.str.val, offset->u.constant.value.str.len+1, &element, sizeof(zval *), NULL); + zend_symtable_update(Z_ARRVAL(result->u.constant), Z_STRVAL(offset->u.constant), Z_STRLEN(offset->u.constant)+1, &element, sizeof(zval *), NULL); zval_dtor(&offset->u.constant); break; case IS_NULL: @@ -5962,7 +6031,7 @@ void zend_do_fetch_static_variable(znode *varname, const znode *static_assignmen ALLOC_HASHTABLE(CG(active_op_array)->static_variables); zend_hash_init(CG(active_op_array)->static_variables, 2, NULL, ZVAL_PTR_DTOR, 0); } - zend_hash_update(CG(active_op_array)->static_variables, varname->u.constant.value.str.val, varname->u.constant.value.str.len+1, &tmp, sizeof(zval *), NULL); + zend_hash_update(CG(active_op_array)->static_variables, Z_STRVAL(varname->u.constant), Z_STRLEN(varname->u.constant)+1, &tmp, sizeof(zval *), NULL); if (varname->op_type == IS_CONST) { if (Z_TYPE(varname->u.constant) != IS_STRING) { @@ -6006,7 +6075,7 @@ void zend_do_fetch_lexical_variable(znode *varname, zend_bool is_ref TSRMLS_DC) if (Z_STRLEN(varname->u.constant) == sizeof("this") - 1 && memcmp(Z_STRVAL(varname->u.constant), "this", sizeof("this") - 1) == 0) { - zend_error(E_COMPILE_ERROR, "Cannot use $this as lexical variable"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use $this as lexical variable"); return; } @@ -6091,7 +6160,7 @@ void zend_do_indirect_references(znode *result, const znode *num_references, zno int i; zend_do_end_variable_parse(variable, BP_VAR_R, 0 TSRMLS_CC); - for (i=1; i<num_references->u.constant.value.lval; i++) { + for (i=1; i<Z_LVAL(num_references->u.constant); i++) { fetch_simple_variable_ex(result, variable, 0, ZEND_FETCH_R TSRMLS_CC); *variable = *result; } @@ -6150,7 +6219,7 @@ void zend_do_isset_or_isempty(int type, znode *result, znode *variable TSRMLS_DC /* empty(func()) can be transformed to !func() */ zend_do_unary_op(ZEND_BOOL_NOT, result, variable TSRMLS_CC); } else { - zend_error(E_COMPILE_ERROR, "Cannot use isset() on the result of a function call (you can use \"null !== func()\" instead)"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use isset() on the result of a function call (you can use \"null !== func()\" instead)"); } return; @@ -6198,7 +6267,7 @@ void zend_do_instanceof(znode *result, const znode *expr, const znode *class_zno } if (expr->op_type == IS_CONST) { - zend_error(E_COMPILE_ERROR, "instanceof expects an object instance, constant given"); + zend_error_noreturn(E_COMPILE_ERROR, "instanceof expects an object instance, constant given"); } opline = get_next_op(CG(active_op_array) TSRMLS_CC); @@ -6289,10 +6358,10 @@ void zend_do_foreach_cont(znode *foreach_token, const znode *open_brackets_token if ((key->op_type != IS_UNUSED)) { if (key->EA & ZEND_PARSED_REFERENCE_VARIABLE) { - zend_error(E_COMPILE_ERROR, "Key element cannot be a reference"); + zend_error_noreturn(E_COMPILE_ERROR, "Key element cannot be a reference"); } if (key->EA & ZEND_PARSED_LIST_EXPR) { - zend_error(E_COMPILE_ERROR, "Cannot use list as key element"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use list as key element"); } } @@ -6311,7 +6380,7 @@ void zend_do_foreach_cont(znode *foreach_token, const znode *open_brackets_token while (fetch != end) { --fetch; if (fetch->opcode == ZEND_FETCH_DIM_W && fetch->op2_type == IS_UNUSED) { - zend_error(E_COMPILE_ERROR, "Cannot use [] for reading"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use [] for reading"); } if (fetch->opcode == ZEND_SEPARATE) { MAKE_NOP(fetch); @@ -6325,7 +6394,7 @@ void zend_do_foreach_cont(znode *foreach_token, const znode *open_brackets_token if (value->EA & ZEND_PARSED_LIST_EXPR) { if (!CG(list_llist).head) { - zend_error(E_COMPILE_ERROR, "Cannot use empty list"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use empty list"); } zend_do_list_end(&dummy, &value_node TSRMLS_CC); zend_do_free(&dummy TSRMLS_CC); @@ -6388,12 +6457,12 @@ void zend_do_declare_begin(TSRMLS_D) /* {{{ */ void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC) /* {{{ */ { - if (!zend_binary_strcasecmp(var->u.constant.value.str.val, var->u.constant.value.str.len, "ticks", sizeof("ticks")-1)) { + if (!zend_binary_strcasecmp(Z_STRVAL(var->u.constant), Z_STRLEN(var->u.constant), "ticks", sizeof("ticks")-1)) { convert_to_long(&val->u.constant); CG(declarables).ticks = val->u.constant; - } else if (!zend_binary_strcasecmp(var->u.constant.value.str.val, var->u.constant.value.str.len, "encoding", sizeof("encoding")-1)) { + } else if (!zend_binary_strcasecmp(Z_STRVAL(var->u.constant), Z_STRLEN(var->u.constant), "encoding", sizeof("encoding")-1)) { if ((Z_TYPE(val->u.constant) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) { - zend_error(E_COMPILE_ERROR, "Cannot use constants as encoding"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use constants as encoding"); } /* @@ -6412,7 +6481,7 @@ void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC) /* {{{ */ } if (num > 0) { - zend_error(E_COMPILE_ERROR, "Encoding declaration pragma must be the very first statement in the script"); + zend_error_noreturn(E_COMPILE_ERROR, "Encoding declaration pragma must be the very first statement in the script"); } } @@ -6423,9 +6492,9 @@ void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC) /* {{{ */ CG(encoding_declared) = 1; convert_to_string(&val->u.constant); - new_encoding = zend_multibyte_fetch_encoding(val->u.constant.value.str.val TSRMLS_CC); + new_encoding = zend_multibyte_fetch_encoding(Z_STRVAL(val->u.constant) TSRMLS_CC); if (!new_encoding) { - zend_error(E_COMPILE_WARNING, "Unsupported encoding [%s]", val->u.constant.value.str.val); + zend_error(E_COMPILE_WARNING, "Unsupported encoding [%s]", Z_STRVAL(val->u.constant)); } else { old_input_filter = LANG_SCNG(input_filter); old_encoding = LANG_SCNG(script_encoding); @@ -6442,7 +6511,7 @@ void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC) /* {{{ */ } zval_dtor(&val->u.constant); } else { - zend_error(E_COMPILE_WARNING, "Unsupported declare '%s'", var->u.constant.value.str.val); + zend_error(E_COMPILE_WARNING, "Unsupported declare '%s'", Z_STRVAL(var->u.constant)); zval_dtor(&val->u.constant); } zval_dtor(&var->u.constant); @@ -6682,10 +6751,9 @@ void zend_do_ticks(TSRMLS_D) /* {{{ */ } /* }}} */ -zend_bool zend_is_auto_global_quick(const char *name, uint name_len, ulong hashval TSRMLS_DC) /* {{{ */ +zend_bool zend_is_auto_global_quick(const char *name, uint name_len, ulong hash TSRMLS_DC) /* {{{ */ { zend_auto_global *auto_global; - ulong hash = hashval ? hashval : zend_hash_func(name, name_len+1); if (zend_hash_quick_find(CG(auto_globals), name, name_len+1, hash, (void **) &auto_global)==SUCCESS) { if (auto_global->armed) { @@ -6699,7 +6767,7 @@ zend_bool zend_is_auto_global_quick(const char *name, uint name_len, ulong hashv zend_bool zend_is_auto_global(const char *name, uint name_len TSRMLS_DC) /* {{{ */ { - return zend_is_auto_global_quick(name, name_len, 0 TSRMLS_CC); + return zend_is_auto_global_quick(name, name_len, zend_hash_func(name, name_len+1) TSRMLS_CC); } /* }}} */ @@ -6909,15 +6977,15 @@ void zend_do_begin_namespace(const znode *name, zend_bool with_bracket TSRMLS_DC if (CG(current_namespace)) { /* previous namespace declarations were unbracketed */ if (with_bracket) { - zend_error(E_COMPILE_ERROR, "Cannot mix bracketed namespace declarations with unbracketed namespace declarations"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot mix bracketed namespace declarations with unbracketed namespace declarations"); } } } else { /* previous namespace declarations were bracketed */ if (!with_bracket) { - zend_error(E_COMPILE_ERROR, "Cannot mix bracketed namespace declarations with unbracketed namespace declarations"); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot mix bracketed namespace declarations with unbracketed namespace declarations"); } else if (CG(current_namespace) || CG(in_namespace)) { - zend_error(E_COMPILE_ERROR, "Namespace declarations cannot be nested"); + zend_error_noreturn(E_COMPILE_ERROR, "Namespace declarations cannot be nested"); } } @@ -6930,7 +6998,7 @@ void zend_do_begin_namespace(const znode *name, zend_bool with_bracket TSRMLS_DC --num; } if (num > 0) { - zend_error(E_COMPILE_ERROR, "Namespace declaration statement has to be the very first statement in the script"); + zend_error_noreturn(E_COMPILE_ERROR, "Namespace declaration statement has to be the very first statement in the script"); } } @@ -6945,7 +7013,7 @@ void zend_do_begin_namespace(const znode *name, zend_bool with_bracket TSRMLS_DC !memcmp(lcname, "self", sizeof("self")-1)) || ((Z_STRLEN(name->u.constant) == sizeof("parent")-1) && !memcmp(lcname, "parent", sizeof("parent")-1))) { - zend_error(E_COMPILE_ERROR, "Cannot use '%s' as namespace name", Z_STRVAL(name->u.constant)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use '%s' as namespace name", Z_STRVAL(name->u.constant)); } efree(lcname); @@ -6969,6 +7037,18 @@ void zend_do_begin_namespace(const znode *name, zend_bool with_bracket TSRMLS_DC CG(current_import) = NULL; } + if (CG(current_import_function)) { + zend_hash_destroy(CG(current_import_function)); + efree(CG(current_import_function)); + CG(current_import_function) = NULL; + } + + if (CG(current_import_const)) { + zend_hash_destroy(CG(current_import_const)); + efree(CG(current_import_const)); + CG(current_import_const) = NULL; + } + if (CG(doc_comment)) { efree(CG(doc_comment)); CG(doc_comment) = NULL; @@ -6989,8 +7069,8 @@ void zend_do_use(znode *ns_name, znode *new_name, int is_global TSRMLS_DC) /* {{ zend_hash_init(CG(current_import), 0, NULL, ZVAL_PTR_DTOR, 0); } - ALLOC_ZVAL(ns); - *ns = ns_name->u.constant; + MAKE_STD_ZVAL(ns); + ZVAL_ZVAL(ns, &ns_name->u.constant, 0, 0); if (new_name) { name = &new_name->u.constant; } else { @@ -7003,8 +7083,7 @@ void zend_do_use(znode *ns_name, znode *new_name, int is_global TSRMLS_DC) /* {{ if (p) { ZVAL_STRING(name, p+1, 1); } else { - *name = *ns; - zval_copy_ctor(name); + ZVAL_ZVAL(name, ns, 1, 0); warn = !is_global && !CG(current_namespace); } } @@ -7015,7 +7094,7 @@ void zend_do_use(znode *ns_name, znode *new_name, int is_global TSRMLS_DC) /* {{ !memcmp(lcname, "self", sizeof("self")-1)) || ((Z_STRLEN_P(name) == sizeof("parent")-1) && !memcmp(lcname, "parent", sizeof("parent")-1))) { - zend_error(E_COMPILE_ERROR, "Cannot use %s as %s because '%s' is a special class name", Z_STRVAL_P(ns), Z_STRVAL_P(name), Z_STRVAL_P(name)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use %s as %s because '%s' is a special class name", Z_STRVAL_P(ns), Z_STRVAL_P(name), Z_STRVAL_P(name)); } if (CG(current_namespace)) { @@ -7030,7 +7109,7 @@ void zend_do_use(znode *ns_name, znode *new_name, int is_global TSRMLS_DC) /* {{ if (Z_STRLEN_P(ns) != Z_STRLEN_P(CG(current_namespace)) + 1 + Z_STRLEN_P(name) || memcmp(tmp2, c_ns_name, Z_STRLEN_P(ns))) { - zend_error(E_COMPILE_ERROR, "Cannot use %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name)); } efree(tmp2); } @@ -7042,17 +7121,17 @@ void zend_do_use(znode *ns_name, znode *new_name, int is_global TSRMLS_DC) /* {{ if (Z_STRLEN_P(ns) != Z_STRLEN_P(name) || memcmp(c_tmp, lcname, Z_STRLEN_P(ns))) { - zend_error(E_COMPILE_ERROR, "Cannot use %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name)); } efree(c_tmp); } if (zend_hash_add(CG(current_import), lcname, Z_STRLEN_P(name)+1, &ns, sizeof(zval*), NULL) != SUCCESS) { - zend_error(E_COMPILE_ERROR, "Cannot use %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name)); } if (warn) { if (!strcmp(Z_STRVAL_P(name), "strict")) { - zend_error(E_COMPILE_ERROR, "You seem to be trying to use a different language..."); + zend_error_noreturn(E_COMPILE_ERROR, "You seem to be trying to use a different language..."); } zend_error(E_WARNING, "The use statement with non-compound name '%s' has no effect", Z_STRVAL_P(name)); } @@ -7061,16 +7140,124 @@ void zend_do_use(znode *ns_name, znode *new_name, int is_global TSRMLS_DC) /* {{ } /* }}} */ +void zend_do_use_non_class(znode *ns_name, znode *new_name, int is_global, int is_function, zend_bool case_sensitive, HashTable *current_import_sub, HashTable *lookup_table TSRMLS_DC) /* {{{ */ +{ + char *lookup_name; + zval *name, *ns, tmp; + zend_bool warn = 0; + + MAKE_STD_ZVAL(ns); + ZVAL_ZVAL(ns, &ns_name->u.constant, 0, 0); + if (new_name) { + name = &new_name->u.constant; + } else { + const char *p; + + /* The form "use A\B" is eqivalent to "use A\B as B". + So we extract the last part of compound name to use as a new_name */ + name = &tmp; + p = zend_memrchr(Z_STRVAL_P(ns), '\\', Z_STRLEN_P(ns)); + if (p) { + ZVAL_STRING(name, p+1, 1); + } else { + ZVAL_ZVAL(name, ns, 1, 0); + warn = !is_global && !CG(current_namespace); + } + } + + if (case_sensitive) { + lookup_name = estrndup(Z_STRVAL_P(name), Z_STRLEN_P(name)); + } else { + lookup_name = zend_str_tolower_dup(Z_STRVAL_P(name), Z_STRLEN_P(name)); + } + + if (CG(current_namespace)) { + /* Prefix import name with current namespace name to avoid conflicts with functions/consts */ + char *c_ns_name = emalloc(Z_STRLEN_P(CG(current_namespace)) + 1 + Z_STRLEN_P(name) + 1); + + zend_str_tolower_copy(c_ns_name, Z_STRVAL_P(CG(current_namespace)), Z_STRLEN_P(CG(current_namespace))); + c_ns_name[Z_STRLEN_P(CG(current_namespace))] = '\\'; + memcpy(c_ns_name+Z_STRLEN_P(CG(current_namespace))+1, lookup_name, Z_STRLEN_P(name)+1); + if (zend_hash_exists(lookup_table, c_ns_name, Z_STRLEN_P(CG(current_namespace)) + 1 + Z_STRLEN_P(name)+1)) { + char *tmp2 = zend_str_tolower_dup(Z_STRVAL_P(ns), Z_STRLEN_P(ns)); + + if (Z_STRLEN_P(ns) != Z_STRLEN_P(CG(current_namespace)) + 1 + Z_STRLEN_P(name) || + memcmp(tmp2, c_ns_name, Z_STRLEN_P(ns))) { + zend_error(E_COMPILE_ERROR, "Cannot use %s %s as %s because the name is already in use", is_function ? "function" : "const", Z_STRVAL_P(ns), Z_STRVAL_P(name)); + } + efree(tmp2); + } + efree(c_ns_name); + } else if (is_function) { + zend_function *function; + + if (zend_hash_find(lookup_table, lookup_name, Z_STRLEN_P(name)+1, (void **) &function) == SUCCESS && function->type == ZEND_USER_FUNCTION && strcmp(function->op_array.filename, CG(compiled_filename)) == 0) { + char *c_tmp = zend_str_tolower_dup(Z_STRVAL_P(ns), Z_STRLEN_P(ns)); + + if (Z_STRLEN_P(ns) != Z_STRLEN_P(name) || + memcmp(c_tmp, lookup_name, Z_STRLEN_P(ns))) { + zend_error(E_COMPILE_ERROR, "Cannot use function %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name)); + } + efree(c_tmp); + } + } else { + const char *filename; + + if (zend_hash_find(lookup_table, lookup_name, Z_STRLEN_P(name)+1, (void **) &filename) == SUCCESS && strcmp(filename, CG(compiled_filename)) == 0) { + char *c_tmp = zend_str_tolower_dup(Z_STRVAL_P(ns), Z_STRLEN_P(ns)); + + if (Z_STRLEN_P(ns) != Z_STRLEN_P(name) || + memcmp(c_tmp, lookup_name, Z_STRLEN_P(ns))) { + zend_error(E_COMPILE_ERROR, "Cannot use const %s as %s because the name is already in use", Z_STRVAL_P(ns), Z_STRVAL_P(name)); + } + efree(c_tmp); + } + } + + if (zend_hash_add(current_import_sub, lookup_name, Z_STRLEN_P(name)+1, &ns, sizeof(zval*), NULL) != SUCCESS) { + zend_error(E_COMPILE_ERROR, "Cannot use %s %s as %s because the name is already in use", is_function ? "function" : "const", Z_STRVAL_P(ns), Z_STRVAL_P(name)); + } + if (warn) { + zend_error(E_WARNING, "The use %s statement with non-compound name '%s' has no effect", is_function ? "function" : "const", Z_STRVAL_P(name)); + } + efree(lookup_name); + zval_dtor(name); +} +/* }}} */ + +void zend_do_use_function(znode *ns_name, znode *new_name, int is_global TSRMLS_DC) /* {{{ */ +{ + if (!CG(current_import_function)) { + CG(current_import_function) = emalloc(sizeof(HashTable)); + zend_hash_init(CG(current_import_function), 0, NULL, ZVAL_PTR_DTOR, 0); + } + + zend_do_use_non_class(ns_name, new_name, is_global, 1, 0, CG(current_import_function), CG(function_table) TSRMLS_CC); +} +/* }}} */ + +void zend_do_use_const(znode *ns_name, znode *new_name, int is_global TSRMLS_DC) /* {{{ */ +{ + if (!CG(current_import_const)) { + CG(current_import_const) = emalloc(sizeof(HashTable)); + zend_hash_init(CG(current_import_const), 0, NULL, ZVAL_PTR_DTOR, 0); + } + + zend_do_use_non_class(ns_name, new_name, is_global, 0, 1, CG(current_import_const), &CG(const_filenames) TSRMLS_CC); +} +/* }}} */ + void zend_do_declare_constant(znode *name, znode *value TSRMLS_DC) /* {{{ */ { zend_op *opline; + zval **ns_name; if(Z_TYPE(value->u.constant) == IS_CONSTANT_ARRAY) { - zend_error(E_COMPILE_ERROR, "Arrays are not allowed as constants"); + zend_error_noreturn(E_COMPILE_ERROR, "Arrays are not allowed as constants"); } if (zend_get_ct_const(&name->u.constant, 0 TSRMLS_CC)) { - zend_error(E_COMPILE_ERROR, "Cannot redeclare constant '%s'", Z_STRVAL(name->u.constant)); + zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare constant '%s'", Z_STRVAL(name->u.constant)); } if (CG(current_namespace)) { @@ -7084,18 +7271,33 @@ void zend_do_declare_constant(znode *name, znode *value TSRMLS_DC) /* {{{ */ *name = tmp; } + /* Constant name must not conflict with import names */ + if (CG(current_import_const) && + zend_hash_find(CG(current_import_const), Z_STRVAL(name->u.constant), Z_STRLEN(name->u.constant)+1, (void**)&ns_name) == SUCCESS) { + + char *tmp = estrndup(Z_STRVAL_PP(ns_name), Z_STRLEN_PP(ns_name)); + + if (Z_STRLEN_PP(ns_name) != Z_STRLEN(name->u.constant) || + memcmp(tmp, Z_STRVAL(name->u.constant), Z_STRLEN(name->u.constant))) { + zend_error(E_COMPILE_ERROR, "Cannot declare const %s because the name is already in use", Z_STRVAL(name->u.constant)); + } + efree(tmp); + } + opline = get_next_op(CG(active_op_array) TSRMLS_CC); opline->opcode = ZEND_DECLARE_CONST; SET_UNUSED(opline->result); SET_NODE(opline->op1, name); SET_NODE(opline->op2, value); + + zend_hash_add(&CG(const_filenames), Z_STRVAL(name->u.constant), Z_STRLEN(name->u.constant)+1, CG(compiled_filename), strlen(CG(compiled_filename))+1, NULL); } /* }}} */ void zend_verify_namespace(TSRMLS_D) /* {{{ */ { if (CG(has_bracketed_namespaces) && !CG(in_namespace)) { - zend_error(E_COMPILE_ERROR, "No code may exist outside of namespace {}"); + zend_error_noreturn(E_COMPILE_ERROR, "No code may exist outside of namespace {}"); } } /* }}} */ @@ -7113,6 +7315,16 @@ void zend_do_end_namespace(TSRMLS_D) /* {{{ */ efree(CG(current_import)); CG(current_import) = NULL; } + if (CG(current_import_function)) { + zend_hash_destroy(CG(current_import_function)); + efree(CG(current_import_function)); + CG(current_import_function) = NULL; + } + if (CG(current_import_const)) { + zend_hash_destroy(CG(current_import_const)); + efree(CG(current_import_const)); + CG(current_import_const) = NULL; + } } /* }}} */ @@ -7123,6 +7335,21 @@ void zend_do_end_compilation(TSRMLS_D) /* {{{ */ } /* }}} */ +void zend_do_constant_expression(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */ +{ + if (ast->kind == ZEND_CONST) { + result->u.constant = *ast->u.val; + efree(ast); + } else if (zend_ast_is_ct_constant(ast)) { + zend_ast_evaluate(&result->u.constant, ast, NULL TSRMLS_CC); + zend_ast_destroy(ast); + } else { + Z_TYPE(result->u.constant) = IS_CONSTANT_AST; + Z_AST(result->u.constant) = ast; + } +} +/* }}} */ + /* {{{ zend_dirname Returns directory name component of path */ ZEND_API size_t zend_dirname(char *path, size_t len) diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 9c55b5ebe8..5d89a2b5c0 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -23,6 +23,7 @@ #define ZEND_COMPILE_H #include "zend.h" +#include "zend_ast.h" #ifdef HAVE_STDARG_H # include <stdarg.h> @@ -74,7 +75,7 @@ typedef struct _zend_literal { #define Z_HASH_P(zv) \ (((zend_literal*)(zv))->hash_value) -typedef union _znode_op { +typedef union _znode_op { zend_uint constant; zend_uint var; zend_uint num; @@ -86,12 +87,13 @@ typedef union _znode_op { void *ptr; /* Used for passing pointers from the compile to execution phase, currently used for traits */ } znode_op; -typedef struct _znode { /* used only during compilation */ +typedef struct _znode { /* used only during compilation */ int op_type; union { znode_op op; zval constant; /* replaced by literal/zv */ zend_op_array *op_array; + zend_ast *ast; } u; zend_uint EA; /* extended attributes */ } znode; @@ -207,12 +209,14 @@ typedef struct _zend_try_catch_element { /* disable inline caching */ #define ZEND_ACC_NEVER_CACHE 0x400000 -#define ZEND_ACC_PASS_REST_BY_REFERENCE 0x1000000 -#define ZEND_ACC_PASS_REST_PREFER_REF 0x2000000 +#define ZEND_ACC_VARIADIC 0x1000000 #define ZEND_ACC_RETURN_REFERENCE 0x4000000 #define ZEND_ACC_DONE_PASS_TWO 0x8000000 +/* function has arguments with type hinting */ +#define ZEND_ACC_HAS_TYPE_HINTS 0x10000000 + char *zend_visibility_string(zend_uint fn_flags); @@ -234,12 +238,13 @@ typedef struct _zend_arg_info { const char *class_name; zend_uint class_name_len; zend_uchar type_hint; + zend_uchar pass_by_reference; zend_bool allow_null; - zend_bool pass_by_reference; + zend_bool is_variadic; } zend_arg_info; /* the following structure repeats the layout of zend_arg_info, - * but its fields have different meaning. It's used as the first element of + * but its fields have different meaning. It's used as the first element of * arg_info array to define properties of internal functions. */ typedef struct _zend_internal_function_info { @@ -249,7 +254,8 @@ typedef struct _zend_internal_function_info { zend_uint required_num_args; zend_uchar _type_hint; zend_bool return_reference; - zend_bool pass_rest_by_reference; + zend_bool _allow_null; + zend_bool _is_variadic; } zend_internal_function_info; typedef struct _zend_compiled_variable { @@ -261,7 +267,7 @@ typedef struct _zend_compiled_variable { struct _zend_op_array { /* Common elements */ zend_uchar type; - const char *function_name; + const char *function_name; zend_class_entry *scope; zend_uint fn_flags; union _zend_function *prototype; @@ -395,6 +401,7 @@ struct _zend_execute_data { zend_class_entry *current_called_scope; zval *current_this; struct _zend_op *fast_ret; /* used by FAST_CALL/FAST_RET (finally keyword) */ + zval *delayed_exception; call_slot *call_slots; call_slot *call; }; @@ -437,8 +444,10 @@ ZEND_API char *zend_get_compiled_filename(TSRMLS_D); ZEND_API int zend_get_compiled_lineno(TSRMLS_D); ZEND_API size_t zend_get_scanned_file_offset(TSRMLS_D); -void zend_resolve_non_class_name(znode *element_name, zend_bool check_namespace TSRMLS_DC); -void zend_resolve_class_name(znode *class_name, ulong fetch_type, int check_ns_name TSRMLS_DC); +void zend_resolve_non_class_name(znode *element_name, zend_bool *check_namespace, zend_bool case_sensitive, HashTable *current_import_sub TSRMLS_DC); +void zend_resolve_function_name(znode *element_name, zend_bool *check_namespace TSRMLS_DC); +void zend_resolve_const_name(znode *element_name, zend_bool *check_namespace TSRMLS_DC); +void zend_resolve_class_name(znode *class_name TSRMLS_DC); ZEND_API const char* zend_get_compiled_variable_name(const zend_op_array *op_array, zend_uint var, int* name_len); #ifdef ZTS @@ -500,7 +509,7 @@ void zend_do_add_variable(znode *result, const znode *op1, const znode *op2 TSRM int zend_do_verify_access_types(const znode *current_access_type, const znode *new_modifier); void zend_do_begin_function_declaration(znode *function_token, znode *function_name, int is_method, int return_reference, znode *fn_flags_znode TSRMLS_DC); void zend_do_end_function_declaration(const znode *function_token TSRMLS_DC); -void zend_do_receive_arg(zend_uchar op, znode *varname, const znode *offset, const znode *initialization, znode *class_type, zend_bool pass_by_reference TSRMLS_DC); +void zend_do_receive_param(zend_uchar op, znode *varname, const znode *initialization, znode *class_type, zend_bool pass_by_reference, zend_bool is_variadic TSRMLS_DC); int zend_do_begin_function_call(znode *function_name, zend_bool check_namespace TSRMLS_DC); void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC); void zend_do_clone(znode *result, const znode *expr TSRMLS_DC); @@ -636,7 +645,11 @@ void zend_do_begin_namespace(const znode *name, zend_bool with_brackets TSRMLS_D void zend_do_end_namespace(TSRMLS_D); void zend_verify_namespace(TSRMLS_D); void zend_do_use(znode *name, znode *new_name, int is_global TSRMLS_DC); +void zend_do_use_non_class(znode *ns_name, znode *new_name, int is_global, int is_function, zend_bool case_sensitive, HashTable *current_import_sub, HashTable *lookup_table TSRMLS_DC); +void zend_do_use_function(znode *name, znode *new_name, int is_global TSRMLS_DC); +void zend_do_use_const(znode *name, znode *new_name, int is_global TSRMLS_DC); void zend_do_end_compilation(TSRMLS_D); +void zend_do_constant_expression(znode *result, zend_ast *ast TSRMLS_DC); void zend_do_resolve_class_name(znode *result, znode *class_name, int is_static TSRMLS_DC); @@ -674,7 +687,7 @@ void zend_class_add_ref(zend_class_entry **ce); ZEND_API void zend_mangle_property_name(char **dest, int *dest_length, const char *src1, int src1_length, const char *src2, int src2_length, int internal); #define zend_unmangle_property_name(mangled_property, mangled_property_len, class_name, prop_name) \ - zend_unmangle_property_name_ex(mangled_property, mangled_property_len, class_name, prop_name, NULL) + zend_unmangle_property_name_ex(mangled_property, mangled_property_len, class_name, prop_name, NULL) ZEND_API int zend_unmangle_property_name_ex(const char *mangled_property, int mangled_property_len, const char **class_name, const char **prop_name, int *prop_len); #define ZEND_FUNCTION_DTOR (void (*)(void *)) zend_function_dtor @@ -726,8 +739,8 @@ int zend_add_literal(zend_op_array *op_array, const zval *zv TSRMLS_DC); #define ZEND_FETCH_CLASS_DEFAULT 0 #define ZEND_FETCH_CLASS_SELF 1 #define ZEND_FETCH_CLASS_PARENT 2 -#define ZEND_FETCH_CLASS_MAIN 3 -#define ZEND_FETCH_CLASS_GLOBAL 4 +#define ZEND_FETCH_CLASS_MAIN 3 /* unused */ +#define ZEND_FETCH_CLASS_GLOBAL 4 /* unused */ #define ZEND_FETCH_CLASS_AUTO 5 #define ZEND_FETCH_CLASS_INTERFACE 6 #define ZEND_FETCH_CLASS_STATIC 7 @@ -817,21 +830,21 @@ int zend_add_literal(zend_op_array *op_array, const zval *zv TSRMLS_DC); #define ZEND_SEND_BY_REF 1 #define ZEND_SEND_PREFER_REF 2 -#define CHECK_ARG_SEND_TYPE(zf, arg_num, m1, m2) \ - ((zf) && \ - ((((zend_function*)(zf))->common.arg_info && \ - arg_num <= ((zend_function*)(zf))->common.num_args) ? \ - (((zend_function *)(zf))->common.arg_info[arg_num-1].pass_by_reference & (m1)) : \ - (((zend_function *)(zf))->common.fn_flags & (m2)))) +#define CHECK_ARG_SEND_TYPE(zf, arg_num, m) \ + ((zf)->common.arg_info && \ + (arg_num <= (zf)->common.num_args \ + ? ((zf)->common.arg_info[arg_num-1].pass_by_reference & (m)) \ + : ((zf)->common.fn_flags & ZEND_ACC_VARIADIC) \ + ? ((zf)->common.arg_info[(zf)->common.num_args-1].pass_by_reference & (m)) : 0)) #define ARG_MUST_BE_SENT_BY_REF(zf, arg_num) \ - CHECK_ARG_SEND_TYPE(zf, arg_num, ZEND_SEND_BY_REF, ZEND_ACC_PASS_REST_BY_REFERENCE) + CHECK_ARG_SEND_TYPE(zf, arg_num, ZEND_SEND_BY_REF) #define ARG_SHOULD_BE_SENT_BY_REF(zf, arg_num) \ - CHECK_ARG_SEND_TYPE(zf, arg_num, ZEND_SEND_BY_REF|ZEND_SEND_PREFER_REF, ZEND_ACC_PASS_REST_BY_REFERENCE|ZEND_ACC_PASS_REST_PREFER_REF) + CHECK_ARG_SEND_TYPE(zf, arg_num, ZEND_SEND_BY_REF|ZEND_SEND_PREFER_REF) #define ARG_MAY_BE_SENT_BY_REF(zf, arg_num) \ - CHECK_ARG_SEND_TYPE(zf, arg_num, ZEND_SEND_PREFER_REF, ZEND_ACC_PASS_REST_PREFER_REF) + CHECK_ARG_SEND_TYPE(zf, arg_num, ZEND_SEND_PREFER_REF) #define ZEND_RETURN_VAL 0 #define ZEND_RETURN_REF 1 @@ -839,6 +852,7 @@ int zend_add_literal(zend_op_array *op_array, const zval *zv TSRMLS_DC); #define ZEND_RETURNS_FUNCTION 1<<0 #define ZEND_RETURNS_NEW 1<<1 +#define ZEND_RETURNS_VALUE 1<<2 #define ZEND_FAST_RET_TO_CATCH 1 #define ZEND_FAST_RET_TO_FINALLY 2 diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c index 21580d3d5f..a53af497cc 100644 --- a/Zend/zend_constants.c +++ b/Zend/zend_constants.c @@ -25,7 +25,7 @@ #include "zend_variables.h" #include "zend_operators.h" #include "zend_globals.h" - +#include "zend_API.h" void free_zend_constant(zend_constant *c) { @@ -38,9 +38,7 @@ void free_zend_constant(zend_constant *c) void copy_zend_constant(zend_constant *c) { - if (!IS_INTERNED(c->name)) { - c->name = zend_strndup(c->name, c->name_len - 1); - } + c->name = str_strndup(c->name, c->name_len - 1); if (!(c->flags & CONST_PERSISTENT)) { zval_copy_ctor(&c->value); } @@ -119,42 +117,12 @@ void zend_register_standard_constants(TSRMLS_D) REGISTER_MAIN_LONG_CONSTANT("DEBUG_BACKTRACE_IGNORE_ARGS", DEBUG_BACKTRACE_IGNORE_ARGS, CONST_PERSISTENT | CONST_CS); /* true/false constants */ { - zend_constant c; - - c.flags = CONST_PERSISTENT | CONST_CT_SUBST; - c.module_number = 0; - - c.name = zend_strndup(ZEND_STRL("TRUE")); - c.name_len = sizeof("TRUE"); - c.value.value.lval = 1; - c.value.type = IS_BOOL; - zend_register_constant(&c TSRMLS_CC); - - c.name = zend_strndup(ZEND_STRL("FALSE")); - c.name_len = sizeof("FALSE"); - c.value.value.lval = 0; - c.value.type = IS_BOOL; - zend_register_constant(&c TSRMLS_CC); - - c.name = zend_strndup(ZEND_STRL("NULL")); - c.name_len = sizeof("NULL"); - c.value.type = IS_NULL; - zend_register_constant(&c TSRMLS_CC); - - c.flags = CONST_PERSISTENT | CONST_CS; - - c.name = zend_strndup(ZEND_STRL("ZEND_THREAD_SAFE")); - c.name_len = sizeof("ZEND_THREAD_SAFE"); - c.value.value.lval = ZTS_V; - c.value.type = IS_BOOL; - zend_register_constant(&c TSRMLS_CC); - - c.name = zend_strndup(ZEND_STRL("ZEND_DEBUG_BUILD")); - c.name_len = sizeof("ZEND_DEBUG_BUILD"); - c.value.value.lval = ZEND_DEBUG; - c.value.type = IS_BOOL; - zend_register_constant(&c TSRMLS_CC); + REGISTER_MAIN_BOOL_CONSTANT("TRUE", 1, CONST_PERSISTENT | CONST_CT_SUBST); + REGISTER_MAIN_BOOL_CONSTANT("FALSE", 0, CONST_PERSISTENT | CONST_CT_SUBST); + REGISTER_MAIN_BOOL_CONSTANT("ZEND_THREAD_SAFE", ZTS_V, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_BOOL_CONSTANT("ZEND_DEBUG_BUILD", ZEND_DEBUG, CONST_PERSISTENT | CONST_CS); } + REGISTER_MAIN_NULL_CONSTANT("NULL", CONST_PERSISTENT | CONST_CT_SUBST); } @@ -175,13 +143,35 @@ void clean_non_persistent_constants(TSRMLS_D) } } +ZEND_API void zend_register_null_constant(const char *name, uint name_len, int flags, int module_number TSRMLS_DC) +{ + zend_constant c; + + ZVAL_NULL(&c.value); + c.flags = flags; + c.name = zend_strndup(name, name_len-1); + c.name_len = name_len; + c.module_number = module_number; + zend_register_constant(&c TSRMLS_CC); +} + +ZEND_API void zend_register_bool_constant(const char *name, uint name_len, zend_bool bval, int flags, int module_number TSRMLS_DC) +{ + zend_constant c; + + ZVAL_BOOL(&c.value, bval); + c.flags = flags; + c.name = zend_strndup(name, name_len-1); + c.name_len = name_len; + c.module_number = module_number; + zend_register_constant(&c TSRMLS_CC); +} ZEND_API void zend_register_long_constant(const char *name, uint name_len, long lval, int flags, int module_number TSRMLS_DC) { zend_constant c; - c.value.type = IS_LONG; - c.value.value.lval = lval; + ZVAL_LONG(&c.value, lval); c.flags = flags; c.name = zend_strndup(name, name_len-1); c.name_len = name_len; @@ -194,8 +184,7 @@ ZEND_API void zend_register_double_constant(const char *name, uint name_len, dou { zend_constant c; - c.value.type = IS_DOUBLE; - c.value.value.dval = dval; + ZVAL_DOUBLE(&c.value, dval); c.flags = flags; c.name = zend_strndup(name, name_len-1); c.name_len = name_len; @@ -208,9 +197,7 @@ ZEND_API void zend_register_stringl_constant(const char *name, uint name_len, ch { zend_constant c; - c.value.type = IS_STRING; - c.value.value.str.val = strval; - c.value.value.str.len = strlen; + ZVAL_STRINGL(&c.value, strval, strlen, 0); c.flags = flags; c.name = zend_strndup(name, name_len-1); c.name_len = name_len; @@ -485,7 +472,7 @@ ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC) char *lowercase_name = NULL; char *name; int ret = SUCCESS; - ulong chash = 0; + ulong chash; #if 0 printf("Registering constant for module %d\n", c->module_number); @@ -497,23 +484,18 @@ ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC) zend_str_tolower(lowercase_name, c->name_len-1); lowercase_name = (char*)zend_new_interned_string(lowercase_name, c->name_len, 1 TSRMLS_CC); name = lowercase_name; - chash = IS_INTERNED(lowercase_name) ? INTERNED_HASH(lowercase_name) : 0; } else { char *slash = strrchr(c->name, '\\'); - if(slash) { + if (slash) { lowercase_name = estrndup(c->name, c->name_len-1); zend_str_tolower(lowercase_name, slash-c->name); lowercase_name = (char*)zend_new_interned_string(lowercase_name, c->name_len, 1 TSRMLS_CC); name = lowercase_name; - - chash = IS_INTERNED(lowercase_name) ? INTERNED_HASH(lowercase_name) : 0; } else { name = c->name; } } - if (chash == 0) { - chash = zend_hash_func(name, c->name_len); - } + chash = str_hash(name, c->name_len-1); /* Check if the user is trying to define the internal pseudo constant name __COMPILER_HALT_OFFSET__ */ if ((c->name_len == sizeof("__COMPILER_HALT_OFFSET__") @@ -532,8 +514,8 @@ ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC) } ret = FAILURE; } - if (lowercase_name && !IS_INTERNED(lowercase_name)) { - efree(lowercase_name); + if (lowercase_name) { + str_efree(lowercase_name); } return ret; } diff --git a/Zend/zend_constants.h b/Zend/zend_constants.h index c7261946c8..718c173cc7 100644 --- a/Zend/zend_constants.h +++ b/Zend/zend_constants.h @@ -38,16 +38,22 @@ typedef struct _zend_constant { int module_number; } zend_constant; +#define REGISTER_NULL_CONSTANT(name, flags) zend_register_null_constant((name), sizeof(name), (flags), module_number TSRMLS_CC) +#define REGISTER_BOOL_CONSTANT(name, bval, flags) zend_register_bool_constant((name), sizeof(name), (bval), (flags), module_number TSRMLS_CC) #define REGISTER_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name), (lval), (flags), module_number TSRMLS_CC) #define REGISTER_DOUBLE_CONSTANT(name, dval, flags) zend_register_double_constant((name), sizeof(name), (dval), (flags), module_number TSRMLS_CC) #define REGISTER_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name), (str), (flags), module_number TSRMLS_CC) #define REGISTER_STRINGL_CONSTANT(name, str, len, flags) zend_register_stringl_constant((name), sizeof(name), (str), (len), (flags), module_number TSRMLS_CC) +#define REGISTER_NS_NULL_CONSTANT(ns, name, flags) zend_register_null_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (flags), module_number TSRMLS_CC) +#define REGISTER_NS_BOOL_CONSTANT(ns, name, bval, flags) zend_register_bool_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (bval), (flags), module_number TSRMLS_CC) #define REGISTER_NS_LONG_CONSTANT(ns, name, lval, flags) zend_register_long_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (lval), (flags), module_number TSRMLS_CC) #define REGISTER_NS_DOUBLE_CONSTANT(ns, name, dval, flags) zend_register_double_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (dval), (flags), module_number TSRMLS_CC) #define REGISTER_NS_STRING_CONSTANT(ns, name, str, flags) zend_register_string_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (str), (flags), module_number TSRMLS_CC) #define REGISTER_NS_STRINGL_CONSTANT(ns, name, str, len, flags) zend_register_stringl_constant(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name)), (str), (len), (flags), module_number TSRMLS_CC) +#define REGISTER_MAIN_NULL_CONSTANT(name, flags) zend_register_null_constant((name), sizeof(name), (flags), 0 TSRMLS_CC) +#define REGISTER_MAIN_BOOL_CONSTANT(name, bval, flags) zend_register_bool_constant((name), sizeof(name), (bval), (flags), 0 TSRMLS_CC) #define REGISTER_MAIN_LONG_CONSTANT(name, lval, flags) zend_register_long_constant((name), sizeof(name), (lval), (flags), 0 TSRMLS_CC) #define REGISTER_MAIN_DOUBLE_CONSTANT(name, dval, flags) zend_register_double_constant((name), sizeof(name), (dval), (flags), 0 TSRMLS_CC) #define REGISTER_MAIN_STRING_CONSTANT(name, str, flags) zend_register_string_constant((name), sizeof(name), (str), (flags), 0 TSRMLS_CC) @@ -62,6 +68,8 @@ void zend_register_standard_constants(TSRMLS_D); void clean_non_persistent_constants(TSRMLS_D); ZEND_API int zend_get_constant(const char *name, uint name_len, zval *result TSRMLS_DC); ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result, zend_class_entry *scope, ulong flags TSRMLS_DC); +ZEND_API void zend_register_bool_constant(const char *name, uint name_len, zend_bool bval, int flags, int module_number TSRMLS_DC); +ZEND_API void zend_register_null_constant(const char *name, uint name_len, int flags, int module_number TSRMLS_DC); ZEND_API void zend_register_long_constant(const char *name, uint name_len, long lval, int flags, int module_number TSRMLS_DC); ZEND_API void zend_register_double_constant(const char *name, uint name_len, double dval, int flags, int module_number TSRMLS_DC); ZEND_API void zend_register_string_constant(const char *name, uint name_len, char *strval, int flags, int module_number TSRMLS_DC); diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index f1ec47f73b..5c6d3e780b 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -40,7 +40,7 @@ #include "zend_dtrace.h" /* Virtual current working directory support */ -#include "tsrm_virtual_cwd.h" +#include "zend_virtual_cwd.h" #define _CONST_CODE 0 #define _TMP_CODE 1 @@ -79,7 +79,6 @@ static zend_always_inline void zend_pzval_unlock_func(zval *z, zend_free_op *sho if (unref && Z_ISREF_P(z) && Z_REFCOUNT_P(z) == 1) { Z_UNSET_ISREF_P(z); } - GC_ZVAL_CHECK_POSSIBLE_ROOT(z); } } @@ -94,7 +93,8 @@ static zend_always_inline void zend_pzval_unlock_free_func(zval *z TSRMLS_DC) } #undef zval_ptr_dtor -#define zval_ptr_dtor(pzv) i_zval_ptr_dtor(*(pzv) ZEND_FILE_LINE_CC) +#define zval_ptr_dtor(pzv) i_zval_ptr_dtor(*(pzv) ZEND_FILE_LINE_CC TSRMLS_CC) +#define zval_ptr_dtor_nogc(pzv) i_zval_ptr_dtor_nogc(*(pzv) ZEND_FILE_LINE_CC TSRMLS_CC) #define PZVAL_UNLOCK(z, f) zend_pzval_unlock_func(z, f, 1 TSRMLS_CC) #define PZVAL_UNLOCK_EX(z, f, u) zend_pzval_unlock_func(z, f, u TSRMLS_CC) @@ -102,16 +102,14 @@ static zend_always_inline void zend_pzval_unlock_free_func(zval *z TSRMLS_DC) #define PZVAL_LOCK(z) Z_ADDREF_P((z)) #define SELECTIVE_PZVAL_LOCK(pzv, opline) if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(pzv); } -#define EXTRACT_ZVAL_PTR(t) do { \ - temp_variable *__t = (t); \ - if (__t->var.ptr_ptr) { \ - __t->var.ptr = *__t->var.ptr_ptr; \ - __t->var.ptr_ptr = &__t->var.ptr; \ - if (!PZVAL_IS_REF(__t->var.ptr) && \ - Z_REFCOUNT_P(__t->var.ptr) > 2) { \ - SEPARATE_ZVAL(__t->var.ptr_ptr); \ - } \ - } \ +#define EXTRACT_ZVAL_PTR(t) do { \ + temp_variable *__t = (t); \ + __t->var.ptr = *__t->var.ptr_ptr; \ + __t->var.ptr_ptr = &__t->var.ptr; \ + if (!PZVAL_IS_REF(__t->var.ptr) && \ + Z_REFCOUNT_P(__t->var.ptr) > 2) { \ + SEPARATE_ZVAL(__t->var.ptr_ptr); \ + } \ } while (0) #define AI_SET_PTR(t, val) do { \ @@ -125,18 +123,18 @@ static zend_always_inline void zend_pzval_unlock_free_func(zval *z TSRMLS_DC) if ((zend_uintptr_t)should_free.var & 1L) { \ zval_dtor((zval*)((zend_uintptr_t)should_free.var & ~1L)); \ } else { \ - zval_ptr_dtor(&should_free.var); \ + zval_ptr_dtor_nogc(&should_free.var); \ } \ } #define FREE_OP_IF_VAR(should_free) \ if (should_free.var != NULL && (((zend_uintptr_t)should_free.var & 1L) == 0)) { \ - zval_ptr_dtor(&should_free.var); \ + zval_ptr_dtor_nogc(&should_free.var); \ } #define FREE_OP_VAR_PTR(should_free) \ if (should_free.var) { \ - zval_ptr_dtor(&should_free.var); \ + zval_ptr_dtor_nogc(&should_free.var); \ } #define TMP_FREE(z) (zval*)(((zend_uintptr_t)(z)) | 1L) @@ -183,8 +181,7 @@ static zend_always_inline zval *_get_zval_ptr_var(zend_uint var, const zend_exec { zval *ptr = EX_T(var).var.ptr; - PZVAL_UNLOCK(ptr, should_free); - return ptr; + return should_free->var = ptr; } static zend_never_inline zval **_get_zval_cv_lookup(zval ***ptr, zend_uint var, int type TSRMLS_DC) @@ -386,6 +383,19 @@ static zend_always_inline zval **_get_zval_ptr_ptr_var(zend_uint var, const zend return ptr_ptr; } +static zend_always_inline zval **_get_zval_ptr_ptr_var_fast(zend_uint var, const zend_execute_data *execute_data, zend_free_op *should_free TSRMLS_DC) +{ + zval** ptr_ptr = EX_T(var).var.ptr_ptr; + + if (EXPECTED(ptr_ptr != NULL)) { + should_free->var = *ptr_ptr; + } else { + /* string offset */ + should_free->var = EX_T(var).str_offset.str; + } + return ptr_ptr; +} + static zend_always_inline zval **_get_zval_ptr_ptr_cv(zend_uint var, int type TSRMLS_DC) { zval ***ptr = EX_CV_NUM(EG(current_execute_data), var); @@ -604,12 +614,17 @@ static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zva char *need_msg; zend_class_entry *ce; - if (!zf->common.arg_info - || arg_num>zf->common.num_args) { + if (!zf->common.arg_info) { return 1; } - cur_arg_info = &zf->common.arg_info[arg_num-1]; + if (arg_num <= zf->common.num_args) { + cur_arg_info = &zf->common.arg_info[arg_num-1]; + } else if (zf->common.fn_flags & ZEND_ACC_VARIADIC) { + cur_arg_info = &zf->common.arg_info[zf->common.num_args-1]; + } else { + return 1; + } if (cur_arg_info->class_name) { const char *class_name; @@ -755,32 +770,21 @@ static inline void zend_assign_to_object(zval **retval, zval **object_ptr, zval static inline int zend_assign_to_string_offset(const temp_variable *T, const zval *value, int value_type TSRMLS_DC) { - if (Z_TYPE_P(T->str_offset.str) == IS_STRING) { - - if (((int)T->str_offset.offset < 0)) { - zend_error(E_WARNING, "Illegal string offset: %d", T->str_offset.offset); + zval *str = T->str_offset.str; + zend_uint offset = T->str_offset.offset; + if (Z_TYPE_P(str) == IS_STRING) { + if ((int)offset < 0) { + zend_error(E_WARNING, "Illegal string offset: %d", offset); return 0; } - if (T->str_offset.offset >= Z_STRLEN_P(T->str_offset.str)) { - if (IS_INTERNED(Z_STRVAL_P(T->str_offset.str))) { - char *tmp = (char *) emalloc(T->str_offset.offset+1+1); - - memcpy(tmp, Z_STRVAL_P(T->str_offset.str), Z_STRLEN_P(T->str_offset.str)+1); - Z_STRVAL_P(T->str_offset.str) = tmp; - } else { - Z_STRVAL_P(T->str_offset.str) = (char *) erealloc(Z_STRVAL_P(T->str_offset.str), T->str_offset.offset+1+1); - } - memset(Z_STRVAL_P(T->str_offset.str) + Z_STRLEN_P(T->str_offset.str), - ' ', - T->str_offset.offset - Z_STRLEN_P(T->str_offset.str)); - Z_STRVAL_P(T->str_offset.str)[T->str_offset.offset+1] = 0; - Z_STRLEN_P(T->str_offset.str) = T->str_offset.offset+1; - } else if (IS_INTERNED(Z_STRVAL_P(T->str_offset.str))) { - char *tmp = (char *) emalloc(Z_STRLEN_P(T->str_offset.str) + 1); - - memcpy(tmp, Z_STRVAL_P(T->str_offset.str), Z_STRLEN_P(T->str_offset.str) + 1); - Z_STRVAL_P(T->str_offset.str) = tmp; + if (offset >= Z_STRLEN_P(str)) { + Z_STRVAL_P(str) = str_erealloc(Z_STRVAL_P(str), offset+1+1); + memset(Z_STRVAL_P(str) + Z_STRLEN_P(str), ' ', offset - Z_STRLEN_P(str)); + Z_STRVAL_P(str)[offset+1] = 0; + Z_STRLEN_P(str) = offset+1; + } else if (IS_INTERNED(Z_STRVAL_P(str))) { + Z_STRVAL_P(str) = estrndup(Z_STRVAL_P(str), Z_STRLEN_P(str)); } if (Z_TYPE_P(value) != IS_STRING) { @@ -791,15 +795,15 @@ static inline int zend_assign_to_string_offset(const temp_variable *T, const zva zval_copy_ctor(&tmp); } convert_to_string(&tmp); - Z_STRVAL_P(T->str_offset.str)[T->str_offset.offset] = Z_STRVAL(tmp)[0]; - STR_FREE(Z_STRVAL(tmp)); + Z_STRVAL_P(str)[offset] = Z_STRVAL(tmp)[0]; + str_efree(Z_STRVAL(tmp)); } else { - Z_STRVAL_P(T->str_offset.str)[T->str_offset.offset] = Z_STRVAL_P(value)[0]; + Z_STRVAL_P(str)[offset] = Z_STRVAL_P(value)[0]; if (value_type == IS_TMP_VAR) { /* we can safely free final_value here * because separation is done only * in case value_type == IS_VAR */ - STR_FREE(Z_STRVAL_P(value)); + str_efree(Z_STRVAL_P(value)); } } /* @@ -909,7 +913,7 @@ static inline zval* zend_assign_to_variable(zval **variable_ptr_ptr, zval *value } else { /* we need to split */ Z_DELREF_P(variable_ptr); GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr); - if (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) { + if (PZVAL_IS_REF(value)) { ALLOC_ZVAL(variable_ptr); *variable_ptr_ptr = variable_ptr; INIT_PZVAL_COPY(variable_ptr, value); @@ -918,7 +922,6 @@ static inline zval* zend_assign_to_variable(zval **variable_ptr_ptr, zval *value } else { *variable_ptr_ptr = value; Z_ADDREF_P(value); - Z_UNSET_ISREF_P(value); return value; } } @@ -1013,11 +1016,7 @@ static inline zval **zend_fetch_dimension_address_inner(HashTable *ht, const zva hval = Z_HASH_P(dim); } else { ZEND_HANDLE_NUMERIC_EX(offset_key, offset_key_length+1, hval, goto num_index); - if (IS_INTERNED(offset_key)) { - hval = INTERNED_HASH(offset_key); - } else { - hval = zend_hash_func(offset_key, offset_key_length+1); - } + hval = str_hash(offset_key, offset_key_length); } fetch_string_dim: if (zend_hash_quick_find(ht, offset_key, offset_key_length+1, hval, (void **) &retval) == FAILURE) { @@ -1214,12 +1213,12 @@ convert_to_array: zend_error(E_NOTICE, "Indirect modification of overloaded element of %s has no effect", ce->name); } } - retval = &overloaded_result; + AI_SET_PTR(result, overloaded_result); + PZVAL_LOCK(overloaded_result); } else { - retval = &EG(error_zval_ptr); + result->var.ptr_ptr = &EG(error_zval_ptr); + PZVAL_LOCK(EG(error_zval_ptr)); } - AI_SET_PTR(result, *retval); - PZVAL_LOCK(*retval); if (dim_type == IS_TMP_VAR) { zval_ptr_dtor(&dim); } @@ -1236,8 +1235,8 @@ convert_to_array: default: if (type == BP_VAR_UNSET) { zend_error(E_WARNING, "Cannot unset offset in a non-array variable"); - AI_SET_PTR(result, &EG(uninitialized_zval)); - PZVAL_LOCK(&EG(uninitialized_zval)); + result->var.ptr_ptr = &EG(uninitialized_zval_ptr); + PZVAL_LOCK(EG(uninitialized_zval_ptr)); } else { zend_error(E_WARNING, "Cannot use a scalar value as an array"); result->var.ptr_ptr = &EG(error_zval_ptr); @@ -1255,12 +1254,12 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval *conta case IS_ARRAY: retval = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, dim_type, type TSRMLS_CC); - AI_SET_PTR(result, *retval); + result->var.ptr = *retval; PZVAL_LOCK(*retval); return; case IS_NULL: - AI_SET_PTR(result, &EG(uninitialized_zval)); + result->var.ptr = &EG(uninitialized_zval); PZVAL_LOCK(&EG(uninitialized_zval)); return; @@ -1313,7 +1312,7 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval *conta Z_STRVAL_P(ptr)[1] = 0; Z_STRLEN_P(ptr) = 1; } - AI_SET_PTR(result, ptr); + result->var.ptr = ptr; return; } break; @@ -1331,12 +1330,14 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval *conta } overloaded_result = Z_OBJ_HT_P(container)->read_dimension(container, dim, type TSRMLS_CC); - if (overloaded_result) { - AI_SET_PTR(result, overloaded_result); - PZVAL_LOCK(overloaded_result); - } else if (result) { - AI_SET_PTR(result, &EG(uninitialized_zval)); - PZVAL_LOCK(&EG(uninitialized_zval)); + if (result) { + if (overloaded_result) { + result->var.ptr = overloaded_result; + PZVAL_LOCK(overloaded_result); + } else { + result->var.ptr = &EG(uninitialized_zval); + PZVAL_LOCK(&EG(uninitialized_zval)); + } } if (dim_type == IS_TMP_VAR) { zval_ptr_dtor(&dim); @@ -1345,7 +1346,7 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval *conta return; default: - AI_SET_PTR(result, &EG(uninitialized_zval)); + result->var.ptr = &EG(uninitialized_zval); PZVAL_LOCK(&EG(uninitialized_zval)); return; } @@ -1475,15 +1476,17 @@ ZEND_API opcode_handler_t *zend_opcode_handlers; ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, zend_fcall_info *fci, int return_value_used TSRMLS_DC) { - if(fci != NULL) { - ((zend_internal_function *) execute_data_ptr->function_state.function)->handler(fci->param_count, - *fci->retval_ptr_ptr, fci->retval_ptr_ptr, fci->object_ptr, 1 TSRMLS_CC); - + if (fci != NULL) { + execute_data_ptr->function_state.function->internal_function.handler( + fci->param_count, *fci->retval_ptr_ptr, fci->retval_ptr_ptr, + fci->object_ptr, 1 TSRMLS_CC + ); } else { zval **return_value_ptr = &EX_TMP_VAR(execute_data_ptr, execute_data_ptr->opline->result.var)->var.ptr; - ((zend_internal_function *) execute_data_ptr->function_state.function)->handler(execute_data_ptr->opline->extended_value, *return_value_ptr, - (execute_data_ptr->function_state.function->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)?return_value_ptr:NULL, - execute_data_ptr->object, return_value_used TSRMLS_CC); + execute_data_ptr->function_state.function->internal_function.handler( + execute_data_ptr->opline->extended_value, *return_value_ptr, return_value_ptr, + execute_data_ptr->object, return_value_used TSRMLS_CC + ); } } @@ -1501,7 +1504,7 @@ void zend_clean_and_cache_symbol_table(HashTable *symbol_table TSRMLS_DC) /* {{{ } /* }}} */ -static zend_always_inline void i_free_compiled_variables(zend_execute_data *execute_data) /* {{{ */ +static zend_always_inline void i_free_compiled_variables(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */ { zval ***cv = EX_CV_NUM(execute_data, 0); zval ***end = cv + EX(op_array)->last_var; @@ -1514,9 +1517,9 @@ static zend_always_inline void i_free_compiled_variables(zend_execute_data *exec } /* }}} */ -void zend_free_compiled_variables(zend_execute_data *execute_data) /* {{{ */ +void zend_free_compiled_variables(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */ { - i_free_compiled_variables(execute_data); + i_free_compiled_variables(execute_data TSRMLS_CC); } /* }}} */ @@ -1647,6 +1650,7 @@ static zend_always_inline zend_execute_data *i_create_execute_data_from_op_array EX(call) = NULL; EG(current_execute_data) = execute_data; EX(nested) = nested; + EX(delayed_exception) = NULL; if (!op_array->run_time_cache && op_array->last_cache_slot) { op_array->run_time_cache = ecalloc(op_array->last_cache_slot, sizeof(void*)); @@ -1674,7 +1678,7 @@ static zend_always_inline zend_execute_data *i_create_execute_data_from_op_array } /* }}} */ -zend_execute_data *zend_create_execute_data_from_op_array(zend_op_array *op_array, zend_bool nested TSRMLS_DC) /* {{{ */ +ZEND_API zend_execute_data *zend_create_execute_data_from_op_array(zend_op_array *op_array, zend_bool nested TSRMLS_DC) /* {{{ */ { return i_create_execute_data_from_op_array(op_array, nested TSRMLS_CC); } diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index ff0758772e..ca619dbf50 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -56,7 +56,7 @@ ZEND_API extern void (*zend_execute_internal)(zend_execute_data *execute_data_pt void init_executor(TSRMLS_D); void shutdown_executor(TSRMLS_D); void shutdown_destructors(TSRMLS_D); -zend_execute_data *zend_create_execute_data_from_op_array(zend_op_array *op_array, zend_bool nested TSRMLS_DC); +ZEND_API zend_execute_data *zend_create_execute_data_from_op_array(zend_op_array *op_array, zend_bool nested TSRMLS_DC); ZEND_API void zend_execute(zend_op_array *op_array TSRMLS_DC); ZEND_API void execute_ex(zend_execute_data *execute_data TSRMLS_DC); ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, struct _zend_fcall_info *fci, int return_value_used TSRMLS_DC); @@ -71,18 +71,14 @@ ZEND_API int zend_eval_stringl_ex(char *str, int str_len, zval *retval_ptr, char ZEND_API char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, ulong fetch_type, const char **class_name, zend_class_entry **pce TSRMLS_DC); ZEND_API int zend_verify_arg_error(int error_type, const zend_function *zf, zend_uint arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind TSRMLS_DC); -static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC) +static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC TSRMLS_DC) { if (!Z_DELREF_P(zval_ptr)) { - TSRMLS_FETCH(); - ZEND_ASSERT(zval_ptr != &EG(uninitialized_zval)); GC_REMOVE_ZVAL_FROM_BUFFER(zval_ptr); zval_dtor(zval_ptr); efree_rel(zval_ptr); } else { - TSRMLS_FETCH(); - if (Z_REFCOUNT_P(zval_ptr) == 1) { Z_UNSET_ISREF_P(zval_ptr); } @@ -91,6 +87,20 @@ static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC) } } +static zend_always_inline void i_zval_ptr_dtor_nogc(zval *zval_ptr ZEND_FILE_LINE_DC TSRMLS_DC) +{ + if (!Z_DELREF_P(zval_ptr)) { + ZEND_ASSERT(zval_ptr != &EG(uninitialized_zval)); + GC_REMOVE_ZVAL_FROM_BUFFER(zval_ptr); + zval_dtor(zval_ptr); + efree_rel(zval_ptr); + } else { + if (Z_REFCOUNT_P(zval_ptr) == 1) { + Z_UNSET_ISREF_P(zval_ptr); + } + } +} + static zend_always_inline int i_zend_is_true(zval *op) { int result; @@ -295,7 +305,7 @@ static zend_always_inline void zend_vm_stack_clear_multiple(int nested TSRMLS_DC while (p != end) { zval *q = (zval *) *(--p); *p = NULL; - i_zval_ptr_dtor(q ZEND_FILE_LINE_CC); + i_zval_ptr_dtor(q ZEND_FILE_LINE_CC TSRMLS_CC); } if (nested) { EG(argument_stack)->top = p; @@ -394,7 +404,7 @@ ZEND_API zval **zend_get_zval_ptr_ptr(int op_type, const znode_op *node, const z ZEND_API int zend_do_fcall(ZEND_OPCODE_HANDLER_ARGS); void zend_clean_and_cache_symbol_table(HashTable *symbol_table TSRMLS_DC); -void zend_free_compiled_variables(zend_execute_data *execute_data); +void zend_free_compiled_variables(zend_execute_data *execute_data TSRMLS_DC); #define CACHED_PTR(num) \ EG(active_op_array)->run_time_cache[(num)] diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 3cc8b10083..82689ed7d6 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -423,7 +423,8 @@ ZEND_API zend_bool zend_is_executing(TSRMLS_D) /* {{{ */ ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC) /* {{{ */ { - i_zval_ptr_dtor(*zval_ptr ZEND_FILE_LINE_RELAY_CC); + TSRMLS_FETCH(); + i_zval_ptr_dtor(*zval_ptr ZEND_FILE_LINE_RELAY_CC TSRMLS_CC); } /* }}} */ @@ -533,13 +534,13 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco if (fix_save) { save--; } - if (inline_change && !IS_INTERNED(save)) { - efree(save); + if (inline_change) { + str_efree(save); } save = NULL; } - if (inline_change && save && save != actual && !IS_INTERNED(save)) { - efree(save); + if (inline_change && save && save != actual) { + str_efree(save); } zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", actual, actual); p->type = IS_STRING; @@ -551,7 +552,7 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco } } else { if (inline_change) { - STR_FREE(Z_STRVAL_P(p)); + str_efree(Z_STRVAL_P(p)); } *p = const_value; } @@ -591,7 +592,10 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco zend_hash_move_forward(Z_ARRVAL_P(p)); continue; } - if (!zend_get_constant_ex(str_index, str_index_len - 3, &const_value, scope, str_index[str_index_len - 2] TSRMLS_CC)) { + if (str_index[str_index_len - 2] == IS_CONSTANT_AST) { + zend_ast_evaluate(&const_value, *(zend_ast **)str_index, scope TSRMLS_CC); + zend_ast_destroy(*(zend_ast **)str_index); + } else if (!zend_get_constant_ex(str_index, str_index_len - 3, &const_value, scope, str_index[str_index_len - 2] TSRMLS_CC)) { char *actual; const char *save = str_index; if ((colon = (char*)zend_memrchr(str_index, ':', str_index_len - 3))) { @@ -659,6 +663,15 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco } zend_hash_apply_with_argument(Z_ARRVAL_P(p), (apply_func_arg_t) zval_update_constant_inline_change, (void *) scope TSRMLS_CC); zend_hash_internal_pointer_reset(Z_ARRVAL_P(p)); + } else if (Z_TYPE_P(p) == IS_CONSTANT_AST) { + SEPARATE_ZVAL_IF_NOT_REF(pp); + p = *pp; + + zend_ast_evaluate(&const_value, Z_AST_P(p), scope TSRMLS_CC); + if (inline_change) { + zend_ast_destroy(Z_AST_P(p)); + } + ZVAL_COPY_VALUE(p, &const_value); } return 0; } @@ -952,9 +965,9 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS if (EX(function_state).function->common.scope) { EG(scope) = EX(function_state).function->common.scope; } - if(EXPECTED(zend_execute_internal == NULL)) { + if (EXPECTED(zend_execute_internal == NULL)) { /* saves one function call if zend_execute_internal is not used */ - ((zend_internal_function *) EX(function_state).function)->handler(fci->param_count, *fci->retval_ptr_ptr, fci->retval_ptr_ptr, fci->object_ptr, 1 TSRMLS_CC); + EX(function_state).function->internal_function.handler(fci->param_count, *fci->retval_ptr_ptr, fci->retval_ptr_ptr, fci->object_ptr, 1 TSRMLS_CC); } else { zend_execute_internal(&execute_data, fci, 1 TSRMLS_CC); } diff --git a/Zend/zend_extensions.h b/Zend/zend_extensions.h index 83cad7f38d..e59c9ade8b 100644 --- a/Zend/zend_extensions.h +++ b/Zend/zend_extensions.h @@ -28,7 +28,7 @@ /* The first number is the engine version and the rest is the date. * This way engine 2/3 API no. is always greater than engine 1 API no.. */ -#define ZEND_EXTENSION_API_NO 220121212 +#define ZEND_EXTENSION_API_NO 220131107 typedef struct _zend_extension_version_info { int zend_extension_api_no; diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c index ec9e9b89fb..e121e3c92a 100644 --- a/Zend/zend_generators.c +++ b/Zend/zend_generators.c @@ -113,7 +113,7 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished zend_op_array *op_array = execute_data->op_array; if (!execute_data->symbol_table) { - zend_free_compiled_variables(execute_data); + zend_free_compiled_variables(execute_data TSRMLS_CC); } else { zend_clean_and_cache_symbol_table(execute_data->symbol_table TSRMLS_CC); } @@ -466,7 +466,7 @@ ZEND_METHOD(Generator, current) zend_generator_ensure_initialized(generator TSRMLS_CC); if (generator->value) { - RETURN_ZVAL(generator->value, 1, 0); + RETURN_ZVAL_FAST(generator->value); } } /* }}} */ @@ -486,7 +486,7 @@ ZEND_METHOD(Generator, key) zend_generator_ensure_initialized(generator TSRMLS_CC); if (generator->key) { - RETURN_ZVAL(generator->key, 1, 0); + RETURN_ZVAL_FAST(generator->key); } } /* }}} */ @@ -539,7 +539,7 @@ ZEND_METHOD(Generator, send) zend_generator_resume(generator TSRMLS_CC); if (generator->value) { - RETURN_ZVAL(generator->value, 1, 0); + RETURN_ZVAL_FAST(generator->value); } } /* }}} */ @@ -574,7 +574,7 @@ ZEND_METHOD(Generator, throw) zend_generator_resume(generator TSRMLS_CC); if (generator->value) { - RETURN_ZVAL(generator->value, 1, 0); + RETURN_ZVAL_FAST(generator->value); } } else { /* If the generator is already closed throw the exception in the diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h index b9a5b39914..27d471fa06 100644 --- a/Zend/zend_globals.h +++ b/Zend/zend_globals.h @@ -131,9 +131,13 @@ struct _zend_compiler_globals { zval *current_namespace; HashTable *current_import; + HashTable *current_import_function; + HashTable *current_import_const; zend_bool in_namespace; zend_bool has_bracketed_namespaces; + HashTable const_filenames; + zend_compiler_context context; zend_stack context_stack; diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c index 96c3f3d7b5..e938d1d3d7 100644 --- a/Zend/zend_hash.c +++ b/Zend/zend_hash.c @@ -96,7 +96,7 @@ static void _zend_is_inconsistent(const HashTable *ht, const char *file, int lin zend_hash_do_resize(ht); \ } -static int zend_hash_do_resize(HashTable *ht); +static void zend_hash_do_resize(HashTable *ht); ZEND_API ulong zend_hash_func(const char *arKey, uint nKeyLength) { @@ -128,10 +128,6 @@ ZEND_API ulong zend_hash_func(const char *arKey, uint nKeyLength) (p)->pData = &(p)->pDataPtr; \ } else { \ (p)->pData = (void *) pemalloc_rel(nDataSize, (ht)->persistent);\ - if (!(p)->pData) { \ - pefree_rel(p, (ht)->persistent); \ - return FAILURE; \ - } \ memcpy((p)->pData, pData, nDataSize); \ (p)->pDataPtr=NULL; \ } @@ -145,7 +141,7 @@ ZEND_API ulong zend_hash_func(const char *arKey, uint nKeyLength) static const Bucket *uninitialized_bucket = NULL; -ZEND_API int _zend_hash_init(HashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC) +ZEND_API int _zend_hash_init(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC) { uint i = 3; @@ -176,9 +172,9 @@ ZEND_API int _zend_hash_init(HashTable *ht, uint nSize, hash_func_t pHashFunctio } -ZEND_API int _zend_hash_init_ex(HashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC) +ZEND_API int _zend_hash_init_ex(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC) { - int retval = _zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent ZEND_FILE_LINE_CC); + int retval = _zend_hash_init(ht, nSize, pDestructor, persistent ZEND_FILE_LINE_CC); ht->bApplyProtection = bApplyProtection; return retval; @@ -203,12 +199,7 @@ ZEND_API int _zend_hash_add_or_update(HashTable *ht, const char *arKey, uint nKe IS_CONSISTENT(ht); - if (nKeyLength <= 0) { -#if ZEND_DEBUG - ZEND_PUTS("zend_hash_update: Can't put in empty key\n"); -#endif - return FAILURE; - } + ZEND_ASSERT(nKeyLength != 0); CHECK_INIT(ht); @@ -222,14 +213,8 @@ ZEND_API int _zend_hash_add_or_update(HashTable *ht, const char *arKey, uint nKe if (flag & HASH_ADD) { return FAILURE; } + ZEND_ASSERT(p->pData != pData); HANDLE_BLOCK_INTERRUPTIONS(); -#if ZEND_DEBUG - if (p->pData == pData) { - ZEND_PUTS("Fatal error in zend_hash_update: p->pData == pData\n"); - HANDLE_UNBLOCK_INTERRUPTIONS(); - return FAILURE; - } -#endif if (ht->pDestructor) { ht->pDestructor(p->pData); } @@ -245,15 +230,9 @@ ZEND_API int _zend_hash_add_or_update(HashTable *ht, const char *arKey, uint nKe if (IS_INTERNED(arKey)) { p = (Bucket *) pemalloc(sizeof(Bucket), ht->persistent); - if (!p) { - return FAILURE; - } p->arKey = arKey; } else { p = (Bucket *) pemalloc(sizeof(Bucket) + nKeyLength, ht->persistent); - if (!p) { - return FAILURE; - } p->arKey = (const char*)(p + 1); memcpy((char*)p->arKey, arKey, nKeyLength); } @@ -285,9 +264,7 @@ ZEND_API int _zend_hash_quick_add_or_update(HashTable *ht, const char *arKey, ui IS_CONSISTENT(ht); - if (nKeyLength == 0) { - return zend_hash_index_update(ht, h, pData, nDataSize, pDest); - } + ZEND_ASSERT(nKeyLength != 0); CHECK_INIT(ht); nIndex = h & ht->nTableMask; @@ -299,14 +276,8 @@ ZEND_API int _zend_hash_quick_add_or_update(HashTable *ht, const char *arKey, ui if (flag & HASH_ADD) { return FAILURE; } + ZEND_ASSERT(p->pData != pData); HANDLE_BLOCK_INTERRUPTIONS(); -#if ZEND_DEBUG - if (p->pData == pData) { - ZEND_PUTS("Fatal error in zend_hash_update: p->pData == pData\n"); - HANDLE_UNBLOCK_INTERRUPTIONS(); - return FAILURE; - } -#endif if (ht->pDestructor) { ht->pDestructor(p->pData); } @@ -322,15 +293,9 @@ ZEND_API int _zend_hash_quick_add_or_update(HashTable *ht, const char *arKey, ui if (IS_INTERNED(arKey)) { p = (Bucket *) pemalloc(sizeof(Bucket), ht->persistent); - if (!p) { - return FAILURE; - } p->arKey = arKey; } else { p = (Bucket *) pemalloc(sizeof(Bucket) + nKeyLength, ht->persistent); - if (!p) { - return FAILURE; - } p->arKey = (const char*)(p + 1); memcpy((char*)p->arKey, arKey, nKeyLength); } @@ -386,14 +351,8 @@ ZEND_API int _zend_hash_index_update_or_next_insert(HashTable *ht, ulong h, void if (flag & HASH_NEXT_INSERT || flag & HASH_ADD) { return FAILURE; } + ZEND_ASSERT(p->pData != pData); HANDLE_BLOCK_INTERRUPTIONS(); -#if ZEND_DEBUG - if (p->pData == pData) { - ZEND_PUTS("Fatal error in zend_hash_index_update: p->pData == pData\n"); - HANDLE_UNBLOCK_INTERRUPTIONS(); - return FAILURE; - } -#endif if (ht->pDestructor) { ht->pDestructor(p->pData); } @@ -410,9 +369,6 @@ ZEND_API int _zend_hash_index_update_or_next_insert(HashTable *ht, ulong h, void p = p->pNext; } p = (Bucket *) pemalloc_rel(sizeof(Bucket), ht->persistent); - if (!p) { - return FAILURE; - } p->arKey = NULL; p->nKeyLength = 0; /* Numeric indices are marked by making the nKeyLength == 0 */ p->h = h; @@ -437,7 +393,7 @@ ZEND_API int _zend_hash_index_update_or_next_insert(HashTable *ht, ulong h, void } -static int zend_hash_do_resize(HashTable *ht) +static void zend_hash_do_resize(HashTable *ht) { Bucket **t; #ifdef ZEND_SIGNALS @@ -447,19 +403,14 @@ static int zend_hash_do_resize(HashTable *ht) IS_CONSISTENT(ht); if ((ht->nTableSize << 1) > 0) { /* Let's double the table size */ - t = (Bucket **) perealloc_recoverable(ht->arBuckets, (ht->nTableSize << 1) * sizeof(Bucket *), ht->persistent); - if (t) { - HANDLE_BLOCK_INTERRUPTIONS(); - ht->arBuckets = t; - ht->nTableSize = (ht->nTableSize << 1); - ht->nTableMask = ht->nTableSize - 1; - zend_hash_rehash(ht); - HANDLE_UNBLOCK_INTERRUPTIONS(); - return SUCCESS; - } - return FAILURE; + t = (Bucket **) perealloc(ht->arBuckets, (ht->nTableSize << 1) * sizeof(Bucket *), ht->persistent); + HANDLE_BLOCK_INTERRUPTIONS(); + ht->arBuckets = t; + ht->nTableSize = (ht->nTableSize << 1); + ht->nTableMask = ht->nTableSize - 1; + zend_hash_rehash(ht); + HANDLE_UNBLOCK_INTERRUPTIONS(); } - return SUCCESS; } ZEND_API int zend_hash_rehash(HashTable *ht) @@ -900,12 +851,6 @@ ZEND_API void zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor } -ZEND_API ulong zend_get_hash_value(const char *arKey, uint nKeyLength) -{ - return zend_inline_hash_func(arKey, nKeyLength); -} - - /* Returns SUCCESS if found and FAILURE if not. The pointer to the * data is returned in pData. The reason is that there's no reason * someone using the hash table might not want to have NULL data @@ -939,9 +884,7 @@ ZEND_API int zend_hash_quick_find(const HashTable *ht, const char *arKey, uint n uint nIndex; Bucket *p; - if (nKeyLength==0) { - return zend_hash_index_find(ht, h, pData); - } + ZEND_ASSERT(nKeyLength != 0); IS_CONSISTENT(ht); @@ -988,9 +931,7 @@ ZEND_API int zend_hash_quick_exists(const HashTable *ht, const char *arKey, uint uint nIndex; Bucket *p; - if (nKeyLength==0) { - return zend_hash_index_exists(ht, h); - } + ZEND_ASSERT(nKeyLength != 0); IS_CONSISTENT(ht); @@ -1182,7 +1123,7 @@ ZEND_API void zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, Z_TYPE_P(key) = IS_NULL; } else if (p->nKeyLength) { Z_TYPE_P(key) = IS_STRING; - Z_STRVAL_P(key) = estrndup(p->arKey, p->nKeyLength - 1); + Z_STRVAL_P(key) = IS_INTERNED(p->arKey) ? (char*)p->arKey : estrndup(p->arKey, p->nKeyLength - 1); Z_STRLEN_P(key) = p->nKeyLength - 1; } else { Z_TYPE_P(key) = IS_LONG; @@ -1449,9 +1390,6 @@ ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func, return SUCCESS; } arTmp = (Bucket **) pemalloc(ht->nNumOfElements * sizeof(Bucket *), ht->persistent); - if (!arTmp) { - return FAILURE; - } p = ht->pListHead; i = 0; while (p) { diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h index 69732cd597..c97412b46b 100644 --- a/Zend/zend_hash.h +++ b/Zend/zend_hash.h @@ -97,12 +97,12 @@ typedef Bucket* HashPosition; BEGIN_EXTERN_C() /* startup/shutdown */ -ZEND_API int _zend_hash_init(HashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC); -ZEND_API int _zend_hash_init_ex(HashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC); +ZEND_API int _zend_hash_init(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC); +ZEND_API int _zend_hash_init_ex(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC); ZEND_API void zend_hash_destroy(HashTable *ht); ZEND_API void zend_hash_clean(HashTable *ht); -#define zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent) _zend_hash_init((ht), (nSize), (pHashFunction), (pDestructor), (persistent) ZEND_FILE_LINE_CC) -#define zend_hash_init_ex(ht, nSize, pHashFunction, pDestructor, persistent, bApplyProtection) _zend_hash_init_ex((ht), (nSize), (pHashFunction), (pDestructor), (persistent), (bApplyProtection) ZEND_FILE_LINE_CC) +#define zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent) _zend_hash_init((ht), (nSize), (pDestructor), (persistent) ZEND_FILE_LINE_CC) +#define zend_hash_init_ex(ht, nSize, pHashFunction, pDestructor, persistent, bApplyProtection) _zend_hash_init_ex((ht), (nSize), (pDestructor), (persistent), (bApplyProtection) ZEND_FILE_LINE_CC) /* additions/updates/changes */ ZEND_API int _zend_hash_add_or_update(HashTable *ht, const char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC); @@ -157,8 +157,8 @@ ZEND_API int zend_hash_del_key_or_index(HashTable *ht, const char *arKey, uint n zend_hash_del_key_or_index(ht, arKey, nKeyLength, h, HASH_DEL_KEY_QUICK) #define zend_hash_index_del(ht, h) \ zend_hash_del_key_or_index(ht, NULL, 0, h, HASH_DEL_INDEX) - -ZEND_API ulong zend_get_hash_value(const char *arKey, uint nKeyLength); +#define zend_get_hash_value \ + zend_hash_func /* Data retreival */ ZEND_API int zend_hash_find(const HashTable *ht, const char *arKey, uint nKeyLength, void **pData); diff --git a/Zend/zend_ini_scanner.c b/Zend/zend_ini_scanner.c index 87ba664312..a3ecdef494 100644 --- a/Zend/zend_ini_scanner.c +++ b/Zend/zend_ini_scanner.c @@ -1,4663 +1,4663 @@ -/* Generated by re2c 0.13.5 */ -#line 1 "Zend/zend_ini_scanner.l" -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 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: Zeev Suraski <zeev@zend.com> | - | Jani Taskinen <jani@php.net> | - | Marcus Boerger <helly@php.net> | - | Nuno Lopes <nlopess@php.net> | - | Scott MacVicar <scottmac@php.net> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -#include <errno.h> -#include "zend.h" -#include "zend_globals.h" -#include <zend_ini_parser.h> -#include "zend_ini_scanner.h" - -#if 0 -# define YYDEBUG(s, c) printf("state: %d char: %c\n", s, c) -#else -# define YYDEBUG(s, c) -#endif - -#include "zend_ini_scanner_defs.h" - -#define YYCTYPE unsigned char -/* allow the scanner to read one null byte after the end of the string (from ZEND_MMAP_AHEAD) - * so that if will be able to terminate to match the current token (e.g. non-enclosed string) */ -#define YYFILL(n) { if (YYCURSOR > YYLIMIT) return 0; } -#define YYCURSOR SCNG(yy_cursor) -#define YYLIMIT SCNG(yy_limit) -#define YYMARKER SCNG(yy_marker) - -#define YYGETCONDITION() SCNG(yy_state) -#define YYSETCONDITION(s) SCNG(yy_state) = s - -#define STATE(name) yyc##name - -/* emulate flex constructs */ -#define BEGIN(state) YYSETCONDITION(STATE(state)) -#define YYSTATE YYGETCONDITION() -#define yytext ((char*)SCNG(yy_text)) -#define yyleng SCNG(yy_leng) -#define yyless(x) do { YYCURSOR = (unsigned char*)yytext + x; \ - yyleng = (unsigned int)x; } while(0) - -/* #define yymore() goto yymore_restart */ - -/* perform sanity check. If this message is triggered you should - increase the ZEND_MMAP_AHEAD value in the zend_streams.h file */ -#define YYMAXFILL 6 -#if ZEND_MMAP_AHEAD < (YYMAXFILL + 1) -# error ZEND_MMAP_AHEAD should be greater than YYMAXFILL -#endif - - -/* How it works (for the core ini directives): - * =========================================== - * - * 1. Scanner scans file for tokens and passes them to parser. - * 2. Parser parses the tokens and passes the name/value pairs to the callback - * function which stores them in the configuration hash table. - * 3. Later REGISTER_INI_ENTRIES() is called which triggers the actual - * registering of ini entries and uses zend_get_configuration_directive() - * to fetch the previously stored name/value pair from configuration hash table - * and registers the static ini entries which match the name to the value - * into EG(ini_directives) hash table. - * 4. PATH section entries are used per-request from down to top, each overriding - * previous if one exists. zend_alter_ini_entry() is called for each entry. - * Settings in PATH section are ZEND_INI_SYSTEM accessible and thus mimics the - * php_admin_* directives used within Apache httpd.conf when PHP is compiled as - * module for Apache. - * 5. User defined ini files (like .htaccess for apache) are parsed for each request and - * stored in separate hash defined by SAPI. - */ - -/* TODO: (ordered by importance :-) - * =============================================================================== - * - * - Separate constant lookup totally from plain strings (using CONSTANT pattern) - * - Add #if .. #else .. #endif and ==, !=, <, > , <=, >= operators - * - Add #include "some.ini" - * - Allow variables to refer to options also when using parse_ini_file() - * - */ - -/* Globals Macros */ -#define SCNG INI_SCNG -#ifdef ZTS -ZEND_API ts_rsrc_id ini_scanner_globals_id; -#else -ZEND_API zend_ini_scanner_globals ini_scanner_globals; -#endif - -/* Eat leading whitespace */ -#define EAT_LEADING_WHITESPACE() \ - while (yytext[0]) { \ - if (yytext[0] == ' ' || yytext[0] == '\t') { \ - SCNG(yy_text)++; \ - yyleng--; \ - } else { \ - break; \ - } \ - } - -/* Eat trailing whitespace + extra char */ -#define EAT_TRAILING_WHITESPACE_EX(ch) \ - while (yyleng > 0 && ( \ - (ch != 'X' && yytext[yyleng - 1] == ch) || \ - yytext[yyleng - 1] == '\n' || \ - yytext[yyleng - 1] == '\r' || \ - yytext[yyleng - 1] == '\t' || \ - yytext[yyleng - 1] == ' ') \ - ) { \ - yyleng--; \ - } - -/* Eat trailing whitespace */ -#define EAT_TRAILING_WHITESPACE() EAT_TRAILING_WHITESPACE_EX('X') - -#define zend_ini_copy_value(retval, str, len) { \ - Z_STRVAL_P(retval) = zend_strndup(str, len); \ - Z_STRLEN_P(retval) = len; \ - Z_TYPE_P(retval) = IS_STRING; \ -} - -#define RETURN_TOKEN(type, str, len) { \ - zend_ini_copy_value(ini_lval, str, len); \ - return type; \ -} - -static void _yy_push_state(int new_state TSRMLS_DC) -{ - zend_stack_push(&SCNG(state_stack), (void *) &YYGETCONDITION(), sizeof(int)); - YYSETCONDITION(new_state); -} - -#define yy_push_state(state_and_tsrm) _yy_push_state(yyc##state_and_tsrm) - -static void yy_pop_state(TSRMLS_D) -{ - int *stack_state; - zend_stack_top(&SCNG(state_stack), (void **) &stack_state); - YYSETCONDITION(*stack_state); - zend_stack_del_top(&SCNG(state_stack)); -} - -static void yy_scan_buffer(char *str, unsigned int len TSRMLS_DC) -{ - YYCURSOR = (YYCTYPE*)str; - SCNG(yy_start) = YYCURSOR; - YYLIMIT = YYCURSOR + len; -} - -#define ini_filename SCNG(filename) - -/* {{{ init_ini_scanner() -*/ -static int init_ini_scanner(int scanner_mode, zend_file_handle *fh TSRMLS_DC) -{ - /* Sanity check */ - if (scanner_mode != ZEND_INI_SCANNER_NORMAL && scanner_mode != ZEND_INI_SCANNER_RAW) { - zend_error(E_WARNING, "Invalid scanner mode"); - return FAILURE; - } - - SCNG(lineno) = 1; - SCNG(scanner_mode) = scanner_mode; - SCNG(yy_in) = fh; - - if (fh != NULL) { - ini_filename = zend_strndup(fh->filename, strlen(fh->filename)); - } else { - ini_filename = NULL; - } - - zend_stack_init(&SCNG(state_stack)); - BEGIN(INITIAL); - - return SUCCESS; -} -/* }}} */ - -/* {{{ shutdown_ini_scanner() -*/ -void shutdown_ini_scanner(TSRMLS_D) -{ - zend_stack_destroy(&SCNG(state_stack)); - if (ini_filename) { - free(ini_filename); - } -} -/* }}} */ - -/* {{{ zend_ini_scanner_get_lineno() -*/ -int zend_ini_scanner_get_lineno(TSRMLS_D) -{ - return SCNG(lineno); -} -/* }}} */ - -/* {{{ zend_ini_scanner_get_filename() -*/ -char *zend_ini_scanner_get_filename(TSRMLS_D) -{ - return ini_filename ? ini_filename : "Unknown"; -} -/* }}} */ - -/* {{{ zend_ini_open_file_for_scanning() -*/ -int zend_ini_open_file_for_scanning(zend_file_handle *fh, int scanner_mode TSRMLS_DC) -{ - char *buf; - size_t size; - - if (zend_stream_fixup(fh, &buf, &size TSRMLS_CC) == FAILURE) { - return FAILURE; - } - - if (init_ini_scanner(scanner_mode, fh TSRMLS_CC) == FAILURE) { - zend_file_handle_dtor(fh TSRMLS_CC); - return FAILURE; - } - - yy_scan_buffer(buf, size TSRMLS_CC); - - return SUCCESS; -} -/* }}} */ - -/* {{{ zend_ini_prepare_string_for_scanning() -*/ -int zend_ini_prepare_string_for_scanning(char *str, int scanner_mode TSRMLS_DC) -{ - int len = strlen(str); - - if (init_ini_scanner(scanner_mode, NULL TSRMLS_CC) == FAILURE) { - return FAILURE; - } - - yy_scan_buffer(str, len TSRMLS_CC); - - return SUCCESS; -} -/* }}} */ - -/* {{{ zend_ini_escape_string() - */ -static void zend_ini_escape_string(zval *lval, char *str, int len, char quote_type TSRMLS_DC) -{ - register char *s, *t; - char *end; - - zend_ini_copy_value(lval, str, len); - - /* convert escape sequences */ - s = t = Z_STRVAL_P(lval); - end = s + Z_STRLEN_P(lval); - - while (s < end) { - if (*s == '\\') { - s++; - if (s >= end) { - *t++ = '\\'; - continue; - } - switch (*s) { - case '"': - if (*s != quote_type) { - *t++ = '\\'; - *t++ = *s; - break; - } - case '\\': - case '$': - *t++ = *s; - Z_STRLEN_P(lval)--; - break; - default: - *t++ = '\\'; - *t++ = *s; - break; - } - } else { - *t++ = *s; - } - if (*s == '\n' || (*s == '\r' && (*(s+1) != '\n'))) { - SCNG(lineno)++; - } - s++; - } - *t = 0; -} -/* }}} */ - -int ini_lex(zval *ini_lval TSRMLS_DC) -{ -restart: - SCNG(yy_text) = YYCURSOR; - -/* yymore_restart: */ - /* detect EOF */ - if (YYCURSOR >= YYLIMIT) { - if (YYSTATE == STATE(ST_VALUE) || YYSTATE == STATE(ST_RAW)) { - BEGIN(INITIAL); - return END_OF_LINE; - } - return 0; - } - - /* Eat any UTF-8 BOM we find in the first 3 bytes */ - if (YYCURSOR == SCNG(yy_start) && YYCURSOR + 3 < YYLIMIT) { - if (memcmp(YYCURSOR, "\xef\xbb\xbf", 3) == 0) { - YYCURSOR += 3; - goto restart; - } - } - -#line 337 "Zend/zend_ini_scanner.c" -{ - YYCTYPE yych; - unsigned int yyaccept = 0; - if (YYGETCONDITION() < 4) { - if (YYGETCONDITION() < 2) { - if (YYGETCONDITION() < 1) { - goto yyc_INITIAL; - } else { - goto yyc_ST_OFFSET; - } - } else { - if (YYGETCONDITION() < 3) { - goto yyc_ST_SECTION_VALUE; - } else { - goto yyc_ST_VALUE; - } - } - } else { - if (YYGETCONDITION() < 6) { - if (YYGETCONDITION() < 5) { - goto yyc_ST_SECTION_RAW; - } else { - goto yyc_ST_DOUBLE_QUOTES; - } - } else { - if (YYGETCONDITION() < 7) { - goto yyc_ST_VARNAME; - } else { - goto yyc_ST_RAW; - } - } - } -/* *********************************** */ -yyc_INITIAL: - { - static const unsigned char yybm[] = { - 144, 144, 144, 144, 144, 144, 144, 144, - 144, 160, 0, 144, 144, 0, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, - 240, 128, 128, 144, 128, 144, 128, 144, - 128, 128, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 128, 144, 128, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 128, 144, 144, 128, 144, - 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 128, 128, 128, 128, 144, - 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, - }; - - YYDEBUG(0, *YYCURSOR); - YYFILL(5); - yych = *YYCURSOR; - YYDEBUG(-1, yych); - switch (yych) { - case '\t': goto yy4; - case '\n': goto yy6; - case '\r': goto yy8; - case ' ': goto yy9; - case '!': - case '"': - case '$': - case '&': - case '(': - case ')': - case '^': - case '{': - case '|': - case '}': - case '~': goto yy10; - case '#': goto yy12; - case '%': - case '\'': - case '*': - case '+': - case ',': - case '-': - case '.': - case '/': - case ':': - case '<': - case '>': - case '?': - case '@': - case ']': goto yy13; - case ';': goto yy14; - case '=': goto yy16; - case 'F': - case 'f': goto yy18; - case 'N': - case 'n': goto yy19; - case 'O': - case 'o': goto yy20; - case 'T': - case 't': goto yy21; - case 'Y': - case 'y': goto yy22; - case '[': goto yy23; - default: goto yy2; - } -yy2: - YYDEBUG(2, *YYCURSOR); - ++YYCURSOR; - yych = *YYCURSOR; - goto yy26; -yy3: - YYDEBUG(3, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 429 "Zend/zend_ini_scanner.l" - { /* Get option name */ - /* Eat leading whitespace */ - EAT_LEADING_WHITESPACE(); - - /* Eat trailing whitespace */ - EAT_TRAILING_WHITESPACE(); - - RETURN_TOKEN(TC_LABEL, yytext, yyleng); -} -#line 476 "Zend/zend_ini_scanner.c" -yy4: - YYDEBUG(4, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - goto yy68; -yy5: - YYDEBUG(5, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 575 "Zend/zend_ini_scanner.l" - { - /* eat whitespace */ - goto restart; -} -#line 490 "Zend/zend_ini_scanner.c" -yy6: - YYDEBUG(6, *YYCURSOR); - ++YYCURSOR; -yy7: - YYDEBUG(7, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 580 "Zend/zend_ini_scanner.l" - { - SCNG(lineno)++; - return END_OF_LINE; -} -#line 502 "Zend/zend_ini_scanner.c" -yy8: - YYDEBUG(8, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '\n') goto yy71; - goto yy7; -yy9: - YYDEBUG(9, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ' ') { - if (yych <= '\n') { - if (yych <= 0x08) goto yy26; - if (yych <= '\t') goto yy67; - goto yy71; - } else { - if (yych == '\r') goto yy72; - if (yych <= 0x1F) goto yy26; - goto yy69; - } - } else { - if (yych <= ':') { - if (yych == '#') goto yy58; - goto yy26; - } else { - if (yych <= ';') goto yy53; - if (yych == '=') goto yy51; - goto yy26; - } - } -yy10: - YYDEBUG(10, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(11, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 503 "Zend/zend_ini_scanner.l" - { /* Disallow these chars outside option values */ - return yytext[0]; -} -#line 541 "Zend/zend_ini_scanner.c" -yy12: - YYDEBUG(12, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - goto yy59; -yy13: - YYDEBUG(13, *YYCURSOR); - yych = *++YYCURSOR; - goto yy26; -yy14: - YYDEBUG(14, *YYCURSOR); - yyaccept = 2; - yych = *(YYMARKER = ++YYCURSOR); - goto yy54; - YYDEBUG(15, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 603 "Zend/zend_ini_scanner.l" - { - return 0; -} -#line 562 "Zend/zend_ini_scanner.c" -yy16: - YYDEBUG(16, *YYCURSOR); - ++YYCURSOR; - yych = *YYCURSOR; - goto yy52; -yy17: - YYDEBUG(17, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 439 "Zend/zend_ini_scanner.l" - { /* Start option value */ - if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) { - yy_push_state(ST_RAW TSRMLS_CC); - } else { - yy_push_state(ST_VALUE TSRMLS_CC); - } - return '='; -} -#line 580 "Zend/zend_ini_scanner.c" -yy18: - YYDEBUG(18, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy48; - if (yych == 'a') goto yy48; - goto yy26; -yy19: - YYDEBUG(19, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'U') { - if (yych == 'O') goto yy44; - if (yych <= 'T') goto yy26; - goto yy45; - } else { - if (yych <= 'o') { - if (yych <= 'n') goto yy26; - goto yy44; - } else { - if (yych == 'u') goto yy45; - goto yy26; - } - } -yy20: - YYDEBUG(20, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= 'N') { - if (yych == 'F') goto yy38; - if (yych <= 'M') goto yy26; - goto yy31; - } else { - if (yych <= 'f') { - if (yych <= 'e') goto yy26; - goto yy38; - } else { - if (yych == 'n') goto yy31; - goto yy26; - } - } -yy21: - YYDEBUG(21, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy36; - if (yych == 'r') goto yy36; - goto yy26; -yy22: - YYDEBUG(22, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy27; - if (yych == 'e') goto yy27; - goto yy26; -yy23: - YYDEBUG(23, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(24, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 358 "Zend/zend_ini_scanner.l" - { /* Section start */ - /* Enter section data lookup state */ - if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) { - yy_push_state(ST_SECTION_RAW TSRMLS_CC); - } else { - yy_push_state(ST_SECTION_VALUE TSRMLS_CC); - } - return TC_SECTION; -} -#line 646 "Zend/zend_ini_scanner.c" -yy25: - YYDEBUG(25, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; -yy26: - YYDEBUG(26, *YYCURSOR); - if (yybm[0+yych] & 16) { - goto yy25; - } - if (yych == '[') goto yy28; - goto yy3; -yy27: - YYDEBUG(27, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'S') goto yy31; - if (yych == 's') goto yy31; - goto yy26; -yy28: - YYDEBUG(28, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(29, *YYCURSOR); - if (yybm[0+yych] & 32) { - goto yy28; - } - YYDEBUG(30, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 383 "Zend/zend_ini_scanner.l" - { /* Start of option with offset */ - /* Eat leading whitespace */ - EAT_LEADING_WHITESPACE(); - - /* Eat trailing whitespace and [ */ - EAT_TRAILING_WHITESPACE_EX('['); - - /* Enter offset lookup state */ - yy_push_state(ST_OFFSET TSRMLS_CC); - - RETURN_TOKEN(TC_OFFSET, yytext, yyleng); -} -#line 689 "Zend/zend_ini_scanner.c" -yy31: - YYDEBUG(31, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(32, *YYCURSOR); - if (yybm[0+yych] & 64) { - goto yy31; - } - if (yych <= '\'') { - if (yych <= ' ') { - if (yych <= '\n') { - if (yych <= 0x08) goto yy25; - if (yych <= '\t') goto yy34; - } else { - if (yych != '\r') goto yy25; - } - } else { - if (yych <= '$') { - if (yych == '#') goto yy25; - } else { - if (yych != '&') goto yy25; - } - } - } else { - if (yych <= 'Z') { - if (yych <= ';') { - if (yych <= ')') goto yy33; - if (yych <= ':') goto yy25; - } else { - if (yych != '=') goto yy25; - } - } else { - if (yych <= '^') { - if (yych <= '[') goto yy28; - if (yych <= ']') goto yy25; - } else { - if (yych <= 'z') goto yy25; - if (yych >= 0x7F) goto yy25; - } - } - } -yy33: - YYDEBUG(33, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 421 "Zend/zend_ini_scanner.l" - { /* TRUE value (when used outside option value/offset this causes parse error!) */ - RETURN_TOKEN(BOOL_TRUE, "1", 1); -} -#line 739 "Zend/zend_ini_scanner.c" -yy34: - YYDEBUG(34, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(35, *YYCURSOR); - if (yych == '\t') goto yy34; - if (yych == ' ') goto yy34; - goto yy33; -yy36: - YYDEBUG(36, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'U') goto yy37; - if (yych != 'u') goto yy26; -yy37: - YYDEBUG(37, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy31; - if (yych == 'e') goto yy31; - goto yy26; -yy38: - YYDEBUG(38, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'F') goto yy39; - if (yych != 'f') goto yy26; -yy39: - YYDEBUG(39, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(40, *YYCURSOR); - if (yych <= '&') { - if (yych <= 0x1F) { - if (yych <= '\n') { - if (yych <= 0x08) goto yy25; - if (yych <= '\t') goto yy42; - } else { - if (yych != '\r') goto yy25; - } - } else { - if (yych <= '#') { - if (yych <= ' ') goto yy39; - if (yych >= '#') goto yy25; - } else { - if (yych == '%') goto yy25; - } - } - } else { - if (yych <= '=') { - if (yych <= ':') { - if (yych <= '\'') goto yy25; - if (yych >= '*') goto yy25; - } else { - if (yych == '<') goto yy25; - } - } else { - if (yych <= ']') { - if (yych == '[') goto yy28; - goto yy25; - } else { - if (yych <= '^') goto yy41; - if (yych <= 'z') goto yy25; - if (yych >= 0x7F) goto yy25; - } - } - } -yy41: - YYDEBUG(41, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 425 "Zend/zend_ini_scanner.l" - { /* FALSE value (when used outside option value/offset this causes parse error!)*/ - RETURN_TOKEN(BOOL_FALSE, "", 0); -} -#line 813 "Zend/zend_ini_scanner.c" -yy42: - YYDEBUG(42, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(43, *YYCURSOR); - if (yych == '\t') goto yy42; - if (yych == ' ') goto yy42; - goto yy41; -yy44: - YYDEBUG(44, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '\'') { - if (yych <= 0x1F) { - if (yych <= '\n') { - if (yych <= 0x08) goto yy26; - if (yych <= '\t') goto yy42; - goto yy41; - } else { - if (yych == '\r') goto yy41; - goto yy26; - } - } else { - if (yych <= '#') { - if (yych <= ' ') goto yy39; - if (yych <= '"') goto yy41; - goto yy26; - } else { - if (yych == '%') goto yy26; - if (yych <= '&') goto yy41; - goto yy26; - } - } - } else { - if (yych <= 'N') { - if (yych <= ';') { - if (yych <= ')') goto yy41; - if (yych <= ':') goto yy26; - goto yy41; - } else { - if (yych == '=') goto yy41; - if (yych <= 'M') goto yy26; - goto yy47; - } - } else { - if (yych <= 'm') { - if (yych == '^') goto yy41; - goto yy26; - } else { - if (yych <= 'n') goto yy47; - if (yych <= 'z') goto yy26; - if (yych <= '~') goto yy41; - goto yy26; - } - } - } -yy45: - YYDEBUG(45, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'L') goto yy46; - if (yych != 'l') goto yy26; -yy46: - YYDEBUG(46, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'L') goto yy39; - if (yych == 'l') goto yy39; - goto yy26; -yy47: - YYDEBUG(47, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy39; - if (yych == 'e') goto yy39; - goto yy26; -yy48: - YYDEBUG(48, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'L') goto yy49; - if (yych != 'l') goto yy26; -yy49: - YYDEBUG(49, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'S') goto yy50; - if (yych != 's') goto yy26; -yy50: - YYDEBUG(50, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy39; - if (yych == 'e') goto yy39; - goto yy26; -yy51: - YYDEBUG(51, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; -yy52: - YYDEBUG(52, *YYCURSOR); - if (yych == '\t') goto yy51; - if (yych == ' ') goto yy51; - goto yy17; -yy53: - YYDEBUG(53, *YYCURSOR); - ++YYCURSOR; - YYFILL(2); - yych = *YYCURSOR; -yy54: - YYDEBUG(54, *YYCURSOR); - if (yybm[0+yych] & 128) { - goto yy53; - } - if (yych >= '\r') goto yy57; -yy55: - YYDEBUG(55, *YYCURSOR); - ++YYCURSOR; -yy56: - YYDEBUG(56, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 585 "Zend/zend_ini_scanner.l" - { /* Comment */ - BEGIN(INITIAL); - SCNG(lineno)++; - return END_OF_LINE; -} -#line 936 "Zend/zend_ini_scanner.c" -yy57: - YYDEBUG(57, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '\n') goto yy55; - goto yy56; -yy58: - YYDEBUG(58, *YYCURSOR); - yyaccept = 1; - YYMARKER = ++YYCURSOR; - YYFILL(2); - yych = *YYCURSOR; -yy59: - YYDEBUG(59, *YYCURSOR); - if (yych <= '\'') { - if (yych <= ' ') { - if (yych <= '\n') { - if (yych <= 0x08) goto yy58; - if (yych >= '\n') goto yy64; - } else { - if (yych == '\r') goto yy66; - goto yy58; - } - } else { - if (yych <= '$') { - if (yych == '#') goto yy58; - } else { - if (yych != '&') goto yy58; - } - } - } else { - if (yych <= 'Z') { - if (yych <= ';') { - if (yych <= ')') goto yy60; - if (yych <= ':') goto yy58; - } else { - if (yych != '=') goto yy58; - } - } else { - if (yych <= '^') { - if (yych <= '[') goto yy62; - if (yych <= ']') goto yy58; - } else { - if (yych <= 'z') goto yy58; - if (yych >= 0x7F) goto yy58; - } - } - } -yy60: - YYDEBUG(60, *YYCURSOR); - ++YYCURSOR; - YYFILL(2); - yych = *YYCURSOR; - YYDEBUG(61, *YYCURSOR); - if (yych == '\n') goto yy64; - if (yych == '\r') goto yy66; - goto yy60; -yy62: - YYDEBUG(62, *YYCURSOR); - yyaccept = 3; - YYMARKER = ++YYCURSOR; - YYFILL(2); - yych = *YYCURSOR; - YYDEBUG(63, *YYCURSOR); - if (yych <= '\f') { - if (yych <= 0x08) goto yy60; - if (yych <= '\t') goto yy62; - if (yych >= '\v') goto yy60; - } else { - if (yych <= '\r') goto yy66; - if (yych == ' ') goto yy62; - goto yy60; - } -yy64: - YYDEBUG(64, *YYCURSOR); - ++YYCURSOR; -yy65: - YYDEBUG(65, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 591 "Zend/zend_ini_scanner.l" - { /* #Comment */ - zend_error(E_DEPRECATED, "Comments starting with '#' are deprecated in %s on line %d", zend_ini_scanner_get_filename(TSRMLS_C), SCNG(lineno)); - BEGIN(INITIAL); - SCNG(lineno)++; - return END_OF_LINE; -} -#line 1022 "Zend/zend_ini_scanner.c" -yy66: - YYDEBUG(66, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '\n') goto yy64; - goto yy65; -yy67: - YYDEBUG(67, *YYCURSOR); - yyaccept = 0; - YYMARKER = ++YYCURSOR; - YYFILL(2); - yych = *YYCURSOR; -yy68: - YYDEBUG(68, *YYCURSOR); - if (yych <= ' ') { - if (yych <= '\n') { - if (yych <= 0x08) goto yy5; - if (yych <= '\t') goto yy67; - goto yy71; - } else { - if (yych == '\r') goto yy72; - if (yych <= 0x1F) goto yy5; - goto yy67; - } - } else { - if (yych <= ':') { - if (yych == '#') goto yy60; - goto yy5; - } else { - if (yych <= ';') goto yy53; - if (yych == '=') goto yy51; - goto yy5; - } - } -yy69: - YYDEBUG(69, *YYCURSOR); - yyaccept = 1; - YYMARKER = ++YYCURSOR; - YYFILL(2); - yych = *YYCURSOR; - YYDEBUG(70, *YYCURSOR); - if (yych <= '&') { - if (yych <= 0x1F) { - if (yych <= '\n') { - if (yych <= 0x08) goto yy25; - if (yych <= '\t') goto yy67; - } else { - if (yych == '\r') goto yy72; - goto yy25; - } - } else { - if (yych <= '#') { - if (yych <= ' ') goto yy69; - if (yych <= '"') goto yy3; - goto yy58; - } else { - if (yych == '%') goto yy25; - goto yy3; - } - } - } else { - if (yych <= '=') { - if (yych <= ':') { - if (yych <= '\'') goto yy25; - if (yych <= ')') goto yy3; - goto yy25; - } else { - if (yych <= ';') goto yy53; - if (yych <= '<') goto yy25; - goto yy51; - } - } else { - if (yych <= ']') { - if (yych == '[') goto yy28; - goto yy25; - } else { - if (yych <= '^') goto yy3; - if (yych <= 'z') goto yy25; - if (yych <= '~') goto yy3; - goto yy25; - } - } - } -yy71: - YYDEBUG(71, *YYCURSOR); - yych = *++YYCURSOR; - goto yy7; -yy72: - YYDEBUG(72, *YYCURSOR); - ++YYCURSOR; - if ((yych = *YYCURSOR) == '\n') goto yy71; - goto yy7; - } -/* *********************************** */ -yyc_ST_DOUBLE_QUOTES: - { - static const unsigned char yybm[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 128, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 128, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }; - YYDEBUG(73, *YYCURSOR); - YYFILL(2); - yych = *YYCURSOR; - if (yych == '"') goto yy77; - if (yych == '$') goto yy79; - YYDEBUG(75, *YYCURSOR); - ++YYCURSOR; -yy76: - YYDEBUG(76, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 535 "Zend/zend_ini_scanner.l" - { /* Escape double quoted string contents */ - if (YYCURSOR > YYLIMIT) { - return 0; - } - - while (YYCURSOR < YYLIMIT) { - switch (*YYCURSOR++) { - case '"': - if (YYCURSOR < YYLIMIT && YYCURSOR[-2] == '\\' && *YYCURSOR != '\r' && *YYCURSOR != '\n') { - continue; - } - break; - case '$': - if (*YYCURSOR == '{') { - break; - } - continue; - case '\\': - if (YYCURSOR < YYLIMIT && *YYCURSOR != '"') { - YYCURSOR++; - } - /* fall through */ - default: - continue; - } - - YYCURSOR--; - break; - } - - yyleng = YYCURSOR - SCNG(yy_text); - - zend_ini_escape_string(ini_lval, yytext, yyleng, '"' TSRMLS_CC); - return TC_QUOTED_STRING; -} -#line 1198 "Zend/zend_ini_scanner.c" -yy77: - YYDEBUG(77, *YYCURSOR); - ++YYCURSOR; - yych = *YYCURSOR; - goto yy83; -yy78: - YYDEBUG(78, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 530 "Zend/zend_ini_scanner.l" - { /* Double quoted '"' string ends */ - yy_pop_state(TSRMLS_C); - return '"'; -} -#line 1212 "Zend/zend_ini_scanner.c" -yy79: - YYDEBUG(79, *YYCURSOR); - yych = *++YYCURSOR; - if (yych != '{') goto yy76; - YYDEBUG(80, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(81, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 401 "Zend/zend_ini_scanner.l" - { /* Variable start */ - yy_push_state(ST_VARNAME TSRMLS_CC); - return TC_DOLLAR_CURLY; -} -#line 1226 "Zend/zend_ini_scanner.c" -yy82: - YYDEBUG(82, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; -yy83: - YYDEBUG(83, *YYCURSOR); - if (yybm[0+yych] & 128) { - goto yy82; - } - goto yy78; - } -/* *********************************** */ -yyc_ST_OFFSET: - { - static const unsigned char yybm[] = { - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 194, 64, 66, 66, 64, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 194, 66, 64, 66, 68, 66, 66, 0, - 66, 66, 66, 66, 66, 66, 66, 66, - 114, 114, 114, 114, 114, 114, 114, 114, - 114, 114, 66, 64, 66, 66, 66, 66, - 66, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 66, 72, 64, 66, 82, - 66, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, - 82, 82, 82, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, - }; - YYDEBUG(84, *YYCURSOR); - YYFILL(2); - yych = *YYCURSOR; - if (yych <= '-') { - if (yych <= ' ') { - if (yych <= '\n') { - if (yych <= 0x08) goto yy86; - if (yych <= '\t') goto yy88; - goto yy89; - } else { - if (yych == '\r') goto yy89; - if (yych >= ' ') goto yy88; - } - } else { - if (yych <= '$') { - if (yych == '"') goto yy91; - if (yych >= '$') goto yy93; - } else { - if (yych == '\'') goto yy94; - if (yych >= '-') goto yy95; - } - } - } else { - if (yych <= 'Z') { - if (yych <= '9') { - if (yych <= '.') goto yy96; - if (yych >= '0') goto yy97; - } else { - if (yych == ';') goto yy89; - if (yych >= 'A') goto yy99; - } - } else { - if (yych <= '^') { - if (yych <= '[') goto yy86; - if (yych <= '\\') goto yy101; - if (yych <= ']') goto yy102; - } else { - if (yych == '`') goto yy86; - if (yych <= 'z') goto yy99; - } - } - } -yy86: - YYDEBUG(86, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - goto yy105; -yy87: - YYDEBUG(87, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 521 "Zend/zend_ini_scanner.l" - { /* Get rest as section/offset value */ - RETURN_TOKEN(TC_STRING, yytext, yyleng); -} -#line 1330 "Zend/zend_ini_scanner.c" -yy88: - YYDEBUG(88, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yybm[0+yych] & 128) { - goto yy131; - } - if (yych == '"') goto yy133; - if (yych == ']') goto yy134; - goto yy105; -yy89: - YYDEBUG(89, *YYCURSOR); - ++YYCURSOR; -yy90: - YYDEBUG(90, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 603 "Zend/zend_ini_scanner.l" - { - return 0; -} -#line 1351 "Zend/zend_ini_scanner.c" -yy91: - YYDEBUG(91, *YYCURSOR); - ++YYCURSOR; -yy92: - YYDEBUG(92, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 525 "Zend/zend_ini_scanner.l" - { /* Double quoted '"' string start */ - yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC); - return '"'; -} -#line 1363 "Zend/zend_ini_scanner.c" -yy93: - YYDEBUG(93, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '\\') { - if (yych <= 0x00) goto yy90; - if (yych <= '[') goto yy104; - goto yy109; - } else { - if (yych == '{') goto yy129; - goto yy104; - } -yy94: - YYDEBUG(94, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if (yybm[0+yych] & 64) { - goto yy125; - } - goto yy90; -yy95: - YYDEBUG(95, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy105; - if (yych <= '9') goto yy123; - goto yy105; -yy96: - YYDEBUG(96, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy105; - if (yych <= '9') goto yy121; - goto yy105; -yy97: - YYDEBUG(97, *YYCURSOR); - yyaccept = 2; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '\'') { - if (yych <= '\r') { - if (yych == '\n') goto yy98; - if (yych <= '\f') goto yy105; - } else { - if (yych == '"') goto yy98; - if (yych <= '&') goto yy105; - } - } else { - if (yych <= '9') { - if (yych == '.') goto yy117; - if (yych <= '/') goto yy105; - goto yy119; - } else { - if (yych <= ';') { - if (yych <= ':') goto yy105; - } else { - if (yych != ']') goto yy105; - } - } - } -yy98: - YYDEBUG(98, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 499 "Zend/zend_ini_scanner.l" - { /* Get number option value as string */ - RETURN_TOKEN(TC_NUMBER, yytext, yyleng); -} -#line 1429 "Zend/zend_ini_scanner.c" -yy99: - YYDEBUG(99, *YYCURSOR); - yyaccept = 3; - yych = *(YYMARKER = ++YYCURSOR); - if (yybm[0+yych] & 16) { - goto yy115; - } - if (yych <= '"') { - if (yych <= '\f') { - if (yych != '\n') goto yy105; - } else { - if (yych <= '\r') goto yy100; - if (yych <= '!') goto yy105; - } - } else { - if (yych <= ':') { - if (yych != '\'') goto yy105; - } else { - if (yych <= ';') goto yy100; - if (yych != ']') goto yy105; - } - } -yy100: - YYDEBUG(100, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 495 "Zend/zend_ini_scanner.l" - { /* Get constant option value */ - RETURN_TOKEN(TC_CONSTANT, yytext, yyleng); -} -#line 1459 "Zend/zend_ini_scanner.c" -yy101: - YYDEBUG(101, *YYCURSOR); - yych = *++YYCURSOR; - goto yy104; -yy102: - YYDEBUG(102, *YYCURSOR); - ++YYCURSOR; -yy103: - YYDEBUG(103, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 396 "Zend/zend_ini_scanner.l" - { /* End of section or an option offset */ - BEGIN(INITIAL); - return ']'; -} -#line 1475 "Zend/zend_ini_scanner.c" -yy104: - YYDEBUG(104, *YYCURSOR); - yyaccept = 0; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; -yy105: - YYDEBUG(105, *YYCURSOR); - if (yybm[0+yych] & 2) { - goto yy104; - } - if (yych == '$') goto yy107; - if (yych != '\\') goto yy87; -yy106: - YYDEBUG(106, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - goto yy104; -yy107: - YYDEBUG(107, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - if (yych <= '\\') { - if (yych <= 0x00) goto yy108; - if (yych <= '[') goto yy104; - goto yy109; - } else { - if (yych != '{') goto yy104; - } -yy108: - YYDEBUG(108, *YYCURSOR); - YYCURSOR = YYMARKER; - if (yyaccept <= 1) { - if (yyaccept <= 0) { - goto yy87; - } else { - goto yy90; - } - } else { - if (yyaccept <= 2) { - goto yy98; - } else { - goto yy100; - } - } -yy109: - YYDEBUG(109, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - if (yybm[0+yych] & 4) { - goto yy110; - } - if (yych == '\\') goto yy112; - goto yy104; -yy110: - YYDEBUG(110, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(111, *YYCURSOR); - if (yybm[0+yych] & 4) { - goto yy110; - } - if (yych == '\\') goto yy114; - goto yy104; -yy112: - YYDEBUG(112, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(113, *YYCURSOR); - if (yybm[0+yych] & 4) { - goto yy110; - } - if (yych == '\\') goto yy112; - goto yy104; -yy114: - YYDEBUG(114, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - if (yybm[0+yych] & 4) { - goto yy110; - } - if (yych == '\\') goto yy112; - goto yy104; -yy115: - YYDEBUG(115, *YYCURSOR); - yyaccept = 3; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(116, *YYCURSOR); - if (yybm[0+yych] & 16) { - goto yy115; - } - if (yych <= '$') { - if (yych <= '\r') { - if (yych == '\n') goto yy100; - if (yych <= '\f') goto yy104; - goto yy100; - } else { - if (yych == '"') goto yy100; - if (yych <= '#') goto yy104; - goto yy107; - } - } else { - if (yych <= ';') { - if (yych == '\'') goto yy100; - if (yych <= ':') goto yy104; - goto yy100; - } else { - if (yych <= '[') goto yy104; - if (yych <= '\\') goto yy106; - if (yych <= ']') goto yy100; - goto yy104; - } - } -yy117: - YYDEBUG(117, *YYCURSOR); - yyaccept = 2; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(118, *YYCURSOR); - if (yybm[0+yych] & 32) { - goto yy117; - } - if (yych <= '$') { - if (yych <= '\r') { - if (yych == '\n') goto yy98; - if (yych <= '\f') goto yy104; - goto yy98; - } else { - if (yych == '"') goto yy98; - if (yych <= '#') goto yy104; - goto yy107; - } - } else { - if (yych <= ';') { - if (yych == '\'') goto yy98; - if (yych <= ':') goto yy104; - goto yy98; - } else { - if (yych <= '[') goto yy104; - if (yych <= '\\') goto yy106; - if (yych <= ']') goto yy98; - goto yy104; - } - } -yy119: - YYDEBUG(119, *YYCURSOR); - yyaccept = 2; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(120, *YYCURSOR); - if (yych <= '\'') { - if (yych <= '!') { - if (yych <= '\n') { - if (yych <= '\t') goto yy104; - goto yy98; - } else { - if (yych == '\r') goto yy98; - goto yy104; - } - } else { - if (yych <= '#') { - if (yych <= '"') goto yy98; - goto yy104; - } else { - if (yych <= '$') goto yy107; - if (yych <= '&') goto yy104; - goto yy98; - } - } - } else { - if (yych <= ':') { - if (yych <= '.') { - if (yych <= '-') goto yy104; - goto yy117; - } else { - if (yych <= '/') goto yy104; - if (yych <= '9') goto yy119; - goto yy104; - } - } else { - if (yych <= '[') { - if (yych <= ';') goto yy98; - goto yy104; - } else { - if (yych <= '\\') goto yy106; - if (yych <= ']') goto yy98; - goto yy104; - } - } - } -yy121: - YYDEBUG(121, *YYCURSOR); - yyaccept = 2; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(122, *YYCURSOR); - if (yych <= '&') { - if (yych <= '\r') { - if (yych == '\n') goto yy98; - if (yych <= '\f') goto yy104; - goto yy98; - } else { - if (yych <= '"') { - if (yych <= '!') goto yy104; - goto yy98; - } else { - if (yych == '$') goto yy107; - goto yy104; - } - } - } else { - if (yych <= ':') { - if (yych <= '\'') goto yy98; - if (yych <= '/') goto yy104; - if (yych <= '9') goto yy121; - goto yy104; - } else { - if (yych <= '[') { - if (yych <= ';') goto yy98; - goto yy104; - } else { - if (yych <= '\\') goto yy106; - if (yych <= ']') goto yy98; - goto yy104; - } - } - } -yy123: - YYDEBUG(123, *YYCURSOR); - yyaccept = 2; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(124, *YYCURSOR); - if (yych <= '&') { - if (yych <= '\r') { - if (yych == '\n') goto yy98; - if (yych <= '\f') goto yy104; - goto yy98; - } else { - if (yych <= '"') { - if (yych <= '!') goto yy104; - goto yy98; - } else { - if (yych == '$') goto yy107; - goto yy104; - } - } - } else { - if (yych <= ':') { - if (yych <= '\'') goto yy98; - if (yych <= '/') goto yy104; - if (yych <= '9') goto yy123; - goto yy104; - } else { - if (yych <= '[') { - if (yych <= ';') goto yy98; - goto yy104; - } else { - if (yych <= '\\') goto yy106; - if (yych <= ']') goto yy98; - goto yy104; - } - } - } -yy125: - YYDEBUG(125, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(126, *YYCURSOR); - if (yybm[0+yych] & 64) { - goto yy125; - } - YYDEBUG(127, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(128, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 368 "Zend/zend_ini_scanner.l" - { /* Raw string */ - /* Eat leading and trailing single quotes */ - if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') { - SCNG(yy_text)++; - yyleng = yyleng - 2; - } - RETURN_TOKEN(TC_RAW, yytext, yyleng); -} -#line 1774 "Zend/zend_ini_scanner.c" -yy129: - YYDEBUG(129, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(130, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 401 "Zend/zend_ini_scanner.l" - { /* Variable start */ - yy_push_state(ST_VARNAME TSRMLS_CC); - return TC_DOLLAR_CURLY; -} -#line 1785 "Zend/zend_ini_scanner.c" -yy131: - YYDEBUG(131, *YYCURSOR); - yyaccept = 0; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(132, *YYCURSOR); - if (yybm[0+yych] & 128) { - goto yy131; - } - if (yych <= '$') { - if (yych <= '\r') { - if (yych == '\n') goto yy87; - if (yych <= '\f') goto yy104; - goto yy87; - } else { - if (yych == '"') goto yy133; - if (yych <= '#') goto yy104; - goto yy107; - } - } else { - if (yych <= ';') { - if (yych == '\'') goto yy87; - if (yych <= ':') goto yy104; - goto yy87; - } else { - if (yych <= '[') goto yy104; - if (yych <= '\\') goto yy106; - if (yych <= ']') goto yy134; - goto yy104; - } - } -yy133: - YYDEBUG(133, *YYCURSOR); - yych = *++YYCURSOR; - goto yy92; -yy134: - YYDEBUG(134, *YYCURSOR); - ++YYCURSOR; - yych = *YYCURSOR; - goto yy103; - } -/* *********************************** */ -yyc_ST_RAW: - { - static const unsigned char yybm[] = { - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 192, 0, 64, 64, 0, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 192, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - }; - YYDEBUG(135, *YYCURSOR); - YYFILL(3); - yych = *YYCURSOR; - if (yych <= '\f') { - if (yych <= 0x08) { - if (yych >= 0x01) goto yy139; - } else { - if (yych <= '\t') goto yy141; - if (yych <= '\n') goto yy142; - goto yy139; - } - } else { - if (yych <= ' ') { - if (yych <= '\r') goto yy144; - if (yych <= 0x1F) goto yy139; - goto yy141; - } else { - if (yych == ';') goto yy145; - goto yy139; - } - } - YYDEBUG(137, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(138, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 598 "Zend/zend_ini_scanner.l" - { /* End of option value (if EOF is reached before EOL */ - BEGIN(INITIAL); - return END_OF_LINE; -} -#line 1895 "Zend/zend_ini_scanner.c" -yy139: - YYDEBUG(139, *YYCURSOR); - ++YYCURSOR; -yy140: - YYDEBUG(140, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 448 "Zend/zend_ini_scanner.l" - { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */ - char *sc = NULL; - while (YYCURSOR < YYLIMIT) { - switch (*YYCURSOR) { - case '\n': - case '\r': - goto end_raw_value_chars; - break; - case ';': - if (sc == NULL) { - sc = YYCURSOR; - } - /* no break */ - default: - YYCURSOR++; - break; - } - } -end_raw_value_chars: - yyleng = YYCURSOR - SCNG(yy_text); - - /* Eat trailing semicolons */ - while (yytext[yyleng - 1] == ';') { - yyleng--; - } - - /* Eat leading and trailing double quotes */ - if (yytext[0] == '"' && yytext[yyleng - 1] == '"') { - SCNG(yy_text)++; - yyleng = yyleng - 2; - } else if (sc) { - YYCURSOR = sc; - yyleng = YYCURSOR - SCNG(yy_text); - } - RETURN_TOKEN(TC_RAW, yytext, yyleng); -} -#line 1939 "Zend/zend_ini_scanner.c" -yy141: - YYDEBUG(141, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '\r') { - if (yych <= 0x08) goto yy140; - if (yych <= '\n') goto yy153; - if (yych <= '\f') goto yy140; - goto yy153; - } else { - if (yych <= ' ') { - if (yych <= 0x1F) goto yy140; - goto yy153; - } else { - if (yych == ';') goto yy153; - goto yy140; - } - } -yy142: - YYDEBUG(142, *YYCURSOR); - ++YYCURSOR; -yy143: - YYDEBUG(143, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 489 "Zend/zend_ini_scanner.l" - { /* End of option value */ - BEGIN(INITIAL); - SCNG(lineno)++; - return END_OF_LINE; -} -#line 1970 "Zend/zend_ini_scanner.c" -yy144: - YYDEBUG(144, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '\n') goto yy151; - goto yy143; -yy145: - YYDEBUG(145, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - goto yy147; -yy146: - YYDEBUG(146, *YYCURSOR); - ++YYCURSOR; - YYFILL(2); - yych = *YYCURSOR; -yy147: - YYDEBUG(147, *YYCURSOR); - if (yybm[0+yych] & 64) { - goto yy146; - } - if (yych >= '\r') goto yy150; -yy148: - YYDEBUG(148, *YYCURSOR); - ++YYCURSOR; -yy149: - YYDEBUG(149, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 585 "Zend/zend_ini_scanner.l" - { /* Comment */ - BEGIN(INITIAL); - SCNG(lineno)++; - return END_OF_LINE; -} -#line 2004 "Zend/zend_ini_scanner.c" -yy150: - YYDEBUG(150, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '\n') goto yy148; - goto yy149; -yy151: - YYDEBUG(151, *YYCURSOR); - yych = *++YYCURSOR; - goto yy143; -yy152: - YYDEBUG(152, *YYCURSOR); - yyaccept = 2; - YYMARKER = ++YYCURSOR; - YYFILL(2); - yych = *YYCURSOR; -yy153: - YYDEBUG(153, *YYCURSOR); - if (yybm[0+yych] & 128) { - goto yy152; - } - if (yych <= '\f') { - if (yych == '\n') goto yy151; - } else { - if (yych <= '\r') goto yy155; - if (yych == ';') goto yy146; - } - YYDEBUG(154, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 575 "Zend/zend_ini_scanner.l" - { - /* eat whitespace */ - goto restart; -} -#line 2038 "Zend/zend_ini_scanner.c" -yy155: - YYDEBUG(155, *YYCURSOR); - ++YYCURSOR; - if ((yych = *YYCURSOR) == '\n') goto yy151; - goto yy143; - } -/* *********************************** */ -yyc_ST_SECTION_RAW: - { - static const unsigned char yybm[] = { - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 192, 0, 128, 128, 0, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 192, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 0, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - }; - YYDEBUG(156, *YYCURSOR); - YYFILL(3); - yych = *YYCURSOR; - if (yych <= '\f') { - if (yych == '\n') goto yy160; - } else { - if (yych <= '\r') goto yy160; - if (yych == ']') goto yy162; - } - YYDEBUG(158, *YYCURSOR); - ++YYCURSOR; - yych = *YYCURSOR; - goto yy169; -yy159: - YYDEBUG(159, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 485 "Zend/zend_ini_scanner.l" - { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */ - RETURN_TOKEN(TC_RAW, yytext, yyleng); -} -#line 2102 "Zend/zend_ini_scanner.c" -yy160: - YYDEBUG(160, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(161, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 603 "Zend/zend_ini_scanner.l" - { - return 0; -} -#line 2112 "Zend/zend_ini_scanner.c" -yy162: - YYDEBUG(162, *YYCURSOR); - ++YYCURSOR; - yych = *YYCURSOR; - goto yy165; -yy163: - YYDEBUG(163, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 377 "Zend/zend_ini_scanner.l" - { /* End of section */ - BEGIN(INITIAL); - SCNG(lineno)++; - return ']'; -} -#line 2127 "Zend/zend_ini_scanner.c" -yy164: - YYDEBUG(164, *YYCURSOR); - ++YYCURSOR; - YYFILL(2); - yych = *YYCURSOR; -yy165: - YYDEBUG(165, *YYCURSOR); - if (yybm[0+yych] & 64) { - goto yy164; - } - if (yych == '\n') goto yy166; - if (yych == '\r') goto yy167; - goto yy163; -yy166: - YYDEBUG(166, *YYCURSOR); - yych = *++YYCURSOR; - goto yy163; -yy167: - YYDEBUG(167, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '\n') goto yy166; - goto yy163; -yy168: - YYDEBUG(168, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; -yy169: - YYDEBUG(169, *YYCURSOR); - if (yybm[0+yych] & 128) { - goto yy168; - } - goto yy159; - } -/* *********************************** */ -yyc_ST_SECTION_VALUE: - { - static const unsigned char yybm[] = { - 132, 132, 132, 132, 132, 132, 132, 132, - 132, 134, 128, 132, 132, 128, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, - 134, 132, 128, 132, 136, 132, 132, 0, - 132, 132, 132, 132, 132, 132, 132, 132, - 228, 228, 228, 228, 228, 228, 228, 228, - 228, 228, 132, 128, 132, 132, 132, 132, - 132, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 132, 144, 128, 132, 164, - 132, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, - }; - YYDEBUG(170, *YYCURSOR); - YYFILL(3); - yych = *YYCURSOR; - if (yych <= '-') { - if (yych <= ' ') { - if (yych <= '\n') { - if (yych <= 0x08) goto yy172; - if (yych <= '\t') goto yy174; - goto yy175; - } else { - if (yych == '\r') goto yy175; - if (yych >= ' ') goto yy174; - } - } else { - if (yych <= '$') { - if (yych == '"') goto yy177; - if (yych >= '$') goto yy179; - } else { - if (yych == '\'') goto yy180; - if (yych >= '-') goto yy181; - } - } - } else { - if (yych <= 'Z') { - if (yych <= '9') { - if (yych <= '.') goto yy182; - if (yych >= '0') goto yy183; - } else { - if (yych == ';') goto yy175; - if (yych >= 'A') goto yy185; - } - } else { - if (yych <= '^') { - if (yych <= '[') goto yy172; - if (yych <= '\\') goto yy187; - if (yych <= ']') goto yy188; - } else { - if (yych == '`') goto yy172; - if (yych <= 'z') goto yy185; - } - } - } -yy172: - YYDEBUG(172, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - goto yy195; -yy173: - YYDEBUG(173, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 521 "Zend/zend_ini_scanner.l" - { /* Get rest as section/offset value */ - RETURN_TOKEN(TC_STRING, yytext, yyleng); -} -#line 2253 "Zend/zend_ini_scanner.c" -yy174: - YYDEBUG(174, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 0x1F) { - if (yych == '\t') goto yy221; - goto yy195; - } else { - if (yych <= ' ') goto yy221; - if (yych == '"') goto yy223; - goto yy195; - } -yy175: - YYDEBUG(175, *YYCURSOR); - ++YYCURSOR; -yy176: - YYDEBUG(176, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 603 "Zend/zend_ini_scanner.l" - { - return 0; -} -#line 2276 "Zend/zend_ini_scanner.c" -yy177: - YYDEBUG(177, *YYCURSOR); - ++YYCURSOR; -yy178: - YYDEBUG(178, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 525 "Zend/zend_ini_scanner.l" - { /* Double quoted '"' string start */ - yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC); - return '"'; -} -#line 2288 "Zend/zend_ini_scanner.c" -yy179: - YYDEBUG(179, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '\\') { - if (yych <= 0x00) goto yy176; - if (yych <= '[') goto yy194; - goto yy199; - } else { - if (yych == '{') goto yy219; - goto yy194; - } -yy180: - YYDEBUG(180, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if (yybm[0+yych] & 128) { - goto yy215; - } - goto yy176; -yy181: - YYDEBUG(181, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy195; - if (yych <= '9') goto yy213; - goto yy195; -yy182: - YYDEBUG(182, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy195; - if (yych <= '9') goto yy211; - goto yy195; -yy183: - YYDEBUG(183, *YYCURSOR); - yyaccept = 2; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '\'') { - if (yych <= '\r') { - if (yych == '\n') goto yy184; - if (yych <= '\f') goto yy195; - } else { - if (yych == '"') goto yy184; - if (yych <= '&') goto yy195; - } - } else { - if (yych <= '9') { - if (yych == '.') goto yy207; - if (yych <= '/') goto yy195; - goto yy209; - } else { - if (yych <= ';') { - if (yych <= ':') goto yy195; - } else { - if (yych != ']') goto yy195; - } - } - } -yy184: - YYDEBUG(184, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 499 "Zend/zend_ini_scanner.l" - { /* Get number option value as string */ - RETURN_TOKEN(TC_NUMBER, yytext, yyleng); -} -#line 2354 "Zend/zend_ini_scanner.c" -yy185: - YYDEBUG(185, *YYCURSOR); - yyaccept = 3; - yych = *(YYMARKER = ++YYCURSOR); - if (yybm[0+yych] & 32) { - goto yy205; - } - if (yych <= '"') { - if (yych <= '\f') { - if (yych != '\n') goto yy195; - } else { - if (yych <= '\r') goto yy186; - if (yych <= '!') goto yy195; - } - } else { - if (yych <= ':') { - if (yych != '\'') goto yy195; - } else { - if (yych <= ';') goto yy186; - if (yych != ']') goto yy195; - } - } -yy186: - YYDEBUG(186, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 495 "Zend/zend_ini_scanner.l" - { /* Get constant option value */ - RETURN_TOKEN(TC_CONSTANT, yytext, yyleng); -} -#line 2384 "Zend/zend_ini_scanner.c" -yy187: - YYDEBUG(187, *YYCURSOR); - yych = *++YYCURSOR; - goto yy194; -yy188: - YYDEBUG(188, *YYCURSOR); - ++YYCURSOR; - yych = *YYCURSOR; - goto yy191; -yy189: - YYDEBUG(189, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 377 "Zend/zend_ini_scanner.l" - { /* End of section */ - BEGIN(INITIAL); - SCNG(lineno)++; - return ']'; -} -#line 2403 "Zend/zend_ini_scanner.c" -yy190: - YYDEBUG(190, *YYCURSOR); - ++YYCURSOR; - YYFILL(2); - yych = *YYCURSOR; -yy191: - YYDEBUG(191, *YYCURSOR); - if (yybm[0+yych] & 2) { - goto yy190; - } - if (yych == '\n') goto yy192; - if (yych == '\r') goto yy193; - goto yy189; -yy192: - YYDEBUG(192, *YYCURSOR); - yych = *++YYCURSOR; - goto yy189; -yy193: - YYDEBUG(193, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '\n') goto yy192; - goto yy189; -yy194: - YYDEBUG(194, *YYCURSOR); - yyaccept = 0; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; -yy195: - YYDEBUG(195, *YYCURSOR); - if (yybm[0+yych] & 4) { - goto yy194; - } - if (yych == '$') goto yy197; - if (yych != '\\') goto yy173; -yy196: - YYDEBUG(196, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - goto yy194; -yy197: - YYDEBUG(197, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - if (yych <= '\\') { - if (yych <= 0x00) goto yy198; - if (yych <= '[') goto yy194; - goto yy199; - } else { - if (yych != '{') goto yy194; - } -yy198: - YYDEBUG(198, *YYCURSOR); - YYCURSOR = YYMARKER; - if (yyaccept <= 1) { - if (yyaccept <= 0) { - goto yy173; - } else { - goto yy176; - } - } else { - if (yyaccept <= 2) { - goto yy184; - } else { - goto yy186; - } - } -yy199: - YYDEBUG(199, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - if (yybm[0+yych] & 8) { - goto yy200; - } - if (yych == '\\') goto yy202; - goto yy194; -yy200: - YYDEBUG(200, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(201, *YYCURSOR); - if (yybm[0+yych] & 8) { - goto yy200; - } - if (yych == '\\') goto yy204; - goto yy194; -yy202: - YYDEBUG(202, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(203, *YYCURSOR); - if (yybm[0+yych] & 8) { - goto yy200; - } - if (yych == '\\') goto yy202; - goto yy194; -yy204: - YYDEBUG(204, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - if (yybm[0+yych] & 8) { - goto yy200; - } - if (yych == '\\') goto yy202; - goto yy194; -yy205: - YYDEBUG(205, *YYCURSOR); - yyaccept = 3; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(206, *YYCURSOR); - if (yybm[0+yych] & 32) { - goto yy205; - } - if (yych <= '$') { - if (yych <= '\r') { - if (yych == '\n') goto yy186; - if (yych <= '\f') goto yy194; - goto yy186; - } else { - if (yych == '"') goto yy186; - if (yych <= '#') goto yy194; - goto yy197; - } - } else { - if (yych <= ';') { - if (yych == '\'') goto yy186; - if (yych <= ':') goto yy194; - goto yy186; - } else { - if (yych <= '[') goto yy194; - if (yych <= '\\') goto yy196; - if (yych <= ']') goto yy186; - goto yy194; - } - } -yy207: - YYDEBUG(207, *YYCURSOR); - yyaccept = 2; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(208, *YYCURSOR); - if (yybm[0+yych] & 64) { - goto yy207; - } - if (yych <= '$') { - if (yych <= '\r') { - if (yych == '\n') goto yy184; - if (yych <= '\f') goto yy194; - goto yy184; - } else { - if (yych == '"') goto yy184; - if (yych <= '#') goto yy194; - goto yy197; - } - } else { - if (yych <= ';') { - if (yych == '\'') goto yy184; - if (yych <= ':') goto yy194; - goto yy184; - } else { - if (yych <= '[') goto yy194; - if (yych <= '\\') goto yy196; - if (yych <= ']') goto yy184; - goto yy194; - } - } -yy209: - YYDEBUG(209, *YYCURSOR); - yyaccept = 2; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(210, *YYCURSOR); - if (yych <= '\'') { - if (yych <= '!') { - if (yych <= '\n') { - if (yych <= '\t') goto yy194; - goto yy184; - } else { - if (yych == '\r') goto yy184; - goto yy194; - } - } else { - if (yych <= '#') { - if (yych <= '"') goto yy184; - goto yy194; - } else { - if (yych <= '$') goto yy197; - if (yych <= '&') goto yy194; - goto yy184; - } - } - } else { - if (yych <= ':') { - if (yych <= '.') { - if (yych <= '-') goto yy194; - goto yy207; - } else { - if (yych <= '/') goto yy194; - if (yych <= '9') goto yy209; - goto yy194; - } - } else { - if (yych <= '[') { - if (yych <= ';') goto yy184; - goto yy194; - } else { - if (yych <= '\\') goto yy196; - if (yych <= ']') goto yy184; - goto yy194; - } - } - } -yy211: - YYDEBUG(211, *YYCURSOR); - yyaccept = 2; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(212, *YYCURSOR); - if (yych <= '&') { - if (yych <= '\r') { - if (yych == '\n') goto yy184; - if (yych <= '\f') goto yy194; - goto yy184; - } else { - if (yych <= '"') { - if (yych <= '!') goto yy194; - goto yy184; - } else { - if (yych == '$') goto yy197; - goto yy194; - } - } - } else { - if (yych <= ':') { - if (yych <= '\'') goto yy184; - if (yych <= '/') goto yy194; - if (yych <= '9') goto yy211; - goto yy194; - } else { - if (yych <= '[') { - if (yych <= ';') goto yy184; - goto yy194; - } else { - if (yych <= '\\') goto yy196; - if (yych <= ']') goto yy184; - goto yy194; - } - } - } -yy213: - YYDEBUG(213, *YYCURSOR); - yyaccept = 2; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(214, *YYCURSOR); - if (yych <= '&') { - if (yych <= '\r') { - if (yych == '\n') goto yy184; - if (yych <= '\f') goto yy194; - goto yy184; - } else { - if (yych <= '"') { - if (yych <= '!') goto yy194; - goto yy184; - } else { - if (yych == '$') goto yy197; - goto yy194; - } - } - } else { - if (yych <= ':') { - if (yych <= '\'') goto yy184; - if (yych <= '/') goto yy194; - if (yych <= '9') goto yy213; - goto yy194; - } else { - if (yych <= '[') { - if (yych <= ';') goto yy184; - goto yy194; - } else { - if (yych <= '\\') goto yy196; - if (yych <= ']') goto yy184; - goto yy194; - } - } - } -yy215: - YYDEBUG(215, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(216, *YYCURSOR); - if (yybm[0+yych] & 128) { - goto yy215; - } - YYDEBUG(217, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(218, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 368 "Zend/zend_ini_scanner.l" - { /* Raw string */ - /* Eat leading and trailing single quotes */ - if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') { - SCNG(yy_text)++; - yyleng = yyleng - 2; - } - RETURN_TOKEN(TC_RAW, yytext, yyleng); -} -#line 2724 "Zend/zend_ini_scanner.c" -yy219: - YYDEBUG(219, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(220, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 401 "Zend/zend_ini_scanner.l" - { /* Variable start */ - yy_push_state(ST_VARNAME TSRMLS_CC); - return TC_DOLLAR_CURLY; -} -#line 2735 "Zend/zend_ini_scanner.c" -yy221: - YYDEBUG(221, *YYCURSOR); - yyaccept = 0; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(222, *YYCURSOR); - if (yych <= '"') { - if (yych <= '\f') { - if (yych <= 0x08) goto yy194; - if (yych <= '\t') goto yy221; - if (yych <= '\n') goto yy173; - goto yy194; - } else { - if (yych <= 0x1F) { - if (yych <= '\r') goto yy173; - goto yy194; - } else { - if (yych <= ' ') goto yy221; - if (yych <= '!') goto yy194; - } - } - } else { - if (yych <= ':') { - if (yych <= '$') { - if (yych <= '#') goto yy194; - goto yy197; - } else { - if (yych == '\'') goto yy173; - goto yy194; - } - } else { - if (yych <= '[') { - if (yych <= ';') goto yy173; - goto yy194; - } else { - if (yych <= '\\') goto yy196; - if (yych <= ']') goto yy173; - goto yy194; - } - } - } -yy223: - YYDEBUG(223, *YYCURSOR); - ++YYCURSOR; - yych = *YYCURSOR; - goto yy178; - } -/* *********************************** */ -yyc_ST_VALUE: - { - static const unsigned char yybm[] = { - 160, 162, 162, 162, 162, 162, 162, 162, - 162, 176, 128, 162, 162, 128, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 176, 160, 160, 162, 168, 162, 160, 32, - 160, 160, 162, 162, 162, 162, 162, 162, - 230, 230, 230, 230, 230, 230, 230, 230, - 230, 230, 162, 160, 162, 160, 162, 162, - 162, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 162, 162, 162, 160, 166, - 162, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 162, 160, 162, 160, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, - }; - YYDEBUG(224, *YYCURSOR); - YYFILL(6); - yych = *YYCURSOR; - YYDEBUG(-1, yych); - switch (yych) { - case 0x00: goto yy226; - case '\t': - case ' ': goto yy230; - case '\n': goto yy232; - case '\r': goto yy234; - case '!': - case '&': - case '(': - case ')': - case '^': - case '|': - case '~': goto yy235; - case '"': goto yy237; - case '$': goto yy239; - case '\'': goto yy240; - case '-': goto yy241; - case '.': goto yy242; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy243; - case ';': goto yy245; - case '=': goto yy246; - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Z': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'p': - case 'q': - case 'r': - case 's': - case 'u': - case 'v': - case 'w': - case 'x': - case 'z': goto yy248; - case 'F': - case 'f': goto yy250; - case 'N': - case 'n': goto yy251; - case 'O': - case 'o': goto yy252; - case 'T': - case 't': goto yy253; - case 'Y': - case 'y': goto yy254; - default: goto yy228; - } -yy226: - YYDEBUG(226, *YYCURSOR); - ++YYCURSOR; -yy227: - YYDEBUG(227, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 598 "Zend/zend_ini_scanner.l" - { /* End of option value (if EOF is reached before EOL */ - BEGIN(INITIAL); - return END_OF_LINE; -} -#line 2921 "Zend/zend_ini_scanner.c" -yy228: - YYDEBUG(228, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - goto yy256; -yy229: - YYDEBUG(229, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 517 "Zend/zend_ini_scanner.l" - { /* Get everything else as option/offset value */ - RETURN_TOKEN(TC_STRING, yytext, yyleng); -} -#line 2934 "Zend/zend_ini_scanner.c" -yy230: - YYDEBUG(230, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - goto yy306; -yy231: - YYDEBUG(231, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 571 "Zend/zend_ini_scanner.l" - { - RETURN_TOKEN(TC_WHITESPACE, yytext, yyleng); -} -#line 2947 "Zend/zend_ini_scanner.c" -yy232: - YYDEBUG(232, *YYCURSOR); - ++YYCURSOR; -yy233: - YYDEBUG(233, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 489 "Zend/zend_ini_scanner.l" - { /* End of option value */ - BEGIN(INITIAL); - SCNG(lineno)++; - return END_OF_LINE; -} -#line 2960 "Zend/zend_ini_scanner.c" -yy234: - YYDEBUG(234, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '\n') goto yy304; - goto yy233; -yy235: - YYDEBUG(235, *YYCURSOR); - ++YYCURSOR; - yych = *YYCURSOR; - goto yy303; -yy236: - YYDEBUG(236, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 507 "Zend/zend_ini_scanner.l" - { /* Boolean operators */ - return yytext[0]; -} -#line 2978 "Zend/zend_ini_scanner.c" -yy237: - YYDEBUG(237, *YYCURSOR); - ++YYCURSOR; -yy238: - YYDEBUG(238, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 525 "Zend/zend_ini_scanner.l" - { /* Double quoted '"' string start */ - yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC); - return '"'; -} -#line 2990 "Zend/zend_ini_scanner.c" -yy239: - YYDEBUG(239, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '\\') { - if (yych <= 0x00) goto yy227; - if (yych <= '[') goto yy255; - goto yy262; - } else { - if (yych == '{') goto yy300; - goto yy255; - } -yy240: - YYDEBUG(240, *YYCURSOR); - yyaccept = 2; - yych = *(YYMARKER = ++YYCURSOR); - if (yybm[0+yych] & 128) { - goto yy296; - } - goto yy227; -yy241: - YYDEBUG(241, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy256; - if (yych <= '9') goto yy294; - goto yy256; -yy242: - YYDEBUG(242, *YYCURSOR); - yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy256; - if (yych <= '9') goto yy292; - goto yy256; -yy243: - YYDEBUG(243, *YYCURSOR); - yyaccept = 3; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') { - if (yych <= 0x1F) { - if (yych <= '\n') { - if (yych <= 0x00) goto yy244; - if (yych <= 0x08) goto yy256; - } else { - if (yych != '\r') goto yy256; - } - } else { - if (yych <= ')') { - if (yych <= '"') goto yy244; - if (yych <= '%') goto yy256; - } else { - if (yych == '.') goto yy288; - goto yy256; - } - } - } else { - if (yych <= ']') { - if (yych <= ';') { - if (yych <= '9') goto yy290; - if (yych <= ':') goto yy256; - } else { - if (yych != '=') goto yy256; - } - } else { - if (yych <= '|') { - if (yych <= '^') goto yy244; - if (yych <= '{') goto yy256; - } else { - if (yych != '~') goto yy256; - } - } - } -yy244: - YYDEBUG(244, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 499 "Zend/zend_ini_scanner.l" - { /* Get number option value as string */ - RETURN_TOKEN(TC_NUMBER, yytext, yyleng); -} -#line 3069 "Zend/zend_ini_scanner.c" -yy245: - YYDEBUG(245, *YYCURSOR); - yyaccept = 2; - yych = *(YYMARKER = ++YYCURSOR); - goto yy284; -yy246: - YYDEBUG(246, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(247, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 511 "Zend/zend_ini_scanner.l" - { /* Make = used in option value to trigger error */ - yyless(0); - BEGIN(INITIAL); - return END_OF_LINE; -} -#line 3086 "Zend/zend_ini_scanner.c" -yy248: - YYDEBUG(248, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yybm[0+yych] & 4) { - goto yy257; - } - if (yych <= ':') { - if (yych <= '\r') { - if (yych <= 0x08) { - if (yych >= 0x01) goto yy256; - } else { - if (yych <= '\n') goto yy249; - if (yych <= '\f') goto yy256; - } - } else { - if (yych <= '"') { - if (yych <= 0x1F) goto yy256; - } else { - if (yych <= '%') goto yy256; - if (yych >= '*') goto yy256; - } - } - } else { - if (yych <= '^') { - if (yych <= '<') { - if (yych >= '<') goto yy256; - } else { - if (yych <= '=') goto yy249; - if (yych <= ']') goto yy256; - } - } else { - if (yych <= '|') { - if (yych <= '{') goto yy256; - } else { - if (yych != '~') goto yy256; - } - } - } -yy249: - YYDEBUG(249, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 495 "Zend/zend_ini_scanner.l" - { /* Get constant option value */ - RETURN_TOKEN(TC_CONSTANT, yytext, yyleng); -} -#line 3133 "Zend/zend_ini_scanner.c" -yy250: - YYDEBUG(250, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '<') { - if (yych <= '"') { - if (yych <= '\n') { - if (yych <= 0x00) goto yy249; - if (yych <= 0x08) goto yy256; - goto yy249; - } else { - if (yych == '\r') goto yy249; - if (yych <= 0x1F) goto yy256; - goto yy249; - } - } else { - if (yych <= '/') { - if (yych <= '%') goto yy256; - if (yych <= ')') goto yy249; - goto yy256; - } else { - if (yych <= '9') goto yy257; - if (yych == ';') goto yy249; - goto yy256; - } - } - } else { - if (yych <= '_') { - if (yych <= 'A') { - if (yych <= '=') goto yy249; - if (yych <= '@') goto yy256; - goto yy280; - } else { - if (yych <= 'Z') goto yy257; - if (yych <= ']') goto yy256; - if (yych <= '^') goto yy249; - goto yy257; - } - } else { - if (yych <= '{') { - if (yych <= '`') goto yy256; - if (yych <= 'a') goto yy280; - if (yych <= 'z') goto yy257; - goto yy256; - } else { - if (yych == '}') goto yy256; - if (yych <= '~') goto yy249; - goto yy256; - } - } - } -yy251: - YYDEBUG(251, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'N') { - if (yych <= '%') { - if (yych <= '\f') { - if (yych <= 0x00) goto yy249; - if (yych <= 0x08) goto yy256; - if (yych <= '\n') goto yy249; - goto yy256; - } else { - if (yych <= '\r') goto yy249; - if (yych <= 0x1F) goto yy256; - if (yych <= '"') goto yy249; - goto yy256; - } - } else { - if (yych <= ':') { - if (yych <= ')') goto yy249; - if (yych <= '/') goto yy256; - if (yych <= '9') goto yy257; - goto yy256; - } else { - if (yych <= '<') { - if (yych <= ';') goto yy249; - goto yy256; - } else { - if (yych <= '=') goto yy249; - if (yych <= '@') goto yy256; - goto yy257; - } - } - } - } else { - if (yych <= 'n') { - if (yych <= 'Z') { - if (yych <= 'O') goto yy276; - if (yych == 'U') goto yy277; - goto yy257; - } else { - if (yych <= '^') { - if (yych <= ']') goto yy256; - goto yy249; - } else { - if (yych == '`') goto yy256; - goto yy257; - } - } - } else { - if (yych <= 'z') { - if (yych <= 'o') goto yy276; - if (yych == 'u') goto yy277; - goto yy257; - } else { - if (yych <= '|') { - if (yych <= '{') goto yy256; - goto yy249; - } else { - if (yych == '~') goto yy249; - goto yy256; - } - } - } - } -yy252: - YYDEBUG(252, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 'E') { - if (yych <= '%') { - if (yych <= '\f') { - if (yych <= 0x00) goto yy249; - if (yych <= 0x08) goto yy256; - if (yych <= '\n') goto yy249; - goto yy256; - } else { - if (yych <= '\r') goto yy249; - if (yych <= 0x1F) goto yy256; - if (yych <= '"') goto yy249; - goto yy256; - } - } else { - if (yych <= ':') { - if (yych <= ')') goto yy249; - if (yych <= '/') goto yy256; - if (yych <= '9') goto yy257; - goto yy256; - } else { - if (yych <= '<') { - if (yych <= ';') goto yy249; - goto yy256; - } else { - if (yych <= '=') goto yy249; - if (yych <= '@') goto yy256; - goto yy257; - } - } - } - } else { - if (yych <= 'e') { - if (yych <= 'Z') { - if (yych <= 'F') goto yy271; - if (yych == 'N') goto yy265; - goto yy257; - } else { - if (yych <= '^') { - if (yych <= ']') goto yy256; - goto yy249; - } else { - if (yych == '`') goto yy256; - goto yy257; - } - } - } else { - if (yych <= 'z') { - if (yych <= 'f') goto yy271; - if (yych == 'n') goto yy265; - goto yy257; - } else { - if (yych <= '|') { - if (yych <= '{') goto yy256; - goto yy249; - } else { - if (yych == '~') goto yy249; - goto yy256; - } - } - } - } -yy253: - YYDEBUG(253, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '=') { - if (yych <= '"') { - if (yych <= '\n') { - if (yych <= 0x00) goto yy249; - if (yych <= 0x08) goto yy256; - goto yy249; - } else { - if (yych == '\r') goto yy249; - if (yych <= 0x1F) goto yy256; - goto yy249; - } - } else { - if (yych <= '9') { - if (yych <= '%') goto yy256; - if (yych <= ')') goto yy249; - if (yych <= '/') goto yy256; - goto yy257; - } else { - if (yych == ';') goto yy249; - if (yych <= '<') goto yy256; - goto yy249; - } - } - } else { - if (yych <= '`') { - if (yych <= 'Z') { - if (yych <= '@') goto yy256; - if (yych == 'R') goto yy269; - goto yy257; - } else { - if (yych <= ']') goto yy256; - if (yych <= '^') goto yy249; - if (yych <= '_') goto yy257; - goto yy256; - } - } else { - if (yych <= '{') { - if (yych == 'r') goto yy269; - if (yych <= 'z') goto yy257; - goto yy256; - } else { - if (yych == '}') goto yy256; - if (yych <= '~') goto yy249; - goto yy256; - } - } - } -yy254: - YYDEBUG(254, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '=') { - if (yych <= '"') { - if (yych <= '\n') { - if (yych <= 0x00) goto yy249; - if (yych <= 0x08) goto yy256; - goto yy249; - } else { - if (yych == '\r') goto yy249; - if (yych <= 0x1F) goto yy256; - goto yy249; - } - } else { - if (yych <= '9') { - if (yych <= '%') goto yy256; - if (yych <= ')') goto yy249; - if (yych <= '/') goto yy256; - goto yy257; - } else { - if (yych == ';') goto yy249; - if (yych <= '<') goto yy256; - goto yy249; - } - } - } else { - if (yych <= '`') { - if (yych <= 'Z') { - if (yych <= '@') goto yy256; - if (yych == 'E') goto yy259; - goto yy257; - } else { - if (yych <= ']') goto yy256; - if (yych <= '^') goto yy249; - if (yych <= '_') goto yy257; - goto yy256; - } - } else { - if (yych <= '{') { - if (yych == 'e') goto yy259; - if (yych <= 'z') goto yy257; - goto yy256; - } else { - if (yych == '}') goto yy256; - if (yych <= '~') goto yy249; - goto yy256; - } - } - } -yy255: - YYDEBUG(255, *YYCURSOR); - yyaccept = 0; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; -yy256: - YYDEBUG(256, *YYCURSOR); - if (yybm[0+yych] & 2) { - goto yy255; - } - if (yych == '$') goto yy260; - goto yy229; -yy257: - YYDEBUG(257, *YYCURSOR); - yyaccept = 4; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(258, *YYCURSOR); - if (yybm[0+yych] & 4) { - goto yy257; - } - if (yych <= ')') { - if (yych <= '\r') { - if (yych <= 0x08) { - if (yych <= 0x00) goto yy249; - goto yy255; - } else { - if (yych <= '\n') goto yy249; - if (yych <= '\f') goto yy255; - goto yy249; - } - } else { - if (yych <= '#') { - if (yych <= 0x1F) goto yy255; - if (yych <= '"') goto yy249; - goto yy255; - } else { - if (yych <= '$') goto yy260; - if (yych <= '%') goto yy255; - goto yy249; - } - } - } else { - if (yych <= ']') { - if (yych <= ';') { - if (yych <= ':') goto yy255; - goto yy249; - } else { - if (yych == '=') goto yy249; - goto yy255; - } - } else { - if (yych <= '|') { - if (yych <= '^') goto yy249; - if (yych <= '{') goto yy255; - goto yy249; - } else { - if (yych == '~') goto yy249; - goto yy255; - } - } - } -yy259: - YYDEBUG(259, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '=') { - if (yych <= '"') { - if (yych <= '\n') { - if (yych <= 0x00) goto yy249; - if (yych <= 0x08) goto yy256; - goto yy249; - } else { - if (yych == '\r') goto yy249; - if (yych <= 0x1F) goto yy256; - goto yy249; - } - } else { - if (yych <= '9') { - if (yych <= '%') goto yy256; - if (yych <= ')') goto yy249; - if (yych <= '/') goto yy256; - goto yy257; - } else { - if (yych == ';') goto yy249; - if (yych <= '<') goto yy256; - goto yy249; - } - } - } else { - if (yych <= '`') { - if (yych <= 'Z') { - if (yych <= '@') goto yy256; - if (yych == 'S') goto yy265; - goto yy257; - } else { - if (yych <= ']') goto yy256; - if (yych <= '^') goto yy249; - if (yych <= '_') goto yy257; - goto yy256; - } - } else { - if (yych <= '{') { - if (yych == 's') goto yy265; - if (yych <= 'z') goto yy257; - goto yy256; - } else { - if (yych == '}') goto yy256; - if (yych <= '~') goto yy249; - goto yy256; - } - } - } -yy260: - YYDEBUG(260, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - if (yych <= '\\') { - if (yych <= 0x00) goto yy261; - if (yych <= '[') goto yy255; - goto yy262; - } else { - if (yych != '{') goto yy255; - } -yy261: - YYDEBUG(261, *YYCURSOR); - YYCURSOR = YYMARKER; - if (yyaccept <= 3) { - if (yyaccept <= 1) { - if (yyaccept <= 0) { - goto yy229; - } else { - goto yy231; - } - } else { - if (yyaccept <= 2) { - goto yy227; - } else { - goto yy244; - } - } - } else { - if (yyaccept <= 5) { - if (yyaccept <= 4) { - goto yy249; - } else { - goto yy266; - } - } else { - goto yy273; - } - } -yy262: - YYDEBUG(262, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - if (yybm[0+yych] & 8) { - goto yy263; - } - goto yy255; -yy263: - YYDEBUG(263, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(264, *YYCURSOR); - if (yybm[0+yych] & 8) { - goto yy263; - } - if (yych <= 0x00) goto yy229; - if (yych == '\\') goto yy262; - goto yy255; -yy265: - YYDEBUG(265, *YYCURSOR); - yyaccept = 5; - yych = *(YYMARKER = ++YYCURSOR); - if (yybm[0+yych] & 16) { - goto yy267; - } - if (yych <= ';') { - if (yych <= ' ') { - if (yych <= '\n') { - if (yych <= 0x00) goto yy266; - if (yych <= '\t') goto yy256; - } else { - if (yych != '\r') goto yy256; - } - } else { - if (yych <= ')') { - if (yych <= '"') goto yy266; - if (yych <= '%') goto yy256; - } else { - if (yych <= '/') goto yy256; - if (yych <= '9') goto yy257; - if (yych <= ':') goto yy256; - } - } - } else { - if (yych <= '_') { - if (yych <= '@') { - if (yych != '=') goto yy256; - } else { - if (yych <= 'Z') goto yy257; - if (yych <= ']') goto yy256; - if (yych >= '_') goto yy257; - } - } else { - if (yych <= '{') { - if (yych <= '`') goto yy256; - if (yych <= 'z') goto yy257; - goto yy256; - } else { - if (yych == '}') goto yy256; - if (yych >= 0x7F) goto yy256; - } - } - } -yy266: - YYDEBUG(266, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 421 "Zend/zend_ini_scanner.l" - { /* TRUE value (when used outside option value/offset this causes parse error!) */ - RETURN_TOKEN(BOOL_TRUE, "1", 1); -} -#line 3645 "Zend/zend_ini_scanner.c" -yy267: - YYDEBUG(267, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(268, *YYCURSOR); - if (yybm[0+yych] & 16) { - goto yy267; - } - goto yy266; -yy269: - YYDEBUG(269, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '=') { - if (yych <= '"') { - if (yych <= '\n') { - if (yych <= 0x00) goto yy249; - if (yych <= 0x08) goto yy256; - goto yy249; - } else { - if (yych == '\r') goto yy249; - if (yych <= 0x1F) goto yy256; - goto yy249; - } - } else { - if (yych <= '9') { - if (yych <= '%') goto yy256; - if (yych <= ')') goto yy249; - if (yych <= '/') goto yy256; - goto yy257; - } else { - if (yych == ';') goto yy249; - if (yych <= '<') goto yy256; - goto yy249; - } - } - } else { - if (yych <= '`') { - if (yych <= 'Z') { - if (yych <= '@') goto yy256; - if (yych != 'U') goto yy257; - } else { - if (yych <= ']') goto yy256; - if (yych <= '^') goto yy249; - if (yych <= '_') goto yy257; - goto yy256; - } - } else { - if (yych <= '{') { - if (yych == 'u') goto yy270; - if (yych <= 'z') goto yy257; - goto yy256; - } else { - if (yych == '}') goto yy256; - if (yych <= '~') goto yy249; - goto yy256; - } - } - } -yy270: - YYDEBUG(270, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '=') { - if (yych <= '"') { - if (yych <= '\n') { - if (yych <= 0x00) goto yy249; - if (yych <= 0x08) goto yy256; - goto yy249; - } else { - if (yych == '\r') goto yy249; - if (yych <= 0x1F) goto yy256; - goto yy249; - } - } else { - if (yych <= '9') { - if (yych <= '%') goto yy256; - if (yych <= ')') goto yy249; - if (yych <= '/') goto yy256; - goto yy257; - } else { - if (yych == ';') goto yy249; - if (yych <= '<') goto yy256; - goto yy249; - } - } - } else { - if (yych <= '`') { - if (yych <= 'Z') { - if (yych <= '@') goto yy256; - if (yych == 'E') goto yy265; - goto yy257; - } else { - if (yych <= ']') goto yy256; - if (yych <= '^') goto yy249; - if (yych <= '_') goto yy257; - goto yy256; - } - } else { - if (yych <= '{') { - if (yych == 'e') goto yy265; - if (yych <= 'z') goto yy257; - goto yy256; - } else { - if (yych == '}') goto yy256; - if (yych <= '~') goto yy249; - goto yy256; - } - } - } -yy271: - YYDEBUG(271, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '=') { - if (yych <= '"') { - if (yych <= '\n') { - if (yych <= 0x00) goto yy249; - if (yych <= 0x08) goto yy256; - goto yy249; - } else { - if (yych == '\r') goto yy249; - if (yych <= 0x1F) goto yy256; - goto yy249; - } - } else { - if (yych <= '9') { - if (yych <= '%') goto yy256; - if (yych <= ')') goto yy249; - if (yych <= '/') goto yy256; - goto yy257; - } else { - if (yych == ';') goto yy249; - if (yych <= '<') goto yy256; - goto yy249; - } - } - } else { - if (yych <= '`') { - if (yych <= 'Z') { - if (yych <= '@') goto yy256; - if (yych != 'F') goto yy257; - } else { - if (yych <= ']') goto yy256; - if (yych <= '^') goto yy249; - if (yych <= '_') goto yy257; - goto yy256; - } - } else { - if (yych <= '{') { - if (yych == 'f') goto yy272; - if (yych <= 'z') goto yy257; - goto yy256; - } else { - if (yych == '}') goto yy256; - if (yych <= '~') goto yy249; - goto yy256; - } - } - } -yy272: - YYDEBUG(272, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yybm[0+yych] & 4) { - goto yy257; - } - if (yych <= ')') { - if (yych <= '\f') { - if (yych <= 0x08) { - if (yych >= 0x01) goto yy256; - } else { - if (yych <= '\t') goto yy274; - if (yych >= '\v') goto yy256; - } - } else { - if (yych <= ' ') { - if (yych <= '\r') goto yy273; - if (yych <= 0x1F) goto yy256; - goto yy274; - } else { - if (yych <= '"') goto yy273; - if (yych <= '%') goto yy256; - } - } - } else { - if (yych <= ']') { - if (yych <= ';') { - if (yych <= ':') goto yy256; - } else { - if (yych != '=') goto yy256; - } - } else { - if (yych <= '|') { - if (yych <= '^') goto yy273; - if (yych <= '{') goto yy256; - } else { - if (yych != '~') goto yy256; - } - } - } -yy273: - YYDEBUG(273, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 425 "Zend/zend_ini_scanner.l" - { /* FALSE value (when used outside option value/offset this causes parse error!)*/ - RETURN_TOKEN(BOOL_FALSE, "", 0); -} -#line 3855 "Zend/zend_ini_scanner.c" -yy274: - YYDEBUG(274, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(275, *YYCURSOR); - if (yych == '\t') goto yy274; - if (yych == ' ') goto yy274; - goto yy273; -yy276: - YYDEBUG(276, *YYCURSOR); - yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '<') { - if (yych <= ' ') { - if (yych <= '\n') { - if (yych <= 0x00) goto yy273; - if (yych <= 0x08) goto yy256; - if (yych <= '\t') goto yy274; - goto yy273; - } else { - if (yych == '\r') goto yy273; - if (yych <= 0x1F) goto yy256; - goto yy274; - } - } else { - if (yych <= '/') { - if (yych <= '"') goto yy273; - if (yych <= '%') goto yy256; - if (yych <= ')') goto yy273; - goto yy256; - } else { - if (yych <= '9') goto yy257; - if (yych == ';') goto yy273; - goto yy256; - } - } - } else { - if (yych <= '_') { - if (yych <= 'N') { - if (yych <= '=') goto yy273; - if (yych <= '@') goto yy256; - if (yych <= 'M') goto yy257; - goto yy279; - } else { - if (yych <= 'Z') goto yy257; - if (yych <= ']') goto yy256; - if (yych <= '^') goto yy273; - goto yy257; - } - } else { - if (yych <= 'z') { - if (yych <= '`') goto yy256; - if (yych == 'n') goto yy279; - goto yy257; - } else { - if (yych <= '|') { - if (yych <= '{') goto yy256; - goto yy273; - } else { - if (yych == '~') goto yy273; - goto yy256; - } - } - } - } -yy277: - YYDEBUG(277, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '=') { - if (yych <= '"') { - if (yych <= '\n') { - if (yych <= 0x00) goto yy249; - if (yych <= 0x08) goto yy256; - goto yy249; - } else { - if (yych == '\r') goto yy249; - if (yych <= 0x1F) goto yy256; - goto yy249; - } - } else { - if (yych <= '9') { - if (yych <= '%') goto yy256; - if (yych <= ')') goto yy249; - if (yych <= '/') goto yy256; - goto yy257; - } else { - if (yych == ';') goto yy249; - if (yych <= '<') goto yy256; - goto yy249; - } - } - } else { - if (yych <= '`') { - if (yych <= 'Z') { - if (yych <= '@') goto yy256; - if (yych != 'L') goto yy257; - } else { - if (yych <= ']') goto yy256; - if (yych <= '^') goto yy249; - if (yych <= '_') goto yy257; - goto yy256; - } - } else { - if (yych <= '{') { - if (yych == 'l') goto yy278; - if (yych <= 'z') goto yy257; - goto yy256; - } else { - if (yych == '}') goto yy256; - if (yych <= '~') goto yy249; - goto yy256; - } - } - } -yy278: - YYDEBUG(278, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '=') { - if (yych <= '"') { - if (yych <= '\n') { - if (yych <= 0x00) goto yy249; - if (yych <= 0x08) goto yy256; - goto yy249; - } else { - if (yych == '\r') goto yy249; - if (yych <= 0x1F) goto yy256; - goto yy249; - } - } else { - if (yych <= '9') { - if (yych <= '%') goto yy256; - if (yych <= ')') goto yy249; - if (yych <= '/') goto yy256; - goto yy257; - } else { - if (yych == ';') goto yy249; - if (yych <= '<') goto yy256; - goto yy249; - } - } - } else { - if (yych <= '`') { - if (yych <= 'Z') { - if (yych <= '@') goto yy256; - if (yych == 'L') goto yy272; - goto yy257; - } else { - if (yych <= ']') goto yy256; - if (yych <= '^') goto yy249; - if (yych <= '_') goto yy257; - goto yy256; - } - } else { - if (yych <= '{') { - if (yych == 'l') goto yy272; - if (yych <= 'z') goto yy257; - goto yy256; - } else { - if (yych == '}') goto yy256; - if (yych <= '~') goto yy249; - goto yy256; - } - } - } -yy279: - YYDEBUG(279, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '=') { - if (yych <= '"') { - if (yych <= '\n') { - if (yych <= 0x00) goto yy249; - if (yych <= 0x08) goto yy256; - goto yy249; - } else { - if (yych == '\r') goto yy249; - if (yych <= 0x1F) goto yy256; - goto yy249; - } - } else { - if (yych <= '9') { - if (yych <= '%') goto yy256; - if (yych <= ')') goto yy249; - if (yych <= '/') goto yy256; - goto yy257; - } else { - if (yych == ';') goto yy249; - if (yych <= '<') goto yy256; - goto yy249; - } - } - } else { - if (yych <= '`') { - if (yych <= 'Z') { - if (yych <= '@') goto yy256; - if (yych == 'E') goto yy272; - goto yy257; - } else { - if (yych <= ']') goto yy256; - if (yych <= '^') goto yy249; - if (yych <= '_') goto yy257; - goto yy256; - } - } else { - if (yych <= '{') { - if (yych == 'e') goto yy272; - if (yych <= 'z') goto yy257; - goto yy256; - } else { - if (yych == '}') goto yy256; - if (yych <= '~') goto yy249; - goto yy256; - } - } - } -yy280: - YYDEBUG(280, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '=') { - if (yych <= '"') { - if (yych <= '\n') { - if (yych <= 0x00) goto yy249; - if (yych <= 0x08) goto yy256; - goto yy249; - } else { - if (yych == '\r') goto yy249; - if (yych <= 0x1F) goto yy256; - goto yy249; - } - } else { - if (yych <= '9') { - if (yych <= '%') goto yy256; - if (yych <= ')') goto yy249; - if (yych <= '/') goto yy256; - goto yy257; - } else { - if (yych == ';') goto yy249; - if (yych <= '<') goto yy256; - goto yy249; - } - } - } else { - if (yych <= '`') { - if (yych <= 'Z') { - if (yych <= '@') goto yy256; - if (yych != 'L') goto yy257; - } else { - if (yych <= ']') goto yy256; - if (yych <= '^') goto yy249; - if (yych <= '_') goto yy257; - goto yy256; - } - } else { - if (yych <= '{') { - if (yych == 'l') goto yy281; - if (yych <= 'z') goto yy257; - goto yy256; - } else { - if (yych == '}') goto yy256; - if (yych <= '~') goto yy249; - goto yy256; - } - } - } -yy281: - YYDEBUG(281, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '=') { - if (yych <= '"') { - if (yych <= '\n') { - if (yych <= 0x00) goto yy249; - if (yych <= 0x08) goto yy256; - goto yy249; - } else { - if (yych == '\r') goto yy249; - if (yych <= 0x1F) goto yy256; - goto yy249; - } - } else { - if (yych <= '9') { - if (yych <= '%') goto yy256; - if (yych <= ')') goto yy249; - if (yych <= '/') goto yy256; - goto yy257; - } else { - if (yych == ';') goto yy249; - if (yych <= '<') goto yy256; - goto yy249; - } - } - } else { - if (yych <= '`') { - if (yych <= 'Z') { - if (yych <= '@') goto yy256; - if (yych != 'S') goto yy257; - } else { - if (yych <= ']') goto yy256; - if (yych <= '^') goto yy249; - if (yych <= '_') goto yy257; - goto yy256; - } - } else { - if (yych <= '{') { - if (yych == 's') goto yy282; - if (yych <= 'z') goto yy257; - goto yy256; - } else { - if (yych == '}') goto yy256; - if (yych <= '~') goto yy249; - goto yy256; - } - } - } -yy282: - YYDEBUG(282, *YYCURSOR); - yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '=') { - if (yych <= '"') { - if (yych <= '\n') { - if (yych <= 0x00) goto yy249; - if (yych <= 0x08) goto yy256; - goto yy249; - } else { - if (yych == '\r') goto yy249; - if (yych <= 0x1F) goto yy256; - goto yy249; - } - } else { - if (yych <= '9') { - if (yych <= '%') goto yy256; - if (yych <= ')') goto yy249; - if (yych <= '/') goto yy256; - goto yy257; - } else { - if (yych == ';') goto yy249; - if (yych <= '<') goto yy256; - goto yy249; - } - } - } else { - if (yych <= '`') { - if (yych <= 'Z') { - if (yych <= '@') goto yy256; - if (yych == 'E') goto yy272; - goto yy257; - } else { - if (yych <= ']') goto yy256; - if (yych <= '^') goto yy249; - if (yych <= '_') goto yy257; - goto yy256; - } - } else { - if (yych <= '{') { - if (yych == 'e') goto yy272; - if (yych <= 'z') goto yy257; - goto yy256; - } else { - if (yych == '}') goto yy256; - if (yych <= '~') goto yy249; - goto yy256; - } - } - } -yy283: - YYDEBUG(283, *YYCURSOR); - ++YYCURSOR; - YYFILL(2); - yych = *YYCURSOR; -yy284: - YYDEBUG(284, *YYCURSOR); - if (yybm[0+yych] & 32) { - goto yy283; - } - if (yych >= '\r') goto yy287; -yy285: - YYDEBUG(285, *YYCURSOR); - ++YYCURSOR; -yy286: - YYDEBUG(286, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 585 "Zend/zend_ini_scanner.l" - { /* Comment */ - BEGIN(INITIAL); - SCNG(lineno)++; - return END_OF_LINE; -} -#line 4248 "Zend/zend_ini_scanner.c" -yy287: - YYDEBUG(287, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '\n') goto yy285; - goto yy286; -yy288: - YYDEBUG(288, *YYCURSOR); - yyaccept = 3; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(289, *YYCURSOR); - if (yybm[0+yych] & 64) { - goto yy288; - } - if (yych <= ')') { - if (yych <= '\r') { - if (yych <= 0x08) { - if (yych <= 0x00) goto yy244; - goto yy255; - } else { - if (yych <= '\n') goto yy244; - if (yych <= '\f') goto yy255; - goto yy244; - } - } else { - if (yych <= '#') { - if (yych <= 0x1F) goto yy255; - if (yych <= '"') goto yy244; - goto yy255; - } else { - if (yych <= '$') goto yy260; - if (yych <= '%') goto yy255; - goto yy244; - } - } - } else { - if (yych <= ']') { - if (yych <= ';') { - if (yych <= ':') goto yy255; - goto yy244; - } else { - if (yych == '=') goto yy244; - goto yy255; - } - } else { - if (yych <= '|') { - if (yych <= '^') goto yy244; - if (yych <= '{') goto yy255; - goto yy244; - } else { - if (yych == '~') goto yy244; - goto yy255; - } - } - } -yy290: - YYDEBUG(290, *YYCURSOR); - yyaccept = 3; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(291, *YYCURSOR); - if (yych <= '.') { - if (yych <= 0x1F) { - if (yych <= '\n') { - if (yych <= 0x00) goto yy244; - if (yych <= 0x08) goto yy255; - goto yy244; - } else { - if (yych == '\r') goto yy244; - goto yy255; - } - } else { - if (yych <= '$') { - if (yych <= '"') goto yy244; - if (yych <= '#') goto yy255; - goto yy260; - } else { - if (yych <= '%') goto yy255; - if (yych <= ')') goto yy244; - if (yych <= '-') goto yy255; - goto yy288; - } - } - } else { - if (yych <= '=') { - if (yych <= ':') { - if (yych <= '/') goto yy255; - if (yych <= '9') goto yy290; - goto yy255; - } else { - if (yych == '<') goto yy255; - goto yy244; - } - } else { - if (yych <= '{') { - if (yych == '^') goto yy244; - goto yy255; - } else { - if (yych == '}') goto yy255; - if (yych <= '~') goto yy244; - goto yy255; - } - } - } -yy292: - YYDEBUG(292, *YYCURSOR); - yyaccept = 3; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(293, *YYCURSOR); - if (yych <= '/') { - if (yych <= 0x1F) { - if (yych <= '\n') { - if (yych <= 0x00) goto yy244; - if (yych <= 0x08) goto yy255; - goto yy244; - } else { - if (yych == '\r') goto yy244; - goto yy255; - } - } else { - if (yych <= '$') { - if (yych <= '"') goto yy244; - if (yych <= '#') goto yy255; - goto yy260; - } else { - if (yych <= '%') goto yy255; - if (yych <= ')') goto yy244; - goto yy255; - } - } - } else { - if (yych <= ']') { - if (yych <= ';') { - if (yych <= '9') goto yy292; - if (yych <= ':') goto yy255; - goto yy244; - } else { - if (yych == '=') goto yy244; - goto yy255; - } - } else { - if (yych <= '|') { - if (yych <= '^') goto yy244; - if (yych <= '{') goto yy255; - goto yy244; - } else { - if (yych == '~') goto yy244; - goto yy255; - } - } - } -yy294: - YYDEBUG(294, *YYCURSOR); - yyaccept = 3; - YYMARKER = ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(295, *YYCURSOR); - if (yych <= '/') { - if (yych <= 0x1F) { - if (yych <= '\n') { - if (yych <= 0x00) goto yy244; - if (yych <= 0x08) goto yy255; - goto yy244; - } else { - if (yych == '\r') goto yy244; - goto yy255; - } - } else { - if (yych <= '$') { - if (yych <= '"') goto yy244; - if (yych <= '#') goto yy255; - goto yy260; - } else { - if (yych <= '%') goto yy255; - if (yych <= ')') goto yy244; - goto yy255; - } - } - } else { - if (yych <= ']') { - if (yych <= ';') { - if (yych <= '9') goto yy294; - if (yych <= ':') goto yy255; - goto yy244; - } else { - if (yych == '=') goto yy244; - goto yy255; - } - } else { - if (yych <= '|') { - if (yych <= '^') goto yy244; - if (yych <= '{') goto yy255; - goto yy244; - } else { - if (yych == '~') goto yy244; - goto yy255; - } - } - } -yy296: - YYDEBUG(296, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; - YYDEBUG(297, *YYCURSOR); - if (yybm[0+yych] & 128) { - goto yy296; - } - YYDEBUG(298, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(299, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 368 "Zend/zend_ini_scanner.l" - { /* Raw string */ - /* Eat leading and trailing single quotes */ - if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') { - SCNG(yy_text)++; - yyleng = yyleng - 2; - } - RETURN_TOKEN(TC_RAW, yytext, yyleng); -} -#line 4475 "Zend/zend_ini_scanner.c" -yy300: - YYDEBUG(300, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(301, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 401 "Zend/zend_ini_scanner.l" - { /* Variable start */ - yy_push_state(ST_VARNAME TSRMLS_CC); - return TC_DOLLAR_CURLY; -} -#line 4486 "Zend/zend_ini_scanner.c" -yy302: - YYDEBUG(302, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; -yy303: - YYDEBUG(303, *YYCURSOR); - if (yych == '\t') goto yy302; - if (yych == ' ') goto yy302; - goto yy236; -yy304: - YYDEBUG(304, *YYCURSOR); - yych = *++YYCURSOR; - goto yy233; -yy305: - YYDEBUG(305, *YYCURSOR); - yyaccept = 1; - YYMARKER = ++YYCURSOR; - YYFILL(2); - yych = *YYCURSOR; -yy306: - YYDEBUG(306, *YYCURSOR); - if (yych <= 0x1F) { - if (yych <= '\n') { - if (yych <= 0x08) goto yy231; - if (yych <= '\t') goto yy305; - goto yy304; - } else { - if (yych == '\r') goto yy308; - goto yy231; - } - } else { - if (yych <= '"') { - if (yych <= ' ') goto yy305; - if (yych <= '!') goto yy231; - } else { - if (yych == ';') goto yy283; - goto yy231; - } - } - YYDEBUG(307, *YYCURSOR); - yych = *++YYCURSOR; - goto yy238; -yy308: - YYDEBUG(308, *YYCURSOR); - ++YYCURSOR; - if ((yych = *YYCURSOR) == '\n') goto yy304; - goto yy233; - } -/* *********************************** */ -yyc_ST_VARNAME: - { - static const unsigned char yybm[] = { - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 0, 0, 128, 128, 0, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 0, 0, 128, 0, 128, 0, 128, - 0, 0, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 0, 128, 0, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 0, 128, 128, 0, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 0, 0, 0, 0, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - }; - YYDEBUG(309, *YYCURSOR); - YYFILL(2); - yych = *YYCURSOR; - if (yych <= ')') { - if (yych <= '"') { - if (yych <= '\f') { - if (yych <= 0x08) goto yy311; - if (yych <= '\n') goto yy313; - } else { - if (yych <= '\r') goto yy313; - if (yych >= '!') goto yy313; - } - } else { - if (yych <= '%') { - if (yych == '$') goto yy313; - } else { - if (yych != '\'') goto yy313; - } - } - } else { - if (yych <= '[') { - if (yych <= '<') { - if (yych == ';') goto yy313; - } else { - if (yych <= '=') goto yy313; - if (yych >= '[') goto yy313; - } - } else { - if (yych <= 'z') { - if (yych == '^') goto yy313; - } else { - if (yych == '}') goto yy315; - if (yych <= '~') goto yy313; - } - } - } -yy311: - YYDEBUG(311, *YYCURSOR); - ++YYCURSOR; - yych = *YYCURSOR; - goto yy318; -yy312: - YYDEBUG(312, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 406 "Zend/zend_ini_scanner.l" - { /* Variable name */ - /* Eat leading whitespace */ - EAT_LEADING_WHITESPACE(); - - /* Eat trailing whitespace */ - EAT_TRAILING_WHITESPACE(); - - RETURN_TOKEN(TC_VARNAME, yytext, yyleng); -} -#line 4627 "Zend/zend_ini_scanner.c" -yy313: - YYDEBUG(313, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(314, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 603 "Zend/zend_ini_scanner.l" - { - return 0; -} -#line 4637 "Zend/zend_ini_scanner.c" -yy315: - YYDEBUG(315, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(316, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 416 "Zend/zend_ini_scanner.l" - { /* Variable end */ - yy_pop_state(TSRMLS_C); - return '}'; -} -#line 4648 "Zend/zend_ini_scanner.c" -yy317: - YYDEBUG(317, *YYCURSOR); - ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; -yy318: - YYDEBUG(318, *YYCURSOR); - if (yybm[0+yych] & 128) { - goto yy317; - } - goto yy312; - } -} -#line 607 "Zend/zend_ini_scanner.l" - -} +/* Generated by re2c 0.13.5 */
+#line 1 "Zend/zend_ini_scanner.l"
+/*
+ +----------------------------------------------------------------------+
+ | Zend Engine |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1998-2013 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: Zeev Suraski <zeev@zend.com> |
+ | Jani Taskinen <jani@php.net> |
+ | Marcus Boerger <helly@php.net> |
+ | Nuno Lopes <nlopess@php.net> |
+ | Scott MacVicar <scottmac@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id$ */
+
+#include <errno.h>
+#include "zend.h"
+#include "zend_globals.h"
+#include <zend_ini_parser.h>
+#include "zend_ini_scanner.h"
+
+#if 0
+# define YYDEBUG(s, c) printf("state: %d char: %c\n", s, c)
+#else
+# define YYDEBUG(s, c)
+#endif
+
+#include "zend_ini_scanner_defs.h"
+
+#define YYCTYPE unsigned char
+/* allow the scanner to read one null byte after the end of the string (from ZEND_MMAP_AHEAD)
+ * so that if will be able to terminate to match the current token (e.g. non-enclosed string) */
+#define YYFILL(n) { if (YYCURSOR > YYLIMIT) return 0; }
+#define YYCURSOR SCNG(yy_cursor)
+#define YYLIMIT SCNG(yy_limit)
+#define YYMARKER SCNG(yy_marker)
+
+#define YYGETCONDITION() SCNG(yy_state)
+#define YYSETCONDITION(s) SCNG(yy_state) = s
+
+#define STATE(name) yyc##name
+
+/* emulate flex constructs */
+#define BEGIN(state) YYSETCONDITION(STATE(state))
+#define YYSTATE YYGETCONDITION()
+#define yytext ((char*)SCNG(yy_text))
+#define yyleng SCNG(yy_leng)
+#define yyless(x) do { YYCURSOR = (unsigned char*)yytext + x; \
+ yyleng = (unsigned int)x; } while(0)
+
+/* #define yymore() goto yymore_restart */
+
+/* perform sanity check. If this message is triggered you should
+ increase the ZEND_MMAP_AHEAD value in the zend_streams.h file */
+#define YYMAXFILL 6
+#if ZEND_MMAP_AHEAD < (YYMAXFILL + 1)
+# error ZEND_MMAP_AHEAD should be greater than YYMAXFILL
+#endif
+
+
+/* How it works (for the core ini directives):
+ * ===========================================
+ *
+ * 1. Scanner scans file for tokens and passes them to parser.
+ * 2. Parser parses the tokens and passes the name/value pairs to the callback
+ * function which stores them in the configuration hash table.
+ * 3. Later REGISTER_INI_ENTRIES() is called which triggers the actual
+ * registering of ini entries and uses zend_get_configuration_directive()
+ * to fetch the previously stored name/value pair from configuration hash table
+ * and registers the static ini entries which match the name to the value
+ * into EG(ini_directives) hash table.
+ * 4. PATH section entries are used per-request from down to top, each overriding
+ * previous if one exists. zend_alter_ini_entry() is called for each entry.
+ * Settings in PATH section are ZEND_INI_SYSTEM accessible and thus mimics the
+ * php_admin_* directives used within Apache httpd.conf when PHP is compiled as
+ * module for Apache.
+ * 5. User defined ini files (like .htaccess for apache) are parsed for each request and
+ * stored in separate hash defined by SAPI.
+ */
+
+/* TODO: (ordered by importance :-)
+ * ===============================================================================
+ *
+ * - Separate constant lookup totally from plain strings (using CONSTANT pattern)
+ * - Add #if .. #else .. #endif and ==, !=, <, > , <=, >= operators
+ * - Add #include "some.ini"
+ * - Allow variables to refer to options also when using parse_ini_file()
+ *
+ */
+
+/* Globals Macros */
+#define SCNG INI_SCNG
+#ifdef ZTS
+ZEND_API ts_rsrc_id ini_scanner_globals_id;
+#else
+ZEND_API zend_ini_scanner_globals ini_scanner_globals;
+#endif
+
+/* Eat leading whitespace */
+#define EAT_LEADING_WHITESPACE() \
+ while (yytext[0]) { \
+ if (yytext[0] == ' ' || yytext[0] == '\t') { \
+ SCNG(yy_text)++; \
+ yyleng--; \
+ } else { \
+ break; \
+ } \
+ }
+
+/* Eat trailing whitespace + extra char */
+#define EAT_TRAILING_WHITESPACE_EX(ch) \
+ while (yyleng > 0 && ( \
+ (ch != 'X' && yytext[yyleng - 1] == ch) || \
+ yytext[yyleng - 1] == '\n' || \
+ yytext[yyleng - 1] == '\r' || \
+ yytext[yyleng - 1] == '\t' || \
+ yytext[yyleng - 1] == ' ') \
+ ) { \
+ yyleng--; \
+ }
+
+/* Eat trailing whitespace */
+#define EAT_TRAILING_WHITESPACE() EAT_TRAILING_WHITESPACE_EX('X')
+
+#define zend_ini_copy_value(retval, str, len) { \
+ Z_STRVAL_P(retval) = zend_strndup(str, len); \
+ Z_STRLEN_P(retval) = len; \
+ Z_TYPE_P(retval) = IS_STRING; \
+}
+
+#define RETURN_TOKEN(type, str, len) { \
+ zend_ini_copy_value(ini_lval, str, len); \
+ return type; \
+}
+
+static void _yy_push_state(int new_state TSRMLS_DC)
+{
+ zend_stack_push(&SCNG(state_stack), (void *) &YYGETCONDITION(), sizeof(int));
+ YYSETCONDITION(new_state);
+}
+
+#define yy_push_state(state_and_tsrm) _yy_push_state(yyc##state_and_tsrm)
+
+static void yy_pop_state(TSRMLS_D)
+{
+ int *stack_state;
+ zend_stack_top(&SCNG(state_stack), (void **) &stack_state);
+ YYSETCONDITION(*stack_state);
+ zend_stack_del_top(&SCNG(state_stack));
+}
+
+static void yy_scan_buffer(char *str, unsigned int len TSRMLS_DC)
+{
+ YYCURSOR = (YYCTYPE*)str;
+ SCNG(yy_start) = YYCURSOR;
+ YYLIMIT = YYCURSOR + len;
+}
+
+#define ini_filename SCNG(filename)
+
+/* {{{ init_ini_scanner()
+*/
+static int init_ini_scanner(int scanner_mode, zend_file_handle *fh TSRMLS_DC)
+{
+ /* Sanity check */
+ if (scanner_mode != ZEND_INI_SCANNER_NORMAL && scanner_mode != ZEND_INI_SCANNER_RAW) {
+ zend_error(E_WARNING, "Invalid scanner mode");
+ return FAILURE;
+ }
+
+ SCNG(lineno) = 1;
+ SCNG(scanner_mode) = scanner_mode;
+ SCNG(yy_in) = fh;
+
+ if (fh != NULL) {
+ ini_filename = zend_strndup(fh->filename, strlen(fh->filename));
+ } else {
+ ini_filename = NULL;
+ }
+
+ zend_stack_init(&SCNG(state_stack));
+ BEGIN(INITIAL);
+
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ shutdown_ini_scanner()
+*/
+void shutdown_ini_scanner(TSRMLS_D)
+{
+ zend_stack_destroy(&SCNG(state_stack));
+ if (ini_filename) {
+ free(ini_filename);
+ }
+}
+/* }}} */
+
+/* {{{ zend_ini_scanner_get_lineno()
+*/
+int zend_ini_scanner_get_lineno(TSRMLS_D)
+{
+ return SCNG(lineno);
+}
+/* }}} */
+
+/* {{{ zend_ini_scanner_get_filename()
+*/
+char *zend_ini_scanner_get_filename(TSRMLS_D)
+{
+ return ini_filename ? ini_filename : "Unknown";
+}
+/* }}} */
+
+/* {{{ zend_ini_open_file_for_scanning()
+*/
+int zend_ini_open_file_for_scanning(zend_file_handle *fh, int scanner_mode TSRMLS_DC)
+{
+ char *buf;
+ size_t size;
+
+ if (zend_stream_fixup(fh, &buf, &size TSRMLS_CC) == FAILURE) {
+ return FAILURE;
+ }
+
+ if (init_ini_scanner(scanner_mode, fh TSRMLS_CC) == FAILURE) {
+ zend_file_handle_dtor(fh TSRMLS_CC);
+ return FAILURE;
+ }
+
+ yy_scan_buffer(buf, size TSRMLS_CC);
+
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ zend_ini_prepare_string_for_scanning()
+*/
+int zend_ini_prepare_string_for_scanning(char *str, int scanner_mode TSRMLS_DC)
+{
+ int len = strlen(str);
+
+ if (init_ini_scanner(scanner_mode, NULL TSRMLS_CC) == FAILURE) {
+ return FAILURE;
+ }
+
+ yy_scan_buffer(str, len TSRMLS_CC);
+
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ zend_ini_escape_string()
+ */
+static void zend_ini_escape_string(zval *lval, char *str, int len, char quote_type TSRMLS_DC)
+{
+ register char *s, *t;
+ char *end;
+
+ zend_ini_copy_value(lval, str, len);
+
+ /* convert escape sequences */
+ s = t = Z_STRVAL_P(lval);
+ end = s + Z_STRLEN_P(lval);
+
+ while (s < end) {
+ if (*s == '\\') {
+ s++;
+ if (s >= end) {
+ *t++ = '\\';
+ continue;
+ }
+ switch (*s) {
+ case '"':
+ if (*s != quote_type) {
+ *t++ = '\\';
+ *t++ = *s;
+ break;
+ }
+ case '\\':
+ case '$':
+ *t++ = *s;
+ Z_STRLEN_P(lval)--;
+ break;
+ default:
+ *t++ = '\\';
+ *t++ = *s;
+ break;
+ }
+ } else {
+ *t++ = *s;
+ }
+ if (*s == '\n' || (*s == '\r' && (*(s+1) != '\n'))) {
+ SCNG(lineno)++;
+ }
+ s++;
+ }
+ *t = 0;
+}
+/* }}} */
+
+int ini_lex(zval *ini_lval TSRMLS_DC)
+{
+restart:
+ SCNG(yy_text) = YYCURSOR;
+
+/* yymore_restart: */
+ /* detect EOF */
+ if (YYCURSOR >= YYLIMIT) {
+ if (YYSTATE == STATE(ST_VALUE) || YYSTATE == STATE(ST_RAW)) {
+ BEGIN(INITIAL);
+ return END_OF_LINE;
+ }
+ return 0;
+ }
+
+ /* Eat any UTF-8 BOM we find in the first 3 bytes */
+ if (YYCURSOR == SCNG(yy_start) && YYCURSOR + 3 < YYLIMIT) {
+ if (memcmp(YYCURSOR, "\xef\xbb\xbf", 3) == 0) {
+ YYCURSOR += 3;
+ goto restart;
+ }
+ }
+
+#line 337 "Zend/zend_ini_scanner.c"
+{
+ YYCTYPE yych;
+ unsigned int yyaccept = 0;
+ if (YYGETCONDITION() < 4) {
+ if (YYGETCONDITION() < 2) {
+ if (YYGETCONDITION() < 1) {
+ goto yyc_INITIAL;
+ } else {
+ goto yyc_ST_OFFSET;
+ }
+ } else {
+ if (YYGETCONDITION() < 3) {
+ goto yyc_ST_SECTION_VALUE;
+ } else {
+ goto yyc_ST_VALUE;
+ }
+ }
+ } else {
+ if (YYGETCONDITION() < 6) {
+ if (YYGETCONDITION() < 5) {
+ goto yyc_ST_SECTION_RAW;
+ } else {
+ goto yyc_ST_DOUBLE_QUOTES;
+ }
+ } else {
+ if (YYGETCONDITION() < 7) {
+ goto yyc_ST_VARNAME;
+ } else {
+ goto yyc_ST_RAW;
+ }
+ }
+ }
+/* *********************************** */
+yyc_INITIAL:
+ {
+ static const unsigned char yybm[] = {
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ 144, 160, 0, 144, 144, 0, 144, 144,
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ 240, 128, 128, 144, 128, 144, 128, 144,
+ 128, 128, 144, 144, 144, 144, 144, 144,
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ 144, 144, 144, 128, 144, 128, 144, 144,
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ 144, 144, 144, 128, 144, 144, 128, 144,
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ 144, 144, 144, 128, 128, 128, 128, 144,
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ 144, 144, 144, 144, 144, 144, 144, 144,
+ };
+
+ YYDEBUG(0, *YYCURSOR);
+ YYFILL(5);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch (yych) {
+ case '\t': goto yy4;
+ case '\n': goto yy6;
+ case '\r': goto yy8;
+ case ' ': goto yy9;
+ case '!':
+ case '"':
+ case '$':
+ case '&':
+ case '(':
+ case ')':
+ case '^':
+ case '{':
+ case '|':
+ case '}':
+ case '~': goto yy10;
+ case '#': goto yy12;
+ case '%':
+ case '\'':
+ case '*':
+ case '+':
+ case ',':
+ case '-':
+ case '.':
+ case '/':
+ case ':':
+ case '<':
+ case '>':
+ case '?':
+ case '@':
+ case ']': goto yy13;
+ case ';': goto yy14;
+ case '=': goto yy16;
+ case 'F':
+ case 'f': goto yy18;
+ case 'N':
+ case 'n': goto yy19;
+ case 'O':
+ case 'o': goto yy20;
+ case 'T':
+ case 't': goto yy21;
+ case 'Y':
+ case 'y': goto yy22;
+ case '[': goto yy23;
+ default: goto yy2;
+ }
+yy2:
+ YYDEBUG(2, *YYCURSOR);
+ ++YYCURSOR;
+ yych = *YYCURSOR;
+ goto yy26;
+yy3:
+ YYDEBUG(3, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 429 "Zend/zend_ini_scanner.l"
+ { /* Get option name */
+ /* Eat leading whitespace */
+ EAT_LEADING_WHITESPACE();
+
+ /* Eat trailing whitespace */
+ EAT_TRAILING_WHITESPACE();
+
+ RETURN_TOKEN(TC_LABEL, yytext, yyleng);
+}
+#line 476 "Zend/zend_ini_scanner.c"
+yy4:
+ YYDEBUG(4, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ goto yy68;
+yy5:
+ YYDEBUG(5, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 575 "Zend/zend_ini_scanner.l"
+ {
+ /* eat whitespace */
+ goto restart;
+}
+#line 490 "Zend/zend_ini_scanner.c"
+yy6:
+ YYDEBUG(6, *YYCURSOR);
+ ++YYCURSOR;
+yy7:
+ YYDEBUG(7, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 580 "Zend/zend_ini_scanner.l"
+ {
+ SCNG(lineno)++;
+ return END_OF_LINE;
+}
+#line 502 "Zend/zend_ini_scanner.c"
+yy8:
+ YYDEBUG(8, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '\n') goto yy71;
+ goto yy7;
+yy9:
+ YYDEBUG(9, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= ' ') {
+ if (yych <= '\n') {
+ if (yych <= 0x08) goto yy26;
+ if (yych <= '\t') goto yy67;
+ goto yy71;
+ } else {
+ if (yych == '\r') goto yy72;
+ if (yych <= 0x1F) goto yy26;
+ goto yy69;
+ }
+ } else {
+ if (yych <= ':') {
+ if (yych == '#') goto yy58;
+ goto yy26;
+ } else {
+ if (yych <= ';') goto yy53;
+ if (yych == '=') goto yy51;
+ goto yy26;
+ }
+ }
+yy10:
+ YYDEBUG(10, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(11, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 503 "Zend/zend_ini_scanner.l"
+ { /* Disallow these chars outside option values */
+ return yytext[0];
+}
+#line 541 "Zend/zend_ini_scanner.c"
+yy12:
+ YYDEBUG(12, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ goto yy59;
+yy13:
+ YYDEBUG(13, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy26;
+yy14:
+ YYDEBUG(14, *YYCURSOR);
+ yyaccept = 2;
+ yych = *(YYMARKER = ++YYCURSOR);
+ goto yy54;
+ YYDEBUG(15, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 603 "Zend/zend_ini_scanner.l"
+ {
+ return 0;
+}
+#line 562 "Zend/zend_ini_scanner.c"
+yy16:
+ YYDEBUG(16, *YYCURSOR);
+ ++YYCURSOR;
+ yych = *YYCURSOR;
+ goto yy52;
+yy17:
+ YYDEBUG(17, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 439 "Zend/zend_ini_scanner.l"
+ { /* Start option value */
+ if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) {
+ yy_push_state(ST_RAW TSRMLS_CC);
+ } else {
+ yy_push_state(ST_VALUE TSRMLS_CC);
+ }
+ return '=';
+}
+#line 580 "Zend/zend_ini_scanner.c"
+yy18:
+ YYDEBUG(18, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy48;
+ if (yych == 'a') goto yy48;
+ goto yy26;
+yy19:
+ YYDEBUG(19, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= 'U') {
+ if (yych == 'O') goto yy44;
+ if (yych <= 'T') goto yy26;
+ goto yy45;
+ } else {
+ if (yych <= 'o') {
+ if (yych <= 'n') goto yy26;
+ goto yy44;
+ } else {
+ if (yych == 'u') goto yy45;
+ goto yy26;
+ }
+ }
+yy20:
+ YYDEBUG(20, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= 'N') {
+ if (yych == 'F') goto yy38;
+ if (yych <= 'M') goto yy26;
+ goto yy31;
+ } else {
+ if (yych <= 'f') {
+ if (yych <= 'e') goto yy26;
+ goto yy38;
+ } else {
+ if (yych == 'n') goto yy31;
+ goto yy26;
+ }
+ }
+yy21:
+ YYDEBUG(21, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'R') goto yy36;
+ if (yych == 'r') goto yy36;
+ goto yy26;
+yy22:
+ YYDEBUG(22, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy27;
+ if (yych == 'e') goto yy27;
+ goto yy26;
+yy23:
+ YYDEBUG(23, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(24, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 358 "Zend/zend_ini_scanner.l"
+ { /* Section start */
+ /* Enter section data lookup state */
+ if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) {
+ yy_push_state(ST_SECTION_RAW TSRMLS_CC);
+ } else {
+ yy_push_state(ST_SECTION_VALUE TSRMLS_CC);
+ }
+ return TC_SECTION;
+}
+#line 646 "Zend/zend_ini_scanner.c"
+yy25:
+ YYDEBUG(25, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+yy26:
+ YYDEBUG(26, *YYCURSOR);
+ if (yybm[0+yych] & 16) {
+ goto yy25;
+ }
+ if (yych == '[') goto yy28;
+ goto yy3;
+yy27:
+ YYDEBUG(27, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'S') goto yy31;
+ if (yych == 's') goto yy31;
+ goto yy26;
+yy28:
+ YYDEBUG(28, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(29, *YYCURSOR);
+ if (yybm[0+yych] & 32) {
+ goto yy28;
+ }
+ YYDEBUG(30, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 383 "Zend/zend_ini_scanner.l"
+ { /* Start of option with offset */
+ /* Eat leading whitespace */
+ EAT_LEADING_WHITESPACE();
+
+ /* Eat trailing whitespace and [ */
+ EAT_TRAILING_WHITESPACE_EX('[');
+
+ /* Enter offset lookup state */
+ yy_push_state(ST_OFFSET TSRMLS_CC);
+
+ RETURN_TOKEN(TC_OFFSET, yytext, yyleng);
+}
+#line 689 "Zend/zend_ini_scanner.c"
+yy31:
+ YYDEBUG(31, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(32, *YYCURSOR);
+ if (yybm[0+yych] & 64) {
+ goto yy31;
+ }
+ if (yych <= '\'') {
+ if (yych <= ' ') {
+ if (yych <= '\n') {
+ if (yych <= 0x08) goto yy25;
+ if (yych <= '\t') goto yy34;
+ } else {
+ if (yych != '\r') goto yy25;
+ }
+ } else {
+ if (yych <= '$') {
+ if (yych == '#') goto yy25;
+ } else {
+ if (yych != '&') goto yy25;
+ }
+ }
+ } else {
+ if (yych <= 'Z') {
+ if (yych <= ';') {
+ if (yych <= ')') goto yy33;
+ if (yych <= ':') goto yy25;
+ } else {
+ if (yych != '=') goto yy25;
+ }
+ } else {
+ if (yych <= '^') {
+ if (yych <= '[') goto yy28;
+ if (yych <= ']') goto yy25;
+ } else {
+ if (yych <= 'z') goto yy25;
+ if (yych >= 0x7F) goto yy25;
+ }
+ }
+ }
+yy33:
+ YYDEBUG(33, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 421 "Zend/zend_ini_scanner.l"
+ { /* TRUE value (when used outside option value/offset this causes parse error!) */
+ RETURN_TOKEN(BOOL_TRUE, "1", 1);
+}
+#line 739 "Zend/zend_ini_scanner.c"
+yy34:
+ YYDEBUG(34, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(35, *YYCURSOR);
+ if (yych == '\t') goto yy34;
+ if (yych == ' ') goto yy34;
+ goto yy33;
+yy36:
+ YYDEBUG(36, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'U') goto yy37;
+ if (yych != 'u') goto yy26;
+yy37:
+ YYDEBUG(37, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy31;
+ if (yych == 'e') goto yy31;
+ goto yy26;
+yy38:
+ YYDEBUG(38, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'F') goto yy39;
+ if (yych != 'f') goto yy26;
+yy39:
+ YYDEBUG(39, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(40, *YYCURSOR);
+ if (yych <= '&') {
+ if (yych <= 0x1F) {
+ if (yych <= '\n') {
+ if (yych <= 0x08) goto yy25;
+ if (yych <= '\t') goto yy42;
+ } else {
+ if (yych != '\r') goto yy25;
+ }
+ } else {
+ if (yych <= '#') {
+ if (yych <= ' ') goto yy39;
+ if (yych >= '#') goto yy25;
+ } else {
+ if (yych == '%') goto yy25;
+ }
+ }
+ } else {
+ if (yych <= '=') {
+ if (yych <= ':') {
+ if (yych <= '\'') goto yy25;
+ if (yych >= '*') goto yy25;
+ } else {
+ if (yych == '<') goto yy25;
+ }
+ } else {
+ if (yych <= ']') {
+ if (yych == '[') goto yy28;
+ goto yy25;
+ } else {
+ if (yych <= '^') goto yy41;
+ if (yych <= 'z') goto yy25;
+ if (yych >= 0x7F) goto yy25;
+ }
+ }
+ }
+yy41:
+ YYDEBUG(41, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 425 "Zend/zend_ini_scanner.l"
+ { /* FALSE value (when used outside option value/offset this causes parse error!)*/
+ RETURN_TOKEN(BOOL_FALSE, "", 0);
+}
+#line 813 "Zend/zend_ini_scanner.c"
+yy42:
+ YYDEBUG(42, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(43, *YYCURSOR);
+ if (yych == '\t') goto yy42;
+ if (yych == ' ') goto yy42;
+ goto yy41;
+yy44:
+ YYDEBUG(44, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= '\'') {
+ if (yych <= 0x1F) {
+ if (yych <= '\n') {
+ if (yych <= 0x08) goto yy26;
+ if (yych <= '\t') goto yy42;
+ goto yy41;
+ } else {
+ if (yych == '\r') goto yy41;
+ goto yy26;
+ }
+ } else {
+ if (yych <= '#') {
+ if (yych <= ' ') goto yy39;
+ if (yych <= '"') goto yy41;
+ goto yy26;
+ } else {
+ if (yych == '%') goto yy26;
+ if (yych <= '&') goto yy41;
+ goto yy26;
+ }
+ }
+ } else {
+ if (yych <= 'N') {
+ if (yych <= ';') {
+ if (yych <= ')') goto yy41;
+ if (yych <= ':') goto yy26;
+ goto yy41;
+ } else {
+ if (yych == '=') goto yy41;
+ if (yych <= 'M') goto yy26;
+ goto yy47;
+ }
+ } else {
+ if (yych <= 'm') {
+ if (yych == '^') goto yy41;
+ goto yy26;
+ } else {
+ if (yych <= 'n') goto yy47;
+ if (yych <= 'z') goto yy26;
+ if (yych <= '~') goto yy41;
+ goto yy26;
+ }
+ }
+ }
+yy45:
+ YYDEBUG(45, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy46;
+ if (yych != 'l') goto yy26;
+yy46:
+ YYDEBUG(46, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy39;
+ if (yych == 'l') goto yy39;
+ goto yy26;
+yy47:
+ YYDEBUG(47, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy39;
+ if (yych == 'e') goto yy39;
+ goto yy26;
+yy48:
+ YYDEBUG(48, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'L') goto yy49;
+ if (yych != 'l') goto yy26;
+yy49:
+ YYDEBUG(49, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'S') goto yy50;
+ if (yych != 's') goto yy26;
+yy50:
+ YYDEBUG(50, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == 'E') goto yy39;
+ if (yych == 'e') goto yy39;
+ goto yy26;
+yy51:
+ YYDEBUG(51, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+yy52:
+ YYDEBUG(52, *YYCURSOR);
+ if (yych == '\t') goto yy51;
+ if (yych == ' ') goto yy51;
+ goto yy17;
+yy53:
+ YYDEBUG(53, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(2);
+ yych = *YYCURSOR;
+yy54:
+ YYDEBUG(54, *YYCURSOR);
+ if (yybm[0+yych] & 128) {
+ goto yy53;
+ }
+ if (yych >= '\r') goto yy57;
+yy55:
+ YYDEBUG(55, *YYCURSOR);
+ ++YYCURSOR;
+yy56:
+ YYDEBUG(56, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 585 "Zend/zend_ini_scanner.l"
+ { /* Comment */
+ BEGIN(INITIAL);
+ SCNG(lineno)++;
+ return END_OF_LINE;
+}
+#line 936 "Zend/zend_ini_scanner.c"
+yy57:
+ YYDEBUG(57, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '\n') goto yy55;
+ goto yy56;
+yy58:
+ YYDEBUG(58, *YYCURSOR);
+ yyaccept = 1;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(2);
+ yych = *YYCURSOR;
+yy59:
+ YYDEBUG(59, *YYCURSOR);
+ if (yych <= '\'') {
+ if (yych <= ' ') {
+ if (yych <= '\n') {
+ if (yych <= 0x08) goto yy58;
+ if (yych >= '\n') goto yy64;
+ } else {
+ if (yych == '\r') goto yy66;
+ goto yy58;
+ }
+ } else {
+ if (yych <= '$') {
+ if (yych == '#') goto yy58;
+ } else {
+ if (yych != '&') goto yy58;
+ }
+ }
+ } else {
+ if (yych <= 'Z') {
+ if (yych <= ';') {
+ if (yych <= ')') goto yy60;
+ if (yych <= ':') goto yy58;
+ } else {
+ if (yych != '=') goto yy58;
+ }
+ } else {
+ if (yych <= '^') {
+ if (yych <= '[') goto yy62;
+ if (yych <= ']') goto yy58;
+ } else {
+ if (yych <= 'z') goto yy58;
+ if (yych >= 0x7F) goto yy58;
+ }
+ }
+ }
+yy60:
+ YYDEBUG(60, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(2);
+ yych = *YYCURSOR;
+ YYDEBUG(61, *YYCURSOR);
+ if (yych == '\n') goto yy64;
+ if (yych == '\r') goto yy66;
+ goto yy60;
+yy62:
+ YYDEBUG(62, *YYCURSOR);
+ yyaccept = 3;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(2);
+ yych = *YYCURSOR;
+ YYDEBUG(63, *YYCURSOR);
+ if (yych <= '\f') {
+ if (yych <= 0x08) goto yy60;
+ if (yych <= '\t') goto yy62;
+ if (yych >= '\v') goto yy60;
+ } else {
+ if (yych <= '\r') goto yy66;
+ if (yych == ' ') goto yy62;
+ goto yy60;
+ }
+yy64:
+ YYDEBUG(64, *YYCURSOR);
+ ++YYCURSOR;
+yy65:
+ YYDEBUG(65, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 591 "Zend/zend_ini_scanner.l"
+ { /* #Comment */
+ zend_error(E_DEPRECATED, "Comments starting with '#' are deprecated in %s on line %d", zend_ini_scanner_get_filename(TSRMLS_C), SCNG(lineno));
+ BEGIN(INITIAL);
+ SCNG(lineno)++;
+ return END_OF_LINE;
+}
+#line 1022 "Zend/zend_ini_scanner.c"
+yy66:
+ YYDEBUG(66, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '\n') goto yy64;
+ goto yy65;
+yy67:
+ YYDEBUG(67, *YYCURSOR);
+ yyaccept = 0;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(2);
+ yych = *YYCURSOR;
+yy68:
+ YYDEBUG(68, *YYCURSOR);
+ if (yych <= ' ') {
+ if (yych <= '\n') {
+ if (yych <= 0x08) goto yy5;
+ if (yych <= '\t') goto yy67;
+ goto yy71;
+ } else {
+ if (yych == '\r') goto yy72;
+ if (yych <= 0x1F) goto yy5;
+ goto yy67;
+ }
+ } else {
+ if (yych <= ':') {
+ if (yych == '#') goto yy60;
+ goto yy5;
+ } else {
+ if (yych <= ';') goto yy53;
+ if (yych == '=') goto yy51;
+ goto yy5;
+ }
+ }
+yy69:
+ YYDEBUG(69, *YYCURSOR);
+ yyaccept = 1;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(2);
+ yych = *YYCURSOR;
+ YYDEBUG(70, *YYCURSOR);
+ if (yych <= '&') {
+ if (yych <= 0x1F) {
+ if (yych <= '\n') {
+ if (yych <= 0x08) goto yy25;
+ if (yych <= '\t') goto yy67;
+ } else {
+ if (yych == '\r') goto yy72;
+ goto yy25;
+ }
+ } else {
+ if (yych <= '#') {
+ if (yych <= ' ') goto yy69;
+ if (yych <= '"') goto yy3;
+ goto yy58;
+ } else {
+ if (yych == '%') goto yy25;
+ goto yy3;
+ }
+ }
+ } else {
+ if (yych <= '=') {
+ if (yych <= ':') {
+ if (yych <= '\'') goto yy25;
+ if (yych <= ')') goto yy3;
+ goto yy25;
+ } else {
+ if (yych <= ';') goto yy53;
+ if (yych <= '<') goto yy25;
+ goto yy51;
+ }
+ } else {
+ if (yych <= ']') {
+ if (yych == '[') goto yy28;
+ goto yy25;
+ } else {
+ if (yych <= '^') goto yy3;
+ if (yych <= 'z') goto yy25;
+ if (yych <= '~') goto yy3;
+ goto yy25;
+ }
+ }
+ }
+yy71:
+ YYDEBUG(71, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy7;
+yy72:
+ YYDEBUG(72, *YYCURSOR);
+ ++YYCURSOR;
+ if ((yych = *YYCURSOR) == '\n') goto yy71;
+ goto yy7;
+ }
+/* *********************************** */
+yyc_ST_DOUBLE_QUOTES:
+ {
+ static const unsigned char yybm[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 128, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 128, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ };
+ YYDEBUG(73, *YYCURSOR);
+ YYFILL(2);
+ yych = *YYCURSOR;
+ if (yych == '"') goto yy77;
+ if (yych == '$') goto yy79;
+ YYDEBUG(75, *YYCURSOR);
+ ++YYCURSOR;
+yy76:
+ YYDEBUG(76, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 535 "Zend/zend_ini_scanner.l"
+ { /* Escape double quoted string contents */
+ if (YYCURSOR > YYLIMIT) {
+ return 0;
+ }
+
+ while (YYCURSOR < YYLIMIT) {
+ switch (*YYCURSOR++) {
+ case '"':
+ if (YYCURSOR < YYLIMIT && YYCURSOR[-2] == '\\' && *YYCURSOR != '\r' && *YYCURSOR != '\n') {
+ continue;
+ }
+ break;
+ case '$':
+ if (*YYCURSOR == '{') {
+ break;
+ }
+ continue;
+ case '\\':
+ if (YYCURSOR < YYLIMIT && *YYCURSOR != '"') {
+ YYCURSOR++;
+ }
+ /* fall through */
+ default:
+ continue;
+ }
+
+ YYCURSOR--;
+ break;
+ }
+
+ yyleng = YYCURSOR - SCNG(yy_text);
+
+ zend_ini_escape_string(ini_lval, yytext, yyleng, '"' TSRMLS_CC);
+ return TC_QUOTED_STRING;
+}
+#line 1198 "Zend/zend_ini_scanner.c"
+yy77:
+ YYDEBUG(77, *YYCURSOR);
+ ++YYCURSOR;
+ yych = *YYCURSOR;
+ goto yy83;
+yy78:
+ YYDEBUG(78, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 530 "Zend/zend_ini_scanner.l"
+ { /* Double quoted '"' string ends */
+ yy_pop_state(TSRMLS_C);
+ return '"';
+}
+#line 1212 "Zend/zend_ini_scanner.c"
+yy79:
+ YYDEBUG(79, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych != '{') goto yy76;
+ YYDEBUG(80, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(81, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 401 "Zend/zend_ini_scanner.l"
+ { /* Variable start */
+ yy_push_state(ST_VARNAME TSRMLS_CC);
+ return TC_DOLLAR_CURLY;
+}
+#line 1226 "Zend/zend_ini_scanner.c"
+yy82:
+ YYDEBUG(82, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+yy83:
+ YYDEBUG(83, *YYCURSOR);
+ if (yybm[0+yych] & 128) {
+ goto yy82;
+ }
+ goto yy78;
+ }
+/* *********************************** */
+yyc_ST_OFFSET:
+ {
+ static const unsigned char yybm[] = {
+ 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 194, 64, 66, 66, 64, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66,
+ 194, 66, 64, 66, 68, 66, 66, 0,
+ 66, 66, 66, 66, 66, 66, 66, 66,
+ 114, 114, 114, 114, 114, 114, 114, 114,
+ 114, 114, 66, 64, 66, 66, 66, 66,
+ 66, 82, 82, 82, 82, 82, 82, 82,
+ 82, 82, 82, 82, 82, 82, 82, 82,
+ 82, 82, 82, 82, 82, 82, 82, 82,
+ 82, 82, 82, 66, 72, 64, 66, 82,
+ 66, 82, 82, 82, 82, 82, 82, 82,
+ 82, 82, 82, 82, 82, 82, 82, 82,
+ 82, 82, 82, 82, 82, 82, 82, 82,
+ 82, 82, 82, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66,
+ };
+ YYDEBUG(84, *YYCURSOR);
+ YYFILL(2);
+ yych = *YYCURSOR;
+ if (yych <= '-') {
+ if (yych <= ' ') {
+ if (yych <= '\n') {
+ if (yych <= 0x08) goto yy86;
+ if (yych <= '\t') goto yy88;
+ goto yy89;
+ } else {
+ if (yych == '\r') goto yy89;
+ if (yych >= ' ') goto yy88;
+ }
+ } else {
+ if (yych <= '$') {
+ if (yych == '"') goto yy91;
+ if (yych >= '$') goto yy93;
+ } else {
+ if (yych == '\'') goto yy94;
+ if (yych >= '-') goto yy95;
+ }
+ }
+ } else {
+ if (yych <= 'Z') {
+ if (yych <= '9') {
+ if (yych <= '.') goto yy96;
+ if (yych >= '0') goto yy97;
+ } else {
+ if (yych == ';') goto yy89;
+ if (yych >= 'A') goto yy99;
+ }
+ } else {
+ if (yych <= '^') {
+ if (yych <= '[') goto yy86;
+ if (yych <= '\\') goto yy101;
+ if (yych <= ']') goto yy102;
+ } else {
+ if (yych == '`') goto yy86;
+ if (yych <= 'z') goto yy99;
+ }
+ }
+ }
+yy86:
+ YYDEBUG(86, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ goto yy105;
+yy87:
+ YYDEBUG(87, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 521 "Zend/zend_ini_scanner.l"
+ { /* Get rest as section/offset value */
+ RETURN_TOKEN(TC_STRING, yytext, yyleng);
+}
+#line 1330 "Zend/zend_ini_scanner.c"
+yy88:
+ YYDEBUG(88, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yybm[0+yych] & 128) {
+ goto yy131;
+ }
+ if (yych == '"') goto yy133;
+ if (yych == ']') goto yy134;
+ goto yy105;
+yy89:
+ YYDEBUG(89, *YYCURSOR);
+ ++YYCURSOR;
+yy90:
+ YYDEBUG(90, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 603 "Zend/zend_ini_scanner.l"
+ {
+ return 0;
+}
+#line 1351 "Zend/zend_ini_scanner.c"
+yy91:
+ YYDEBUG(91, *YYCURSOR);
+ ++YYCURSOR;
+yy92:
+ YYDEBUG(92, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 525 "Zend/zend_ini_scanner.l"
+ { /* Double quoted '"' string start */
+ yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
+ return '"';
+}
+#line 1363 "Zend/zend_ini_scanner.c"
+yy93:
+ YYDEBUG(93, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= '\\') {
+ if (yych <= 0x00) goto yy90;
+ if (yych <= '[') goto yy104;
+ goto yy109;
+ } else {
+ if (yych == '{') goto yy129;
+ goto yy104;
+ }
+yy94:
+ YYDEBUG(94, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yybm[0+yych] & 64) {
+ goto yy125;
+ }
+ goto yy90;
+yy95:
+ YYDEBUG(95, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '/') goto yy105;
+ if (yych <= '9') goto yy123;
+ goto yy105;
+yy96:
+ YYDEBUG(96, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '/') goto yy105;
+ if (yych <= '9') goto yy121;
+ goto yy105;
+yy97:
+ YYDEBUG(97, *YYCURSOR);
+ yyaccept = 2;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '\'') {
+ if (yych <= '\r') {
+ if (yych == '\n') goto yy98;
+ if (yych <= '\f') goto yy105;
+ } else {
+ if (yych == '"') goto yy98;
+ if (yych <= '&') goto yy105;
+ }
+ } else {
+ if (yych <= '9') {
+ if (yych == '.') goto yy117;
+ if (yych <= '/') goto yy105;
+ goto yy119;
+ } else {
+ if (yych <= ';') {
+ if (yych <= ':') goto yy105;
+ } else {
+ if (yych != ']') goto yy105;
+ }
+ }
+ }
+yy98:
+ YYDEBUG(98, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 499 "Zend/zend_ini_scanner.l"
+ { /* Get number option value as string */
+ RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
+}
+#line 1429 "Zend/zend_ini_scanner.c"
+yy99:
+ YYDEBUG(99, *YYCURSOR);
+ yyaccept = 3;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yybm[0+yych] & 16) {
+ goto yy115;
+ }
+ if (yych <= '"') {
+ if (yych <= '\f') {
+ if (yych != '\n') goto yy105;
+ } else {
+ if (yych <= '\r') goto yy100;
+ if (yych <= '!') goto yy105;
+ }
+ } else {
+ if (yych <= ':') {
+ if (yych != '\'') goto yy105;
+ } else {
+ if (yych <= ';') goto yy100;
+ if (yych != ']') goto yy105;
+ }
+ }
+yy100:
+ YYDEBUG(100, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 495 "Zend/zend_ini_scanner.l"
+ { /* Get constant option value */
+ RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
+}
+#line 1459 "Zend/zend_ini_scanner.c"
+yy101:
+ YYDEBUG(101, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy104;
+yy102:
+ YYDEBUG(102, *YYCURSOR);
+ ++YYCURSOR;
+yy103:
+ YYDEBUG(103, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 396 "Zend/zend_ini_scanner.l"
+ { /* End of section or an option offset */
+ BEGIN(INITIAL);
+ return ']';
+}
+#line 1475 "Zend/zend_ini_scanner.c"
+yy104:
+ YYDEBUG(104, *YYCURSOR);
+ yyaccept = 0;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+yy105:
+ YYDEBUG(105, *YYCURSOR);
+ if (yybm[0+yych] & 2) {
+ goto yy104;
+ }
+ if (yych == '$') goto yy107;
+ if (yych != '\\') goto yy87;
+yy106:
+ YYDEBUG(106, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy104;
+yy107:
+ YYDEBUG(107, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ if (yych <= '\\') {
+ if (yych <= 0x00) goto yy108;
+ if (yych <= '[') goto yy104;
+ goto yy109;
+ } else {
+ if (yych != '{') goto yy104;
+ }
+yy108:
+ YYDEBUG(108, *YYCURSOR);
+ YYCURSOR = YYMARKER;
+ if (yyaccept <= 1) {
+ if (yyaccept <= 0) {
+ goto yy87;
+ } else {
+ goto yy90;
+ }
+ } else {
+ if (yyaccept <= 2) {
+ goto yy98;
+ } else {
+ goto yy100;
+ }
+ }
+yy109:
+ YYDEBUG(109, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ if (yybm[0+yych] & 4) {
+ goto yy110;
+ }
+ if (yych == '\\') goto yy112;
+ goto yy104;
+yy110:
+ YYDEBUG(110, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(111, *YYCURSOR);
+ if (yybm[0+yych] & 4) {
+ goto yy110;
+ }
+ if (yych == '\\') goto yy114;
+ goto yy104;
+yy112:
+ YYDEBUG(112, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(113, *YYCURSOR);
+ if (yybm[0+yych] & 4) {
+ goto yy110;
+ }
+ if (yych == '\\') goto yy112;
+ goto yy104;
+yy114:
+ YYDEBUG(114, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ if (yybm[0+yych] & 4) {
+ goto yy110;
+ }
+ if (yych == '\\') goto yy112;
+ goto yy104;
+yy115:
+ YYDEBUG(115, *YYCURSOR);
+ yyaccept = 3;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(116, *YYCURSOR);
+ if (yybm[0+yych] & 16) {
+ goto yy115;
+ }
+ if (yych <= '$') {
+ if (yych <= '\r') {
+ if (yych == '\n') goto yy100;
+ if (yych <= '\f') goto yy104;
+ goto yy100;
+ } else {
+ if (yych == '"') goto yy100;
+ if (yych <= '#') goto yy104;
+ goto yy107;
+ }
+ } else {
+ if (yych <= ';') {
+ if (yych == '\'') goto yy100;
+ if (yych <= ':') goto yy104;
+ goto yy100;
+ } else {
+ if (yych <= '[') goto yy104;
+ if (yych <= '\\') goto yy106;
+ if (yych <= ']') goto yy100;
+ goto yy104;
+ }
+ }
+yy117:
+ YYDEBUG(117, *YYCURSOR);
+ yyaccept = 2;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(118, *YYCURSOR);
+ if (yybm[0+yych] & 32) {
+ goto yy117;
+ }
+ if (yych <= '$') {
+ if (yych <= '\r') {
+ if (yych == '\n') goto yy98;
+ if (yych <= '\f') goto yy104;
+ goto yy98;
+ } else {
+ if (yych == '"') goto yy98;
+ if (yych <= '#') goto yy104;
+ goto yy107;
+ }
+ } else {
+ if (yych <= ';') {
+ if (yych == '\'') goto yy98;
+ if (yych <= ':') goto yy104;
+ goto yy98;
+ } else {
+ if (yych <= '[') goto yy104;
+ if (yych <= '\\') goto yy106;
+ if (yych <= ']') goto yy98;
+ goto yy104;
+ }
+ }
+yy119:
+ YYDEBUG(119, *YYCURSOR);
+ yyaccept = 2;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(120, *YYCURSOR);
+ if (yych <= '\'') {
+ if (yych <= '!') {
+ if (yych <= '\n') {
+ if (yych <= '\t') goto yy104;
+ goto yy98;
+ } else {
+ if (yych == '\r') goto yy98;
+ goto yy104;
+ }
+ } else {
+ if (yych <= '#') {
+ if (yych <= '"') goto yy98;
+ goto yy104;
+ } else {
+ if (yych <= '$') goto yy107;
+ if (yych <= '&') goto yy104;
+ goto yy98;
+ }
+ }
+ } else {
+ if (yych <= ':') {
+ if (yych <= '.') {
+ if (yych <= '-') goto yy104;
+ goto yy117;
+ } else {
+ if (yych <= '/') goto yy104;
+ if (yych <= '9') goto yy119;
+ goto yy104;
+ }
+ } else {
+ if (yych <= '[') {
+ if (yych <= ';') goto yy98;
+ goto yy104;
+ } else {
+ if (yych <= '\\') goto yy106;
+ if (yych <= ']') goto yy98;
+ goto yy104;
+ }
+ }
+ }
+yy121:
+ YYDEBUG(121, *YYCURSOR);
+ yyaccept = 2;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(122, *YYCURSOR);
+ if (yych <= '&') {
+ if (yych <= '\r') {
+ if (yych == '\n') goto yy98;
+ if (yych <= '\f') goto yy104;
+ goto yy98;
+ } else {
+ if (yych <= '"') {
+ if (yych <= '!') goto yy104;
+ goto yy98;
+ } else {
+ if (yych == '$') goto yy107;
+ goto yy104;
+ }
+ }
+ } else {
+ if (yych <= ':') {
+ if (yych <= '\'') goto yy98;
+ if (yych <= '/') goto yy104;
+ if (yych <= '9') goto yy121;
+ goto yy104;
+ } else {
+ if (yych <= '[') {
+ if (yych <= ';') goto yy98;
+ goto yy104;
+ } else {
+ if (yych <= '\\') goto yy106;
+ if (yych <= ']') goto yy98;
+ goto yy104;
+ }
+ }
+ }
+yy123:
+ YYDEBUG(123, *YYCURSOR);
+ yyaccept = 2;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(124, *YYCURSOR);
+ if (yych <= '&') {
+ if (yych <= '\r') {
+ if (yych == '\n') goto yy98;
+ if (yych <= '\f') goto yy104;
+ goto yy98;
+ } else {
+ if (yych <= '"') {
+ if (yych <= '!') goto yy104;
+ goto yy98;
+ } else {
+ if (yych == '$') goto yy107;
+ goto yy104;
+ }
+ }
+ } else {
+ if (yych <= ':') {
+ if (yych <= '\'') goto yy98;
+ if (yych <= '/') goto yy104;
+ if (yych <= '9') goto yy123;
+ goto yy104;
+ } else {
+ if (yych <= '[') {
+ if (yych <= ';') goto yy98;
+ goto yy104;
+ } else {
+ if (yych <= '\\') goto yy106;
+ if (yych <= ']') goto yy98;
+ goto yy104;
+ }
+ }
+ }
+yy125:
+ YYDEBUG(125, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(126, *YYCURSOR);
+ if (yybm[0+yych] & 64) {
+ goto yy125;
+ }
+ YYDEBUG(127, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(128, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 368 "Zend/zend_ini_scanner.l"
+ { /* Raw string */
+ /* Eat leading and trailing single quotes */
+ if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
+ SCNG(yy_text)++;
+ yyleng = yyleng - 2;
+ }
+ RETURN_TOKEN(TC_RAW, yytext, yyleng);
+}
+#line 1774 "Zend/zend_ini_scanner.c"
+yy129:
+ YYDEBUG(129, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(130, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 401 "Zend/zend_ini_scanner.l"
+ { /* Variable start */
+ yy_push_state(ST_VARNAME TSRMLS_CC);
+ return TC_DOLLAR_CURLY;
+}
+#line 1785 "Zend/zend_ini_scanner.c"
+yy131:
+ YYDEBUG(131, *YYCURSOR);
+ yyaccept = 0;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(132, *YYCURSOR);
+ if (yybm[0+yych] & 128) {
+ goto yy131;
+ }
+ if (yych <= '$') {
+ if (yych <= '\r') {
+ if (yych == '\n') goto yy87;
+ if (yych <= '\f') goto yy104;
+ goto yy87;
+ } else {
+ if (yych == '"') goto yy133;
+ if (yych <= '#') goto yy104;
+ goto yy107;
+ }
+ } else {
+ if (yych <= ';') {
+ if (yych == '\'') goto yy87;
+ if (yych <= ':') goto yy104;
+ goto yy87;
+ } else {
+ if (yych <= '[') goto yy104;
+ if (yych <= '\\') goto yy106;
+ if (yych <= ']') goto yy134;
+ goto yy104;
+ }
+ }
+yy133:
+ YYDEBUG(133, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy92;
+yy134:
+ YYDEBUG(134, *YYCURSOR);
+ ++YYCURSOR;
+ yych = *YYCURSOR;
+ goto yy103;
+ }
+/* *********************************** */
+yyc_ST_RAW:
+ {
+ static const unsigned char yybm[] = {
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 192, 0, 64, 64, 0, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 192, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64,
+ };
+ YYDEBUG(135, *YYCURSOR);
+ YYFILL(3);
+ yych = *YYCURSOR;
+ if (yych <= '\f') {
+ if (yych <= 0x08) {
+ if (yych >= 0x01) goto yy139;
+ } else {
+ if (yych <= '\t') goto yy141;
+ if (yych <= '\n') goto yy142;
+ goto yy139;
+ }
+ } else {
+ if (yych <= ' ') {
+ if (yych <= '\r') goto yy144;
+ if (yych <= 0x1F) goto yy139;
+ goto yy141;
+ } else {
+ if (yych == ';') goto yy145;
+ goto yy139;
+ }
+ }
+ YYDEBUG(137, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(138, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 598 "Zend/zend_ini_scanner.l"
+ { /* End of option value (if EOF is reached before EOL */
+ BEGIN(INITIAL);
+ return END_OF_LINE;
+}
+#line 1895 "Zend/zend_ini_scanner.c"
+yy139:
+ YYDEBUG(139, *YYCURSOR);
+ ++YYCURSOR;
+yy140:
+ YYDEBUG(140, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 448 "Zend/zend_ini_scanner.l"
+ { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
+ char *sc = NULL;
+ while (YYCURSOR < YYLIMIT) {
+ switch (*YYCURSOR) {
+ case '\n':
+ case '\r':
+ goto end_raw_value_chars;
+ break;
+ case ';':
+ if (sc == NULL) {
+ sc = YYCURSOR;
+ }
+ /* no break */
+ default:
+ YYCURSOR++;
+ break;
+ }
+ }
+end_raw_value_chars:
+ yyleng = YYCURSOR - SCNG(yy_text);
+
+ /* Eat trailing semicolons */
+ while (yytext[yyleng - 1] == ';') {
+ yyleng--;
+ }
+
+ /* Eat leading and trailing double quotes */
+ if (yytext[0] == '"' && yytext[yyleng - 1] == '"') {
+ SCNG(yy_text)++;
+ yyleng = yyleng - 2;
+ } else if (sc) {
+ YYCURSOR = sc;
+ yyleng = YYCURSOR - SCNG(yy_text);
+ }
+ RETURN_TOKEN(TC_RAW, yytext, yyleng);
+}
+#line 1939 "Zend/zend_ini_scanner.c"
+yy141:
+ YYDEBUG(141, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '\r') {
+ if (yych <= 0x08) goto yy140;
+ if (yych <= '\n') goto yy153;
+ if (yych <= '\f') goto yy140;
+ goto yy153;
+ } else {
+ if (yych <= ' ') {
+ if (yych <= 0x1F) goto yy140;
+ goto yy153;
+ } else {
+ if (yych == ';') goto yy153;
+ goto yy140;
+ }
+ }
+yy142:
+ YYDEBUG(142, *YYCURSOR);
+ ++YYCURSOR;
+yy143:
+ YYDEBUG(143, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 489 "Zend/zend_ini_scanner.l"
+ { /* End of option value */
+ BEGIN(INITIAL);
+ SCNG(lineno)++;
+ return END_OF_LINE;
+}
+#line 1970 "Zend/zend_ini_scanner.c"
+yy144:
+ YYDEBUG(144, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '\n') goto yy151;
+ goto yy143;
+yy145:
+ YYDEBUG(145, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ goto yy147;
+yy146:
+ YYDEBUG(146, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(2);
+ yych = *YYCURSOR;
+yy147:
+ YYDEBUG(147, *YYCURSOR);
+ if (yybm[0+yych] & 64) {
+ goto yy146;
+ }
+ if (yych >= '\r') goto yy150;
+yy148:
+ YYDEBUG(148, *YYCURSOR);
+ ++YYCURSOR;
+yy149:
+ YYDEBUG(149, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 585 "Zend/zend_ini_scanner.l"
+ { /* Comment */
+ BEGIN(INITIAL);
+ SCNG(lineno)++;
+ return END_OF_LINE;
+}
+#line 2004 "Zend/zend_ini_scanner.c"
+yy150:
+ YYDEBUG(150, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '\n') goto yy148;
+ goto yy149;
+yy151:
+ YYDEBUG(151, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy143;
+yy152:
+ YYDEBUG(152, *YYCURSOR);
+ yyaccept = 2;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(2);
+ yych = *YYCURSOR;
+yy153:
+ YYDEBUG(153, *YYCURSOR);
+ if (yybm[0+yych] & 128) {
+ goto yy152;
+ }
+ if (yych <= '\f') {
+ if (yych == '\n') goto yy151;
+ } else {
+ if (yych <= '\r') goto yy155;
+ if (yych == ';') goto yy146;
+ }
+ YYDEBUG(154, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 575 "Zend/zend_ini_scanner.l"
+ {
+ /* eat whitespace */
+ goto restart;
+}
+#line 2038 "Zend/zend_ini_scanner.c"
+yy155:
+ YYDEBUG(155, *YYCURSOR);
+ ++YYCURSOR;
+ if ((yych = *YYCURSOR) == '\n') goto yy151;
+ goto yy143;
+ }
+/* *********************************** */
+yyc_ST_SECTION_RAW:
+ {
+ static const unsigned char yybm[] = {
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 192, 0, 128, 128, 0, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 192, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 0, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ };
+ YYDEBUG(156, *YYCURSOR);
+ YYFILL(3);
+ yych = *YYCURSOR;
+ if (yych <= '\f') {
+ if (yych == '\n') goto yy160;
+ } else {
+ if (yych <= '\r') goto yy160;
+ if (yych == ']') goto yy162;
+ }
+ YYDEBUG(158, *YYCURSOR);
+ ++YYCURSOR;
+ yych = *YYCURSOR;
+ goto yy169;
+yy159:
+ YYDEBUG(159, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 485 "Zend/zend_ini_scanner.l"
+ { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
+ RETURN_TOKEN(TC_RAW, yytext, yyleng);
+}
+#line 2102 "Zend/zend_ini_scanner.c"
+yy160:
+ YYDEBUG(160, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(161, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 603 "Zend/zend_ini_scanner.l"
+ {
+ return 0;
+}
+#line 2112 "Zend/zend_ini_scanner.c"
+yy162:
+ YYDEBUG(162, *YYCURSOR);
+ ++YYCURSOR;
+ yych = *YYCURSOR;
+ goto yy165;
+yy163:
+ YYDEBUG(163, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 377 "Zend/zend_ini_scanner.l"
+ { /* End of section */
+ BEGIN(INITIAL);
+ SCNG(lineno)++;
+ return ']';
+}
+#line 2127 "Zend/zend_ini_scanner.c"
+yy164:
+ YYDEBUG(164, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(2);
+ yych = *YYCURSOR;
+yy165:
+ YYDEBUG(165, *YYCURSOR);
+ if (yybm[0+yych] & 64) {
+ goto yy164;
+ }
+ if (yych == '\n') goto yy166;
+ if (yych == '\r') goto yy167;
+ goto yy163;
+yy166:
+ YYDEBUG(166, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy163;
+yy167:
+ YYDEBUG(167, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '\n') goto yy166;
+ goto yy163;
+yy168:
+ YYDEBUG(168, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+yy169:
+ YYDEBUG(169, *YYCURSOR);
+ if (yybm[0+yych] & 128) {
+ goto yy168;
+ }
+ goto yy159;
+ }
+/* *********************************** */
+yyc_ST_SECTION_VALUE:
+ {
+ static const unsigned char yybm[] = {
+ 132, 132, 132, 132, 132, 132, 132, 132,
+ 132, 134, 128, 132, 132, 128, 132, 132,
+ 132, 132, 132, 132, 132, 132, 132, 132,
+ 132, 132, 132, 132, 132, 132, 132, 132,
+ 134, 132, 128, 132, 136, 132, 132, 0,
+ 132, 132, 132, 132, 132, 132, 132, 132,
+ 228, 228, 228, 228, 228, 228, 228, 228,
+ 228, 228, 132, 128, 132, 132, 132, 132,
+ 132, 164, 164, 164, 164, 164, 164, 164,
+ 164, 164, 164, 164, 164, 164, 164, 164,
+ 164, 164, 164, 164, 164, 164, 164, 164,
+ 164, 164, 164, 132, 144, 128, 132, 164,
+ 132, 164, 164, 164, 164, 164, 164, 164,
+ 164, 164, 164, 164, 164, 164, 164, 164,
+ 164, 164, 164, 164, 164, 164, 164, 164,
+ 164, 164, 164, 132, 132, 132, 132, 132,
+ 132, 132, 132, 132, 132, 132, 132, 132,
+ 132, 132, 132, 132, 132, 132, 132, 132,
+ 132, 132, 132, 132, 132, 132, 132, 132,
+ 132, 132, 132, 132, 132, 132, 132, 132,
+ 132, 132, 132, 132, 132, 132, 132, 132,
+ 132, 132, 132, 132, 132, 132, 132, 132,
+ 132, 132, 132, 132, 132, 132, 132, 132,
+ 132, 132, 132, 132, 132, 132, 132, 132,
+ 132, 132, 132, 132, 132, 132, 132, 132,
+ 132, 132, 132, 132, 132, 132, 132, 132,
+ 132, 132, 132, 132, 132, 132, 132, 132,
+ 132, 132, 132, 132, 132, 132, 132, 132,
+ 132, 132, 132, 132, 132, 132, 132, 132,
+ 132, 132, 132, 132, 132, 132, 132, 132,
+ 132, 132, 132, 132, 132, 132, 132, 132,
+ 132, 132, 132, 132, 132, 132, 132, 132,
+ };
+ YYDEBUG(170, *YYCURSOR);
+ YYFILL(3);
+ yych = *YYCURSOR;
+ if (yych <= '-') {
+ if (yych <= ' ') {
+ if (yych <= '\n') {
+ if (yych <= 0x08) goto yy172;
+ if (yych <= '\t') goto yy174;
+ goto yy175;
+ } else {
+ if (yych == '\r') goto yy175;
+ if (yych >= ' ') goto yy174;
+ }
+ } else {
+ if (yych <= '$') {
+ if (yych == '"') goto yy177;
+ if (yych >= '$') goto yy179;
+ } else {
+ if (yych == '\'') goto yy180;
+ if (yych >= '-') goto yy181;
+ }
+ }
+ } else {
+ if (yych <= 'Z') {
+ if (yych <= '9') {
+ if (yych <= '.') goto yy182;
+ if (yych >= '0') goto yy183;
+ } else {
+ if (yych == ';') goto yy175;
+ if (yych >= 'A') goto yy185;
+ }
+ } else {
+ if (yych <= '^') {
+ if (yych <= '[') goto yy172;
+ if (yych <= '\\') goto yy187;
+ if (yych <= ']') goto yy188;
+ } else {
+ if (yych == '`') goto yy172;
+ if (yych <= 'z') goto yy185;
+ }
+ }
+ }
+yy172:
+ YYDEBUG(172, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ goto yy195;
+yy173:
+ YYDEBUG(173, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 521 "Zend/zend_ini_scanner.l"
+ { /* Get rest as section/offset value */
+ RETURN_TOKEN(TC_STRING, yytext, yyleng);
+}
+#line 2253 "Zend/zend_ini_scanner.c"
+yy174:
+ YYDEBUG(174, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= 0x1F) {
+ if (yych == '\t') goto yy221;
+ goto yy195;
+ } else {
+ if (yych <= ' ') goto yy221;
+ if (yych == '"') goto yy223;
+ goto yy195;
+ }
+yy175:
+ YYDEBUG(175, *YYCURSOR);
+ ++YYCURSOR;
+yy176:
+ YYDEBUG(176, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 603 "Zend/zend_ini_scanner.l"
+ {
+ return 0;
+}
+#line 2276 "Zend/zend_ini_scanner.c"
+yy177:
+ YYDEBUG(177, *YYCURSOR);
+ ++YYCURSOR;
+yy178:
+ YYDEBUG(178, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 525 "Zend/zend_ini_scanner.l"
+ { /* Double quoted '"' string start */
+ yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
+ return '"';
+}
+#line 2288 "Zend/zend_ini_scanner.c"
+yy179:
+ YYDEBUG(179, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= '\\') {
+ if (yych <= 0x00) goto yy176;
+ if (yych <= '[') goto yy194;
+ goto yy199;
+ } else {
+ if (yych == '{') goto yy219;
+ goto yy194;
+ }
+yy180:
+ YYDEBUG(180, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yybm[0+yych] & 128) {
+ goto yy215;
+ }
+ goto yy176;
+yy181:
+ YYDEBUG(181, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '/') goto yy195;
+ if (yych <= '9') goto yy213;
+ goto yy195;
+yy182:
+ YYDEBUG(182, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '/') goto yy195;
+ if (yych <= '9') goto yy211;
+ goto yy195;
+yy183:
+ YYDEBUG(183, *YYCURSOR);
+ yyaccept = 2;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '\'') {
+ if (yych <= '\r') {
+ if (yych == '\n') goto yy184;
+ if (yych <= '\f') goto yy195;
+ } else {
+ if (yych == '"') goto yy184;
+ if (yych <= '&') goto yy195;
+ }
+ } else {
+ if (yych <= '9') {
+ if (yych == '.') goto yy207;
+ if (yych <= '/') goto yy195;
+ goto yy209;
+ } else {
+ if (yych <= ';') {
+ if (yych <= ':') goto yy195;
+ } else {
+ if (yych != ']') goto yy195;
+ }
+ }
+ }
+yy184:
+ YYDEBUG(184, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 499 "Zend/zend_ini_scanner.l"
+ { /* Get number option value as string */
+ RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
+}
+#line 2354 "Zend/zend_ini_scanner.c"
+yy185:
+ YYDEBUG(185, *YYCURSOR);
+ yyaccept = 3;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yybm[0+yych] & 32) {
+ goto yy205;
+ }
+ if (yych <= '"') {
+ if (yych <= '\f') {
+ if (yych != '\n') goto yy195;
+ } else {
+ if (yych <= '\r') goto yy186;
+ if (yych <= '!') goto yy195;
+ }
+ } else {
+ if (yych <= ':') {
+ if (yych != '\'') goto yy195;
+ } else {
+ if (yych <= ';') goto yy186;
+ if (yych != ']') goto yy195;
+ }
+ }
+yy186:
+ YYDEBUG(186, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 495 "Zend/zend_ini_scanner.l"
+ { /* Get constant option value */
+ RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
+}
+#line 2384 "Zend/zend_ini_scanner.c"
+yy187:
+ YYDEBUG(187, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy194;
+yy188:
+ YYDEBUG(188, *YYCURSOR);
+ ++YYCURSOR;
+ yych = *YYCURSOR;
+ goto yy191;
+yy189:
+ YYDEBUG(189, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 377 "Zend/zend_ini_scanner.l"
+ { /* End of section */
+ BEGIN(INITIAL);
+ SCNG(lineno)++;
+ return ']';
+}
+#line 2403 "Zend/zend_ini_scanner.c"
+yy190:
+ YYDEBUG(190, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(2);
+ yych = *YYCURSOR;
+yy191:
+ YYDEBUG(191, *YYCURSOR);
+ if (yybm[0+yych] & 2) {
+ goto yy190;
+ }
+ if (yych == '\n') goto yy192;
+ if (yych == '\r') goto yy193;
+ goto yy189;
+yy192:
+ YYDEBUG(192, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy189;
+yy193:
+ YYDEBUG(193, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '\n') goto yy192;
+ goto yy189;
+yy194:
+ YYDEBUG(194, *YYCURSOR);
+ yyaccept = 0;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+yy195:
+ YYDEBUG(195, *YYCURSOR);
+ if (yybm[0+yych] & 4) {
+ goto yy194;
+ }
+ if (yych == '$') goto yy197;
+ if (yych != '\\') goto yy173;
+yy196:
+ YYDEBUG(196, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ goto yy194;
+yy197:
+ YYDEBUG(197, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ if (yych <= '\\') {
+ if (yych <= 0x00) goto yy198;
+ if (yych <= '[') goto yy194;
+ goto yy199;
+ } else {
+ if (yych != '{') goto yy194;
+ }
+yy198:
+ YYDEBUG(198, *YYCURSOR);
+ YYCURSOR = YYMARKER;
+ if (yyaccept <= 1) {
+ if (yyaccept <= 0) {
+ goto yy173;
+ } else {
+ goto yy176;
+ }
+ } else {
+ if (yyaccept <= 2) {
+ goto yy184;
+ } else {
+ goto yy186;
+ }
+ }
+yy199:
+ YYDEBUG(199, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ if (yybm[0+yych] & 8) {
+ goto yy200;
+ }
+ if (yych == '\\') goto yy202;
+ goto yy194;
+yy200:
+ YYDEBUG(200, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(201, *YYCURSOR);
+ if (yybm[0+yych] & 8) {
+ goto yy200;
+ }
+ if (yych == '\\') goto yy204;
+ goto yy194;
+yy202:
+ YYDEBUG(202, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(203, *YYCURSOR);
+ if (yybm[0+yych] & 8) {
+ goto yy200;
+ }
+ if (yych == '\\') goto yy202;
+ goto yy194;
+yy204:
+ YYDEBUG(204, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ if (yybm[0+yych] & 8) {
+ goto yy200;
+ }
+ if (yych == '\\') goto yy202;
+ goto yy194;
+yy205:
+ YYDEBUG(205, *YYCURSOR);
+ yyaccept = 3;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(206, *YYCURSOR);
+ if (yybm[0+yych] & 32) {
+ goto yy205;
+ }
+ if (yych <= '$') {
+ if (yych <= '\r') {
+ if (yych == '\n') goto yy186;
+ if (yych <= '\f') goto yy194;
+ goto yy186;
+ } else {
+ if (yych == '"') goto yy186;
+ if (yych <= '#') goto yy194;
+ goto yy197;
+ }
+ } else {
+ if (yych <= ';') {
+ if (yych == '\'') goto yy186;
+ if (yych <= ':') goto yy194;
+ goto yy186;
+ } else {
+ if (yych <= '[') goto yy194;
+ if (yych <= '\\') goto yy196;
+ if (yych <= ']') goto yy186;
+ goto yy194;
+ }
+ }
+yy207:
+ YYDEBUG(207, *YYCURSOR);
+ yyaccept = 2;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(208, *YYCURSOR);
+ if (yybm[0+yych] & 64) {
+ goto yy207;
+ }
+ if (yych <= '$') {
+ if (yych <= '\r') {
+ if (yych == '\n') goto yy184;
+ if (yych <= '\f') goto yy194;
+ goto yy184;
+ } else {
+ if (yych == '"') goto yy184;
+ if (yych <= '#') goto yy194;
+ goto yy197;
+ }
+ } else {
+ if (yych <= ';') {
+ if (yych == '\'') goto yy184;
+ if (yych <= ':') goto yy194;
+ goto yy184;
+ } else {
+ if (yych <= '[') goto yy194;
+ if (yych <= '\\') goto yy196;
+ if (yych <= ']') goto yy184;
+ goto yy194;
+ }
+ }
+yy209:
+ YYDEBUG(209, *YYCURSOR);
+ yyaccept = 2;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(210, *YYCURSOR);
+ if (yych <= '\'') {
+ if (yych <= '!') {
+ if (yych <= '\n') {
+ if (yych <= '\t') goto yy194;
+ goto yy184;
+ } else {
+ if (yych == '\r') goto yy184;
+ goto yy194;
+ }
+ } else {
+ if (yych <= '#') {
+ if (yych <= '"') goto yy184;
+ goto yy194;
+ } else {
+ if (yych <= '$') goto yy197;
+ if (yych <= '&') goto yy194;
+ goto yy184;
+ }
+ }
+ } else {
+ if (yych <= ':') {
+ if (yych <= '.') {
+ if (yych <= '-') goto yy194;
+ goto yy207;
+ } else {
+ if (yych <= '/') goto yy194;
+ if (yych <= '9') goto yy209;
+ goto yy194;
+ }
+ } else {
+ if (yych <= '[') {
+ if (yych <= ';') goto yy184;
+ goto yy194;
+ } else {
+ if (yych <= '\\') goto yy196;
+ if (yych <= ']') goto yy184;
+ goto yy194;
+ }
+ }
+ }
+yy211:
+ YYDEBUG(211, *YYCURSOR);
+ yyaccept = 2;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(212, *YYCURSOR);
+ if (yych <= '&') {
+ if (yych <= '\r') {
+ if (yych == '\n') goto yy184;
+ if (yych <= '\f') goto yy194;
+ goto yy184;
+ } else {
+ if (yych <= '"') {
+ if (yych <= '!') goto yy194;
+ goto yy184;
+ } else {
+ if (yych == '$') goto yy197;
+ goto yy194;
+ }
+ }
+ } else {
+ if (yych <= ':') {
+ if (yych <= '\'') goto yy184;
+ if (yych <= '/') goto yy194;
+ if (yych <= '9') goto yy211;
+ goto yy194;
+ } else {
+ if (yych <= '[') {
+ if (yych <= ';') goto yy184;
+ goto yy194;
+ } else {
+ if (yych <= '\\') goto yy196;
+ if (yych <= ']') goto yy184;
+ goto yy194;
+ }
+ }
+ }
+yy213:
+ YYDEBUG(213, *YYCURSOR);
+ yyaccept = 2;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(214, *YYCURSOR);
+ if (yych <= '&') {
+ if (yych <= '\r') {
+ if (yych == '\n') goto yy184;
+ if (yych <= '\f') goto yy194;
+ goto yy184;
+ } else {
+ if (yych <= '"') {
+ if (yych <= '!') goto yy194;
+ goto yy184;
+ } else {
+ if (yych == '$') goto yy197;
+ goto yy194;
+ }
+ }
+ } else {
+ if (yych <= ':') {
+ if (yych <= '\'') goto yy184;
+ if (yych <= '/') goto yy194;
+ if (yych <= '9') goto yy213;
+ goto yy194;
+ } else {
+ if (yych <= '[') {
+ if (yych <= ';') goto yy184;
+ goto yy194;
+ } else {
+ if (yych <= '\\') goto yy196;
+ if (yych <= ']') goto yy184;
+ goto yy194;
+ }
+ }
+ }
+yy215:
+ YYDEBUG(215, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(216, *YYCURSOR);
+ if (yybm[0+yych] & 128) {
+ goto yy215;
+ }
+ YYDEBUG(217, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(218, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 368 "Zend/zend_ini_scanner.l"
+ { /* Raw string */
+ /* Eat leading and trailing single quotes */
+ if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
+ SCNG(yy_text)++;
+ yyleng = yyleng - 2;
+ }
+ RETURN_TOKEN(TC_RAW, yytext, yyleng);
+}
+#line 2724 "Zend/zend_ini_scanner.c"
+yy219:
+ YYDEBUG(219, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(220, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 401 "Zend/zend_ini_scanner.l"
+ { /* Variable start */
+ yy_push_state(ST_VARNAME TSRMLS_CC);
+ return TC_DOLLAR_CURLY;
+}
+#line 2735 "Zend/zend_ini_scanner.c"
+yy221:
+ YYDEBUG(221, *YYCURSOR);
+ yyaccept = 0;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(222, *YYCURSOR);
+ if (yych <= '"') {
+ if (yych <= '\f') {
+ if (yych <= 0x08) goto yy194;
+ if (yych <= '\t') goto yy221;
+ if (yych <= '\n') goto yy173;
+ goto yy194;
+ } else {
+ if (yych <= 0x1F) {
+ if (yych <= '\r') goto yy173;
+ goto yy194;
+ } else {
+ if (yych <= ' ') goto yy221;
+ if (yych <= '!') goto yy194;
+ }
+ }
+ } else {
+ if (yych <= ':') {
+ if (yych <= '$') {
+ if (yych <= '#') goto yy194;
+ goto yy197;
+ } else {
+ if (yych == '\'') goto yy173;
+ goto yy194;
+ }
+ } else {
+ if (yych <= '[') {
+ if (yych <= ';') goto yy173;
+ goto yy194;
+ } else {
+ if (yych <= '\\') goto yy196;
+ if (yych <= ']') goto yy173;
+ goto yy194;
+ }
+ }
+ }
+yy223:
+ YYDEBUG(223, *YYCURSOR);
+ ++YYCURSOR;
+ yych = *YYCURSOR;
+ goto yy178;
+ }
+/* *********************************** */
+yyc_ST_VALUE:
+ {
+ static const unsigned char yybm[] = {
+ 160, 162, 162, 162, 162, 162, 162, 162,
+ 162, 176, 128, 162, 162, 128, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 176, 160, 160, 162, 168, 162, 160, 32,
+ 160, 160, 162, 162, 162, 162, 162, 162,
+ 230, 230, 230, 230, 230, 230, 230, 230,
+ 230, 230, 162, 160, 162, 160, 162, 162,
+ 162, 166, 166, 166, 166, 166, 166, 166,
+ 166, 166, 166, 166, 166, 166, 166, 166,
+ 166, 166, 166, 166, 166, 166, 166, 166,
+ 166, 166, 166, 162, 162, 162, 160, 166,
+ 162, 166, 166, 166, 166, 166, 166, 166,
+ 166, 166, 166, 166, 166, 166, 166, 166,
+ 166, 166, 166, 166, 166, 166, 166, 166,
+ 166, 166, 166, 162, 160, 162, 160, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162,
+ };
+ YYDEBUG(224, *YYCURSOR);
+ YYFILL(6);
+ yych = *YYCURSOR;
+ YYDEBUG(-1, yych);
+ switch (yych) {
+ case 0x00: goto yy226;
+ case '\t':
+ case ' ': goto yy230;
+ case '\n': goto yy232;
+ case '\r': goto yy234;
+ case '!':
+ case '&':
+ case '(':
+ case ')':
+ case '^':
+ case '|':
+ case '~': goto yy235;
+ case '"': goto yy237;
+ case '$': goto yy239;
+ case '\'': goto yy240;
+ case '-': goto yy241;
+ case '.': goto yy242;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy243;
+ case ';': goto yy245;
+ case '=': goto yy246;
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'z': goto yy248;
+ case 'F':
+ case 'f': goto yy250;
+ case 'N':
+ case 'n': goto yy251;
+ case 'O':
+ case 'o': goto yy252;
+ case 'T':
+ case 't': goto yy253;
+ case 'Y':
+ case 'y': goto yy254;
+ default: goto yy228;
+ }
+yy226:
+ YYDEBUG(226, *YYCURSOR);
+ ++YYCURSOR;
+yy227:
+ YYDEBUG(227, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 598 "Zend/zend_ini_scanner.l"
+ { /* End of option value (if EOF is reached before EOL */
+ BEGIN(INITIAL);
+ return END_OF_LINE;
+}
+#line 2921 "Zend/zend_ini_scanner.c"
+yy228:
+ YYDEBUG(228, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ goto yy256;
+yy229:
+ YYDEBUG(229, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 517 "Zend/zend_ini_scanner.l"
+ { /* Get everything else as option/offset value */
+ RETURN_TOKEN(TC_STRING, yytext, yyleng);
+}
+#line 2934 "Zend/zend_ini_scanner.c"
+yy230:
+ YYDEBUG(230, *YYCURSOR);
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ goto yy306;
+yy231:
+ YYDEBUG(231, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 571 "Zend/zend_ini_scanner.l"
+ {
+ RETURN_TOKEN(TC_WHITESPACE, yytext, yyleng);
+}
+#line 2947 "Zend/zend_ini_scanner.c"
+yy232:
+ YYDEBUG(232, *YYCURSOR);
+ ++YYCURSOR;
+yy233:
+ YYDEBUG(233, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 489 "Zend/zend_ini_scanner.l"
+ { /* End of option value */
+ BEGIN(INITIAL);
+ SCNG(lineno)++;
+ return END_OF_LINE;
+}
+#line 2960 "Zend/zend_ini_scanner.c"
+yy234:
+ YYDEBUG(234, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '\n') goto yy304;
+ goto yy233;
+yy235:
+ YYDEBUG(235, *YYCURSOR);
+ ++YYCURSOR;
+ yych = *YYCURSOR;
+ goto yy303;
+yy236:
+ YYDEBUG(236, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 507 "Zend/zend_ini_scanner.l"
+ { /* Boolean operators */
+ return yytext[0];
+}
+#line 2978 "Zend/zend_ini_scanner.c"
+yy237:
+ YYDEBUG(237, *YYCURSOR);
+ ++YYCURSOR;
+yy238:
+ YYDEBUG(238, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 525 "Zend/zend_ini_scanner.l"
+ { /* Double quoted '"' string start */
+ yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
+ return '"';
+}
+#line 2990 "Zend/zend_ini_scanner.c"
+yy239:
+ YYDEBUG(239, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych <= '\\') {
+ if (yych <= 0x00) goto yy227;
+ if (yych <= '[') goto yy255;
+ goto yy262;
+ } else {
+ if (yych == '{') goto yy300;
+ goto yy255;
+ }
+yy240:
+ YYDEBUG(240, *YYCURSOR);
+ yyaccept = 2;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yybm[0+yych] & 128) {
+ goto yy296;
+ }
+ goto yy227;
+yy241:
+ YYDEBUG(241, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '/') goto yy256;
+ if (yych <= '9') goto yy294;
+ goto yy256;
+yy242:
+ YYDEBUG(242, *YYCURSOR);
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '/') goto yy256;
+ if (yych <= '9') goto yy292;
+ goto yy256;
+yy243:
+ YYDEBUG(243, *YYCURSOR);
+ yyaccept = 3;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '/') {
+ if (yych <= 0x1F) {
+ if (yych <= '\n') {
+ if (yych <= 0x00) goto yy244;
+ if (yych <= 0x08) goto yy256;
+ } else {
+ if (yych != '\r') goto yy256;
+ }
+ } else {
+ if (yych <= ')') {
+ if (yych <= '"') goto yy244;
+ if (yych <= '%') goto yy256;
+ } else {
+ if (yych == '.') goto yy288;
+ goto yy256;
+ }
+ }
+ } else {
+ if (yych <= ']') {
+ if (yych <= ';') {
+ if (yych <= '9') goto yy290;
+ if (yych <= ':') goto yy256;
+ } else {
+ if (yych != '=') goto yy256;
+ }
+ } else {
+ if (yych <= '|') {
+ if (yych <= '^') goto yy244;
+ if (yych <= '{') goto yy256;
+ } else {
+ if (yych != '~') goto yy256;
+ }
+ }
+ }
+yy244:
+ YYDEBUG(244, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 499 "Zend/zend_ini_scanner.l"
+ { /* Get number option value as string */
+ RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
+}
+#line 3069 "Zend/zend_ini_scanner.c"
+yy245:
+ YYDEBUG(245, *YYCURSOR);
+ yyaccept = 2;
+ yych = *(YYMARKER = ++YYCURSOR);
+ goto yy284;
+yy246:
+ YYDEBUG(246, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(247, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 511 "Zend/zend_ini_scanner.l"
+ { /* Make = used in option value to trigger error */
+ yyless(0);
+ BEGIN(INITIAL);
+ return END_OF_LINE;
+}
+#line 3086 "Zend/zend_ini_scanner.c"
+yy248:
+ YYDEBUG(248, *YYCURSOR);
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yybm[0+yych] & 4) {
+ goto yy257;
+ }
+ if (yych <= ':') {
+ if (yych <= '\r') {
+ if (yych <= 0x08) {
+ if (yych >= 0x01) goto yy256;
+ } else {
+ if (yych <= '\n') goto yy249;
+ if (yych <= '\f') goto yy256;
+ }
+ } else {
+ if (yych <= '"') {
+ if (yych <= 0x1F) goto yy256;
+ } else {
+ if (yych <= '%') goto yy256;
+ if (yych >= '*') goto yy256;
+ }
+ }
+ } else {
+ if (yych <= '^') {
+ if (yych <= '<') {
+ if (yych >= '<') goto yy256;
+ } else {
+ if (yych <= '=') goto yy249;
+ if (yych <= ']') goto yy256;
+ }
+ } else {
+ if (yych <= '|') {
+ if (yych <= '{') goto yy256;
+ } else {
+ if (yych != '~') goto yy256;
+ }
+ }
+ }
+yy249:
+ YYDEBUG(249, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 495 "Zend/zend_ini_scanner.l"
+ { /* Get constant option value */
+ RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
+}
+#line 3133 "Zend/zend_ini_scanner.c"
+yy250:
+ YYDEBUG(250, *YYCURSOR);
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '<') {
+ if (yych <= '"') {
+ if (yych <= '\n') {
+ if (yych <= 0x00) goto yy249;
+ if (yych <= 0x08) goto yy256;
+ goto yy249;
+ } else {
+ if (yych == '\r') goto yy249;
+ if (yych <= 0x1F) goto yy256;
+ goto yy249;
+ }
+ } else {
+ if (yych <= '/') {
+ if (yych <= '%') goto yy256;
+ if (yych <= ')') goto yy249;
+ goto yy256;
+ } else {
+ if (yych <= '9') goto yy257;
+ if (yych == ';') goto yy249;
+ goto yy256;
+ }
+ }
+ } else {
+ if (yych <= '_') {
+ if (yych <= 'A') {
+ if (yych <= '=') goto yy249;
+ if (yych <= '@') goto yy256;
+ goto yy280;
+ } else {
+ if (yych <= 'Z') goto yy257;
+ if (yych <= ']') goto yy256;
+ if (yych <= '^') goto yy249;
+ goto yy257;
+ }
+ } else {
+ if (yych <= '{') {
+ if (yych <= '`') goto yy256;
+ if (yych <= 'a') goto yy280;
+ if (yych <= 'z') goto yy257;
+ goto yy256;
+ } else {
+ if (yych == '}') goto yy256;
+ if (yych <= '~') goto yy249;
+ goto yy256;
+ }
+ }
+ }
+yy251:
+ YYDEBUG(251, *YYCURSOR);
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= 'N') {
+ if (yych <= '%') {
+ if (yych <= '\f') {
+ if (yych <= 0x00) goto yy249;
+ if (yych <= 0x08) goto yy256;
+ if (yych <= '\n') goto yy249;
+ goto yy256;
+ } else {
+ if (yych <= '\r') goto yy249;
+ if (yych <= 0x1F) goto yy256;
+ if (yych <= '"') goto yy249;
+ goto yy256;
+ }
+ } else {
+ if (yych <= ':') {
+ if (yych <= ')') goto yy249;
+ if (yych <= '/') goto yy256;
+ if (yych <= '9') goto yy257;
+ goto yy256;
+ } else {
+ if (yych <= '<') {
+ if (yych <= ';') goto yy249;
+ goto yy256;
+ } else {
+ if (yych <= '=') goto yy249;
+ if (yych <= '@') goto yy256;
+ goto yy257;
+ }
+ }
+ }
+ } else {
+ if (yych <= 'n') {
+ if (yych <= 'Z') {
+ if (yych <= 'O') goto yy276;
+ if (yych == 'U') goto yy277;
+ goto yy257;
+ } else {
+ if (yych <= '^') {
+ if (yych <= ']') goto yy256;
+ goto yy249;
+ } else {
+ if (yych == '`') goto yy256;
+ goto yy257;
+ }
+ }
+ } else {
+ if (yych <= 'z') {
+ if (yych <= 'o') goto yy276;
+ if (yych == 'u') goto yy277;
+ goto yy257;
+ } else {
+ if (yych <= '|') {
+ if (yych <= '{') goto yy256;
+ goto yy249;
+ } else {
+ if (yych == '~') goto yy249;
+ goto yy256;
+ }
+ }
+ }
+ }
+yy252:
+ YYDEBUG(252, *YYCURSOR);
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= 'E') {
+ if (yych <= '%') {
+ if (yych <= '\f') {
+ if (yych <= 0x00) goto yy249;
+ if (yych <= 0x08) goto yy256;
+ if (yych <= '\n') goto yy249;
+ goto yy256;
+ } else {
+ if (yych <= '\r') goto yy249;
+ if (yych <= 0x1F) goto yy256;
+ if (yych <= '"') goto yy249;
+ goto yy256;
+ }
+ } else {
+ if (yych <= ':') {
+ if (yych <= ')') goto yy249;
+ if (yych <= '/') goto yy256;
+ if (yych <= '9') goto yy257;
+ goto yy256;
+ } else {
+ if (yych <= '<') {
+ if (yych <= ';') goto yy249;
+ goto yy256;
+ } else {
+ if (yych <= '=') goto yy249;
+ if (yych <= '@') goto yy256;
+ goto yy257;
+ }
+ }
+ }
+ } else {
+ if (yych <= 'e') {
+ if (yych <= 'Z') {
+ if (yych <= 'F') goto yy271;
+ if (yych == 'N') goto yy265;
+ goto yy257;
+ } else {
+ if (yych <= '^') {
+ if (yych <= ']') goto yy256;
+ goto yy249;
+ } else {
+ if (yych == '`') goto yy256;
+ goto yy257;
+ }
+ }
+ } else {
+ if (yych <= 'z') {
+ if (yych <= 'f') goto yy271;
+ if (yych == 'n') goto yy265;
+ goto yy257;
+ } else {
+ if (yych <= '|') {
+ if (yych <= '{') goto yy256;
+ goto yy249;
+ } else {
+ if (yych == '~') goto yy249;
+ goto yy256;
+ }
+ }
+ }
+ }
+yy253:
+ YYDEBUG(253, *YYCURSOR);
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '=') {
+ if (yych <= '"') {
+ if (yych <= '\n') {
+ if (yych <= 0x00) goto yy249;
+ if (yych <= 0x08) goto yy256;
+ goto yy249;
+ } else {
+ if (yych == '\r') goto yy249;
+ if (yych <= 0x1F) goto yy256;
+ goto yy249;
+ }
+ } else {
+ if (yych <= '9') {
+ if (yych <= '%') goto yy256;
+ if (yych <= ')') goto yy249;
+ if (yych <= '/') goto yy256;
+ goto yy257;
+ } else {
+ if (yych == ';') goto yy249;
+ if (yych <= '<') goto yy256;
+ goto yy249;
+ }
+ }
+ } else {
+ if (yych <= '`') {
+ if (yych <= 'Z') {
+ if (yych <= '@') goto yy256;
+ if (yych == 'R') goto yy269;
+ goto yy257;
+ } else {
+ if (yych <= ']') goto yy256;
+ if (yych <= '^') goto yy249;
+ if (yych <= '_') goto yy257;
+ goto yy256;
+ }
+ } else {
+ if (yych <= '{') {
+ if (yych == 'r') goto yy269;
+ if (yych <= 'z') goto yy257;
+ goto yy256;
+ } else {
+ if (yych == '}') goto yy256;
+ if (yych <= '~') goto yy249;
+ goto yy256;
+ }
+ }
+ }
+yy254:
+ YYDEBUG(254, *YYCURSOR);
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '=') {
+ if (yych <= '"') {
+ if (yych <= '\n') {
+ if (yych <= 0x00) goto yy249;
+ if (yych <= 0x08) goto yy256;
+ goto yy249;
+ } else {
+ if (yych == '\r') goto yy249;
+ if (yych <= 0x1F) goto yy256;
+ goto yy249;
+ }
+ } else {
+ if (yych <= '9') {
+ if (yych <= '%') goto yy256;
+ if (yych <= ')') goto yy249;
+ if (yych <= '/') goto yy256;
+ goto yy257;
+ } else {
+ if (yych == ';') goto yy249;
+ if (yych <= '<') goto yy256;
+ goto yy249;
+ }
+ }
+ } else {
+ if (yych <= '`') {
+ if (yych <= 'Z') {
+ if (yych <= '@') goto yy256;
+ if (yych == 'E') goto yy259;
+ goto yy257;
+ } else {
+ if (yych <= ']') goto yy256;
+ if (yych <= '^') goto yy249;
+ if (yych <= '_') goto yy257;
+ goto yy256;
+ }
+ } else {
+ if (yych <= '{') {
+ if (yych == 'e') goto yy259;
+ if (yych <= 'z') goto yy257;
+ goto yy256;
+ } else {
+ if (yych == '}') goto yy256;
+ if (yych <= '~') goto yy249;
+ goto yy256;
+ }
+ }
+ }
+yy255:
+ YYDEBUG(255, *YYCURSOR);
+ yyaccept = 0;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+yy256:
+ YYDEBUG(256, *YYCURSOR);
+ if (yybm[0+yych] & 2) {
+ goto yy255;
+ }
+ if (yych == '$') goto yy260;
+ goto yy229;
+yy257:
+ YYDEBUG(257, *YYCURSOR);
+ yyaccept = 4;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(258, *YYCURSOR);
+ if (yybm[0+yych] & 4) {
+ goto yy257;
+ }
+ if (yych <= ')') {
+ if (yych <= '\r') {
+ if (yych <= 0x08) {
+ if (yych <= 0x00) goto yy249;
+ goto yy255;
+ } else {
+ if (yych <= '\n') goto yy249;
+ if (yych <= '\f') goto yy255;
+ goto yy249;
+ }
+ } else {
+ if (yych <= '#') {
+ if (yych <= 0x1F) goto yy255;
+ if (yych <= '"') goto yy249;
+ goto yy255;
+ } else {
+ if (yych <= '$') goto yy260;
+ if (yych <= '%') goto yy255;
+ goto yy249;
+ }
+ }
+ } else {
+ if (yych <= ']') {
+ if (yych <= ';') {
+ if (yych <= ':') goto yy255;
+ goto yy249;
+ } else {
+ if (yych == '=') goto yy249;
+ goto yy255;
+ }
+ } else {
+ if (yych <= '|') {
+ if (yych <= '^') goto yy249;
+ if (yych <= '{') goto yy255;
+ goto yy249;
+ } else {
+ if (yych == '~') goto yy249;
+ goto yy255;
+ }
+ }
+ }
+yy259:
+ YYDEBUG(259, *YYCURSOR);
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '=') {
+ if (yych <= '"') {
+ if (yych <= '\n') {
+ if (yych <= 0x00) goto yy249;
+ if (yych <= 0x08) goto yy256;
+ goto yy249;
+ } else {
+ if (yych == '\r') goto yy249;
+ if (yych <= 0x1F) goto yy256;
+ goto yy249;
+ }
+ } else {
+ if (yych <= '9') {
+ if (yych <= '%') goto yy256;
+ if (yych <= ')') goto yy249;
+ if (yych <= '/') goto yy256;
+ goto yy257;
+ } else {
+ if (yych == ';') goto yy249;
+ if (yych <= '<') goto yy256;
+ goto yy249;
+ }
+ }
+ } else {
+ if (yych <= '`') {
+ if (yych <= 'Z') {
+ if (yych <= '@') goto yy256;
+ if (yych == 'S') goto yy265;
+ goto yy257;
+ } else {
+ if (yych <= ']') goto yy256;
+ if (yych <= '^') goto yy249;
+ if (yych <= '_') goto yy257;
+ goto yy256;
+ }
+ } else {
+ if (yych <= '{') {
+ if (yych == 's') goto yy265;
+ if (yych <= 'z') goto yy257;
+ goto yy256;
+ } else {
+ if (yych == '}') goto yy256;
+ if (yych <= '~') goto yy249;
+ goto yy256;
+ }
+ }
+ }
+yy260:
+ YYDEBUG(260, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ if (yych <= '\\') {
+ if (yych <= 0x00) goto yy261;
+ if (yych <= '[') goto yy255;
+ goto yy262;
+ } else {
+ if (yych != '{') goto yy255;
+ }
+yy261:
+ YYDEBUG(261, *YYCURSOR);
+ YYCURSOR = YYMARKER;
+ if (yyaccept <= 3) {
+ if (yyaccept <= 1) {
+ if (yyaccept <= 0) {
+ goto yy229;
+ } else {
+ goto yy231;
+ }
+ } else {
+ if (yyaccept <= 2) {
+ goto yy227;
+ } else {
+ goto yy244;
+ }
+ }
+ } else {
+ if (yyaccept <= 5) {
+ if (yyaccept <= 4) {
+ goto yy249;
+ } else {
+ goto yy266;
+ }
+ } else {
+ goto yy273;
+ }
+ }
+yy262:
+ YYDEBUG(262, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ if (yybm[0+yych] & 8) {
+ goto yy263;
+ }
+ goto yy255;
+yy263:
+ YYDEBUG(263, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(264, *YYCURSOR);
+ if (yybm[0+yych] & 8) {
+ goto yy263;
+ }
+ if (yych <= 0x00) goto yy229;
+ if (yych == '\\') goto yy262;
+ goto yy255;
+yy265:
+ YYDEBUG(265, *YYCURSOR);
+ yyaccept = 5;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yybm[0+yych] & 16) {
+ goto yy267;
+ }
+ if (yych <= ';') {
+ if (yych <= ' ') {
+ if (yych <= '\n') {
+ if (yych <= 0x00) goto yy266;
+ if (yych <= '\t') goto yy256;
+ } else {
+ if (yych != '\r') goto yy256;
+ }
+ } else {
+ if (yych <= ')') {
+ if (yych <= '"') goto yy266;
+ if (yych <= '%') goto yy256;
+ } else {
+ if (yych <= '/') goto yy256;
+ if (yych <= '9') goto yy257;
+ if (yych <= ':') goto yy256;
+ }
+ }
+ } else {
+ if (yych <= '_') {
+ if (yych <= '@') {
+ if (yych != '=') goto yy256;
+ } else {
+ if (yych <= 'Z') goto yy257;
+ if (yych <= ']') goto yy256;
+ if (yych >= '_') goto yy257;
+ }
+ } else {
+ if (yych <= '{') {
+ if (yych <= '`') goto yy256;
+ if (yych <= 'z') goto yy257;
+ goto yy256;
+ } else {
+ if (yych == '}') goto yy256;
+ if (yych >= 0x7F) goto yy256;
+ }
+ }
+ }
+yy266:
+ YYDEBUG(266, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 421 "Zend/zend_ini_scanner.l"
+ { /* TRUE value (when used outside option value/offset this causes parse error!) */
+ RETURN_TOKEN(BOOL_TRUE, "1", 1);
+}
+#line 3645 "Zend/zend_ini_scanner.c"
+yy267:
+ YYDEBUG(267, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(268, *YYCURSOR);
+ if (yybm[0+yych] & 16) {
+ goto yy267;
+ }
+ goto yy266;
+yy269:
+ YYDEBUG(269, *YYCURSOR);
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '=') {
+ if (yych <= '"') {
+ if (yych <= '\n') {
+ if (yych <= 0x00) goto yy249;
+ if (yych <= 0x08) goto yy256;
+ goto yy249;
+ } else {
+ if (yych == '\r') goto yy249;
+ if (yych <= 0x1F) goto yy256;
+ goto yy249;
+ }
+ } else {
+ if (yych <= '9') {
+ if (yych <= '%') goto yy256;
+ if (yych <= ')') goto yy249;
+ if (yych <= '/') goto yy256;
+ goto yy257;
+ } else {
+ if (yych == ';') goto yy249;
+ if (yych <= '<') goto yy256;
+ goto yy249;
+ }
+ }
+ } else {
+ if (yych <= '`') {
+ if (yych <= 'Z') {
+ if (yych <= '@') goto yy256;
+ if (yych != 'U') goto yy257;
+ } else {
+ if (yych <= ']') goto yy256;
+ if (yych <= '^') goto yy249;
+ if (yych <= '_') goto yy257;
+ goto yy256;
+ }
+ } else {
+ if (yych <= '{') {
+ if (yych == 'u') goto yy270;
+ if (yych <= 'z') goto yy257;
+ goto yy256;
+ } else {
+ if (yych == '}') goto yy256;
+ if (yych <= '~') goto yy249;
+ goto yy256;
+ }
+ }
+ }
+yy270:
+ YYDEBUG(270, *YYCURSOR);
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '=') {
+ if (yych <= '"') {
+ if (yych <= '\n') {
+ if (yych <= 0x00) goto yy249;
+ if (yych <= 0x08) goto yy256;
+ goto yy249;
+ } else {
+ if (yych == '\r') goto yy249;
+ if (yych <= 0x1F) goto yy256;
+ goto yy249;
+ }
+ } else {
+ if (yych <= '9') {
+ if (yych <= '%') goto yy256;
+ if (yych <= ')') goto yy249;
+ if (yych <= '/') goto yy256;
+ goto yy257;
+ } else {
+ if (yych == ';') goto yy249;
+ if (yych <= '<') goto yy256;
+ goto yy249;
+ }
+ }
+ } else {
+ if (yych <= '`') {
+ if (yych <= 'Z') {
+ if (yych <= '@') goto yy256;
+ if (yych == 'E') goto yy265;
+ goto yy257;
+ } else {
+ if (yych <= ']') goto yy256;
+ if (yych <= '^') goto yy249;
+ if (yych <= '_') goto yy257;
+ goto yy256;
+ }
+ } else {
+ if (yych <= '{') {
+ if (yych == 'e') goto yy265;
+ if (yych <= 'z') goto yy257;
+ goto yy256;
+ } else {
+ if (yych == '}') goto yy256;
+ if (yych <= '~') goto yy249;
+ goto yy256;
+ }
+ }
+ }
+yy271:
+ YYDEBUG(271, *YYCURSOR);
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '=') {
+ if (yych <= '"') {
+ if (yych <= '\n') {
+ if (yych <= 0x00) goto yy249;
+ if (yych <= 0x08) goto yy256;
+ goto yy249;
+ } else {
+ if (yych == '\r') goto yy249;
+ if (yych <= 0x1F) goto yy256;
+ goto yy249;
+ }
+ } else {
+ if (yych <= '9') {
+ if (yych <= '%') goto yy256;
+ if (yych <= ')') goto yy249;
+ if (yych <= '/') goto yy256;
+ goto yy257;
+ } else {
+ if (yych == ';') goto yy249;
+ if (yych <= '<') goto yy256;
+ goto yy249;
+ }
+ }
+ } else {
+ if (yych <= '`') {
+ if (yych <= 'Z') {
+ if (yych <= '@') goto yy256;
+ if (yych != 'F') goto yy257;
+ } else {
+ if (yych <= ']') goto yy256;
+ if (yych <= '^') goto yy249;
+ if (yych <= '_') goto yy257;
+ goto yy256;
+ }
+ } else {
+ if (yych <= '{') {
+ if (yych == 'f') goto yy272;
+ if (yych <= 'z') goto yy257;
+ goto yy256;
+ } else {
+ if (yych == '}') goto yy256;
+ if (yych <= '~') goto yy249;
+ goto yy256;
+ }
+ }
+ }
+yy272:
+ YYDEBUG(272, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yybm[0+yych] & 4) {
+ goto yy257;
+ }
+ if (yych <= ')') {
+ if (yych <= '\f') {
+ if (yych <= 0x08) {
+ if (yych >= 0x01) goto yy256;
+ } else {
+ if (yych <= '\t') goto yy274;
+ if (yych >= '\v') goto yy256;
+ }
+ } else {
+ if (yych <= ' ') {
+ if (yych <= '\r') goto yy273;
+ if (yych <= 0x1F) goto yy256;
+ goto yy274;
+ } else {
+ if (yych <= '"') goto yy273;
+ if (yych <= '%') goto yy256;
+ }
+ }
+ } else {
+ if (yych <= ']') {
+ if (yych <= ';') {
+ if (yych <= ':') goto yy256;
+ } else {
+ if (yych != '=') goto yy256;
+ }
+ } else {
+ if (yych <= '|') {
+ if (yych <= '^') goto yy273;
+ if (yych <= '{') goto yy256;
+ } else {
+ if (yych != '~') goto yy256;
+ }
+ }
+ }
+yy273:
+ YYDEBUG(273, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 425 "Zend/zend_ini_scanner.l"
+ { /* FALSE value (when used outside option value/offset this causes parse error!)*/
+ RETURN_TOKEN(BOOL_FALSE, "", 0);
+}
+#line 3855 "Zend/zend_ini_scanner.c"
+yy274:
+ YYDEBUG(274, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(275, *YYCURSOR);
+ if (yych == '\t') goto yy274;
+ if (yych == ' ') goto yy274;
+ goto yy273;
+yy276:
+ YYDEBUG(276, *YYCURSOR);
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '<') {
+ if (yych <= ' ') {
+ if (yych <= '\n') {
+ if (yych <= 0x00) goto yy273;
+ if (yych <= 0x08) goto yy256;
+ if (yych <= '\t') goto yy274;
+ goto yy273;
+ } else {
+ if (yych == '\r') goto yy273;
+ if (yych <= 0x1F) goto yy256;
+ goto yy274;
+ }
+ } else {
+ if (yych <= '/') {
+ if (yych <= '"') goto yy273;
+ if (yych <= '%') goto yy256;
+ if (yych <= ')') goto yy273;
+ goto yy256;
+ } else {
+ if (yych <= '9') goto yy257;
+ if (yych == ';') goto yy273;
+ goto yy256;
+ }
+ }
+ } else {
+ if (yych <= '_') {
+ if (yych <= 'N') {
+ if (yych <= '=') goto yy273;
+ if (yych <= '@') goto yy256;
+ if (yych <= 'M') goto yy257;
+ goto yy279;
+ } else {
+ if (yych <= 'Z') goto yy257;
+ if (yych <= ']') goto yy256;
+ if (yych <= '^') goto yy273;
+ goto yy257;
+ }
+ } else {
+ if (yych <= 'z') {
+ if (yych <= '`') goto yy256;
+ if (yych == 'n') goto yy279;
+ goto yy257;
+ } else {
+ if (yych <= '|') {
+ if (yych <= '{') goto yy256;
+ goto yy273;
+ } else {
+ if (yych == '~') goto yy273;
+ goto yy256;
+ }
+ }
+ }
+ }
+yy277:
+ YYDEBUG(277, *YYCURSOR);
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '=') {
+ if (yych <= '"') {
+ if (yych <= '\n') {
+ if (yych <= 0x00) goto yy249;
+ if (yych <= 0x08) goto yy256;
+ goto yy249;
+ } else {
+ if (yych == '\r') goto yy249;
+ if (yych <= 0x1F) goto yy256;
+ goto yy249;
+ }
+ } else {
+ if (yych <= '9') {
+ if (yych <= '%') goto yy256;
+ if (yych <= ')') goto yy249;
+ if (yych <= '/') goto yy256;
+ goto yy257;
+ } else {
+ if (yych == ';') goto yy249;
+ if (yych <= '<') goto yy256;
+ goto yy249;
+ }
+ }
+ } else {
+ if (yych <= '`') {
+ if (yych <= 'Z') {
+ if (yych <= '@') goto yy256;
+ if (yych != 'L') goto yy257;
+ } else {
+ if (yych <= ']') goto yy256;
+ if (yych <= '^') goto yy249;
+ if (yych <= '_') goto yy257;
+ goto yy256;
+ }
+ } else {
+ if (yych <= '{') {
+ if (yych == 'l') goto yy278;
+ if (yych <= 'z') goto yy257;
+ goto yy256;
+ } else {
+ if (yych == '}') goto yy256;
+ if (yych <= '~') goto yy249;
+ goto yy256;
+ }
+ }
+ }
+yy278:
+ YYDEBUG(278, *YYCURSOR);
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '=') {
+ if (yych <= '"') {
+ if (yych <= '\n') {
+ if (yych <= 0x00) goto yy249;
+ if (yych <= 0x08) goto yy256;
+ goto yy249;
+ } else {
+ if (yych == '\r') goto yy249;
+ if (yych <= 0x1F) goto yy256;
+ goto yy249;
+ }
+ } else {
+ if (yych <= '9') {
+ if (yych <= '%') goto yy256;
+ if (yych <= ')') goto yy249;
+ if (yych <= '/') goto yy256;
+ goto yy257;
+ } else {
+ if (yych == ';') goto yy249;
+ if (yych <= '<') goto yy256;
+ goto yy249;
+ }
+ }
+ } else {
+ if (yych <= '`') {
+ if (yych <= 'Z') {
+ if (yych <= '@') goto yy256;
+ if (yych == 'L') goto yy272;
+ goto yy257;
+ } else {
+ if (yych <= ']') goto yy256;
+ if (yych <= '^') goto yy249;
+ if (yych <= '_') goto yy257;
+ goto yy256;
+ }
+ } else {
+ if (yych <= '{') {
+ if (yych == 'l') goto yy272;
+ if (yych <= 'z') goto yy257;
+ goto yy256;
+ } else {
+ if (yych == '}') goto yy256;
+ if (yych <= '~') goto yy249;
+ goto yy256;
+ }
+ }
+ }
+yy279:
+ YYDEBUG(279, *YYCURSOR);
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '=') {
+ if (yych <= '"') {
+ if (yych <= '\n') {
+ if (yych <= 0x00) goto yy249;
+ if (yych <= 0x08) goto yy256;
+ goto yy249;
+ } else {
+ if (yych == '\r') goto yy249;
+ if (yych <= 0x1F) goto yy256;
+ goto yy249;
+ }
+ } else {
+ if (yych <= '9') {
+ if (yych <= '%') goto yy256;
+ if (yych <= ')') goto yy249;
+ if (yych <= '/') goto yy256;
+ goto yy257;
+ } else {
+ if (yych == ';') goto yy249;
+ if (yych <= '<') goto yy256;
+ goto yy249;
+ }
+ }
+ } else {
+ if (yych <= '`') {
+ if (yych <= 'Z') {
+ if (yych <= '@') goto yy256;
+ if (yych == 'E') goto yy272;
+ goto yy257;
+ } else {
+ if (yych <= ']') goto yy256;
+ if (yych <= '^') goto yy249;
+ if (yych <= '_') goto yy257;
+ goto yy256;
+ }
+ } else {
+ if (yych <= '{') {
+ if (yych == 'e') goto yy272;
+ if (yych <= 'z') goto yy257;
+ goto yy256;
+ } else {
+ if (yych == '}') goto yy256;
+ if (yych <= '~') goto yy249;
+ goto yy256;
+ }
+ }
+ }
+yy280:
+ YYDEBUG(280, *YYCURSOR);
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '=') {
+ if (yych <= '"') {
+ if (yych <= '\n') {
+ if (yych <= 0x00) goto yy249;
+ if (yych <= 0x08) goto yy256;
+ goto yy249;
+ } else {
+ if (yych == '\r') goto yy249;
+ if (yych <= 0x1F) goto yy256;
+ goto yy249;
+ }
+ } else {
+ if (yych <= '9') {
+ if (yych <= '%') goto yy256;
+ if (yych <= ')') goto yy249;
+ if (yych <= '/') goto yy256;
+ goto yy257;
+ } else {
+ if (yych == ';') goto yy249;
+ if (yych <= '<') goto yy256;
+ goto yy249;
+ }
+ }
+ } else {
+ if (yych <= '`') {
+ if (yych <= 'Z') {
+ if (yych <= '@') goto yy256;
+ if (yych != 'L') goto yy257;
+ } else {
+ if (yych <= ']') goto yy256;
+ if (yych <= '^') goto yy249;
+ if (yych <= '_') goto yy257;
+ goto yy256;
+ }
+ } else {
+ if (yych <= '{') {
+ if (yych == 'l') goto yy281;
+ if (yych <= 'z') goto yy257;
+ goto yy256;
+ } else {
+ if (yych == '}') goto yy256;
+ if (yych <= '~') goto yy249;
+ goto yy256;
+ }
+ }
+ }
+yy281:
+ YYDEBUG(281, *YYCURSOR);
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '=') {
+ if (yych <= '"') {
+ if (yych <= '\n') {
+ if (yych <= 0x00) goto yy249;
+ if (yych <= 0x08) goto yy256;
+ goto yy249;
+ } else {
+ if (yych == '\r') goto yy249;
+ if (yych <= 0x1F) goto yy256;
+ goto yy249;
+ }
+ } else {
+ if (yych <= '9') {
+ if (yych <= '%') goto yy256;
+ if (yych <= ')') goto yy249;
+ if (yych <= '/') goto yy256;
+ goto yy257;
+ } else {
+ if (yych == ';') goto yy249;
+ if (yych <= '<') goto yy256;
+ goto yy249;
+ }
+ }
+ } else {
+ if (yych <= '`') {
+ if (yych <= 'Z') {
+ if (yych <= '@') goto yy256;
+ if (yych != 'S') goto yy257;
+ } else {
+ if (yych <= ']') goto yy256;
+ if (yych <= '^') goto yy249;
+ if (yych <= '_') goto yy257;
+ goto yy256;
+ }
+ } else {
+ if (yych <= '{') {
+ if (yych == 's') goto yy282;
+ if (yych <= 'z') goto yy257;
+ goto yy256;
+ } else {
+ if (yych == '}') goto yy256;
+ if (yych <= '~') goto yy249;
+ goto yy256;
+ }
+ }
+ }
+yy282:
+ YYDEBUG(282, *YYCURSOR);
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych <= '=') {
+ if (yych <= '"') {
+ if (yych <= '\n') {
+ if (yych <= 0x00) goto yy249;
+ if (yych <= 0x08) goto yy256;
+ goto yy249;
+ } else {
+ if (yych == '\r') goto yy249;
+ if (yych <= 0x1F) goto yy256;
+ goto yy249;
+ }
+ } else {
+ if (yych <= '9') {
+ if (yych <= '%') goto yy256;
+ if (yych <= ')') goto yy249;
+ if (yych <= '/') goto yy256;
+ goto yy257;
+ } else {
+ if (yych == ';') goto yy249;
+ if (yych <= '<') goto yy256;
+ goto yy249;
+ }
+ }
+ } else {
+ if (yych <= '`') {
+ if (yych <= 'Z') {
+ if (yych <= '@') goto yy256;
+ if (yych == 'E') goto yy272;
+ goto yy257;
+ } else {
+ if (yych <= ']') goto yy256;
+ if (yych <= '^') goto yy249;
+ if (yych <= '_') goto yy257;
+ goto yy256;
+ }
+ } else {
+ if (yych <= '{') {
+ if (yych == 'e') goto yy272;
+ if (yych <= 'z') goto yy257;
+ goto yy256;
+ } else {
+ if (yych == '}') goto yy256;
+ if (yych <= '~') goto yy249;
+ goto yy256;
+ }
+ }
+ }
+yy283:
+ YYDEBUG(283, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(2);
+ yych = *YYCURSOR;
+yy284:
+ YYDEBUG(284, *YYCURSOR);
+ if (yybm[0+yych] & 32) {
+ goto yy283;
+ }
+ if (yych >= '\r') goto yy287;
+yy285:
+ YYDEBUG(285, *YYCURSOR);
+ ++YYCURSOR;
+yy286:
+ YYDEBUG(286, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 585 "Zend/zend_ini_scanner.l"
+ { /* Comment */
+ BEGIN(INITIAL);
+ SCNG(lineno)++;
+ return END_OF_LINE;
+}
+#line 4248 "Zend/zend_ini_scanner.c"
+yy287:
+ YYDEBUG(287, *YYCURSOR);
+ yych = *++YYCURSOR;
+ if (yych == '\n') goto yy285;
+ goto yy286;
+yy288:
+ YYDEBUG(288, *YYCURSOR);
+ yyaccept = 3;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(289, *YYCURSOR);
+ if (yybm[0+yych] & 64) {
+ goto yy288;
+ }
+ if (yych <= ')') {
+ if (yych <= '\r') {
+ if (yych <= 0x08) {
+ if (yych <= 0x00) goto yy244;
+ goto yy255;
+ } else {
+ if (yych <= '\n') goto yy244;
+ if (yych <= '\f') goto yy255;
+ goto yy244;
+ }
+ } else {
+ if (yych <= '#') {
+ if (yych <= 0x1F) goto yy255;
+ if (yych <= '"') goto yy244;
+ goto yy255;
+ } else {
+ if (yych <= '$') goto yy260;
+ if (yych <= '%') goto yy255;
+ goto yy244;
+ }
+ }
+ } else {
+ if (yych <= ']') {
+ if (yych <= ';') {
+ if (yych <= ':') goto yy255;
+ goto yy244;
+ } else {
+ if (yych == '=') goto yy244;
+ goto yy255;
+ }
+ } else {
+ if (yych <= '|') {
+ if (yych <= '^') goto yy244;
+ if (yych <= '{') goto yy255;
+ goto yy244;
+ } else {
+ if (yych == '~') goto yy244;
+ goto yy255;
+ }
+ }
+ }
+yy290:
+ YYDEBUG(290, *YYCURSOR);
+ yyaccept = 3;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(291, *YYCURSOR);
+ if (yych <= '.') {
+ if (yych <= 0x1F) {
+ if (yych <= '\n') {
+ if (yych <= 0x00) goto yy244;
+ if (yych <= 0x08) goto yy255;
+ goto yy244;
+ } else {
+ if (yych == '\r') goto yy244;
+ goto yy255;
+ }
+ } else {
+ if (yych <= '$') {
+ if (yych <= '"') goto yy244;
+ if (yych <= '#') goto yy255;
+ goto yy260;
+ } else {
+ if (yych <= '%') goto yy255;
+ if (yych <= ')') goto yy244;
+ if (yych <= '-') goto yy255;
+ goto yy288;
+ }
+ }
+ } else {
+ if (yych <= '=') {
+ if (yych <= ':') {
+ if (yych <= '/') goto yy255;
+ if (yych <= '9') goto yy290;
+ goto yy255;
+ } else {
+ if (yych == '<') goto yy255;
+ goto yy244;
+ }
+ } else {
+ if (yych <= '{') {
+ if (yych == '^') goto yy244;
+ goto yy255;
+ } else {
+ if (yych == '}') goto yy255;
+ if (yych <= '~') goto yy244;
+ goto yy255;
+ }
+ }
+ }
+yy292:
+ YYDEBUG(292, *YYCURSOR);
+ yyaccept = 3;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(293, *YYCURSOR);
+ if (yych <= '/') {
+ if (yych <= 0x1F) {
+ if (yych <= '\n') {
+ if (yych <= 0x00) goto yy244;
+ if (yych <= 0x08) goto yy255;
+ goto yy244;
+ } else {
+ if (yych == '\r') goto yy244;
+ goto yy255;
+ }
+ } else {
+ if (yych <= '$') {
+ if (yych <= '"') goto yy244;
+ if (yych <= '#') goto yy255;
+ goto yy260;
+ } else {
+ if (yych <= '%') goto yy255;
+ if (yych <= ')') goto yy244;
+ goto yy255;
+ }
+ }
+ } else {
+ if (yych <= ']') {
+ if (yych <= ';') {
+ if (yych <= '9') goto yy292;
+ if (yych <= ':') goto yy255;
+ goto yy244;
+ } else {
+ if (yych == '=') goto yy244;
+ goto yy255;
+ }
+ } else {
+ if (yych <= '|') {
+ if (yych <= '^') goto yy244;
+ if (yych <= '{') goto yy255;
+ goto yy244;
+ } else {
+ if (yych == '~') goto yy244;
+ goto yy255;
+ }
+ }
+ }
+yy294:
+ YYDEBUG(294, *YYCURSOR);
+ yyaccept = 3;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(295, *YYCURSOR);
+ if (yych <= '/') {
+ if (yych <= 0x1F) {
+ if (yych <= '\n') {
+ if (yych <= 0x00) goto yy244;
+ if (yych <= 0x08) goto yy255;
+ goto yy244;
+ } else {
+ if (yych == '\r') goto yy244;
+ goto yy255;
+ }
+ } else {
+ if (yych <= '$') {
+ if (yych <= '"') goto yy244;
+ if (yych <= '#') goto yy255;
+ goto yy260;
+ } else {
+ if (yych <= '%') goto yy255;
+ if (yych <= ')') goto yy244;
+ goto yy255;
+ }
+ }
+ } else {
+ if (yych <= ']') {
+ if (yych <= ';') {
+ if (yych <= '9') goto yy294;
+ if (yych <= ':') goto yy255;
+ goto yy244;
+ } else {
+ if (yych == '=') goto yy244;
+ goto yy255;
+ }
+ } else {
+ if (yych <= '|') {
+ if (yych <= '^') goto yy244;
+ if (yych <= '{') goto yy255;
+ goto yy244;
+ } else {
+ if (yych == '~') goto yy244;
+ goto yy255;
+ }
+ }
+ }
+yy296:
+ YYDEBUG(296, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+ YYDEBUG(297, *YYCURSOR);
+ if (yybm[0+yych] & 128) {
+ goto yy296;
+ }
+ YYDEBUG(298, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(299, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 368 "Zend/zend_ini_scanner.l"
+ { /* Raw string */
+ /* Eat leading and trailing single quotes */
+ if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
+ SCNG(yy_text)++;
+ yyleng = yyleng - 2;
+ }
+ RETURN_TOKEN(TC_RAW, yytext, yyleng);
+}
+#line 4475 "Zend/zend_ini_scanner.c"
+yy300:
+ YYDEBUG(300, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(301, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 401 "Zend/zend_ini_scanner.l"
+ { /* Variable start */
+ yy_push_state(ST_VARNAME TSRMLS_CC);
+ return TC_DOLLAR_CURLY;
+}
+#line 4486 "Zend/zend_ini_scanner.c"
+yy302:
+ YYDEBUG(302, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+yy303:
+ YYDEBUG(303, *YYCURSOR);
+ if (yych == '\t') goto yy302;
+ if (yych == ' ') goto yy302;
+ goto yy236;
+yy304:
+ YYDEBUG(304, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy233;
+yy305:
+ YYDEBUG(305, *YYCURSOR);
+ yyaccept = 1;
+ YYMARKER = ++YYCURSOR;
+ YYFILL(2);
+ yych = *YYCURSOR;
+yy306:
+ YYDEBUG(306, *YYCURSOR);
+ if (yych <= 0x1F) {
+ if (yych <= '\n') {
+ if (yych <= 0x08) goto yy231;
+ if (yych <= '\t') goto yy305;
+ goto yy304;
+ } else {
+ if (yych == '\r') goto yy308;
+ goto yy231;
+ }
+ } else {
+ if (yych <= '"') {
+ if (yych <= ' ') goto yy305;
+ if (yych <= '!') goto yy231;
+ } else {
+ if (yych == ';') goto yy283;
+ goto yy231;
+ }
+ }
+ YYDEBUG(307, *YYCURSOR);
+ yych = *++YYCURSOR;
+ goto yy238;
+yy308:
+ YYDEBUG(308, *YYCURSOR);
+ ++YYCURSOR;
+ if ((yych = *YYCURSOR) == '\n') goto yy304;
+ goto yy233;
+ }
+/* *********************************** */
+yyc_ST_VARNAME:
+ {
+ static const unsigned char yybm[] = {
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 0, 0, 128, 128, 0, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 0, 0, 128, 0, 128, 0, 128,
+ 0, 0, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 0, 128, 0, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 0, 128, 128, 0, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 0, 0, 0, 0, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ };
+ YYDEBUG(309, *YYCURSOR);
+ YYFILL(2);
+ yych = *YYCURSOR;
+ if (yych <= ')') {
+ if (yych <= '"') {
+ if (yych <= '\f') {
+ if (yych <= 0x08) goto yy311;
+ if (yych <= '\n') goto yy313;
+ } else {
+ if (yych <= '\r') goto yy313;
+ if (yych >= '!') goto yy313;
+ }
+ } else {
+ if (yych <= '%') {
+ if (yych == '$') goto yy313;
+ } else {
+ if (yych != '\'') goto yy313;
+ }
+ }
+ } else {
+ if (yych <= '[') {
+ if (yych <= '<') {
+ if (yych == ';') goto yy313;
+ } else {
+ if (yych <= '=') goto yy313;
+ if (yych >= '[') goto yy313;
+ }
+ } else {
+ if (yych <= 'z') {
+ if (yych == '^') goto yy313;
+ } else {
+ if (yych == '}') goto yy315;
+ if (yych <= '~') goto yy313;
+ }
+ }
+ }
+yy311:
+ YYDEBUG(311, *YYCURSOR);
+ ++YYCURSOR;
+ yych = *YYCURSOR;
+ goto yy318;
+yy312:
+ YYDEBUG(312, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 406 "Zend/zend_ini_scanner.l"
+ { /* Variable name */
+ /* Eat leading whitespace */
+ EAT_LEADING_WHITESPACE();
+
+ /* Eat trailing whitespace */
+ EAT_TRAILING_WHITESPACE();
+
+ RETURN_TOKEN(TC_VARNAME, yytext, yyleng);
+}
+#line 4627 "Zend/zend_ini_scanner.c"
+yy313:
+ YYDEBUG(313, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(314, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 603 "Zend/zend_ini_scanner.l"
+ {
+ return 0;
+}
+#line 4637 "Zend/zend_ini_scanner.c"
+yy315:
+ YYDEBUG(315, *YYCURSOR);
+ ++YYCURSOR;
+ YYDEBUG(316, *YYCURSOR);
+ yyleng = YYCURSOR - SCNG(yy_text);
+#line 416 "Zend/zend_ini_scanner.l"
+ { /* Variable end */
+ yy_pop_state(TSRMLS_C);
+ return '}';
+}
+#line 4648 "Zend/zend_ini_scanner.c"
+yy317:
+ YYDEBUG(317, *YYCURSOR);
+ ++YYCURSOR;
+ YYFILL(1);
+ yych = *YYCURSOR;
+yy318:
+ YYDEBUG(318, *YYCURSOR);
+ if (yybm[0+yych] & 128) {
+ goto yy317;
+ }
+ goto yy312;
+ }
+}
+#line 607 "Zend/zend_ini_scanner.l"
+
+}
diff --git a/Zend/zend_ini_scanner_defs.h b/Zend/zend_ini_scanner_defs.h index 287d7bc1fb..5723954978 100644 --- a/Zend/zend_ini_scanner_defs.h +++ b/Zend/zend_ini_scanner_defs.h @@ -1,13 +1,13 @@ -/* Generated by re2c 0.13.5 */ -#line 3 "Zend/zend_ini_scanner_defs.h" - -enum YYCONDTYPE { - yycINITIAL, - yycST_OFFSET, - yycST_SECTION_VALUE, - yycST_VALUE, - yycST_SECTION_RAW, - yycST_DOUBLE_QUOTES, - yycST_VARNAME, - yycST_RAW, -}; +/* Generated by re2c 0.13.5 */
+#line 3 "Zend/zend_ini_scanner_defs.h"
+
+enum YYCONDTYPE {
+ yycINITIAL,
+ yycST_OFFSET,
+ yycST_SECTION_VALUE,
+ yycST_VALUE,
+ yycST_SECTION_RAW,
+ yycST_DOUBLE_QUOTES,
+ yycST_VARNAME,
+ yycST_RAW,
+};
diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y index 6a9a24a87e..1eb7b3170b 100644 --- a/Zend/zend_language_parser.y +++ b/Zend/zend_language_parser.y @@ -212,6 +212,7 @@ static YYSIZE_T zend_yytnamerr(char*, const char*); %token T_NS_C "__NAMESPACE__ (T_NS_C)" %token T_DIR "__DIR__ (T_DIR)" %token T_NS_SEPARATOR "\\ (T_NS_SEPARATOR)" +%token T_ELLIPSIS "... (T_ELLIPSIS)" %% /* Rules */ @@ -240,6 +241,8 @@ top_statement: | T_NAMESPACE '{' { zend_do_begin_namespace(NULL, 1 TSRMLS_CC); } top_statement_list '}' { zend_do_end_namespace(TSRMLS_C); } | T_USE use_declarations ';' { zend_verify_namespace(TSRMLS_C); } + | T_USE T_FUNCTION use_function_declarations ';' { zend_verify_namespace(TSRMLS_C); } + | T_USE T_CONST use_const_declarations ';' { zend_verify_namespace(TSRMLS_C); } | constant_declaration ';' { zend_verify_namespace(TSRMLS_C); } ; @@ -255,6 +258,30 @@ use_declaration: | T_NS_SEPARATOR namespace_name T_AS T_STRING { zend_do_use(&$2, &$4, 1 TSRMLS_CC); } ; +use_function_declarations: + use_function_declarations ',' use_function_declaration + | use_function_declaration +; + +use_function_declaration: + namespace_name { zend_do_use_function(&$1, NULL, 0 TSRMLS_CC); } + | namespace_name T_AS T_STRING { zend_do_use_function(&$1, &$3, 0 TSRMLS_CC); } + | T_NS_SEPARATOR namespace_name { zend_do_use_function(&$2, NULL, 1 TSRMLS_CC); } + | T_NS_SEPARATOR namespace_name T_AS T_STRING { zend_do_use_function(&$2, &$4, 1 TSRMLS_CC); } +; + +use_const_declarations: + use_const_declarations ',' use_const_declaration + | use_const_declaration +; + +use_const_declaration: + namespace_name { zend_do_use_const(&$1, NULL, 0 TSRMLS_CC); } + | namespace_name T_AS T_STRING { zend_do_use_const(&$1, &$3, 0 TSRMLS_CC); } + | T_NS_SEPARATOR namespace_name { zend_do_use_const(&$2, NULL, 1 TSRMLS_CC); } + | T_NS_SEPARATOR namespace_name T_AS T_STRING { zend_do_use_const(&$2, &$4, 1 TSRMLS_CC); } +; + constant_declaration: constant_declaration ',' T_STRING '=' static_scalar { zend_do_declare_constant(&$3, &$5 TSRMLS_CC); } | T_CONST T_STRING '=' static_scalar { zend_do_declare_constant(&$2, &$4 TSRMLS_CC); } @@ -270,7 +297,7 @@ 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"); } + | T_HALT_COMPILER '(' ')' ';' { zend_error_noreturn(E_COMPILE_ERROR, "__HALT_COMPILER() can only be used from the outermost scope"); } ; @@ -371,10 +398,14 @@ class_declaration_statement: ; is_reference: - /* empty */ { $$.op_type = ZEND_RETURN_VAL; } - | '&' { $$.op_type = ZEND_RETURN_REF; } + /* empty */ { $$.op_type = 0; } + | '&' { $$.op_type = 1; } ; +is_variadic: + /* empty */ { $$.op_type = 0; } + | T_ELLIPSIS { $$.op_type = 1; } +; unticked_function_declaration_statement: function is_reference T_STRING { zend_do_begin_function_declaration(&$1, &$3, 0, $2.op_type, NULL TSRMLS_CC); } @@ -523,14 +554,15 @@ parameter_list: non_empty_parameter_list: - optional_class_type T_VARIABLE { $$.op_type = IS_UNUSED; $$.u.op.num=1; zend_do_receive_arg(ZEND_RECV, &$2, &$$, NULL, &$1, 0 TSRMLS_CC); } - | optional_class_type '&' T_VARIABLE { $$.op_type = IS_UNUSED; $$.u.op.num=1; zend_do_receive_arg(ZEND_RECV, &$3, &$$, NULL, &$1, 1 TSRMLS_CC); } - | optional_class_type '&' T_VARIABLE '=' static_scalar { $$.op_type = IS_UNUSED; $$.u.op.num=1; zend_do_receive_arg(ZEND_RECV_INIT, &$3, &$$, &$5, &$1, 1 TSRMLS_CC); } - | optional_class_type T_VARIABLE '=' static_scalar { $$.op_type = IS_UNUSED; $$.u.op.num=1; zend_do_receive_arg(ZEND_RECV_INIT, &$2, &$$, &$4, &$1, 0 TSRMLS_CC); } - | non_empty_parameter_list ',' optional_class_type T_VARIABLE { $$=$1; $$.u.op.num++; zend_do_receive_arg(ZEND_RECV, &$4, &$$, NULL, &$3, 0 TSRMLS_CC); } - | non_empty_parameter_list ',' optional_class_type '&' T_VARIABLE { $$=$1; $$.u.op.num++; zend_do_receive_arg(ZEND_RECV, &$5, &$$, NULL, &$3, 1 TSRMLS_CC); } - | non_empty_parameter_list ',' optional_class_type '&' T_VARIABLE '=' static_scalar { $$=$1; $$.u.op.num++; zend_do_receive_arg(ZEND_RECV_INIT, &$5, &$$, &$7, &$3, 1 TSRMLS_CC); } - | non_empty_parameter_list ',' optional_class_type T_VARIABLE '=' static_scalar { $$=$1; $$.u.op.num++; zend_do_receive_arg(ZEND_RECV_INIT, &$4, &$$, &$6, &$3, 0 TSRMLS_CC); } + parameter + | non_empty_parameter_list ',' parameter +; + +parameter: + optional_class_type is_reference is_variadic T_VARIABLE + { zend_do_receive_param(ZEND_RECV, &$4, NULL, &$1, $2.op_type, $3.op_type TSRMLS_CC); } + | optional_class_type is_reference is_variadic T_VARIABLE '=' static_scalar + { zend_do_receive_param(ZEND_RECV_INIT, &$4, &$6, &$1, $2.op_type, $3.op_type TSRMLS_CC); } ; @@ -629,8 +661,8 @@ trait_precedence: ; trait_reference_list: - fully_qualified_class_name { zend_resolve_class_name(&$1, ZEND_FETCH_CLASS_GLOBAL, 1 TSRMLS_CC); zend_init_list(&$$.u.op.ptr, Z_STRVAL($1.u.constant) TSRMLS_CC); } - | trait_reference_list ',' fully_qualified_class_name { zend_resolve_class_name(&$3, ZEND_FETCH_CLASS_GLOBAL, 1 TSRMLS_CC); zend_add_to_list(&$1.u.op.ptr, Z_STRVAL($3.u.constant) TSRMLS_CC); $$ = $1; } + fully_qualified_class_name { zend_resolve_class_name(&$1 TSRMLS_CC); zend_init_list(&$$.u.op.ptr, Z_STRVAL($1.u.constant) TSRMLS_CC); } + | trait_reference_list ',' fully_qualified_class_name { zend_resolve_class_name(&$3 TSRMLS_CC); zend_add_to_list(&$1.u.op.ptr, Z_STRVAL($3.u.constant) TSRMLS_CC); $$ = $1; } ; trait_method_reference: @@ -941,25 +973,62 @@ common_scalar: | T_START_HEREDOC T_END_HEREDOC { ZVAL_EMPTY_STRING(&$$.u.constant); INIT_PZVAL(&$$.u.constant); $$.op_type = IS_CONST; } ; +static_class_constant: + class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { zend_do_fetch_constant(&$$, &$1, &$3, ZEND_CT, 0 TSRMLS_CC); } +; static_scalar: /* compile-time evaluated scalars */ - common_scalar { $$ = $1; } - | static_class_name_scalar { $$ = $1; } - | namespace_name { zend_do_fetch_constant(&$$, NULL, &$1, ZEND_CT, 1 TSRMLS_CC); } - | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$.op_type = IS_CONST; ZVAL_EMPTY_STRING(&$$.u.constant); zend_do_build_namespace_name(&$$, &$$, &$3 TSRMLS_CC); $3 = $$; zend_do_fetch_constant(&$$, NULL, &$3, ZEND_CT, 0 TSRMLS_CC); } - | T_NS_SEPARATOR namespace_name { char *tmp = estrndup(Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); memcpy(&(tmp[1]), Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); tmp[0] = '\\'; efree(Z_STRVAL($2.u.constant)); Z_STRVAL($2.u.constant) = tmp; ++Z_STRLEN($2.u.constant); zend_do_fetch_constant(&$$, NULL, &$2, ZEND_CT, 0 TSRMLS_CC); } - | '+' static_scalar { ZVAL_LONG(&$1.u.constant, 0); add_function(&$2.u.constant, &$1.u.constant, &$2.u.constant TSRMLS_CC); $$ = $2; } - | '-' static_scalar { ZVAL_LONG(&$1.u.constant, 0); sub_function(&$2.u.constant, &$1.u.constant, &$2.u.constant TSRMLS_CC); $$ = $2; } + static_scalar_value { zend_do_constant_expression(&$$, $1.u.ast TSRMLS_CC); } | T_ARRAY '(' static_array_pair_list ')' { $$ = $3; Z_TYPE($$.u.constant) = IS_CONSTANT_ARRAY; } | '[' static_array_pair_list ']' { $$ = $2; Z_TYPE($$.u.constant) = IS_CONSTANT_ARRAY; } - | static_class_constant { $$ = $1; } - | T_CLASS_C { $$ = $1; } ; -static_class_constant: - class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { zend_do_fetch_constant(&$$, &$1, &$3, ZEND_CT, 0 TSRMLS_CC); } +static_scalar_value: + common_scalar { $$.u.ast = zend_ast_create_constant(&$1.u.constant); } + | static_class_name_scalar { $$.u.ast = zend_ast_create_constant(&$1.u.constant); } + | namespace_name { zend_do_fetch_constant(&$$, NULL, &$1, ZEND_CT, 1 TSRMLS_CC); $$.u.ast = zend_ast_create_constant(&$$.u.constant); } + | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$.op_type = IS_CONST; ZVAL_EMPTY_STRING(&$$.u.constant); zend_do_build_namespace_name(&$$, &$$, &$3 TSRMLS_CC); $3 = $$; zend_do_fetch_constant(&$$, NULL, &$3, ZEND_CT, 0 TSRMLS_CC); $$.u.ast = zend_ast_create_constant(&$$.u.constant); } + | T_NS_SEPARATOR namespace_name { char *tmp = estrndup(Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); memcpy(&(tmp[1]), Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); tmp[0] = '\\'; efree(Z_STRVAL($2.u.constant)); Z_STRVAL($2.u.constant) = tmp; ++Z_STRLEN($2.u.constant); zend_do_fetch_constant(&$$, NULL, &$2, ZEND_CT, 0 TSRMLS_CC); $$.u.ast = zend_ast_create_constant(&$$.u.constant); } + | static_class_constant { $$.u.ast = zend_ast_create_constant(&$1.u.constant); } + | T_CLASS_C { $$.u.ast = zend_ast_create_constant(&$1.u.constant); } + | static_operation { $$ = $1; } +; + +static_operation: + static_scalar_value '+' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_ADD, $1.u.ast, $3.u.ast); } + | static_scalar_value '-' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_SUB, $1.u.ast, $3.u.ast); } + | static_scalar_value '*' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_MUL, $1.u.ast, $3.u.ast); } + | static_scalar_value '/' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_DIV, $1.u.ast, $3.u.ast); } + | static_scalar_value '%' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_MOD, $1.u.ast, $3.u.ast); } + | '!' static_scalar_value { $$.u.ast = zend_ast_create_unary(ZEND_BOOL_NOT, $2.u.ast); } + | '~' static_scalar_value { $$.u.ast = zend_ast_create_unary(ZEND_BW_NOT, $2.u.ast); } + | static_scalar_value '|' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_BW_OR, $1.u.ast, $3.u.ast); } + | static_scalar_value '&' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_BW_AND, $1.u.ast, $3.u.ast); } + | static_scalar_value '^' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_BW_XOR, $1.u.ast, $3.u.ast); } + | static_scalar_value T_SL static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_SL, $1.u.ast, $3.u.ast); } + | static_scalar_value T_SR static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_SR, $1.u.ast, $3.u.ast); } + | static_scalar_value '.' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_CONCAT, $1.u.ast, $3.u.ast); } + | static_scalar_value T_LOGICAL_XOR static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_BOOL_XOR, $1.u.ast, $3.u.ast); } + | static_scalar_value T_LOGICAL_AND static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_BOOL_AND, $1.u.ast, $3.u.ast); } + | static_scalar_value T_LOGICAL_OR static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_BOOL_OR, $1.u.ast, $3.u.ast); } + | static_scalar_value T_BOOLEAN_AND static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_BOOL_AND, $1.u.ast, $3.u.ast); } + | static_scalar_value T_BOOLEAN_OR static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_BOOL_OR, $1.u.ast, $3.u.ast); } + | static_scalar_value T_IS_IDENTICAL static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_IS_IDENTICAL, $1.u.ast, $3.u.ast); } + | static_scalar_value T_IS_NOT_IDENTICAL static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_IS_NOT_IDENTICAL, $1.u.ast, $3.u.ast); } + | static_scalar_value T_IS_EQUAL static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_IS_EQUAL, $1.u.ast, $3.u.ast); } + | static_scalar_value T_IS_NOT_EQUAL static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_IS_NOT_EQUAL, $1.u.ast, $3.u.ast); } + | static_scalar_value '<' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_IS_SMALLER, $1.u.ast, $3.u.ast); } + | static_scalar_value '>' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_IS_SMALLER, $3.u.ast, $1.u.ast); } + | static_scalar_value T_IS_SMALLER_OR_EQUAL static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_IS_SMALLER_OR_EQUAL, $1.u.ast, $3.u.ast); } + | static_scalar_value T_IS_GREATER_OR_EQUAL static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_IS_SMALLER_OR_EQUAL, $3.u.ast, $1.u.ast); } + | static_scalar_value '?' ':' static_scalar_value { $$.u.ast = zend_ast_create_ternary(ZEND_SELECT, $1.u.ast, NULL, $4.u.ast); } + | static_scalar_value '?' static_scalar_value ':' static_scalar_value { $$.u.ast = zend_ast_create_ternary(ZEND_SELECT, $1.u.ast, $3.u.ast, $5.u.ast); } + | '+' static_scalar_value { $$.u.ast = zend_ast_create_unary(ZEND_UNARY_PLUS, $2.u.ast); } + | '-' static_scalar_value { $$.u.ast = zend_ast_create_unary(ZEND_UNARY_MINUS, $2.u.ast); } + | '(' static_scalar_value ')' { $$ = $2; } ; + scalar: T_STRING_VARNAME { $$ = $1; } | class_name_scalar { $$ = $1; } @@ -1196,7 +1265,7 @@ isset_variables: isset_variable: variable { zend_do_isset_or_isempty(ZEND_ISSET, &$$, &$1 TSRMLS_CC); } - | expr_without_variable { zend_error(E_COMPILE_ERROR, "Cannot use isset() on the result of an expression (you can use \"null !== expression\" instead)"); } + | expr_without_variable { zend_error_noreturn(E_COMPILE_ERROR, "Cannot use isset() on the result of an expression (you can use \"null !== expression\" instead)"); } ; class_constant: diff --git a/Zend/zend_language_scanner.c b/Zend/zend_language_scanner.c index deb799ab76..76e3e56451 100644 --- a/Zend/zend_language_scanner.c +++ b/Zend/zend_language_scanner.c @@ -49,7 +49,7 @@ #include "zend_API.h" #include "zend_strtod.h" #include "zend_exceptions.h" -#include "tsrm_virtual_cwd.h" +#include "zend_virtual_cwd.h" #include "tsrm_config_common.h" #define YYCTYPE unsigned char @@ -564,10 +564,8 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR 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; - Z_UNSET_ISREF(retval_znode.u.constant); - Z_SET_REFCOUNT(retval_znode.u.constant, 1); + INIT_PZVAL(&retval_znode.u.constant); + ZVAL_LONG(&retval_znode.u.constant, 1); zend_save_lexical_state(&original_lex_state TSRMLS_CC); @@ -624,7 +622,7 @@ zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC) convert_to_string(&tmp); filename = &tmp; } - file_handle.filename = filename->value.str.val; + file_handle.filename = Z_STRVAL_P(filename); file_handle.free_filename = 0; file_handle.type = ZEND_HANDLE_FILENAME; file_handle.opened_path = NULL; @@ -635,7 +633,7 @@ zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC) int dummy = 1; if (!file_handle.opened_path) { - file_handle.opened_path = opened_path = estrndup(filename->value.str.val, filename->value.str.len); + file_handle.opened_path = opened_path = estrndup(Z_STRVAL_P(filename), Z_STRLEN_P(filename)); } zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL); @@ -657,22 +655,15 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D char *buf; size_t size; - /* enforce two trailing NULLs for flex... */ - if (IS_INTERNED(str->value.str.val)) { - char *tmp = safe_emalloc(1, str->value.str.len, ZEND_MMAP_AHEAD); - memcpy(tmp, str->value.str.val, str->value.str.len + ZEND_MMAP_AHEAD); - str->value.str.val = tmp; - } else { - str->value.str.val = safe_erealloc(str->value.str.val, 1, str->value.str.len, ZEND_MMAP_AHEAD); - } - - memset(str->value.str.val + str->value.str.len, 0, ZEND_MMAP_AHEAD); + /* enforce ZEND_MMAP_AHEAD trailing NULLs for flex... */ + Z_STRVAL_P(str) = str_erealloc(Z_STRVAL_P(str), Z_STRLEN_P(str) + ZEND_MMAP_AHEAD); + memset(Z_STRVAL_P(str) + Z_STRLEN_P(str), 0, ZEND_MMAP_AHEAD); SCNG(yy_in) = NULL; SCNG(yy_start) = NULL; - buf = str->value.str.val; - size = str->value.str.len; + buf = Z_STRVAL_P(str); + size = Z_STRLEN_P(str); if (CG(multibyte)) { SCNG(script_org) = (unsigned char*)buf; @@ -733,7 +724,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC) int compiler_result; zend_bool original_in_compilation = CG(in_compilation); - if (source_string->value.str.len==0) { + if (Z_STRLEN_P(source_string)==0) { efree(op_array); return NULL; } @@ -871,11 +862,11 @@ ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter # define zend_copy_value(zendlval, yytext, yyleng) \ if (SCNG(output_filter)) { \ size_t sz = 0; \ - SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); \ - zendlval->value.str.len = sz; \ + SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); \ + Z_STRLEN_P(zendlval) = sz; \ } else { \ - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); \ - zendlval->value.str.len = yyleng; \ + Z_STRVAL_P(zendlval) = (char *) estrndup(yytext, yyleng); \ + Z_STRLEN_P(zendlval) = yyleng; \ } static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quote_type TSRMLS_DC) @@ -886,8 +877,8 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo ZVAL_STRINGL(zendlval, str, len, 1); /* convert escape sequences */ - s = t = zendlval->value.str.val; - end = s+zendlval->value.str.len; + s = t = Z_STRVAL_P(zendlval); + end = s+Z_STRLEN_P(zendlval); while (s<end) { if (*s=='\\') { s++; @@ -899,23 +890,23 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo switch(*s) { case 'n': *t++ = '\n'; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; case 'r': *t++ = '\r'; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; case 't': *t++ = '\t'; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; case 'f': *t++ = '\f'; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; case 'v': *t++ = '\v'; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; case 'e': #ifdef PHP_WIN32 @@ -923,7 +914,7 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo #else *t++ = '\e'; #endif - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; case '"': case '`': @@ -935,20 +926,20 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo case '\\': case '$': *t++ = *s; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; case 'x': case 'X': if (ZEND_IS_HEX(*(s+1))) { char hex_buf[3] = { 0, 0, 0 }; - zendlval->value.str.len--; /* for the 'x' */ + Z_STRLEN_P(zendlval)--; /* for the 'x' */ hex_buf[0] = *(++s); - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; if (ZEND_IS_HEX(*(s+1))) { hex_buf[1] = *(++s); - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; } *t++ = (char) strtol(hex_buf, NULL, 16); } else { @@ -962,13 +953,13 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo char octal_buf[4] = { 0, 0, 0, 0 }; octal_buf[0] = *s; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; if (ZEND_IS_OCT(*(s+1))) { octal_buf[1] = *(++s); - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; if (ZEND_IS_OCT(*(s+1))) { octal_buf[2] = *(++s); - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; } } *t++ = (char) strtol(octal_buf, NULL, 8); @@ -990,9 +981,9 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo *t = 0; if (SCNG(output_filter)) { size_t sz = 0; - s = zendlval->value.str.val; - SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)s, (size_t)zendlval->value.str.len TSRMLS_CC); - zendlval->value.str.len = sz; + s = Z_STRVAL_P(zendlval); + SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval) TSRMLS_CC); + Z_STRLEN_P(zendlval) = sz; efree(s); } } @@ -1006,7 +997,7 @@ restart: yymore_restart: -#line 1010 "Zend/zend_language_scanner.c" +#line 1001 "Zend/zend_language_scanner.c" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -1105,7 +1096,7 @@ yyc_INITIAL: yy3: YYDEBUG(3, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1807 "Zend/zend_language_scanner.l" +#line 1741 "Zend/zend_language_scanner.l" { if (YYCURSOR > YYLIMIT) { return 0; @@ -1152,20 +1143,20 @@ inline_html: if (SCNG(output_filter)) { int readsize; size_t sz = 0; - readsize = SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); - zendlval->value.str.len = sz; + readsize = SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); + Z_STRLEN_P(zendlval) = sz; if (readsize < yyleng) { yyless(readsize); } } else { - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; + Z_STRVAL_P(zendlval) = (char *) estrndup(yytext, yyleng); + Z_STRLEN_P(zendlval) = yyleng; } zendlval->type = IS_STRING; HANDLE_NEWLINES(yytext, yyleng); return T_INLINE_HTML; } -#line 1169 "Zend/zend_language_scanner.c" +#line 1160 "Zend/zend_language_scanner.c" yy4: YYDEBUG(4, *YYCURSOR); yych = *++YYCURSOR; @@ -1183,38 +1174,34 @@ yy5: yy6: YYDEBUG(6, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1795 "Zend/zend_language_scanner.l" +#line 1731 "Zend/zend_language_scanner.l" { if (CG(short_tags)) { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG; } else { goto inline_char_handler; } } -#line 1199 "Zend/zend_language_scanner.c" +#line 1188 "Zend/zend_language_scanner.c" yy7: YYDEBUG(7, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) == '=') goto yy43; YYDEBUG(8, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1772 "Zend/zend_language_scanner.l" +#line 1712 "Zend/zend_language_scanner.l" { if (CG(asp_tags)) { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG; } else { goto inline_char_handler; } } -#line 1218 "Zend/zend_language_scanner.c" +#line 1205 "Zend/zend_language_scanner.c" yy9: YYDEBUG(9, *YYCURSOR); yych = *++YYCURSOR; @@ -1400,7 +1387,7 @@ yy35: ++YYCURSOR; YYDEBUG(38, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1732 "Zend/zend_language_scanner.l" +#line 1678 "Zend/zend_language_scanner.l" { YYCTYPE *bracket = (YYCTYPE*)zend_memrchr(yytext, '<', yyleng - (sizeof("script language=php>") - 1)); @@ -1411,13 +1398,11 @@ yy35: } HANDLE_NEWLINES(yytext, yyleng); - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG; } -#line 1421 "Zend/zend_language_scanner.c" +#line 1406 "Zend/zend_language_scanner.c" yy39: YYDEBUG(39, *YYCURSOR); yych = *++YYCURSOR; @@ -1444,33 +1429,29 @@ yy43: ++YYCURSOR; YYDEBUG(44, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1750 "Zend/zend_language_scanner.l" +#line 1694 "Zend/zend_language_scanner.l" { if (CG(asp_tags)) { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG_WITH_ECHO; } else { goto inline_char_handler; } } -#line 1460 "Zend/zend_language_scanner.c" +#line 1443 "Zend/zend_language_scanner.c" yy45: YYDEBUG(45, *YYCURSOR); ++YYCURSOR; YYDEBUG(46, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1763 "Zend/zend_language_scanner.l" +#line 1705 "Zend/zend_language_scanner.l" { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG_WITH_ECHO; } -#line 1474 "Zend/zend_language_scanner.c" +#line 1455 "Zend/zend_language_scanner.c" yy47: YYDEBUG(47, *YYCURSOR); yych = *++YYCURSOR; @@ -1497,16 +1478,14 @@ yy50: yy51: YYDEBUG(51, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1785 "Zend/zend_language_scanner.l" +#line 1723 "Zend/zend_language_scanner.l" { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ HANDLE_NEWLINE(yytext[yyleng-1]); BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG; } -#line 1510 "Zend/zend_language_scanner.c" +#line 1489 "Zend/zend_language_scanner.c" yy52: YYDEBUG(52, *YYCURSOR); ++YYCURSOR; @@ -1577,7 +1556,7 @@ yyc_ST_BACKQUOTE: yy56: YYDEBUG(56, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2258 "Zend/zend_language_scanner.l" +#line 2186 "Zend/zend_language_scanner.l" { if (YYCURSOR > YYLIMIT) { return 0; @@ -1618,7 +1597,7 @@ yy56: zend_scan_escape_string(zendlval, yytext, yyleng, '`' TSRMLS_CC); return T_ENCAPSED_AND_WHITESPACE; } -#line 1622 "Zend/zend_language_scanner.c" +#line 1601 "Zend/zend_language_scanner.c" yy57: YYDEBUG(57, *YYCURSOR); yych = *++YYCURSOR; @@ -1629,12 +1608,12 @@ yy58: ++YYCURSOR; YYDEBUG(59, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2202 "Zend/zend_language_scanner.l" +#line 2130 "Zend/zend_language_scanner.l" { BEGIN(ST_IN_SCRIPTING); return '`'; } -#line 1638 "Zend/zend_language_scanner.c" +#line 1617 "Zend/zend_language_scanner.c" yy60: YYDEBUG(60, *YYCURSOR); yych = *++YYCURSOR; @@ -1644,14 +1623,14 @@ yy61: ++YYCURSOR; YYDEBUG(62, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2189 "Zend/zend_language_scanner.l" +#line 2117 "Zend/zend_language_scanner.l" { - zendlval->value.lval = (long) '{'; + Z_LVAL_P(zendlval) = (long) '{'; yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); yyless(1); return T_CURLY_OPEN; } -#line 1655 "Zend/zend_language_scanner.c" +#line 1634 "Zend/zend_language_scanner.c" yy63: YYDEBUG(63, *YYCURSOR); yyaccept = 0; @@ -1667,24 +1646,24 @@ yy63: yy65: YYDEBUG(65, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1889 "Zend/zend_language_scanner.l" +#line 1823 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); zendlval->type = IS_STRING; return T_VARIABLE; } -#line 1677 "Zend/zend_language_scanner.c" +#line 1656 "Zend/zend_language_scanner.c" yy66: YYDEBUG(66, *YYCURSOR); ++YYCURSOR; YYDEBUG(67, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1465 "Zend/zend_language_scanner.l" +#line 1457 "Zend/zend_language_scanner.l" { yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC); return T_DOLLAR_OPEN_CURLY_BRACES; } -#line 1688 "Zend/zend_language_scanner.c" +#line 1667 "Zend/zend_language_scanner.c" yy68: YYDEBUG(68, *YYCURSOR); yych = *++YYCURSOR; @@ -1698,7 +1677,7 @@ yy70: ++YYCURSOR; YYDEBUG(71, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1881 "Zend/zend_language_scanner.l" +#line 1815 "Zend/zend_language_scanner.l" { yyless(yyleng - 1); yy_push_state(ST_VAR_OFFSET TSRMLS_CC); @@ -1706,7 +1685,7 @@ yy70: zendlval->type = IS_STRING; return T_VARIABLE; } -#line 1710 "Zend/zend_language_scanner.c" +#line 1689 "Zend/zend_language_scanner.c" yy72: YYDEBUG(72, *YYCURSOR); yych = *++YYCURSOR; @@ -1724,7 +1703,7 @@ yy73: ++YYCURSOR; YYDEBUG(74, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1871 "Zend/zend_language_scanner.l" +#line 1805 "Zend/zend_language_scanner.l" { yyless(yyleng - 3); yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC); @@ -1732,7 +1711,7 @@ yy73: zendlval->type = IS_STRING; return T_VARIABLE; } -#line 1736 "Zend/zend_language_scanner.c" +#line 1715 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_DOUBLE_QUOTES: @@ -1800,7 +1779,7 @@ yy77: yy78: YYDEBUG(78, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2208 "Zend/zend_language_scanner.l" +#line 2136 "Zend/zend_language_scanner.l" { if (GET_DOUBLE_QUOTES_SCANNED_LENGTH()) { YYCURSOR += GET_DOUBLE_QUOTES_SCANNED_LENGTH() - 1; @@ -1849,7 +1828,7 @@ double_quotes_scan_done: zend_scan_escape_string(zendlval, yytext, yyleng, '"' TSRMLS_CC); return T_ENCAPSED_AND_WHITESPACE; } -#line 1853 "Zend/zend_language_scanner.c" +#line 1832 "Zend/zend_language_scanner.c" yy79: YYDEBUG(79, *YYCURSOR); yych = *++YYCURSOR; @@ -1860,12 +1839,12 @@ yy80: ++YYCURSOR; YYDEBUG(81, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2197 "Zend/zend_language_scanner.l" +#line 2125 "Zend/zend_language_scanner.l" { BEGIN(ST_IN_SCRIPTING); return '"'; } -#line 1869 "Zend/zend_language_scanner.c" +#line 1848 "Zend/zend_language_scanner.c" yy82: YYDEBUG(82, *YYCURSOR); yych = *++YYCURSOR; @@ -1875,14 +1854,14 @@ yy83: ++YYCURSOR; YYDEBUG(84, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2189 "Zend/zend_language_scanner.l" +#line 2117 "Zend/zend_language_scanner.l" { - zendlval->value.lval = (long) '{'; + Z_LVAL_P(zendlval) = (long) '{'; yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); yyless(1); return T_CURLY_OPEN; } -#line 1886 "Zend/zend_language_scanner.c" +#line 1865 "Zend/zend_language_scanner.c" yy85: YYDEBUG(85, *YYCURSOR); yyaccept = 0; @@ -1898,24 +1877,24 @@ yy85: yy87: YYDEBUG(87, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1889 "Zend/zend_language_scanner.l" +#line 1823 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); zendlval->type = IS_STRING; return T_VARIABLE; } -#line 1908 "Zend/zend_language_scanner.c" +#line 1887 "Zend/zend_language_scanner.c" yy88: YYDEBUG(88, *YYCURSOR); ++YYCURSOR; YYDEBUG(89, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1465 "Zend/zend_language_scanner.l" +#line 1457 "Zend/zend_language_scanner.l" { yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC); return T_DOLLAR_OPEN_CURLY_BRACES; } -#line 1919 "Zend/zend_language_scanner.c" +#line 1898 "Zend/zend_language_scanner.c" yy90: YYDEBUG(90, *YYCURSOR); yych = *++YYCURSOR; @@ -1929,7 +1908,7 @@ yy92: ++YYCURSOR; YYDEBUG(93, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1881 "Zend/zend_language_scanner.l" +#line 1815 "Zend/zend_language_scanner.l" { yyless(yyleng - 1); yy_push_state(ST_VAR_OFFSET TSRMLS_CC); @@ -1937,7 +1916,7 @@ yy92: zendlval->type = IS_STRING; return T_VARIABLE; } -#line 1941 "Zend/zend_language_scanner.c" +#line 1920 "Zend/zend_language_scanner.c" yy94: YYDEBUG(94, *YYCURSOR); yych = *++YYCURSOR; @@ -1955,7 +1934,7 @@ yy95: ++YYCURSOR; YYDEBUG(96, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1871 "Zend/zend_language_scanner.l" +#line 1805 "Zend/zend_language_scanner.l" { yyless(yyleng - 3); yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC); @@ -1963,7 +1942,7 @@ yy95: zendlval->type = IS_STRING; return T_VARIABLE; } -#line 1967 "Zend/zend_language_scanner.c" +#line 1946 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_END_HEREDOC: @@ -1974,7 +1953,7 @@ yyc_ST_END_HEREDOC: ++YYCURSOR; YYDEBUG(100, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2175 "Zend/zend_language_scanner.l" +#line 2103 "Zend/zend_language_scanner.l" { zend_heredoc_label *heredoc_label = zend_ptr_stack_pop(&SCNG(heredoc_label_stack)); @@ -1987,7 +1966,7 @@ yyc_ST_END_HEREDOC: BEGIN(ST_IN_SCRIPTING); return T_END_HEREDOC; } -#line 1991 "Zend/zend_language_scanner.c" +#line 1970 "Zend/zend_language_scanner.c" /* *********************************** */ yyc_ST_HEREDOC: { @@ -2049,7 +2028,7 @@ yy103: yy104: YYDEBUG(104, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2300 "Zend/zend_language_scanner.l" +#line 2228 "Zend/zend_language_scanner.l" { int newline = 0; @@ -2122,7 +2101,7 @@ heredoc_scan_done: zend_scan_escape_string(zendlval, yytext, yyleng - newline, 0 TSRMLS_CC); return T_ENCAPSED_AND_WHITESPACE; } -#line 2126 "Zend/zend_language_scanner.c" +#line 2105 "Zend/zend_language_scanner.c" yy105: YYDEBUG(105, *YYCURSOR); yych = *++YYCURSOR; @@ -2137,14 +2116,14 @@ yy107: ++YYCURSOR; YYDEBUG(108, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2189 "Zend/zend_language_scanner.l" +#line 2117 "Zend/zend_language_scanner.l" { - zendlval->value.lval = (long) '{'; + Z_LVAL_P(zendlval) = (long) '{'; yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); yyless(1); return T_CURLY_OPEN; } -#line 2148 "Zend/zend_language_scanner.c" +#line 2127 "Zend/zend_language_scanner.c" yy109: YYDEBUG(109, *YYCURSOR); yyaccept = 0; @@ -2160,24 +2139,24 @@ yy109: yy111: YYDEBUG(111, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1889 "Zend/zend_language_scanner.l" +#line 1823 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); zendlval->type = IS_STRING; return T_VARIABLE; } -#line 2170 "Zend/zend_language_scanner.c" +#line 2149 "Zend/zend_language_scanner.c" yy112: YYDEBUG(112, *YYCURSOR); ++YYCURSOR; YYDEBUG(113, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1465 "Zend/zend_language_scanner.l" +#line 1457 "Zend/zend_language_scanner.l" { yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC); return T_DOLLAR_OPEN_CURLY_BRACES; } -#line 2181 "Zend/zend_language_scanner.c" +#line 2160 "Zend/zend_language_scanner.c" yy114: YYDEBUG(114, *YYCURSOR); yych = *++YYCURSOR; @@ -2191,7 +2170,7 @@ yy116: ++YYCURSOR; YYDEBUG(117, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1881 "Zend/zend_language_scanner.l" +#line 1815 "Zend/zend_language_scanner.l" { yyless(yyleng - 1); yy_push_state(ST_VAR_OFFSET TSRMLS_CC); @@ -2199,7 +2178,7 @@ yy116: zendlval->type = IS_STRING; return T_VARIABLE; } -#line 2203 "Zend/zend_language_scanner.c" +#line 2182 "Zend/zend_language_scanner.c" yy118: YYDEBUG(118, *YYCURSOR); yych = *++YYCURSOR; @@ -2217,7 +2196,7 @@ yy119: ++YYCURSOR; YYDEBUG(120, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1871 "Zend/zend_language_scanner.l" +#line 1805 "Zend/zend_language_scanner.l" { yyless(yyleng - 3); yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC); @@ -2225,7 +2204,7 @@ yy119: zendlval->type = IS_STRING; return T_VARIABLE; } -#line 2229 "Zend/zend_language_scanner.c" +#line 2208 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_IN_SCRIPTING: @@ -2302,14 +2281,14 @@ yyc_ST_IN_SCRIPTING: case '\n': case '\r': case ' ': goto yy140; - case '!': goto yy153; + case '!': goto yy154; case '"': goto yy180; case '#': goto yy176; case '$': goto yy165; case '%': goto yy159; case '&': goto yy160; case '\'': goto yy178; - case '(': goto yy147; + case '(': goto yy148; case ')': case ',': case ';': @@ -2317,11 +2296,11 @@ yyc_ST_IN_SCRIPTING: case '[': case ']': case '~': goto yy166; - case '*': goto yy156; - case '+': goto yy152; + case '*': goto yy157; + case '+': goto yy153; case '-': goto yy138; - case '.': goto yy158; - case '/': goto yy157; + case '.': goto yy145; + case '/': goto yy158; case '0': goto yy172; case '1': case '2': @@ -2333,9 +2312,9 @@ yyc_ST_IN_SCRIPTING: case '8': case '9': goto yy174; case ':': goto yy142; - case '<': goto yy154; - case '=': goto yy150; - case '>': goto yy155; + case '<': goto yy155; + case '=': goto yy151; + case '>': goto yy156; case '?': goto yy167; case 'A': case 'a': goto yy133; @@ -2354,9 +2333,9 @@ yyc_ST_IN_SCRIPTING: case 'I': case 'i': goto yy131; case 'L': - case 'l': goto yy151; + case 'l': goto yy152; case 'N': - case 'n': goto yy145; + case 'n': goto yy146; case 'O': case 'o': goto yy163; case 'P': @@ -2368,9 +2347,9 @@ yyc_ST_IN_SCRIPTING: case 'T': case 't': goto yy130; case 'U': - case 'u': goto yy148; + case 'u': goto yy149; case 'V': - case 'v': goto yy146; + case 'v': goto yy147; case 'W': case 'w': goto yy132; case 'X': @@ -2379,7 +2358,7 @@ yyc_ST_IN_SCRIPTING: case 'y': goto yy129; case '\\': goto yy143; case '^': goto yy162; - case '_': goto yy149; + case '_': goto yy150; case '`': goto yy182; case '{': goto yy168; case '|': goto yy161; @@ -2392,48 +2371,48 @@ yy123: YYDEBUG(-1, yych); switch ((yych = *YYCURSOR)) { case 'C': - case 'c': goto yy735; + case 'c': goto yy738; case 'L': - case 'l': goto yy736; + case 'l': goto yy739; case 'M': - case 'm': goto yy737; + case 'm': goto yy740; case 'N': - case 'n': goto yy738; + case 'n': goto yy741; case 'V': - case 'v': goto yy739; + case 'v': goto yy742; case 'X': - case 'x': goto yy740; + case 'x': goto yy743; default: goto yy187; } yy124: YYDEBUG(124, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1912 "Zend/zend_language_scanner.l" +#line 1846 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, yytext, yyleng); zendlval->type = IS_STRING; return T_STRING; } -#line 2418 "Zend/zend_language_scanner.c" +#line 2397 "Zend/zend_language_scanner.c" yy125: YYDEBUG(125, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { if (yych <= 'H') { - if (yych == 'E') goto yy717; + if (yych == 'E') goto yy720; goto yy187; } else { - if (yych <= 'I') goto yy718; + if (yych <= 'I') goto yy721; if (yych <= 'N') goto yy187; - goto yy719; + goto yy722; } } else { if (yych <= 'h') { - if (yych == 'e') goto yy717; + if (yych == 'e') goto yy720; goto yy187; } else { - if (yych <= 'i') goto yy718; - if (yych == 'o') goto yy719; + if (yych <= 'i') goto yy721; + if (yych == 'o') goto yy722; goto yy187; } } @@ -2442,20 +2421,20 @@ yy126: yych = *++YYCURSOR; if (yych <= 'U') { if (yych <= 'N') { - if (yych == 'I') goto yy693; + if (yych == 'I') goto yy696; goto yy187; } else { - if (yych <= 'O') goto yy694; + if (yych <= 'O') goto yy697; if (yych <= 'T') goto yy187; - goto yy695; + goto yy698; } } else { if (yych <= 'n') { - if (yych == 'i') goto yy693; + if (yych == 'i') goto yy696; goto yy187; } else { - if (yych <= 'o') goto yy694; - if (yych == 'u') goto yy695; + if (yych <= 'o') goto yy697; + if (yych == 'u') goto yy698; goto yy187; } } @@ -2464,48 +2443,48 @@ yy127: yych = *++YYCURSOR; if (yych <= 'O') { if (yych <= 'K') { - if (yych == 'A') goto yy658; + if (yych == 'A') goto yy661; goto yy187; } else { - if (yych <= 'L') goto yy659; + if (yych <= 'L') goto yy662; if (yych <= 'N') goto yy187; - goto yy660; + goto yy663; } } else { if (yych <= 'k') { - if (yych == 'a') goto yy658; + if (yych == 'a') goto yy661; goto yy187; } else { - if (yych <= 'l') goto yy659; - if (yych == 'o') goto yy660; + if (yych <= 'l') goto yy662; + if (yych == 'o') goto yy663; goto yy187; } } yy128: YYDEBUG(128, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy640; - if (yych == 'e') goto yy640; + if (yych == 'E') goto yy643; + if (yych == 'e') goto yy643; goto yy187; yy129: YYDEBUG(129, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy635; - if (yych == 'i') goto yy635; + if (yych == 'I') goto yy638; + if (yych == 'i') goto yy638; goto yy187; yy130: YYDEBUG(130, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'R') { - if (yych == 'H') goto yy623; + if (yych == 'H') goto yy626; if (yych <= 'Q') goto yy187; - goto yy624; + goto yy627; } else { if (yych <= 'h') { if (yych <= 'g') goto yy187; - goto yy623; + goto yy626; } else { - if (yych == 'r') goto yy624; + if (yych == 'r') goto yy627; goto yy187; } } @@ -2514,53 +2493,53 @@ yy131: yych = *++YYCURSOR; if (yych <= 'S') { if (yych <= 'L') { - if (yych == 'F') goto yy570; + if (yych == 'F') goto yy573; goto yy187; } else { - if (yych <= 'M') goto yy572; - if (yych <= 'N') goto yy573; + if (yych <= 'M') goto yy575; + if (yych <= 'N') goto yy576; if (yych <= 'R') goto yy187; - goto yy574; + goto yy577; } } else { if (yych <= 'm') { - if (yych == 'f') goto yy570; + if (yych == 'f') goto yy573; if (yych <= 'l') goto yy187; - goto yy572; + goto yy575; } else { - if (yych <= 'n') goto yy573; - if (yych == 's') goto yy574; + if (yych <= 'n') goto yy576; + if (yych == 's') goto yy577; goto yy187; } } yy132: YYDEBUG(132, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy565; - if (yych == 'h') goto yy565; + if (yych == 'H') goto yy568; + if (yych == 'h') goto yy568; goto yy187; yy133: YYDEBUG(133, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'S') { if (yych <= 'M') { - if (yych == 'B') goto yy547; + if (yych == 'B') goto yy550; goto yy187; } else { - if (yych <= 'N') goto yy548; + if (yych <= 'N') goto yy551; if (yych <= 'Q') goto yy187; - if (yych <= 'R') goto yy549; - goto yy550; + if (yych <= 'R') goto yy552; + goto yy553; } } else { if (yych <= 'n') { - if (yych == 'b') goto yy547; + if (yych == 'b') goto yy550; if (yych <= 'm') goto yy187; - goto yy548; + goto yy551; } else { if (yych <= 'q') goto yy187; - if (yych <= 'r') goto yy549; - if (yych <= 's') goto yy550; + if (yych <= 'r') goto yy552; + if (yych <= 's') goto yy553; goto yy187; } } @@ -2568,15 +2547,15 @@ yy134: YYDEBUG(134, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'W') { - if (yych == 'T') goto yy535; + if (yych == 'T') goto yy538; if (yych <= 'V') goto yy187; - goto yy536; + goto yy539; } else { if (yych <= 't') { if (yych <= 's') goto yy187; - goto yy535; + goto yy538; } else { - if (yych == 'w') goto yy536; + if (yych == 'w') goto yy539; goto yy187; } } @@ -2587,18 +2566,18 @@ yy135: if (yych <= ';') { if (yych <= '"') { if (yych <= '!') goto yy187; - goto yy527; + goto yy530; } else { - if (yych == '\'') goto yy528; + if (yych == '\'') goto yy531; goto yy187; } } else { if (yych <= 'R') { - if (yych <= '<') goto yy526; + if (yych <= '<') goto yy529; if (yych <= 'Q') goto yy187; - goto yy529; + goto yy532; } else { - if (yych == 'r') goto yy529; + if (yych == 'r') goto yy532; goto yy187; } } @@ -2606,15 +2585,15 @@ yy136: YYDEBUG(136, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { - if (yych == 'L') goto yy516; + if (yych == 'L') goto yy519; if (yych <= 'N') goto yy187; - goto yy517; + goto yy520; } else { if (yych <= 'l') { if (yych <= 'k') goto yy187; - goto yy516; + goto yy519; } else { - if (yych == 'o') goto yy517; + if (yych == 'o') goto yy520; goto yy187; } } @@ -2622,15 +2601,15 @@ yy137: YYDEBUG(137, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { - if (yych == 'R') goto yy492; + if (yych == 'R') goto yy495; if (yych <= 'T') goto yy187; - goto yy493; + goto yy496; } else { if (yych <= 'r') { if (yych <= 'q') goto yy187; - goto yy492; + goto yy495; } else { - if (yych == 'u') goto yy493; + if (yych == 'u') goto yy496; goto yy187; } } @@ -2638,214 +2617,217 @@ yy138: YYDEBUG(138, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '<') { - if (yych == '-') goto yy488; + if (yych == '-') goto yy491; } else { - if (yych <= '=') goto yy486; - if (yych <= '>') goto yy490; + if (yych <= '=') goto yy489; + if (yych <= '>') goto yy493; } yy139: YYDEBUG(139, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1454 "Zend/zend_language_scanner.l" +#line 1446 "Zend/zend_language_scanner.l" { return yytext[0]; } -#line 2654 "Zend/zend_language_scanner.c" +#line 2633 "Zend/zend_language_scanner.c" yy140: YYDEBUG(140, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy485; + goto yy488; yy141: YYDEBUG(141, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1185 "Zend/zend_language_scanner.l" +#line 1175 "Zend/zend_language_scanner.l" { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ HANDLE_NEWLINES(yytext, yyleng); return T_WHITESPACE; } -#line 2671 "Zend/zend_language_scanner.c" +#line 2648 "Zend/zend_language_scanner.c" yy142: YYDEBUG(142, *YYCURSOR); yych = *++YYCURSOR; - if (yych == ':') goto yy482; + if (yych == ':') goto yy485; goto yy139; yy143: YYDEBUG(143, *YYCURSOR); ++YYCURSOR; YYDEBUG(144, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1214 "Zend/zend_language_scanner.l" +#line 1202 "Zend/zend_language_scanner.l" { return T_NS_SEPARATOR; } -#line 2686 "Zend/zend_language_scanner.c" +#line 2663 "Zend/zend_language_scanner.c" yy145: YYDEBUG(145, *YYCURSOR); + yyaccept = 1; + yych = *(YYMARKER = ++YYCURSOR); + if (yych <= '/') { + if (yych == '.') goto yy482; + goto yy139; + } else { + if (yych <= '9') goto yy478; + if (yych == '=') goto yy480; + goto yy139; + } +yy146: + YYDEBUG(146, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'E') { - if (yych == 'A') goto yy470; + if (yych == 'A') goto yy466; if (yych <= 'D') goto yy187; - goto yy471; + goto yy467; } else { if (yych <= 'a') { if (yych <= '`') goto yy187; - goto yy470; + goto yy466; } else { - if (yych == 'e') goto yy471; + if (yych == 'e') goto yy467; goto yy187; } } -yy146: - YYDEBUG(146, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy467; - if (yych == 'a') goto yy467; - goto yy187; yy147: YYDEBUG(147, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'A') goto yy463; + if (yych == 'a') goto yy463; + goto yy187; +yy148: + YYDEBUG(148, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { if (yych <= 'D') { if (yych <= ' ') { - if (yych == '\t') goto yy392; + if (yych == '\t') goto yy388; if (yych <= 0x1F) goto yy139; - goto yy392; + goto yy388; } else { if (yych <= '@') goto yy139; if (yych == 'C') goto yy139; - goto yy392; + goto yy388; } } else { if (yych <= 'I') { - if (yych == 'F') goto yy392; + if (yych == 'F') goto yy388; if (yych <= 'H') goto yy139; - goto yy392; + goto yy388; } else { - if (yych == 'O') goto yy392; + if (yych == 'O') goto yy388; if (yych <= 'Q') goto yy139; - goto yy392; + goto yy388; } } } else { if (yych <= 'f') { if (yych <= 'b') { - if (yych == 'U') goto yy392; + if (yych == 'U') goto yy388; if (yych <= '`') goto yy139; - goto yy392; + goto yy388; } else { - if (yych == 'd') goto yy392; + if (yych == 'd') goto yy388; if (yych <= 'e') goto yy139; - goto yy392; + goto yy388; } } else { if (yych <= 'o') { - if (yych == 'i') goto yy392; + if (yych == 'i') goto yy388; if (yych <= 'n') goto yy139; - goto yy392; + goto yy388; } else { if (yych <= 's') { if (yych <= 'q') goto yy139; - goto yy392; + goto yy388; } else { - if (yych == 'u') goto yy392; + if (yych == 'u') goto yy388; goto yy139; } } } } -yy148: - YYDEBUG(148, *YYCURSOR); +yy149: + YYDEBUG(149, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'S') { - if (yych == 'N') goto yy383; + if (yych == 'N') goto yy379; if (yych <= 'R') goto yy187; - goto yy384; + goto yy380; } else { if (yych <= 'n') { if (yych <= 'm') goto yy187; - goto yy383; + goto yy379; } else { - if (yych == 's') goto yy384; + if (yych == 's') goto yy380; goto yy187; } } -yy149: - YYDEBUG(149, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '_') goto yy301; - goto yy187; yy150: YYDEBUG(150, *YYCURSOR); yych = *++YYCURSOR; - if (yych <= '<') goto yy139; - if (yych <= '=') goto yy295; - if (yych <= '>') goto yy297; - goto yy139; + if (yych == '_') goto yy297; + goto yy187; yy151: YYDEBUG(151, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy291; - if (yych == 'i') goto yy291; - goto yy187; + if (yych <= '<') goto yy139; + if (yych <= '=') goto yy291; + if (yych <= '>') goto yy293; + goto yy139; yy152: YYDEBUG(152, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '+') goto yy289; - if (yych == '=') goto yy287; - goto yy139; + if (yych == 'I') goto yy287; + if (yych == 'i') goto yy287; + goto yy187; yy153: YYDEBUG(153, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '=') goto yy284; + if (yych == '+') goto yy285; + if (yych == '=') goto yy283; goto yy139; yy154: YYDEBUG(154, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == '=') goto yy280; + goto yy139; +yy155: + YYDEBUG(155, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ';') { - if (yych == '/') goto yy256; + if (yych == '/') goto yy252; goto yy139; } else { - if (yych <= '<') goto yy254; - if (yych <= '=') goto yy257; - if (yych <= '>') goto yy259; + if (yych <= '<') goto yy250; + if (yych <= '=') goto yy253; + if (yych <= '>') goto yy255; goto yy139; } -yy155: - YYDEBUG(155, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '<') goto yy139; - if (yych <= '=') goto yy250; - if (yych <= '>') goto yy248; - goto yy139; yy156: YYDEBUG(156, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '=') goto yy246; + if (yych <= '<') goto yy139; + if (yych <= '=') goto yy246; + if (yych <= '>') goto yy244; goto yy139; yy157: YYDEBUG(157, *YYCURSOR); yych = *++YYCURSOR; + if (yych == '=') goto yy242; + goto yy139; +yy158: + YYDEBUG(158, *YYCURSOR); + yych = *++YYCURSOR; if (yych <= '.') { - if (yych == '*') goto yy238; + if (yych == '*') goto yy234; goto yy139; } else { - if (yych <= '/') goto yy240; - if (yych == '=') goto yy241; + if (yych <= '/') goto yy236; + if (yych == '=') goto yy237; goto yy139; } -yy158: - YYDEBUG(158, *YYCURSOR); - yych = *++YYCURSOR; - if (yych <= '/') goto yy139; - if (yych <= '9') goto yy234; - if (yych == '=') goto yy236; - goto yy139; yy159: YYDEBUG(159, *YYCURSOR); yych = *++YYCURSOR; @@ -2910,18 +2892,18 @@ yy168: ++YYCURSOR; YYDEBUG(169, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1459 "Zend/zend_language_scanner.l" +#line 1451 "Zend/zend_language_scanner.l" { yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); return '{'; } -#line 2919 "Zend/zend_language_scanner.c" +#line 2901 "Zend/zend_language_scanner.c" yy170: YYDEBUG(170, *YYCURSOR); ++YYCURSOR; YYDEBUG(171, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1471 "Zend/zend_language_scanner.l" +#line 1463 "Zend/zend_language_scanner.l" { RESET_DOC_COMMENT(); if (!zend_stack_is_empty(&SCNG(state_stack))) { @@ -2929,7 +2911,7 @@ yy170: } return '}'; } -#line 2933 "Zend/zend_language_scanner.c" +#line 2915 "Zend/zend_language_scanner.c" yy172: YYDEBUG(172, *YYCURSOR); yyaccept = 2; @@ -2957,18 +2939,18 @@ yy172: yy173: YYDEBUG(173, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1522 "Zend/zend_language_scanner.l" +#line 1513 "Zend/zend_language_scanner.l" { if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */ - zendlval->value.lval = strtol(yytext, NULL, 0); + Z_LVAL_P(zendlval) = strtol(yytext, NULL, 0); } else { errno = 0; - zendlval->value.lval = strtol(yytext, NULL, 0); + Z_LVAL_P(zendlval) = strtol(yytext, NULL, 0); if (errno == ERANGE) { /* Overflow */ if (yytext[0] == '0') { /* octal overflow */ - zendlval->value.dval = zend_oct_strtod(yytext, NULL); + Z_DVAL_P(zendlval) = zend_oct_strtod(yytext, NULL); } else { - zendlval->value.dval = zend_strtod(yytext, NULL); + Z_DVAL_P(zendlval) = zend_strtod(yytext, NULL); } zendlval->type = IS_DOUBLE; return T_DNUMBER; @@ -2978,7 +2960,7 @@ yy173: zendlval->type = IS_LONG; return T_LNUMBER; } -#line 2982 "Zend/zend_language_scanner.c" +#line 2964 "Zend/zend_language_scanner.c" yy174: YYDEBUG(174, *YYCURSOR); yyaccept = 2; @@ -3006,7 +2988,7 @@ yy176: yy177: YYDEBUG(177, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1919 "Zend/zend_language_scanner.l" +#line 1853 "Zend/zend_language_scanner.l" { while (YYCURSOR < YYLIMIT) { switch (*YYCURSOR++) { @@ -3040,14 +3022,14 @@ yy177: return T_COMMENT; } -#line 3044 "Zend/zend_language_scanner.c" +#line 3026 "Zend/zend_language_scanner.c" yy178: YYDEBUG(178, *YYCURSOR); ++YYCURSOR; yy179: YYDEBUG(179, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2010 "Zend/zend_language_scanner.l" +#line 1940 "Zend/zend_language_scanner.l" { register char *s, *t; char *end; @@ -3073,13 +3055,11 @@ yy179: } } - zendlval->value.str.val = estrndup(yytext+bprefix+1, yyleng-bprefix-2); - zendlval->value.str.len = yyleng-bprefix-2; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext+bprefix+1, yyleng-bprefix-2, 1); /* convert escape sequences */ - s = t = zendlval->value.str.val; - end = s+zendlval->value.str.len; + s = t = Z_STRVAL_P(zendlval); + end = s+Z_STRLEN_P(zendlval); while (s<end) { if (*s=='\\') { s++; @@ -3088,7 +3068,7 @@ yy179: case '\\': case '\'': *t++ = *s; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; default: *t++ = '\\'; @@ -3108,21 +3088,21 @@ yy179: if (SCNG(output_filter)) { size_t sz = 0; - s = zendlval->value.str.val; - SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)s, (size_t)zendlval->value.str.len TSRMLS_CC); - zendlval->value.str.len = sz; + s = Z_STRVAL_P(zendlval); + SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval) TSRMLS_CC); + Z_STRLEN_P(zendlval) = sz; efree(s); } return T_CONSTANT_ENCAPSED_STRING; } -#line 3119 "Zend/zend_language_scanner.c" +#line 3099 "Zend/zend_language_scanner.c" yy180: YYDEBUG(180, *YYCURSOR); ++YYCURSOR; yy181: YYDEBUG(181, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2079 "Zend/zend_language_scanner.l" +#line 2007 "Zend/zend_language_scanner.l" { int bprefix = (yytext[0] != '"') ? 1 : 0; @@ -3163,24 +3143,24 @@ yy181: BEGIN(ST_DOUBLE_QUOTES); return '"'; } -#line 3167 "Zend/zend_language_scanner.c" +#line 3147 "Zend/zend_language_scanner.c" yy182: YYDEBUG(182, *YYCURSOR); ++YYCURSOR; YYDEBUG(183, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2169 "Zend/zend_language_scanner.l" +#line 2097 "Zend/zend_language_scanner.l" { BEGIN(ST_BACKQUOTE); return '`'; } -#line 3178 "Zend/zend_language_scanner.c" +#line 3158 "Zend/zend_language_scanner.c" yy184: YYDEBUG(184, *YYCURSOR); ++YYCURSOR; YYDEBUG(185, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2432 "Zend/zend_language_scanner.l" +#line 2360 "Zend/zend_language_scanner.l" { if (YYCURSOR > YYLIMIT) { return 0; @@ -3189,7 +3169,7 @@ yy184: zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE); goto restart; } -#line 3193 "Zend/zend_language_scanner.c" +#line 3173 "Zend/zend_language_scanner.c" yy186: YYDEBUG(186, *YYCURSOR); ++YYCURSOR; @@ -3216,13 +3196,12 @@ yy188: yy190: YYDEBUG(190, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1587 "Zend/zend_language_scanner.l" +#line 1572 "Zend/zend_language_scanner.l" { - zendlval->value.dval = zend_strtod(yytext, NULL); - zendlval->type = IS_DOUBLE; + ZVAL_DOUBLE(zendlval, zend_strtod(yytext, NULL)); return T_DNUMBER; } -#line 3226 "Zend/zend_language_scanner.c" +#line 3205 "Zend/zend_language_scanner.c" yy191: YYDEBUG(191, *YYCURSOR); yyaccept = 2; @@ -3269,10 +3248,10 @@ yy194: if (yyaccept <= 3) { goto yy190; } else { - goto yy239; + goto yy235; } } else { - goto yy255; + goto yy251; } } yy195: @@ -3314,7 +3293,7 @@ yy200: } YYDEBUG(202, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1497 "Zend/zend_language_scanner.l" +#line 1489 "Zend/zend_language_scanner.l" { char *bin = yytext + 2; /* Skip "0b" */ int len = yyleng - 2; @@ -3327,19 +3306,18 @@ yy200: if (len < SIZEOF_LONG * 8) { if (len == 0) { - zendlval->value.lval = 0; + Z_LVAL_P(zendlval) = 0; } else { - zendlval->value.lval = strtol(bin, NULL, 2); + Z_LVAL_P(zendlval) = strtol(bin, NULL, 2); } zendlval->type = IS_LONG; return T_LNUMBER; } else { - zendlval->value.dval = zend_bin_strtod(bin, NULL); - zendlval->type = IS_DOUBLE; + ZVAL_DOUBLE(zendlval, zend_bin_strtod(bin, NULL)); return T_DNUMBER; } } -#line 3343 "Zend/zend_language_scanner.c" +#line 3321 "Zend/zend_language_scanner.c" yy203: YYDEBUG(203, *YYCURSOR); ++YYCURSOR; @@ -3351,7 +3329,7 @@ yy203: } YYDEBUG(205, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1543 "Zend/zend_language_scanner.l" +#line 1534 "Zend/zend_language_scanner.l" { char *hex = yytext + 2; /* Skip "0x" */ int len = yyleng - 2; @@ -3364,19 +3342,18 @@ yy203: if (len < SIZEOF_LONG * 2 || (len == SIZEOF_LONG * 2 && *hex <= '7')) { if (len == 0) { - zendlval->value.lval = 0; + Z_LVAL_P(zendlval) = 0; } else { - zendlval->value.lval = strtol(hex, NULL, 16); + Z_LVAL_P(zendlval) = strtol(hex, NULL, 16); } zendlval->type = IS_LONG; return T_LNUMBER; } else { - zendlval->value.dval = zend_hex_strtod(hex, NULL); - zendlval->type = IS_DOUBLE; + ZVAL_DOUBLE(zendlval, zend_hex_strtod(hex, NULL)); return T_DNUMBER; } } -#line 3380 "Zend/zend_language_scanner.c" +#line 3357 "Zend/zend_language_scanner.c" yy206: YYDEBUG(206, *YYCURSOR); ++YYCURSOR; @@ -3385,15 +3362,13 @@ yy206: yy207: YYDEBUG(207, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1987 "Zend/zend_language_scanner.l" +#line 1921 "Zend/zend_language_scanner.l" { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ BEGIN(INITIAL); return T_CLOSE_TAG; /* implicit ';' at php-end tag */ } -#line 3397 "Zend/zend_language_scanner.c" +#line 3372 "Zend/zend_language_scanner.c" yy208: YYDEBUG(208, *YYCURSOR); yych = *++YYCURSOR; @@ -3427,13 +3402,13 @@ yy210: yy212: YYDEBUG(212, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1889 "Zend/zend_language_scanner.l" +#line 1823 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); zendlval->type = IS_STRING; return T_VARIABLE; } -#line 3437 "Zend/zend_language_scanner.c" +#line 3412 "Zend/zend_language_scanner.c" yy213: YYDEBUG(213, *YYCURSOR); yych = *++YYCURSOR; @@ -3447,11 +3422,11 @@ yy214: } YYDEBUG(215, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1442 "Zend/zend_language_scanner.l" +#line 1434 "Zend/zend_language_scanner.l" { return T_LOGICAL_XOR; } -#line 3455 "Zend/zend_language_scanner.c" +#line 3430 "Zend/zend_language_scanner.c" yy216: YYDEBUG(216, *YYCURSOR); ++YYCURSOR; @@ -3460,61 +3435,61 @@ yy216: } YYDEBUG(217, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1434 "Zend/zend_language_scanner.l" +#line 1426 "Zend/zend_language_scanner.l" { return T_LOGICAL_OR; } -#line 3468 "Zend/zend_language_scanner.c" +#line 3443 "Zend/zend_language_scanner.c" yy218: YYDEBUG(218, *YYCURSOR); ++YYCURSOR; YYDEBUG(219, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1422 "Zend/zend_language_scanner.l" +#line 1414 "Zend/zend_language_scanner.l" { return T_XOR_EQUAL; } -#line 3478 "Zend/zend_language_scanner.c" +#line 3453 "Zend/zend_language_scanner.c" yy220: YYDEBUG(220, *YYCURSOR); ++YYCURSOR; YYDEBUG(221, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1426 "Zend/zend_language_scanner.l" +#line 1418 "Zend/zend_language_scanner.l" { return T_BOOLEAN_OR; } -#line 3488 "Zend/zend_language_scanner.c" +#line 3463 "Zend/zend_language_scanner.c" yy222: YYDEBUG(222, *YYCURSOR); ++YYCURSOR; YYDEBUG(223, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1418 "Zend/zend_language_scanner.l" +#line 1410 "Zend/zend_language_scanner.l" { return T_OR_EQUAL; } -#line 3498 "Zend/zend_language_scanner.c" +#line 3473 "Zend/zend_language_scanner.c" yy224: YYDEBUG(224, *YYCURSOR); ++YYCURSOR; YYDEBUG(225, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1430 "Zend/zend_language_scanner.l" +#line 1422 "Zend/zend_language_scanner.l" { return T_BOOLEAN_AND; } -#line 3508 "Zend/zend_language_scanner.c" +#line 3483 "Zend/zend_language_scanner.c" yy226: YYDEBUG(226, *YYCURSOR); ++YYCURSOR; YYDEBUG(227, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1414 "Zend/zend_language_scanner.l" +#line 1406 "Zend/zend_language_scanner.l" { return T_AND_EQUAL; } -#line 3518 "Zend/zend_language_scanner.c" +#line 3493 "Zend/zend_language_scanner.c" yy228: YYDEBUG(228, *YYCURSOR); ++YYCURSOR; @@ -3523,30 +3498,28 @@ yy228: yy229: YYDEBUG(229, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1996 "Zend/zend_language_scanner.l" +#line 1928 "Zend/zend_language_scanner.l" { if (CG(asp_tags)) { BEGIN(INITIAL); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - zendlval->value.str.val = yytext; /* no copying - intentional */ + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ return T_CLOSE_TAG; /* implicit ';' at php-end tag */ } else { yyless(1); return yytext[0]; } } -#line 3540 "Zend/zend_language_scanner.c" +#line 3513 "Zend/zend_language_scanner.c" yy230: YYDEBUG(230, *YYCURSOR); ++YYCURSOR; YYDEBUG(231, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1402 "Zend/zend_language_scanner.l" +#line 1394 "Zend/zend_language_scanner.l" { return T_MOD_EQUAL; } -#line 3550 "Zend/zend_language_scanner.c" +#line 3523 "Zend/zend_language_scanner.c" yy232: YYDEBUG(232, *YYCURSOR); yych = *++YYCURSOR; @@ -3558,39 +3531,13 @@ yy233: goto yy229; yy234: YYDEBUG(234, *YYCURSOR); - yyaccept = 3; - YYMARKER = ++YYCURSOR; - YYFILL(3); - yych = *YYCURSOR; - YYDEBUG(235, *YYCURSOR); - if (yych <= 'D') { - if (yych <= '/') goto yy190; - if (yych <= '9') goto yy234; - goto yy190; - } else { - if (yych <= 'E') goto yy193; - if (yych == 'e') goto yy193; - goto yy190; - } -yy236: - YYDEBUG(236, *YYCURSOR); - ++YYCURSOR; - YYDEBUG(237, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 1398 "Zend/zend_language_scanner.l" - { - return T_CONCAT_EQUAL; -} -#line 3585 "Zend/zend_language_scanner.c" -yy238: - YYDEBUG(238, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); - if (yych == '*') goto yy243; -yy239: - YYDEBUG(239, *YYCURSOR); + if (yych == '*') goto yy239; +yy235: + YYDEBUG(235, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1953 "Zend/zend_language_scanner.l" +#line 1887 "Zend/zend_language_scanner.l" { int doc_com; @@ -3624,281 +3571,281 @@ yy239: return T_COMMENT; } -#line 3628 "Zend/zend_language_scanner.c" -yy240: - YYDEBUG(240, *YYCURSOR); +#line 3575 "Zend/zend_language_scanner.c" +yy236: + YYDEBUG(236, *YYCURSOR); yych = *++YYCURSOR; goto yy177; -yy241: - YYDEBUG(241, *YYCURSOR); +yy237: + YYDEBUG(237, *YYCURSOR); ++YYCURSOR; - YYDEBUG(242, *YYCURSOR); + YYDEBUG(238, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1394 "Zend/zend_language_scanner.l" +#line 1386 "Zend/zend_language_scanner.l" { return T_DIV_EQUAL; } -#line 3642 "Zend/zend_language_scanner.c" -yy243: - YYDEBUG(243, *YYCURSOR); +#line 3589 "Zend/zend_language_scanner.c" +yy239: + YYDEBUG(239, *YYCURSOR); yych = *++YYCURSOR; if (yybm[0+yych] & 64) { - goto yy244; + goto yy240; } goto yy194; -yy244: - YYDEBUG(244, *YYCURSOR); +yy240: + YYDEBUG(240, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(245, *YYCURSOR); + YYDEBUG(241, *YYCURSOR); if (yybm[0+yych] & 64) { - goto yy244; + goto yy240; } - goto yy239; -yy246: - YYDEBUG(246, *YYCURSOR); + goto yy235; +yy242: + YYDEBUG(242, *YYCURSOR); ++YYCURSOR; - YYDEBUG(247, *YYCURSOR); + YYDEBUG(243, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1390 "Zend/zend_language_scanner.l" +#line 1382 "Zend/zend_language_scanner.l" { return T_MUL_EQUAL; } -#line 3669 "Zend/zend_language_scanner.c" -yy248: - YYDEBUG(248, *YYCURSOR); +#line 3616 "Zend/zend_language_scanner.c" +yy244: + YYDEBUG(244, *YYCURSOR); ++YYCURSOR; - if ((yych = *YYCURSOR) == '=') goto yy252; - YYDEBUG(249, *YYCURSOR); + if ((yych = *YYCURSOR) == '=') goto yy248; + YYDEBUG(245, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1450 "Zend/zend_language_scanner.l" +#line 1442 "Zend/zend_language_scanner.l" { return T_SR; } -#line 3680 "Zend/zend_language_scanner.c" -yy250: - YYDEBUG(250, *YYCURSOR); +#line 3627 "Zend/zend_language_scanner.c" +yy246: + YYDEBUG(246, *YYCURSOR); ++YYCURSOR; - YYDEBUG(251, *YYCURSOR); + YYDEBUG(247, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1378 "Zend/zend_language_scanner.l" +#line 1370 "Zend/zend_language_scanner.l" { return T_IS_GREATER_OR_EQUAL; } -#line 3690 "Zend/zend_language_scanner.c" -yy252: - YYDEBUG(252, *YYCURSOR); +#line 3637 "Zend/zend_language_scanner.c" +yy248: + YYDEBUG(248, *YYCURSOR); ++YYCURSOR; - YYDEBUG(253, *YYCURSOR); + YYDEBUG(249, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1410 "Zend/zend_language_scanner.l" +#line 1402 "Zend/zend_language_scanner.l" { return T_SR_EQUAL; } -#line 3700 "Zend/zend_language_scanner.c" -yy254: - YYDEBUG(254, *YYCURSOR); +#line 3647 "Zend/zend_language_scanner.c" +yy250: + YYDEBUG(250, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= ';') goto yy255; - if (yych <= '<') goto yy270; - if (yych <= '=') goto yy268; -yy255: - YYDEBUG(255, *YYCURSOR); + if (yych <= ';') goto yy251; + if (yych <= '<') goto yy266; + if (yych <= '=') goto yy264; +yy251: + YYDEBUG(251, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1446 "Zend/zend_language_scanner.l" +#line 1438 "Zend/zend_language_scanner.l" { return T_SL; } -#line 3715 "Zend/zend_language_scanner.c" -yy256: - YYDEBUG(256, *YYCURSOR); +#line 3662 "Zend/zend_language_scanner.c" +yy252: + YYDEBUG(252, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy261; - if (yych == 's') goto yy261; + if (yych == 'S') goto yy257; + if (yych == 's') goto yy257; goto yy194; -yy257: - YYDEBUG(257, *YYCURSOR); +yy253: + YYDEBUG(253, *YYCURSOR); ++YYCURSOR; - YYDEBUG(258, *YYCURSOR); + YYDEBUG(254, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1374 "Zend/zend_language_scanner.l" +#line 1366 "Zend/zend_language_scanner.l" { return T_IS_SMALLER_OR_EQUAL; } -#line 3731 "Zend/zend_language_scanner.c" -yy259: - YYDEBUG(259, *YYCURSOR); +#line 3678 "Zend/zend_language_scanner.c" +yy255: + YYDEBUG(255, *YYCURSOR); ++YYCURSOR; -yy260: - YYDEBUG(260, *YYCURSOR); +yy256: + YYDEBUG(256, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1370 "Zend/zend_language_scanner.l" +#line 1362 "Zend/zend_language_scanner.l" { return T_IS_NOT_EQUAL; } -#line 3742 "Zend/zend_language_scanner.c" -yy261: - YYDEBUG(261, *YYCURSOR); +#line 3689 "Zend/zend_language_scanner.c" +yy257: + YYDEBUG(257, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy262; + if (yych == 'C') goto yy258; if (yych != 'c') goto yy194; -yy262: - YYDEBUG(262, *YYCURSOR); +yy258: + YYDEBUG(258, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy263; + if (yych == 'R') goto yy259; if (yych != 'r') goto yy194; -yy263: - YYDEBUG(263, *YYCURSOR); +yy259: + YYDEBUG(259, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy264; + if (yych == 'I') goto yy260; if (yych != 'i') goto yy194; -yy264: - YYDEBUG(264, *YYCURSOR); +yy260: + YYDEBUG(260, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'P') goto yy265; + if (yych == 'P') goto yy261; if (yych != 'p') goto yy194; -yy265: - YYDEBUG(265, *YYCURSOR); +yy261: + YYDEBUG(261, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy266; + if (yych == 'T') goto yy262; if (yych != 't') goto yy194; -yy266: - YYDEBUG(266, *YYCURSOR); +yy262: + YYDEBUG(262, *YYCURSOR); ++YYCURSOR; YYFILL(3); yych = *YYCURSOR; - YYDEBUG(267, *YYCURSOR); + YYDEBUG(263, *YYCURSOR); if (yych <= '\r') { if (yych <= 0x08) goto yy194; - if (yych <= '\n') goto yy266; + if (yych <= '\n') goto yy262; if (yych <= '\f') goto yy194; - goto yy266; + goto yy262; } else { if (yych <= ' ') { if (yych <= 0x1F) goto yy194; - goto yy266; + goto yy262; } else { if (yych == '>') goto yy206; goto yy194; } } -yy268: - YYDEBUG(268, *YYCURSOR); +yy264: + YYDEBUG(264, *YYCURSOR); ++YYCURSOR; - YYDEBUG(269, *YYCURSOR); + YYDEBUG(265, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1406 "Zend/zend_language_scanner.l" +#line 1398 "Zend/zend_language_scanner.l" { return T_SL_EQUAL; } -#line 3797 "Zend/zend_language_scanner.c" -yy270: - YYDEBUG(270, *YYCURSOR); +#line 3744 "Zend/zend_language_scanner.c" +yy266: + YYDEBUG(266, *YYCURSOR); ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; - YYDEBUG(271, *YYCURSOR); + YYDEBUG(267, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy270; + goto yy266; } if (yych <= 'Z') { if (yych <= '&') { - if (yych == '"') goto yy275; + if (yych == '"') goto yy271; goto yy194; } else { - if (yych <= '\'') goto yy274; + if (yych <= '\'') goto yy270; if (yych <= '@') goto yy194; } } else { if (yych <= '`') { if (yych != '_') goto yy194; } else { - if (yych <= 'z') goto yy272; + if (yych <= 'z') goto yy268; if (yych <= '~') goto yy194; } } -yy272: - YYDEBUG(272, *YYCURSOR); +yy268: + YYDEBUG(268, *YYCURSOR); ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; - YYDEBUG(273, *YYCURSOR); + YYDEBUG(269, *YYCURSOR); if (yych <= '@') { if (yych <= '\f') { - if (yych == '\n') goto yy279; + if (yych == '\n') goto yy275; goto yy194; } else { - if (yych <= '\r') goto yy281; + if (yych <= '\r') goto yy277; if (yych <= '/') goto yy194; - if (yych <= '9') goto yy272; + if (yych <= '9') goto yy268; goto yy194; } } else { if (yych <= '_') { - if (yych <= 'Z') goto yy272; + if (yych <= 'Z') goto yy268; if (yych <= '^') goto yy194; - goto yy272; + goto yy268; } else { if (yych <= '`') goto yy194; - if (yych <= 'z') goto yy272; + if (yych <= 'z') goto yy268; if (yych <= '~') goto yy194; - goto yy272; + goto yy268; } } -yy274: - YYDEBUG(274, *YYCURSOR); +yy270: + YYDEBUG(270, *YYCURSOR); yych = *++YYCURSOR; if (yych == '\'') goto yy194; - if (yych <= '/') goto yy283; + if (yych <= '/') goto yy279; if (yych <= '9') goto yy194; - goto yy283; -yy275: - YYDEBUG(275, *YYCURSOR); + goto yy279; +yy271: + YYDEBUG(271, *YYCURSOR); yych = *++YYCURSOR; if (yych == '"') goto yy194; - if (yych <= '/') goto yy277; + if (yych <= '/') goto yy273; if (yych <= '9') goto yy194; - goto yy277; -yy276: - YYDEBUG(276, *YYCURSOR); + goto yy273; +yy272: + YYDEBUG(272, *YYCURSOR); ++YYCURSOR; YYFILL(3); yych = *YYCURSOR; -yy277: - YYDEBUG(277, *YYCURSOR); +yy273: + YYDEBUG(273, *YYCURSOR); if (yych <= 'Z') { if (yych <= '/') { if (yych != '"') goto yy194; } else { - if (yych <= '9') goto yy276; + if (yych <= '9') goto yy272; if (yych <= '@') goto yy194; - goto yy276; + goto yy272; } } else { if (yych <= '`') { - if (yych == '_') goto yy276; + if (yych == '_') goto yy272; goto yy194; } else { - if (yych <= 'z') goto yy276; + if (yych <= 'z') goto yy272; if (yych <= '~') goto yy194; - goto yy276; + goto yy272; } } -yy278: - YYDEBUG(278, *YYCURSOR); +yy274: + YYDEBUG(274, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '\n') goto yy279; - if (yych == '\r') goto yy281; + if (yych == '\n') goto yy275; + if (yych == '\r') goto yy277; goto yy194; -yy279: - YYDEBUG(279, *YYCURSOR); +yy275: + YYDEBUG(275, *YYCURSOR); ++YYCURSOR; -yy280: - YYDEBUG(280, *YYCURSOR); +yy276: + YYDEBUG(276, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2121 "Zend/zend_language_scanner.l" +#line 2049 "Zend/zend_language_scanner.l" { char *s; int bprefix = (yytext[0] != '<') ? 1 : 0; @@ -3945,255 +3892,255 @@ yy280: return T_START_HEREDOC; } -#line 3949 "Zend/zend_language_scanner.c" -yy281: - YYDEBUG(281, *YYCURSOR); +#line 3896 "Zend/zend_language_scanner.c" +yy277: + YYDEBUG(277, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '\n') goto yy279; - goto yy280; -yy282: - YYDEBUG(282, *YYCURSOR); + if (yych == '\n') goto yy275; + goto yy276; +yy278: + YYDEBUG(278, *YYCURSOR); ++YYCURSOR; YYFILL(3); yych = *YYCURSOR; -yy283: - YYDEBUG(283, *YYCURSOR); +yy279: + YYDEBUG(279, *YYCURSOR); if (yych <= 'Z') { if (yych <= '/') { - if (yych == '\'') goto yy278; + if (yych == '\'') goto yy274; goto yy194; } else { - if (yych <= '9') goto yy282; + if (yych <= '9') goto yy278; if (yych <= '@') goto yy194; - goto yy282; + goto yy278; } } else { if (yych <= '`') { - if (yych == '_') goto yy282; + if (yych == '_') goto yy278; goto yy194; } else { - if (yych <= 'z') goto yy282; + if (yych <= 'z') goto yy278; if (yych <= '~') goto yy194; - goto yy282; + goto yy278; } } -yy284: - YYDEBUG(284, *YYCURSOR); +yy280: + YYDEBUG(280, *YYCURSOR); yych = *++YYCURSOR; - if (yych != '=') goto yy260; - YYDEBUG(285, *YYCURSOR); + if (yych != '=') goto yy256; + YYDEBUG(281, *YYCURSOR); ++YYCURSOR; - YYDEBUG(286, *YYCURSOR); + YYDEBUG(282, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1362 "Zend/zend_language_scanner.l" +#line 1354 "Zend/zend_language_scanner.l" { return T_IS_NOT_IDENTICAL; } -#line 3993 "Zend/zend_language_scanner.c" -yy287: - YYDEBUG(287, *YYCURSOR); +#line 3940 "Zend/zend_language_scanner.c" +yy283: + YYDEBUG(283, *YYCURSOR); ++YYCURSOR; - YYDEBUG(288, *YYCURSOR); + YYDEBUG(284, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1382 "Zend/zend_language_scanner.l" +#line 1374 "Zend/zend_language_scanner.l" { return T_PLUS_EQUAL; } -#line 4003 "Zend/zend_language_scanner.c" -yy289: - YYDEBUG(289, *YYCURSOR); +#line 3950 "Zend/zend_language_scanner.c" +yy285: + YYDEBUG(285, *YYCURSOR); ++YYCURSOR; - YYDEBUG(290, *YYCURSOR); + YYDEBUG(286, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1350 "Zend/zend_language_scanner.l" +#line 1342 "Zend/zend_language_scanner.l" { return T_INC; } -#line 4013 "Zend/zend_language_scanner.c" -yy291: - YYDEBUG(291, *YYCURSOR); +#line 3960 "Zend/zend_language_scanner.c" +yy287: + YYDEBUG(287, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy292; + if (yych == 'S') goto yy288; if (yych != 's') goto yy187; -yy292: - YYDEBUG(292, *YYCURSOR); +yy288: + YYDEBUG(288, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy293; + if (yych == 'T') goto yy289; if (yych != 't') goto yy187; -yy293: - YYDEBUG(293, *YYCURSOR); +yy289: + YYDEBUG(289, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(294, *YYCURSOR); + YYDEBUG(290, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1338 "Zend/zend_language_scanner.l" +#line 1330 "Zend/zend_language_scanner.l" { return T_LIST; } -#line 4036 "Zend/zend_language_scanner.c" -yy295: - YYDEBUG(295, *YYCURSOR); +#line 3983 "Zend/zend_language_scanner.c" +yy291: + YYDEBUG(291, *YYCURSOR); ++YYCURSOR; - if ((yych = *YYCURSOR) == '=') goto yy299; - YYDEBUG(296, *YYCURSOR); + if ((yych = *YYCURSOR) == '=') goto yy295; + YYDEBUG(292, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1366 "Zend/zend_language_scanner.l" +#line 1358 "Zend/zend_language_scanner.l" { return T_IS_EQUAL; } -#line 4047 "Zend/zend_language_scanner.c" -yy297: - YYDEBUG(297, *YYCURSOR); +#line 3994 "Zend/zend_language_scanner.c" +yy293: + YYDEBUG(293, *YYCURSOR); ++YYCURSOR; - YYDEBUG(298, *YYCURSOR); + YYDEBUG(294, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1334 "Zend/zend_language_scanner.l" +#line 1326 "Zend/zend_language_scanner.l" { return T_DOUBLE_ARROW; } -#line 4057 "Zend/zend_language_scanner.c" -yy299: - YYDEBUG(299, *YYCURSOR); +#line 4004 "Zend/zend_language_scanner.c" +yy295: + YYDEBUG(295, *YYCURSOR); ++YYCURSOR; - YYDEBUG(300, *YYCURSOR); + YYDEBUG(296, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1358 "Zend/zend_language_scanner.l" +#line 1350 "Zend/zend_language_scanner.l" { return T_IS_IDENTICAL; } -#line 4067 "Zend/zend_language_scanner.c" -yy301: - YYDEBUG(301, *YYCURSOR); +#line 4014 "Zend/zend_language_scanner.c" +yy297: + YYDEBUG(297, *YYCURSOR); yych = *++YYCURSOR; YYDEBUG(-1, yych); switch (yych) { case 'C': - case 'c': goto yy303; + case 'c': goto yy299; case 'D': - case 'd': goto yy308; + case 'd': goto yy304; case 'F': - case 'f': goto yy305; + case 'f': goto yy301; case 'H': - case 'h': goto yy302; + case 'h': goto yy298; case 'L': - case 'l': goto yy307; + case 'l': goto yy303; case 'M': - case 'm': goto yy306; + case 'm': goto yy302; case 'N': - case 'n': goto yy309; + case 'n': goto yy305; case 'T': - case 't': goto yy304; + case 't': goto yy300; default: goto yy187; } -yy302: - YYDEBUG(302, *YYCURSOR); +yy298: + YYDEBUG(298, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy370; - if (yych == 'a') goto yy370; + if (yych == 'A') goto yy366; + if (yych == 'a') goto yy366; goto yy187; -yy303: - YYDEBUG(303, *YYCURSOR); +yy299: + YYDEBUG(299, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy363; - if (yych == 'l') goto yy363; + if (yych == 'L') goto yy359; + if (yych == 'l') goto yy359; goto yy187; -yy304: - YYDEBUG(304, *YYCURSOR); +yy300: + YYDEBUG(300, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy356; - if (yych == 'r') goto yy356; + if (yych == 'R') goto yy352; + if (yych == 'r') goto yy352; goto yy187; -yy305: - YYDEBUG(305, *YYCURSOR); +yy301: + YYDEBUG(301, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { - if (yych == 'I') goto yy340; + if (yych == 'I') goto yy336; if (yych <= 'T') goto yy187; - goto yy341; + goto yy337; } else { if (yych <= 'i') { if (yych <= 'h') goto yy187; - goto yy340; + goto yy336; } else { - if (yych == 'u') goto yy341; + if (yych == 'u') goto yy337; goto yy187; } } +yy302: + YYDEBUG(302, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'E') goto yy328; + if (yych == 'e') goto yy328; + goto yy187; +yy303: + YYDEBUG(303, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'I') goto yy322; + if (yych == 'i') goto yy322; + goto yy187; +yy304: + YYDEBUG(304, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'I') goto yy317; + if (yych == 'i') goto yy317; + goto yy187; +yy305: + YYDEBUG(305, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'A') goto yy306; + if (yych != 'a') goto yy187; yy306: YYDEBUG(306, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy332; - if (yych == 'e') goto yy332; - goto yy187; + if (yych == 'M') goto yy307; + if (yych != 'm') goto yy187; yy307: YYDEBUG(307, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy326; - if (yych == 'i') goto yy326; - goto yy187; + if (yych == 'E') goto yy308; + if (yych != 'e') goto yy187; yy308: YYDEBUG(308, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy321; - if (yych == 'i') goto yy321; - goto yy187; + if (yych == 'S') goto yy309; + if (yych != 's') goto yy187; yy309: YYDEBUG(309, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy310; - if (yych != 'a') goto yy187; + if (yych == 'P') goto yy310; + if (yych != 'p') goto yy187; yy310: YYDEBUG(310, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'M') goto yy311; - if (yych != 'm') goto yy187; + if (yych == 'A') goto yy311; + if (yych != 'a') goto yy187; yy311: YYDEBUG(311, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy312; - if (yych != 'e') goto yy187; + if (yych == 'C') goto yy312; + if (yych != 'c') goto yy187; yy312: YYDEBUG(312, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy313; - if (yych != 's') goto yy187; + if (yych == 'E') goto yy313; + if (yych != 'e') goto yy187; yy313: YYDEBUG(313, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'P') goto yy314; - if (yych != 'p') goto yy187; -yy314: - YYDEBUG(314, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'A') goto yy315; - if (yych != 'a') goto yy187; -yy315: - YYDEBUG(315, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy316; - if (yych != 'c') goto yy187; -yy316: - YYDEBUG(316, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy317; - if (yych != 'e') goto yy187; -yy317: - YYDEBUG(317, *YYCURSOR); - yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(318, *YYCURSOR); + YYDEBUG(314, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(319, *YYCURSOR); + YYDEBUG(315, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(320, *YYCURSOR); + YYDEBUG(316, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1722 "Zend/zend_language_scanner.l" +#line 1668 "Zend/zend_language_scanner.l" { if (CG(current_namespace)) { *zendlval = *CG(current_namespace); @@ -4203,27 +4150,27 @@ yy317: } return T_NS_C; } -#line 4207 "Zend/zend_language_scanner.c" -yy321: - YYDEBUG(321, *YYCURSOR); +#line 4154 "Zend/zend_language_scanner.c" +yy317: + YYDEBUG(317, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy322; + if (yych == 'R') goto yy318; if (yych != 'r') goto yy187; -yy322: - YYDEBUG(322, *YYCURSOR); +yy318: + YYDEBUG(318, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(323, *YYCURSOR); + YYDEBUG(319, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(324, *YYCURSOR); + YYDEBUG(320, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(325, *YYCURSOR); + YYDEBUG(321, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1695 "Zend/zend_language_scanner.l" +#line 1643 "Zend/zend_language_scanner.l" { char *filename = zend_get_compiled_filename(TSRMLS_C); const size_t filename_len = strlen(filename); @@ -4245,91 +4192,80 @@ yy322: #endif } - zendlval->value.str.len = strlen(dirname); - zendlval->value.str.val = dirname; - zendlval->type = IS_STRING; + ZVAL_STRING(zendlval, dirname, 0); return T_DIR; } -#line 4254 "Zend/zend_language_scanner.c" -yy326: - YYDEBUG(326, *YYCURSOR); +#line 4199 "Zend/zend_language_scanner.c" +yy322: + YYDEBUG(322, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy327; + if (yych == 'N') goto yy323; if (yych != 'n') goto yy187; -yy327: - YYDEBUG(327, *YYCURSOR); +yy323: + YYDEBUG(323, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy328; + if (yych == 'E') goto yy324; if (yych != 'e') goto yy187; -yy328: - YYDEBUG(328, *YYCURSOR); +yy324: + YYDEBUG(324, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(329, *YYCURSOR); + YYDEBUG(325, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(330, *YYCURSOR); + YYDEBUG(326, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(331, *YYCURSOR); + YYDEBUG(327, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1677 "Zend/zend_language_scanner.l" +#line 1628 "Zend/zend_language_scanner.l" { - zendlval->value.lval = CG(zend_lineno); - zendlval->type = IS_LONG; + ZVAL_LONG(zendlval, CG(zend_lineno)); return T_LINE; } -#line 4285 "Zend/zend_language_scanner.c" -yy332: - YYDEBUG(332, *YYCURSOR); +#line 4229 "Zend/zend_language_scanner.c" +yy328: + YYDEBUG(328, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy333; + if (yych == 'T') goto yy329; if (yych != 't') goto yy187; -yy333: - YYDEBUG(333, *YYCURSOR); +yy329: + YYDEBUG(329, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy334; + if (yych == 'H') goto yy330; if (yych != 'h') goto yy187; -yy334: - YYDEBUG(334, *YYCURSOR); +yy330: + YYDEBUG(330, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy335; + if (yych == 'O') goto yy331; if (yych != 'o') goto yy187; -yy335: - YYDEBUG(335, *YYCURSOR); +yy331: + YYDEBUG(331, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'D') goto yy336; + if (yych == 'D') goto yy332; if (yych != 'd') goto yy187; -yy336: - YYDEBUG(336, *YYCURSOR); +yy332: + YYDEBUG(332, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(337, *YYCURSOR); + YYDEBUG(333, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(338, *YYCURSOR); + YYDEBUG(334, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(339, *YYCURSOR); + YYDEBUG(335, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1656 "Zend/zend_language_scanner.l" +#line 1615 "Zend/zend_language_scanner.l" { const char *class_name = CG(active_class_entry) ? CG(active_class_entry)->name : NULL; const 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.len = zend_spprintf(&zendlval->value.str.val, 0, "%s%s%s", + Z_STRLEN_P(zendlval) = zend_spprintf(&Z_STRVAL_P(zendlval), 0, "%s%s%s", class_name ? class_name : "", class_name && func_name ? "::" : "", func_name ? func_name : "" @@ -4337,266 +4273,263 @@ yy336: zendlval->type = IS_STRING; return T_METHOD_C; } -#line 4341 "Zend/zend_language_scanner.c" -yy340: - YYDEBUG(340, *YYCURSOR); +#line 4277 "Zend/zend_language_scanner.c" +yy336: + YYDEBUG(336, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy351; - if (yych == 'l') goto yy351; + if (yych == 'L') goto yy347; + if (yych == 'l') goto yy347; goto yy187; -yy341: - YYDEBUG(341, *YYCURSOR); +yy337: + YYDEBUG(337, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy342; + if (yych == 'N') goto yy338; if (yych != 'n') goto yy187; -yy342: - YYDEBUG(342, *YYCURSOR); +yy338: + YYDEBUG(338, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy343; + if (yych == 'C') goto yy339; if (yych != 'c') goto yy187; -yy343: - YYDEBUG(343, *YYCURSOR); +yy339: + YYDEBUG(339, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy344; + if (yych == 'T') goto yy340; if (yych != 't') goto yy187; -yy344: - YYDEBUG(344, *YYCURSOR); +yy340: + YYDEBUG(340, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy345; + if (yych == 'I') goto yy341; if (yych != 'i') goto yy187; -yy345: - YYDEBUG(345, *YYCURSOR); +yy341: + YYDEBUG(341, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy346; + if (yych == 'O') goto yy342; if (yych != 'o') goto yy187; -yy346: - YYDEBUG(346, *YYCURSOR); +yy342: + YYDEBUG(342, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy347; + if (yych == 'N') goto yy343; if (yych != 'n') goto yy187; -yy347: - YYDEBUG(347, *YYCURSOR); +yy343: + YYDEBUG(343, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(348, *YYCURSOR); + YYDEBUG(344, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(349, *YYCURSOR); + YYDEBUG(345, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(350, *YYCURSOR); + YYDEBUG(346, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1640 "Zend/zend_language_scanner.l" +#line 1605 "Zend/zend_language_scanner.l" { - const char *func_name = NULL; - - if (CG(active_op_array)) { - func_name = CG(active_op_array)->function_name; - } - - if (!func_name) { - func_name = ""; + zend_op_array *op_array = CG(active_op_array); + if (op_array && op_array->function_name) { + ZVAL_STRING(zendlval, op_array->function_name, 1); + } else { + ZVAL_EMPTY_STRING(zendlval); } - 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; } -#line 4408 "Zend/zend_language_scanner.c" -yy351: - YYDEBUG(351, *YYCURSOR); +#line 4338 "Zend/zend_language_scanner.c" +yy347: + YYDEBUG(347, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy352; + if (yych == 'E') goto yy348; if (yych != 'e') goto yy187; -yy352: - YYDEBUG(352, *YYCURSOR); +yy348: + YYDEBUG(348, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(353, *YYCURSOR); + YYDEBUG(349, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(354, *YYCURSOR); + YYDEBUG(350, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(355, *YYCURSOR); + YYDEBUG(351, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1683 "Zend/zend_language_scanner.l" +#line 1633 "Zend/zend_language_scanner.l" { 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; + ZVAL_STRING(zendlval, filename, 1); return T_FILE; } -#line 4440 "Zend/zend_language_scanner.c" -yy356: - YYDEBUG(356, *YYCURSOR); +#line 4368 "Zend/zend_language_scanner.c" +yy352: + YYDEBUG(352, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy357; + if (yych == 'A') goto yy353; if (yych != 'a') goto yy187; -yy357: - YYDEBUG(357, *YYCURSOR); +yy353: + YYDEBUG(353, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy358; + if (yych == 'I') goto yy354; if (yych != 'i') goto yy187; -yy358: - YYDEBUG(358, *YYCURSOR); +yy354: + YYDEBUG(354, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy359; + if (yych == 'T') goto yy355; if (yych != 't') goto yy187; -yy359: - YYDEBUG(359, *YYCURSOR); +yy355: + YYDEBUG(355, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(360, *YYCURSOR); + YYDEBUG(356, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(361, *YYCURSOR); + YYDEBUG(357, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(362, *YYCURSOR); + YYDEBUG(358, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1620 "Zend/zend_language_scanner.l" +#line 1595 "Zend/zend_language_scanner.l" { - const char *trait_name = NULL; - - if (CG(active_class_entry) - && (ZEND_ACC_TRAIT == - (CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT))) { - trait_name = CG(active_class_entry)->name; - } - - if (!trait_name) { - trait_name = ""; + zend_class_entry *ce = CG(active_class_entry); + if (ce && ce->name && ZEND_ACC_TRAIT == (ce->ce_flags & ZEND_ACC_TRAIT)) { + ZVAL_STRINGL(zendlval, ce->name, ce->name_length, 1); + } else { + ZVAL_EMPTY_STRING(zendlval); } - - zendlval->value.str.len = strlen(trait_name); - zendlval->value.str.val = estrndup(trait_name, zendlval->value.str.len); - zendlval->type = IS_STRING; - return T_TRAIT_C; } -#line 4490 "Zend/zend_language_scanner.c" -yy363: - YYDEBUG(363, *YYCURSOR); +#line 4408 "Zend/zend_language_scanner.c" +yy359: + YYDEBUG(359, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy364; + if (yych == 'A') goto yy360; if (yych != 'a') goto yy187; -yy364: - YYDEBUG(364, *YYCURSOR); +yy360: + YYDEBUG(360, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy365; + if (yych == 'S') goto yy361; if (yych != 's') goto yy187; -yy365: - YYDEBUG(365, *YYCURSOR); +yy361: + YYDEBUG(361, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy366; + if (yych == 'S') goto yy362; if (yych != 's') goto yy187; -yy366: - YYDEBUG(366, *YYCURSOR); +yy362: + YYDEBUG(362, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(367, *YYCURSOR); + YYDEBUG(363, *YYCURSOR); yych = *++YYCURSOR; if (yych != '_') goto yy187; - YYDEBUG(368, *YYCURSOR); + YYDEBUG(364, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(369, *YYCURSOR); + YYDEBUG(365, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1593 "Zend/zend_language_scanner.l" +#line 1577 "Zend/zend_language_scanner.l" { - const char *class_name = NULL; - - if (CG(active_class_entry) - && (ZEND_ACC_TRAIT == - (CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT))) { + zend_class_entry *ce = CG(active_class_entry); + if (ce && ZEND_ACC_TRAIT == (ce->ce_flags & ZEND_ACC_TRAIT)) { /* We create a special __CLASS__ constant that is going to be resolved at run-time */ - zendlval->value.str.len = sizeof("__CLASS__")-1; - zendlval->value.str.val = estrndup("__CLASS__", zendlval->value.str.len); + Z_STRLEN_P(zendlval) = sizeof("__CLASS__")-1; + Z_STRVAL_P(zendlval) = estrndup("__CLASS__", Z_STRLEN_P(zendlval)); zendlval->type = IS_CONSTANT; } else { - if (CG(active_class_entry)) { - class_name = CG(active_class_entry)->name; - } - - if (!class_name) { - class_name = ""; + if (ce && ce->name) { + ZVAL_STRINGL(zendlval, ce->name, ce->name_length, 1); + } else { + ZVAL_EMPTY_STRING(zendlval); } - - 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; } -#line 4547 "Zend/zend_language_scanner.c" +#line 4456 "Zend/zend_language_scanner.c" +yy366: + YYDEBUG(366, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'L') goto yy367; + if (yych != 'l') goto yy187; +yy367: + YYDEBUG(367, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'T') goto yy368; + if (yych != 't') goto yy187; +yy368: + YYDEBUG(368, *YYCURSOR); + yych = *++YYCURSOR; + if (yych != '_') goto yy187; + YYDEBUG(369, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'C') goto yy370; + if (yych != 'c') goto yy187; yy370: YYDEBUG(370, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy371; - if (yych != 'l') goto yy187; + if (yych == 'O') goto yy371; + if (yych != 'o') goto yy187; yy371: YYDEBUG(371, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy372; - if (yych != 't') goto yy187; + if (yych == 'M') goto yy372; + if (yych != 'm') goto yy187; yy372: YYDEBUG(372, *YYCURSOR); yych = *++YYCURSOR; - if (yych != '_') goto yy187; + if (yych == 'P') goto yy373; + if (yych != 'p') goto yy187; +yy373: YYDEBUG(373, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy374; - if (yych != 'c') goto yy187; + if (yych == 'I') goto yy374; + if (yych != 'i') goto yy187; yy374: YYDEBUG(374, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy375; - if (yych != 'o') goto yy187; + if (yych == 'L') goto yy375; + if (yych != 'l') goto yy187; yy375: YYDEBUG(375, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'M') goto yy376; - if (yych != 'm') goto yy187; + if (yych == 'E') goto yy376; + if (yych != 'e') goto yy187; yy376: YYDEBUG(376, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'P') goto yy377; - if (yych != 'p') goto yy187; + if (yych == 'R') goto yy377; + if (yych != 'r') goto yy187; yy377: YYDEBUG(377, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'I') goto yy378; - if (yych != 'i') goto yy187; -yy378: + ++YYCURSOR; + if (yybm[0+(yych = *YYCURSOR)] & 4) { + goto yy186; + } YYDEBUG(378, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'L') goto yy379; - if (yych != 'l') goto yy187; + yyleng = YYCURSOR - SCNG(yy_text); +#line 1294 "Zend/zend_language_scanner.l" + { + return T_HALT_COMPILER; +} +#line 4522 "Zend/zend_language_scanner.c" yy379: YYDEBUG(379, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy380; - if (yych != 'e') goto yy187; + if (yych == 'S') goto yy383; + if (yych == 's') goto yy383; + goto yy187; yy380: YYDEBUG(380, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy381; - if (yych != 'r') goto yy187; + if (yych == 'E') goto yy381; + if (yych != 'e') goto yy187; yy381: YYDEBUG(381, *YYCURSOR); ++YYCURSOR; @@ -4605,22 +4538,21 @@ yy381: } YYDEBUG(382, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1302 "Zend/zend_language_scanner.l" +#line 1274 "Zend/zend_language_scanner.l" { - return T_HALT_COMPILER; + return T_USE; } -#line 4613 "Zend/zend_language_scanner.c" +#line 4546 "Zend/zend_language_scanner.c" yy383: YYDEBUG(383, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy387; - if (yych == 's') goto yy387; - goto yy187; + if (yych == 'E') goto yy384; + if (yych != 'e') goto yy187; yy384: YYDEBUG(384, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy385; - if (yych != 'e') goto yy187; + if (yych == 'T') goto yy385; + if (yych != 't') goto yy187; yy385: YYDEBUG(385, *YYCURSOR); ++YYCURSOR; @@ -4629,742 +4561,743 @@ yy385: } YYDEBUG(386, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1282 "Zend/zend_language_scanner.l" +#line 1322 "Zend/zend_language_scanner.l" { - return T_USE; + return T_UNSET; } -#line 4637 "Zend/zend_language_scanner.c" +#line 4569 "Zend/zend_language_scanner.c" yy387: YYDEBUG(387, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy388; - if (yych != 'e') goto yy187; -yy388: - YYDEBUG(388, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy389; - if (yych != 't') goto yy187; -yy389: - YYDEBUG(389, *YYCURSOR); - ++YYCURSOR; - if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; - } - YYDEBUG(390, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 1330 "Zend/zend_language_scanner.l" - { - return T_UNSET; -} -#line 4660 "Zend/zend_language_scanner.c" -yy391: - YYDEBUG(391, *YYCURSOR); ++YYCURSOR; YYFILL(7); yych = *YYCURSOR; -yy392: - YYDEBUG(392, *YYCURSOR); +yy388: + YYDEBUG(388, *YYCURSOR); if (yych <= 'S') { if (yych <= 'D') { if (yych <= ' ') { - if (yych == '\t') goto yy391; + if (yych == '\t') goto yy387; if (yych <= 0x1F) goto yy194; - goto yy391; + goto yy387; } else { if (yych <= 'A') { if (yych <= '@') goto yy194; - goto yy396; + goto yy392; } else { - if (yych <= 'B') goto yy394; + if (yych <= 'B') goto yy390; if (yych <= 'C') goto yy194; - goto yy399; + goto yy395; } } } else { if (yych <= 'I') { - if (yych == 'F') goto yy400; + if (yych == 'F') goto yy396; if (yych <= 'H') goto yy194; - goto yy401; + goto yy397; } else { if (yych <= 'O') { if (yych <= 'N') goto yy194; - goto yy395; + goto yy391; } else { if (yych <= 'Q') goto yy194; - if (yych <= 'R') goto yy398; - goto yy397; + if (yych <= 'R') goto yy394; + goto yy393; } } } } else { if (yych <= 'f') { if (yych <= 'a') { - if (yych == 'U') goto yy393; + if (yych == 'U') goto yy389; if (yych <= '`') goto yy194; - goto yy396; + goto yy392; } else { if (yych <= 'c') { - if (yych <= 'b') goto yy394; + if (yych <= 'b') goto yy390; goto yy194; } else { - if (yych <= 'd') goto yy399; + if (yych <= 'd') goto yy395; if (yych <= 'e') goto yy194; - goto yy400; + goto yy396; } } } else { if (yych <= 'q') { if (yych <= 'i') { if (yych <= 'h') goto yy194; - goto yy401; + goto yy397; } else { - if (yych == 'o') goto yy395; + if (yych == 'o') goto yy391; goto yy194; } } else { if (yych <= 's') { - if (yych <= 'r') goto yy398; - goto yy397; + if (yych <= 'r') goto yy394; + goto yy393; } else { if (yych != 'u') goto yy194; } } } } -yy393: - YYDEBUG(393, *YYCURSOR); +yy389: + YYDEBUG(389, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy460; - if (yych == 'n') goto yy460; + if (yych == 'N') goto yy456; + if (yych == 'n') goto yy456; goto yy194; -yy394: - YYDEBUG(394, *YYCURSOR); +yy390: + YYDEBUG(390, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { - if (yych == 'I') goto yy447; + if (yych == 'I') goto yy443; if (yych <= 'N') goto yy194; - goto yy448; + goto yy444; } else { if (yych <= 'i') { if (yych <= 'h') goto yy194; - goto yy447; + goto yy443; } else { - if (yych == 'o') goto yy448; + if (yych == 'o') goto yy444; goto yy194; } } +yy391: + YYDEBUG(391, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'B') goto yy435; + if (yych == 'b') goto yy435; + goto yy194; +yy392: + YYDEBUG(392, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'R') goto yy428; + if (yych == 'r') goto yy428; + goto yy194; +yy393: + YYDEBUG(393, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'T') goto yy420; + if (yych == 't') goto yy420; + goto yy194; +yy394: + YYDEBUG(394, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'E') goto yy418; + if (yych == 'e') goto yy418; + goto yy194; yy395: YYDEBUG(395, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'B') goto yy439; - if (yych == 'b') goto yy439; + if (yych == 'O') goto yy414; + if (yych == 'o') goto yy414; goto yy194; yy396: YYDEBUG(396, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy432; - if (yych == 'r') goto yy432; + if (yych == 'L') goto yy407; + if (yych == 'l') goto yy407; goto yy194; yy397: YYDEBUG(397, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy424; - if (yych == 't') goto yy424; - goto yy194; + if (yych == 'N') goto yy398; + if (yych != 'n') goto yy194; yy398: YYDEBUG(398, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy422; - if (yych == 'e') goto yy422; - goto yy194; + if (yych == 'T') goto yy399; + if (yych != 't') goto yy194; yy399: YYDEBUG(399, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy418; - if (yych == 'o') goto yy418; - goto yy194; + if (yych == 'E') goto yy400; + if (yych != 'e') goto yy402; yy400: YYDEBUG(400, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy411; - if (yych == 'l') goto yy411; + if (yych == 'G') goto yy405; + if (yych == 'g') goto yy405; goto yy194; yy401: YYDEBUG(401, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy402; - if (yych != 'n') goto yy194; -yy402: - YYDEBUG(402, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy403; - if (yych != 't') goto yy194; -yy403: - YYDEBUG(403, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy404; - if (yych != 'e') goto yy406; -yy404: - YYDEBUG(404, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'G') goto yy409; - if (yych == 'g') goto yy409; - goto yy194; -yy405: - YYDEBUG(405, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy406: - YYDEBUG(406, *YYCURSOR); +yy402: + YYDEBUG(402, *YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy405; + if (yych == '\t') goto yy401; goto yy194; } else { - if (yych <= ' ') goto yy405; + if (yych <= ' ') goto yy401; if (yych != ')') goto yy194; } - YYDEBUG(407, *YYCURSOR); + YYDEBUG(403, *YYCURSOR); ++YYCURSOR; - YYDEBUG(408, *YYCURSOR); + YYDEBUG(404, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1230 "Zend/zend_language_scanner.l" +#line 1222 "Zend/zend_language_scanner.l" { return T_INT_CAST; } -#line 4836 "Zend/zend_language_scanner.c" -yy409: - YYDEBUG(409, *YYCURSOR); +#line 4745 "Zend/zend_language_scanner.c" +yy405: + YYDEBUG(405, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy410; + if (yych == 'E') goto yy406; if (yych != 'e') goto yy194; -yy410: - YYDEBUG(410, *YYCURSOR); +yy406: + YYDEBUG(406, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy405; - if (yych == 'r') goto yy405; + if (yych == 'R') goto yy401; + if (yych == 'r') goto yy401; goto yy194; -yy411: - YYDEBUG(411, *YYCURSOR); +yy407: + YYDEBUG(407, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy412; + if (yych == 'O') goto yy408; if (yych != 'o') goto yy194; -yy412: - YYDEBUG(412, *YYCURSOR); +yy408: + YYDEBUG(408, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy413; + if (yych == 'A') goto yy409; if (yych != 'a') goto yy194; -yy413: - YYDEBUG(413, *YYCURSOR); +yy409: + YYDEBUG(409, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy414; + if (yych == 'T') goto yy410; if (yych != 't') goto yy194; -yy414: - YYDEBUG(414, *YYCURSOR); +yy410: + YYDEBUG(410, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(415, *YYCURSOR); + YYDEBUG(411, *YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy414; + if (yych == '\t') goto yy410; goto yy194; } else { - if (yych <= ' ') goto yy414; + if (yych <= ' ') goto yy410; if (yych != ')') goto yy194; } - YYDEBUG(416, *YYCURSOR); + YYDEBUG(412, *YYCURSOR); ++YYCURSOR; - YYDEBUG(417, *YYCURSOR); + YYDEBUG(413, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1234 "Zend/zend_language_scanner.l" +#line 1226 "Zend/zend_language_scanner.l" { return T_DOUBLE_CAST; } -#line 4884 "Zend/zend_language_scanner.c" -yy418: - YYDEBUG(418, *YYCURSOR); +#line 4793 "Zend/zend_language_scanner.c" +yy414: + YYDEBUG(414, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'U') goto yy419; + if (yych == 'U') goto yy415; if (yych != 'u') goto yy194; -yy419: - YYDEBUG(419, *YYCURSOR); +yy415: + YYDEBUG(415, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'B') goto yy420; + if (yych == 'B') goto yy416; if (yych != 'b') goto yy194; -yy420: - YYDEBUG(420, *YYCURSOR); +yy416: + YYDEBUG(416, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy421; + if (yych == 'L') goto yy417; if (yych != 'l') goto yy194; -yy421: - YYDEBUG(421, *YYCURSOR); +yy417: + YYDEBUG(417, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy414; - if (yych == 'e') goto yy414; + if (yych == 'E') goto yy410; + if (yych == 'e') goto yy410; goto yy194; -yy422: - YYDEBUG(422, *YYCURSOR); +yy418: + YYDEBUG(418, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy423; + if (yych == 'A') goto yy419; if (yych != 'a') goto yy194; -yy423: - YYDEBUG(423, *YYCURSOR); +yy419: + YYDEBUG(419, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy414; - if (yych == 'l') goto yy414; + if (yych == 'L') goto yy410; + if (yych == 'l') goto yy410; goto yy194; -yy424: - YYDEBUG(424, *YYCURSOR); +yy420: + YYDEBUG(420, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy425; + if (yych == 'R') goto yy421; if (yych != 'r') goto yy194; -yy425: - YYDEBUG(425, *YYCURSOR); +yy421: + YYDEBUG(421, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy426; + if (yych == 'I') goto yy422; if (yych != 'i') goto yy194; -yy426: - YYDEBUG(426, *YYCURSOR); +yy422: + YYDEBUG(422, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy427; + if (yych == 'N') goto yy423; if (yych != 'n') goto yy194; -yy427: - YYDEBUG(427, *YYCURSOR); +yy423: + YYDEBUG(423, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'G') goto yy428; + if (yych == 'G') goto yy424; if (yych != 'g') goto yy194; -yy428: - YYDEBUG(428, *YYCURSOR); +yy424: + YYDEBUG(424, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(429, *YYCURSOR); + YYDEBUG(425, *YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy428; + if (yych == '\t') goto yy424; goto yy194; } else { - if (yych <= ' ') goto yy428; + if (yych <= ' ') goto yy424; if (yych != ')') goto yy194; } - YYDEBUG(430, *YYCURSOR); + YYDEBUG(426, *YYCURSOR); ++YYCURSOR; - YYDEBUG(431, *YYCURSOR); + YYDEBUG(427, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1238 "Zend/zend_language_scanner.l" +#line 1230 "Zend/zend_language_scanner.l" { return T_STRING_CAST; } -#line 4958 "Zend/zend_language_scanner.c" -yy432: - YYDEBUG(432, *YYCURSOR); +#line 4867 "Zend/zend_language_scanner.c" +yy428: + YYDEBUG(428, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy433; + if (yych == 'R') goto yy429; if (yych != 'r') goto yy194; -yy433: - YYDEBUG(433, *YYCURSOR); +yy429: + YYDEBUG(429, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy434; + if (yych == 'A') goto yy430; if (yych != 'a') goto yy194; -yy434: - YYDEBUG(434, *YYCURSOR); +yy430: + YYDEBUG(430, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'Y') goto yy435; + if (yych == 'Y') goto yy431; if (yych != 'y') goto yy194; -yy435: - YYDEBUG(435, *YYCURSOR); +yy431: + YYDEBUG(431, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(436, *YYCURSOR); + YYDEBUG(432, *YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy435; + if (yych == '\t') goto yy431; goto yy194; } else { - if (yych <= ' ') goto yy435; + if (yych <= ' ') goto yy431; if (yych != ')') goto yy194; } - YYDEBUG(437, *YYCURSOR); + YYDEBUG(433, *YYCURSOR); ++YYCURSOR; - YYDEBUG(438, *YYCURSOR); + YYDEBUG(434, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1242 "Zend/zend_language_scanner.l" +#line 1234 "Zend/zend_language_scanner.l" { return T_ARRAY_CAST; } -#line 4995 "Zend/zend_language_scanner.c" -yy439: - YYDEBUG(439, *YYCURSOR); +#line 4904 "Zend/zend_language_scanner.c" +yy435: + YYDEBUG(435, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'J') goto yy440; + if (yych == 'J') goto yy436; if (yych != 'j') goto yy194; -yy440: - YYDEBUG(440, *YYCURSOR); +yy436: + YYDEBUG(436, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy441; + if (yych == 'E') goto yy437; if (yych != 'e') goto yy194; -yy441: - YYDEBUG(441, *YYCURSOR); +yy437: + YYDEBUG(437, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy442; + if (yych == 'C') goto yy438; if (yych != 'c') goto yy194; -yy442: - YYDEBUG(442, *YYCURSOR); +yy438: + YYDEBUG(438, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy443; + if (yych == 'T') goto yy439; if (yych != 't') goto yy194; -yy443: - YYDEBUG(443, *YYCURSOR); +yy439: + YYDEBUG(439, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(444, *YYCURSOR); + YYDEBUG(440, *YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy443; + if (yych == '\t') goto yy439; goto yy194; } else { - if (yych <= ' ') goto yy443; + if (yych <= ' ') goto yy439; if (yych != ')') goto yy194; } - YYDEBUG(445, *YYCURSOR); + YYDEBUG(441, *YYCURSOR); ++YYCURSOR; - YYDEBUG(446, *YYCURSOR); + YYDEBUG(442, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1246 "Zend/zend_language_scanner.l" +#line 1238 "Zend/zend_language_scanner.l" { return T_OBJECT_CAST; } -#line 5037 "Zend/zend_language_scanner.c" -yy447: - YYDEBUG(447, *YYCURSOR); +#line 4946 "Zend/zend_language_scanner.c" +yy443: + YYDEBUG(443, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy457; - if (yych == 'n') goto yy457; + if (yych == 'N') goto yy453; + if (yych == 'n') goto yy453; goto yy194; -yy448: - YYDEBUG(448, *YYCURSOR); +yy444: + YYDEBUG(444, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy449; + if (yych == 'O') goto yy445; if (yych != 'o') goto yy194; -yy449: - YYDEBUG(449, *YYCURSOR); +yy445: + YYDEBUG(445, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy450; + if (yych == 'L') goto yy446; if (yych != 'l') goto yy194; -yy450: - YYDEBUG(450, *YYCURSOR); +yy446: + YYDEBUG(446, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy455; - if (yych == 'e') goto yy455; - goto yy452; -yy451: - YYDEBUG(451, *YYCURSOR); + if (yych == 'E') goto yy451; + if (yych == 'e') goto yy451; + goto yy448; +yy447: + YYDEBUG(447, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy452: - YYDEBUG(452, *YYCURSOR); +yy448: + YYDEBUG(448, *YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy451; + if (yych == '\t') goto yy447; goto yy194; } else { - if (yych <= ' ') goto yy451; + if (yych <= ' ') goto yy447; if (yych != ')') goto yy194; } - YYDEBUG(453, *YYCURSOR); + YYDEBUG(449, *YYCURSOR); ++YYCURSOR; - YYDEBUG(454, *YYCURSOR); + YYDEBUG(450, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1250 "Zend/zend_language_scanner.l" +#line 1242 "Zend/zend_language_scanner.l" { return T_BOOL_CAST; } -#line 5082 "Zend/zend_language_scanner.c" -yy455: - YYDEBUG(455, *YYCURSOR); +#line 4991 "Zend/zend_language_scanner.c" +yy451: + YYDEBUG(451, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy456; + if (yych == 'A') goto yy452; if (yych != 'a') goto yy194; -yy456: - YYDEBUG(456, *YYCURSOR); +yy452: + YYDEBUG(452, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy451; - if (yych == 'n') goto yy451; + if (yych == 'N') goto yy447; + if (yych == 'n') goto yy447; goto yy194; -yy457: - YYDEBUG(457, *YYCURSOR); +yy453: + YYDEBUG(453, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy458; + if (yych == 'A') goto yy454; if (yych != 'a') goto yy194; -yy458: - YYDEBUG(458, *YYCURSOR); +yy454: + YYDEBUG(454, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy459; + if (yych == 'R') goto yy455; if (yych != 'r') goto yy194; -yy459: - YYDEBUG(459, *YYCURSOR); +yy455: + YYDEBUG(455, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'Y') goto yy428; - if (yych == 'y') goto yy428; + if (yych == 'Y') goto yy424; + if (yych == 'y') goto yy424; goto yy194; -yy460: - YYDEBUG(460, *YYCURSOR); +yy456: + YYDEBUG(456, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy461; + if (yych == 'S') goto yy457; if (yych != 's') goto yy194; -yy461: - YYDEBUG(461, *YYCURSOR); +yy457: + YYDEBUG(457, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy462; + if (yych == 'E') goto yy458; if (yych != 'e') goto yy194; -yy462: - YYDEBUG(462, *YYCURSOR); +yy458: + YYDEBUG(458, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy463; + if (yych == 'T') goto yy459; if (yych != 't') goto yy194; -yy463: - YYDEBUG(463, *YYCURSOR); +yy459: + YYDEBUG(459, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(464, *YYCURSOR); + YYDEBUG(460, *YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy463; + if (yych == '\t') goto yy459; goto yy194; } else { - if (yych <= ' ') goto yy463; + if (yych <= ' ') goto yy459; if (yych != ')') goto yy194; } - YYDEBUG(465, *YYCURSOR); + YYDEBUG(461, *YYCURSOR); ++YYCURSOR; - YYDEBUG(466, *YYCURSOR); + YYDEBUG(462, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1254 "Zend/zend_language_scanner.l" +#line 1246 "Zend/zend_language_scanner.l" { return T_UNSET_CAST; } -#line 5146 "Zend/zend_language_scanner.c" -yy467: - YYDEBUG(467, *YYCURSOR); +#line 5055 "Zend/zend_language_scanner.c" +yy463: + YYDEBUG(463, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy468; + if (yych == 'R') goto yy464; if (yych != 'r') goto yy187; -yy468: - YYDEBUG(468, *YYCURSOR); +yy464: + YYDEBUG(464, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(469, *YYCURSOR); + YYDEBUG(465, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1226 "Zend/zend_language_scanner.l" +#line 1218 "Zend/zend_language_scanner.l" { return T_VAR; } -#line 5164 "Zend/zend_language_scanner.c" -yy470: - YYDEBUG(470, *YYCURSOR); +#line 5073 "Zend/zend_language_scanner.c" +yy466: + YYDEBUG(466, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'M') goto yy474; - if (yych == 'm') goto yy474; + if (yych == 'M') goto yy470; + if (yych == 'm') goto yy470; goto yy187; -yy471: - YYDEBUG(471, *YYCURSOR); +yy467: + YYDEBUG(467, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'W') goto yy472; + if (yych == 'W') goto yy468; if (yych != 'w') goto yy187; -yy472: - YYDEBUG(472, *YYCURSOR); +yy468: + YYDEBUG(468, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(473, *YYCURSOR); + YYDEBUG(469, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1218 "Zend/zend_language_scanner.l" +#line 1210 "Zend/zend_language_scanner.l" { return T_NEW; } -#line 5188 "Zend/zend_language_scanner.c" -yy474: - YYDEBUG(474, *YYCURSOR); +#line 5097 "Zend/zend_language_scanner.c" +yy470: + YYDEBUG(470, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy475; + if (yych == 'E') goto yy471; if (yych != 'e') goto yy187; -yy475: - YYDEBUG(475, *YYCURSOR); +yy471: + YYDEBUG(471, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy476; + if (yych == 'S') goto yy472; if (yych != 's') goto yy187; -yy476: - YYDEBUG(476, *YYCURSOR); +yy472: + YYDEBUG(472, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'P') goto yy477; + if (yych == 'P') goto yy473; if (yych != 'p') goto yy187; -yy477: - YYDEBUG(477, *YYCURSOR); +yy473: + YYDEBUG(473, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy478; + if (yych == 'A') goto yy474; if (yych != 'a') goto yy187; -yy478: - YYDEBUG(478, *YYCURSOR); +yy474: + YYDEBUG(474, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy479; + if (yych == 'C') goto yy475; if (yych != 'c') goto yy187; -yy479: - YYDEBUG(479, *YYCURSOR); +yy475: + YYDEBUG(475, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy480; + if (yych == 'E') goto yy476; if (yych != 'e') goto yy187; -yy480: - YYDEBUG(480, *YYCURSOR); +yy476: + YYDEBUG(476, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(481, *YYCURSOR); + YYDEBUG(477, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1278 "Zend/zend_language_scanner.l" +#line 1270 "Zend/zend_language_scanner.l" { return T_NAMESPACE; } -#line 5231 "Zend/zend_language_scanner.c" +#line 5140 "Zend/zend_language_scanner.c" +yy478: + YYDEBUG(478, *YYCURSOR); + yyaccept = 3; + YYMARKER = ++YYCURSOR; + YYFILL(3); + yych = *YYCURSOR; + YYDEBUG(479, *YYCURSOR); + if (yych <= 'D') { + if (yych <= '/') goto yy190; + if (yych <= '9') goto yy478; + goto yy190; + } else { + if (yych <= 'E') goto yy193; + if (yych == 'e') goto yy193; + goto yy190; + } +yy480: + YYDEBUG(480, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(481, *YYCURSOR); + yyleng = YYCURSOR - SCNG(yy_text); +#line 1390 "Zend/zend_language_scanner.l" + { + return T_CONCAT_EQUAL; +} +#line 5166 "Zend/zend_language_scanner.c" yy482: YYDEBUG(482, *YYCURSOR); - ++YYCURSOR; + yych = *++YYCURSOR; + if (yych != '.') goto yy194; YYDEBUG(483, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(484, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1210 "Zend/zend_language_scanner.l" +#line 1206 "Zend/zend_language_scanner.l" + { + return T_ELLIPSIS; +} +#line 5179 "Zend/zend_language_scanner.c" +yy485: + YYDEBUG(485, *YYCURSOR); + ++YYCURSOR; + YYDEBUG(486, *YYCURSOR); + yyleng = YYCURSOR - SCNG(yy_text); +#line 1198 "Zend/zend_language_scanner.l" { return T_PAAMAYIM_NEKUDOTAYIM; } -#line 5241 "Zend/zend_language_scanner.c" -yy484: - YYDEBUG(484, *YYCURSOR); +#line 5189 "Zend/zend_language_scanner.c" +yy487: + YYDEBUG(487, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy485: - YYDEBUG(485, *YYCURSOR); +yy488: + YYDEBUG(488, *YYCURSOR); if (yych <= '\f') { if (yych <= 0x08) goto yy141; - if (yych <= '\n') goto yy484; + if (yych <= '\n') goto yy487; goto yy141; } else { - if (yych <= '\r') goto yy484; - if (yych == ' ') goto yy484; + if (yych <= '\r') goto yy487; + if (yych == ' ') goto yy487; goto yy141; } -yy486: - YYDEBUG(486, *YYCURSOR); +yy489: + YYDEBUG(489, *YYCURSOR); ++YYCURSOR; - YYDEBUG(487, *YYCURSOR); + YYDEBUG(490, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1386 "Zend/zend_language_scanner.l" +#line 1378 "Zend/zend_language_scanner.l" { return T_MINUS_EQUAL; } -#line 5267 "Zend/zend_language_scanner.c" -yy488: - YYDEBUG(488, *YYCURSOR); +#line 5215 "Zend/zend_language_scanner.c" +yy491: + YYDEBUG(491, *YYCURSOR); ++YYCURSOR; - YYDEBUG(489, *YYCURSOR); + YYDEBUG(492, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1354 "Zend/zend_language_scanner.l" +#line 1346 "Zend/zend_language_scanner.l" { return T_DEC; } -#line 5277 "Zend/zend_language_scanner.c" -yy490: - YYDEBUG(490, *YYCURSOR); +#line 5225 "Zend/zend_language_scanner.c" +yy493: + YYDEBUG(493, *YYCURSOR); ++YYCURSOR; - YYDEBUG(491, *YYCURSOR); + YYDEBUG(494, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1180 "Zend/zend_language_scanner.l" +#line 1170 "Zend/zend_language_scanner.l" { yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC); return T_OBJECT_OPERATOR; } -#line 5288 "Zend/zend_language_scanner.c" -yy492: - YYDEBUG(492, *YYCURSOR); +#line 5236 "Zend/zend_language_scanner.c" +yy495: + YYDEBUG(495, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { - if (yych == 'I') goto yy499; + if (yych == 'I') goto yy502; if (yych <= 'N') goto yy187; - goto yy500; + goto yy503; } else { if (yych <= 'i') { if (yych <= 'h') goto yy187; - goto yy499; + goto yy502; } else { - if (yych == 'o') goto yy500; + if (yych == 'o') goto yy503; goto yy187; } } -yy493: - YYDEBUG(493, *YYCURSOR); +yy496: + YYDEBUG(496, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'B') goto yy494; + if (yych == 'B') goto yy497; if (yych != 'b') goto yy187; -yy494: - YYDEBUG(494, *YYCURSOR); +yy497: + YYDEBUG(497, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy495; + if (yych == 'L') goto yy498; if (yych != 'l') goto yy187; -yy495: - YYDEBUG(495, *YYCURSOR); +yy498: + YYDEBUG(498, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy496; + if (yych == 'I') goto yy499; if (yych != 'i') goto yy187; -yy496: - YYDEBUG(496, *YYCURSOR); +yy499: + YYDEBUG(499, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy497; + if (yych == 'C') goto yy500; if (yych != 'c') goto yy187; -yy497: - YYDEBUG(497, *YYCURSOR); +yy500: + YYDEBUG(500, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(498, *YYCURSOR); + YYDEBUG(501, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1326 "Zend/zend_language_scanner.l" +#line 1318 "Zend/zend_language_scanner.l" { return T_PUBLIC; } -#line 5337 "Zend/zend_language_scanner.c" -yy499: - YYDEBUG(499, *YYCURSOR); +#line 5285 "Zend/zend_language_scanner.c" +yy502: + YYDEBUG(502, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'V') { - if (yych == 'N') goto yy508; + if (yych == 'N') goto yy511; if (yych <= 'U') goto yy187; - goto yy509; + goto yy512; } else { if (yych <= 'n') { if (yych <= 'm') goto yy187; - goto yy508; + goto yy511; } else { - if (yych == 'v') goto yy509; + if (yych == 'v') goto yy512; goto yy187; } } -yy500: - YYDEBUG(500, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'T') goto yy501; - if (yych != 't') goto yy187; -yy501: - YYDEBUG(501, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy502; - if (yych != 'e') goto yy187; -yy502: - YYDEBUG(502, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy503; - if (yych != 'c') goto yy187; yy503: YYDEBUG(503, *YYCURSOR); yych = *++YYCURSOR; @@ -5378,1112 +5311,1112 @@ yy504: yy505: YYDEBUG(505, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'D') goto yy506; - if (yych != 'd') goto yy187; + if (yych == 'C') goto yy506; + if (yych != 'c') goto yy187; yy506: YYDEBUG(506, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'T') goto yy507; + if (yych != 't') goto yy187; +yy507: + YYDEBUG(507, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'E') goto yy508; + if (yych != 'e') goto yy187; +yy508: + YYDEBUG(508, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'D') goto yy509; + if (yych != 'd') goto yy187; +yy509: + YYDEBUG(509, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(507, *YYCURSOR); + YYDEBUG(510, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1322 "Zend/zend_language_scanner.l" +#line 1314 "Zend/zend_language_scanner.l" { return T_PROTECTED; } -#line 5396 "Zend/zend_language_scanner.c" -yy508: - YYDEBUG(508, *YYCURSOR); +#line 5344 "Zend/zend_language_scanner.c" +yy511: + YYDEBUG(511, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy514; - if (yych == 't') goto yy514; + if (yych == 'T') goto yy517; + if (yych == 't') goto yy517; goto yy187; -yy509: - YYDEBUG(509, *YYCURSOR); +yy512: + YYDEBUG(512, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy510; + if (yych == 'A') goto yy513; if (yych != 'a') goto yy187; -yy510: - YYDEBUG(510, *YYCURSOR); +yy513: + YYDEBUG(513, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy511; + if (yych == 'T') goto yy514; if (yych != 't') goto yy187; -yy511: - YYDEBUG(511, *YYCURSOR); +yy514: + YYDEBUG(514, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy512; + if (yych == 'E') goto yy515; if (yych != 'e') goto yy187; -yy512: - YYDEBUG(512, *YYCURSOR); +yy515: + YYDEBUG(515, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(513, *YYCURSOR); + YYDEBUG(516, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1318 "Zend/zend_language_scanner.l" +#line 1310 "Zend/zend_language_scanner.l" { return T_PRIVATE; } -#line 5430 "Zend/zend_language_scanner.c" -yy514: - YYDEBUG(514, *YYCURSOR); +#line 5378 "Zend/zend_language_scanner.c" +yy517: + YYDEBUG(517, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(515, *YYCURSOR); + YYDEBUG(518, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1156 "Zend/zend_language_scanner.l" +#line 1146 "Zend/zend_language_scanner.l" { return T_PRINT; } -#line 5443 "Zend/zend_language_scanner.c" -yy516: - YYDEBUG(516, *YYCURSOR); +#line 5391 "Zend/zend_language_scanner.c" +yy519: + YYDEBUG(519, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy521; - if (yych == 'o') goto yy521; + if (yych == 'O') goto yy524; + if (yych == 'o') goto yy524; goto yy187; -yy517: - YYDEBUG(517, *YYCURSOR); +yy520: + YYDEBUG(520, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy518; + if (yych == 'T') goto yy521; if (yych != 't') goto yy187; -yy518: - YYDEBUG(518, *YYCURSOR); +yy521: + YYDEBUG(521, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy519; + if (yych == 'O') goto yy522; if (yych != 'o') goto yy187; -yy519: - YYDEBUG(519, *YYCURSOR); +yy522: + YYDEBUG(522, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(520, *YYCURSOR); + YYDEBUG(523, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1148 "Zend/zend_language_scanner.l" +#line 1138 "Zend/zend_language_scanner.l" { return T_GOTO; } -#line 5472 "Zend/zend_language_scanner.c" -yy521: - YYDEBUG(521, *YYCURSOR); +#line 5420 "Zend/zend_language_scanner.c" +yy524: + YYDEBUG(524, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'B') goto yy522; + if (yych == 'B') goto yy525; if (yych != 'b') goto yy187; -yy522: - YYDEBUG(522, *YYCURSOR); +yy525: + YYDEBUG(525, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy523; + if (yych == 'A') goto yy526; if (yych != 'a') goto yy187; -yy523: - YYDEBUG(523, *YYCURSOR); +yy526: + YYDEBUG(526, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy524; + if (yych == 'L') goto yy527; if (yych != 'l') goto yy187; -yy524: - YYDEBUG(524, *YYCURSOR); +yy527: + YYDEBUG(527, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(525, *YYCURSOR); + YYDEBUG(528, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1290 "Zend/zend_language_scanner.l" +#line 1282 "Zend/zend_language_scanner.l" { return T_GLOBAL; } -#line 5500 "Zend/zend_language_scanner.c" -yy526: - YYDEBUG(526, *YYCURSOR); +#line 5448 "Zend/zend_language_scanner.c" +yy529: + YYDEBUG(529, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '<') goto yy534; + if (yych == '<') goto yy537; goto yy194; -yy527: - YYDEBUG(527, *YYCURSOR); +yy530: + YYDEBUG(530, *YYCURSOR); yych = *++YYCURSOR; goto yy181; -yy528: - YYDEBUG(528, *YYCURSOR); +yy531: + YYDEBUG(531, *YYCURSOR); yych = *++YYCURSOR; goto yy179; -yy529: - YYDEBUG(529, *YYCURSOR); +yy532: + YYDEBUG(532, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy530; + if (yych == 'E') goto yy533; if (yych != 'e') goto yy187; -yy530: - YYDEBUG(530, *YYCURSOR); +yy533: + YYDEBUG(533, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy531; + if (yych == 'A') goto yy534; if (yych != 'a') goto yy187; -yy531: - YYDEBUG(531, *YYCURSOR); +yy534: + YYDEBUG(534, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'K') goto yy532; + if (yych == 'K') goto yy535; if (yych != 'k') goto yy187; -yy532: - YYDEBUG(532, *YYCURSOR); +yy535: + YYDEBUG(535, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(533, *YYCURSOR); + YYDEBUG(536, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1140 "Zend/zend_language_scanner.l" +#line 1130 "Zend/zend_language_scanner.l" { return T_BREAK; } -#line 5541 "Zend/zend_language_scanner.c" -yy534: - YYDEBUG(534, *YYCURSOR); +#line 5489 "Zend/zend_language_scanner.c" +yy537: + YYDEBUG(537, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '<') goto yy270; + if (yych == '<') goto yy266; goto yy194; -yy535: - YYDEBUG(535, *YYCURSOR); +yy538: + YYDEBUG(538, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy542; - if (yych == 'a') goto yy542; + if (yych == 'A') goto yy545; + if (yych == 'a') goto yy545; goto yy187; -yy536: - YYDEBUG(536, *YYCURSOR); +yy539: + YYDEBUG(539, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy537; + if (yych == 'I') goto yy540; if (yych != 'i') goto yy187; -yy537: - YYDEBUG(537, *YYCURSOR); +yy540: + YYDEBUG(540, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy538; + if (yych == 'T') goto yy541; if (yych != 't') goto yy187; -yy538: - YYDEBUG(538, *YYCURSOR); +yy541: + YYDEBUG(541, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy539; + if (yych == 'C') goto yy542; if (yych != 'c') goto yy187; -yy539: - YYDEBUG(539, *YYCURSOR); +yy542: + YYDEBUG(542, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy540; + if (yych == 'H') goto yy543; if (yych != 'h') goto yy187; -yy540: - YYDEBUG(540, *YYCURSOR); +yy543: + YYDEBUG(543, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(541, *YYCURSOR); + YYDEBUG(544, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1124 "Zend/zend_language_scanner.l" +#line 1114 "Zend/zend_language_scanner.l" { return T_SWITCH; } -#line 5585 "Zend/zend_language_scanner.c" -yy542: - YYDEBUG(542, *YYCURSOR); +#line 5533 "Zend/zend_language_scanner.c" +yy545: + YYDEBUG(545, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy543; + if (yych == 'T') goto yy546; if (yych != 't') goto yy187; -yy543: - YYDEBUG(543, *YYCURSOR); +yy546: + YYDEBUG(546, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy544; + if (yych == 'I') goto yy547; if (yych != 'i') goto yy187; -yy544: - YYDEBUG(544, *YYCURSOR); +yy547: + YYDEBUG(547, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy545; + if (yych == 'C') goto yy548; if (yych != 'c') goto yy187; -yy545: - YYDEBUG(545, *YYCURSOR); +yy548: + YYDEBUG(548, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(546, *YYCURSOR); + YYDEBUG(549, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1306 "Zend/zend_language_scanner.l" +#line 1298 "Zend/zend_language_scanner.l" { return T_STATIC; } -#line 5613 "Zend/zend_language_scanner.c" -yy547: - YYDEBUG(547, *YYCURSOR); +#line 5561 "Zend/zend_language_scanner.c" +yy550: + YYDEBUG(550, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy558; - if (yych == 's') goto yy558; + if (yych == 'S') goto yy561; + if (yych == 's') goto yy561; goto yy187; -yy548: - YYDEBUG(548, *YYCURSOR); +yy551: + YYDEBUG(551, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'D') goto yy556; - if (yych == 'd') goto yy556; + if (yych == 'D') goto yy559; + if (yych == 'd') goto yy559; goto yy187; -yy549: - YYDEBUG(549, *YYCURSOR); +yy552: + YYDEBUG(552, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy552; - if (yych == 'r') goto yy552; + if (yych == 'R') goto yy555; + if (yych == 'r') goto yy555; goto yy187; -yy550: - YYDEBUG(550, *YYCURSOR); +yy553: + YYDEBUG(553, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(551, *YYCURSOR); + YYDEBUG(554, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1120 "Zend/zend_language_scanner.l" +#line 1110 "Zend/zend_language_scanner.l" { return T_AS; } -#line 5644 "Zend/zend_language_scanner.c" -yy552: - YYDEBUG(552, *YYCURSOR); +#line 5592 "Zend/zend_language_scanner.c" +yy555: + YYDEBUG(555, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy553; + if (yych == 'A') goto yy556; if (yych != 'a') goto yy187; -yy553: - YYDEBUG(553, *YYCURSOR); +yy556: + YYDEBUG(556, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'Y') goto yy554; + if (yych == 'Y') goto yy557; if (yych != 'y') goto yy187; -yy554: - YYDEBUG(554, *YYCURSOR); +yy557: + YYDEBUG(557, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(555, *YYCURSOR); + YYDEBUG(558, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1342 "Zend/zend_language_scanner.l" +#line 1334 "Zend/zend_language_scanner.l" { return T_ARRAY; } -#line 5667 "Zend/zend_language_scanner.c" -yy556: - YYDEBUG(556, *YYCURSOR); +#line 5615 "Zend/zend_language_scanner.c" +yy559: + YYDEBUG(559, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(557, *YYCURSOR); + YYDEBUG(560, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1438 "Zend/zend_language_scanner.l" +#line 1430 "Zend/zend_language_scanner.l" { return T_LOGICAL_AND; } -#line 5680 "Zend/zend_language_scanner.c" -yy558: - YYDEBUG(558, *YYCURSOR); +#line 5628 "Zend/zend_language_scanner.c" +yy561: + YYDEBUG(561, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy559; + if (yych == 'T') goto yy562; if (yych != 't') goto yy187; -yy559: - YYDEBUG(559, *YYCURSOR); +yy562: + YYDEBUG(562, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy560; + if (yych == 'R') goto yy563; if (yych != 'r') goto yy187; -yy560: - YYDEBUG(560, *YYCURSOR); +yy563: + YYDEBUG(563, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy561; + if (yych == 'A') goto yy564; if (yych != 'a') goto yy187; -yy561: - YYDEBUG(561, *YYCURSOR); +yy564: + YYDEBUG(564, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy562; + if (yych == 'C') goto yy565; if (yych != 'c') goto yy187; -yy562: - YYDEBUG(562, *YYCURSOR); +yy565: + YYDEBUG(565, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy563; + if (yych == 'T') goto yy566; if (yych != 't') goto yy187; -yy563: - YYDEBUG(563, *YYCURSOR); +yy566: + YYDEBUG(566, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(564, *YYCURSOR); + YYDEBUG(567, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1310 "Zend/zend_language_scanner.l" +#line 1302 "Zend/zend_language_scanner.l" { return T_ABSTRACT; } -#line 5718 "Zend/zend_language_scanner.c" -yy565: - YYDEBUG(565, *YYCURSOR); +#line 5666 "Zend/zend_language_scanner.c" +yy568: + YYDEBUG(568, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy566; + if (yych == 'I') goto yy569; if (yych != 'i') goto yy187; -yy566: - YYDEBUG(566, *YYCURSOR); +yy569: + YYDEBUG(569, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy567; + if (yych == 'L') goto yy570; if (yych != 'l') goto yy187; -yy567: - YYDEBUG(567, *YYCURSOR); +yy570: + YYDEBUG(570, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy568; + if (yych == 'E') goto yy571; if (yych != 'e') goto yy187; -yy568: - YYDEBUG(568, *YYCURSOR); +yy571: + YYDEBUG(571, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(569, *YYCURSOR); + YYDEBUG(572, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1080 "Zend/zend_language_scanner.l" +#line 1070 "Zend/zend_language_scanner.l" { return T_WHILE; } -#line 5746 "Zend/zend_language_scanner.c" -yy570: - YYDEBUG(570, *YYCURSOR); +#line 5694 "Zend/zend_language_scanner.c" +yy573: + YYDEBUG(573, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(571, *YYCURSOR); + YYDEBUG(574, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1064 "Zend/zend_language_scanner.l" +#line 1054 "Zend/zend_language_scanner.l" { return T_IF; } -#line 5759 "Zend/zend_language_scanner.c" -yy572: - YYDEBUG(572, *YYCURSOR); +#line 5707 "Zend/zend_language_scanner.c" +yy575: + YYDEBUG(575, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'P') goto yy614; - if (yych == 'p') goto yy614; + if (yych == 'P') goto yy617; + if (yych == 'p') goto yy617; goto yy187; -yy573: - YYDEBUG(573, *YYCURSOR); +yy576: + YYDEBUG(576, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= 'C') { if (yych <= 'B') goto yy187; - goto yy581; + goto yy584; } else { if (yych <= 'R') goto yy187; - if (yych <= 'S') goto yy579; - goto yy580; + if (yych <= 'S') goto yy582; + goto yy583; } } else { if (yych <= 'r') { - if (yych == 'c') goto yy581; + if (yych == 'c') goto yy584; goto yy187; } else { - if (yych <= 's') goto yy579; - if (yych <= 't') goto yy580; + if (yych <= 's') goto yy582; + if (yych <= 't') goto yy583; goto yy187; } } -yy574: - YYDEBUG(574, *YYCURSOR); +yy577: + YYDEBUG(577, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy575; + if (yych == 'S') goto yy578; if (yych != 's') goto yy187; -yy575: - YYDEBUG(575, *YYCURSOR); +yy578: + YYDEBUG(578, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy576; + if (yych == 'E') goto yy579; if (yych != 'e') goto yy187; -yy576: - YYDEBUG(576, *YYCURSOR); +yy579: + YYDEBUG(579, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy577; + if (yych == 'T') goto yy580; if (yych != 't') goto yy187; -yy577: - YYDEBUG(577, *YYCURSOR); +yy580: + YYDEBUG(580, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(578, *YYCURSOR); + YYDEBUG(581, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1294 "Zend/zend_language_scanner.l" +#line 1286 "Zend/zend_language_scanner.l" { return T_ISSET; } -#line 5815 "Zend/zend_language_scanner.c" -yy579: - YYDEBUG(579, *YYCURSOR); +#line 5763 "Zend/zend_language_scanner.c" +yy582: + YYDEBUG(582, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy600; - if (yych == 't') goto yy600; + if (yych == 'T') goto yy603; + if (yych == 't') goto yy603; goto yy187; -yy580: - YYDEBUG(580, *YYCURSOR); +yy583: + YYDEBUG(583, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy593; - if (yych == 'e') goto yy593; + if (yych == 'E') goto yy596; + if (yych == 'e') goto yy596; goto yy187; -yy581: - YYDEBUG(581, *YYCURSOR); +yy584: + YYDEBUG(584, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy582; + if (yych == 'L') goto yy585; if (yych != 'l') goto yy187; -yy582: - YYDEBUG(582, *YYCURSOR); +yy585: + YYDEBUG(585, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'U') goto yy583; + if (yych == 'U') goto yy586; if (yych != 'u') goto yy187; -yy583: - YYDEBUG(583, *YYCURSOR); +yy586: + YYDEBUG(586, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'D') goto yy584; + if (yych == 'D') goto yy587; if (yych != 'd') goto yy187; -yy584: - YYDEBUG(584, *YYCURSOR); +yy587: + YYDEBUG(587, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy585; + if (yych == 'E') goto yy588; if (yych != 'e') goto yy187; -yy585: - YYDEBUG(585, *YYCURSOR); +yy588: + YYDEBUG(588, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '^') { if (yych <= '9') { if (yych >= '0') goto yy186; } else { - if (yych <= '@') goto yy586; + if (yych <= '@') goto yy589; if (yych <= 'Z') goto yy186; } } else { if (yych <= '`') { - if (yych <= '_') goto yy587; + if (yych <= '_') goto yy590; } else { if (yych <= 'z') goto yy186; if (yych >= 0x7F) goto yy186; } } -yy586: - YYDEBUG(586, *YYCURSOR); +yy589: + YYDEBUG(589, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1262 "Zend/zend_language_scanner.l" +#line 1254 "Zend/zend_language_scanner.l" { return T_INCLUDE; } -#line 5873 "Zend/zend_language_scanner.c" -yy587: - YYDEBUG(587, *YYCURSOR); +#line 5821 "Zend/zend_language_scanner.c" +yy590: + YYDEBUG(590, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy588; + if (yych == 'O') goto yy591; if (yych != 'o') goto yy187; -yy588: - YYDEBUG(588, *YYCURSOR); +yy591: + YYDEBUG(591, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy589; + if (yych == 'N') goto yy592; if (yych != 'n') goto yy187; -yy589: - YYDEBUG(589, *YYCURSOR); +yy592: + YYDEBUG(592, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy590; + if (yych == 'C') goto yy593; if (yych != 'c') goto yy187; -yy590: - YYDEBUG(590, *YYCURSOR); +yy593: + YYDEBUG(593, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy591; + if (yych == 'E') goto yy594; if (yych != 'e') goto yy187; -yy591: - YYDEBUG(591, *YYCURSOR); +yy594: + YYDEBUG(594, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(592, *YYCURSOR); + YYDEBUG(595, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1266 "Zend/zend_language_scanner.l" +#line 1258 "Zend/zend_language_scanner.l" { return T_INCLUDE_ONCE; } -#line 5906 "Zend/zend_language_scanner.c" -yy593: - YYDEBUG(593, *YYCURSOR); +#line 5854 "Zend/zend_language_scanner.c" +yy596: + YYDEBUG(596, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy594; + if (yych == 'R') goto yy597; if (yych != 'r') goto yy187; -yy594: - YYDEBUG(594, *YYCURSOR); +yy597: + YYDEBUG(597, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'F') goto yy595; + if (yych == 'F') goto yy598; if (yych != 'f') goto yy187; -yy595: - YYDEBUG(595, *YYCURSOR); +yy598: + YYDEBUG(598, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy596; + if (yych == 'A') goto yy599; if (yych != 'a') goto yy187; -yy596: - YYDEBUG(596, *YYCURSOR); +yy599: + YYDEBUG(599, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy597; + if (yych == 'C') goto yy600; if (yych != 'c') goto yy187; -yy597: - YYDEBUG(597, *YYCURSOR); +yy600: + YYDEBUG(600, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy598; + if (yych == 'E') goto yy601; if (yych != 'e') goto yy187; -yy598: - YYDEBUG(598, *YYCURSOR); +yy601: + YYDEBUG(601, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(599, *YYCURSOR); + YYDEBUG(602, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1164 "Zend/zend_language_scanner.l" +#line 1154 "Zend/zend_language_scanner.l" { return T_INTERFACE; } -#line 5944 "Zend/zend_language_scanner.c" -yy600: - YYDEBUG(600, *YYCURSOR); +#line 5892 "Zend/zend_language_scanner.c" +yy603: + YYDEBUG(603, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'E') { - if (yych == 'A') goto yy601; + if (yych == 'A') goto yy604; if (yych <= 'D') goto yy187; - goto yy602; + goto yy605; } else { if (yych <= 'a') { if (yych <= '`') goto yy187; } else { - if (yych == 'e') goto yy602; + if (yych == 'e') goto yy605; goto yy187; } } -yy601: - YYDEBUG(601, *YYCURSOR); +yy604: + YYDEBUG(604, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy608; - if (yych == 'n') goto yy608; + if (yych == 'N') goto yy611; + if (yych == 'n') goto yy611; goto yy187; -yy602: - YYDEBUG(602, *YYCURSOR); +yy605: + YYDEBUG(605, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy603; + if (yych == 'A') goto yy606; if (yych != 'a') goto yy187; -yy603: - YYDEBUG(603, *YYCURSOR); +yy606: + YYDEBUG(606, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'D') goto yy604; + if (yych == 'D') goto yy607; if (yych != 'd') goto yy187; -yy604: - YYDEBUG(604, *YYCURSOR); +yy607: + YYDEBUG(607, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy605; + if (yych == 'O') goto yy608; if (yych != 'o') goto yy187; -yy605: - YYDEBUG(605, *YYCURSOR); +yy608: + YYDEBUG(608, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'F') goto yy606; + if (yych == 'F') goto yy609; if (yych != 'f') goto yy187; -yy606: - YYDEBUG(606, *YYCURSOR); +yy609: + YYDEBUG(609, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(607, *YYCURSOR); + YYDEBUG(610, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1286 "Zend/zend_language_scanner.l" +#line 1278 "Zend/zend_language_scanner.l" { return T_INSTEADOF; } -#line 5998 "Zend/zend_language_scanner.c" -yy608: - YYDEBUG(608, *YYCURSOR); +#line 5946 "Zend/zend_language_scanner.c" +yy611: + YYDEBUG(611, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy609; + if (yych == 'C') goto yy612; if (yych != 'c') goto yy187; -yy609: - YYDEBUG(609, *YYCURSOR); +yy612: + YYDEBUG(612, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy610; + if (yych == 'E') goto yy613; if (yych != 'e') goto yy187; -yy610: - YYDEBUG(610, *YYCURSOR); +yy613: + YYDEBUG(613, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy611; + if (yych == 'O') goto yy614; if (yych != 'o') goto yy187; -yy611: - YYDEBUG(611, *YYCURSOR); +yy614: + YYDEBUG(614, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'F') goto yy612; + if (yych == 'F') goto yy615; if (yych != 'f') goto yy187; -yy612: - YYDEBUG(612, *YYCURSOR); +yy615: + YYDEBUG(615, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(613, *YYCURSOR); + YYDEBUG(616, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1116 "Zend/zend_language_scanner.l" +#line 1106 "Zend/zend_language_scanner.l" { return T_INSTANCEOF; } -#line 6031 "Zend/zend_language_scanner.c" -yy614: - YYDEBUG(614, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'L') goto yy615; - if (yych != 'l') goto yy187; -yy615: - YYDEBUG(615, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy616; - if (yych != 'e') goto yy187; -yy616: - YYDEBUG(616, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'M') goto yy617; - if (yych != 'm') goto yy187; +#line 5979 "Zend/zend_language_scanner.c" yy617: YYDEBUG(617, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy618; - if (yych != 'e') goto yy187; + if (yych == 'L') goto yy618; + if (yych != 'l') goto yy187; yy618: YYDEBUG(618, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy619; - if (yych != 'n') goto yy187; + if (yych == 'E') goto yy619; + if (yych != 'e') goto yy187; yy619: YYDEBUG(619, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy620; - if (yych != 't') goto yy187; + if (yych == 'M') goto yy620; + if (yych != 'm') goto yy187; yy620: YYDEBUG(620, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy621; - if (yych != 's') goto yy187; + if (yych == 'E') goto yy621; + if (yych != 'e') goto yy187; yy621: YYDEBUG(621, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'N') goto yy622; + if (yych != 'n') goto yy187; +yy622: + YYDEBUG(622, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'T') goto yy623; + if (yych != 't') goto yy187; +yy623: + YYDEBUG(623, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'S') goto yy624; + if (yych != 's') goto yy187; +yy624: + YYDEBUG(624, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(622, *YYCURSOR); + YYDEBUG(625, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1176 "Zend/zend_language_scanner.l" +#line 1166 "Zend/zend_language_scanner.l" { return T_IMPLEMENTS; } -#line 6079 "Zend/zend_language_scanner.c" -yy623: - YYDEBUG(623, *YYCURSOR); +#line 6027 "Zend/zend_language_scanner.c" +yy626: + YYDEBUG(626, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy631; - if (yych == 'r') goto yy631; + if (yych == 'R') goto yy634; + if (yych == 'r') goto yy634; goto yy187; -yy624: - YYDEBUG(624, *YYCURSOR); +yy627: + YYDEBUG(627, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'Y') { - if (yych == 'A') goto yy627; + if (yych == 'A') goto yy630; if (yych <= 'X') goto yy187; } else { if (yych <= 'a') { if (yych <= '`') goto yy187; - goto yy627; + goto yy630; } else { if (yych != 'y') goto yy187; } } - YYDEBUG(625, *YYCURSOR); + YYDEBUG(628, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(626, *YYCURSOR); + YYDEBUG(629, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1048 "Zend/zend_language_scanner.l" +#line 1038 "Zend/zend_language_scanner.l" { return T_TRY; } -#line 6111 "Zend/zend_language_scanner.c" -yy627: - YYDEBUG(627, *YYCURSOR); +#line 6059 "Zend/zend_language_scanner.c" +yy630: + YYDEBUG(630, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy628; + if (yych == 'I') goto yy631; if (yych != 'i') goto yy187; -yy628: - YYDEBUG(628, *YYCURSOR); +yy631: + YYDEBUG(631, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy629; + if (yych == 'T') goto yy632; if (yych != 't') goto yy187; -yy629: - YYDEBUG(629, *YYCURSOR); +yy632: + YYDEBUG(632, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(630, *YYCURSOR); + YYDEBUG(633, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1168 "Zend/zend_language_scanner.l" +#line 1158 "Zend/zend_language_scanner.l" { return T_TRAIT; } -#line 6134 "Zend/zend_language_scanner.c" -yy631: - YYDEBUG(631, *YYCURSOR); +#line 6082 "Zend/zend_language_scanner.c" +yy634: + YYDEBUG(634, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy632; + if (yych == 'O') goto yy635; if (yych != 'o') goto yy187; -yy632: - YYDEBUG(632, *YYCURSOR); +yy635: + YYDEBUG(635, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'W') goto yy633; + if (yych == 'W') goto yy636; if (yych != 'w') goto yy187; -yy633: - YYDEBUG(633, *YYCURSOR); +yy636: + YYDEBUG(636, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(634, *YYCURSOR); + YYDEBUG(637, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1060 "Zend/zend_language_scanner.l" +#line 1050 "Zend/zend_language_scanner.l" { return T_THROW; } -#line 6157 "Zend/zend_language_scanner.c" -yy635: - YYDEBUG(635, *YYCURSOR); +#line 6105 "Zend/zend_language_scanner.c" +yy638: + YYDEBUG(638, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy636; + if (yych == 'E') goto yy639; if (yych != 'e') goto yy187; -yy636: - YYDEBUG(636, *YYCURSOR); +yy639: + YYDEBUG(639, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy637; + if (yych == 'L') goto yy640; if (yych != 'l') goto yy187; -yy637: - YYDEBUG(637, *YYCURSOR); +yy640: + YYDEBUG(640, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'D') goto yy638; + if (yych == 'D') goto yy641; if (yych != 'd') goto yy187; -yy638: - YYDEBUG(638, *YYCURSOR); +yy641: + YYDEBUG(641, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(639, *YYCURSOR); + YYDEBUG(642, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1044 "Zend/zend_language_scanner.l" +#line 1034 "Zend/zend_language_scanner.l" { return T_YIELD; } -#line 6185 "Zend/zend_language_scanner.c" -yy640: - YYDEBUG(640, *YYCURSOR); +#line 6133 "Zend/zend_language_scanner.c" +yy643: + YYDEBUG(643, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { - if (yych == 'Q') goto yy642; + if (yych == 'Q') goto yy645; if (yych <= 'S') goto yy187; } else { if (yych <= 'q') { if (yych <= 'p') goto yy187; - goto yy642; + goto yy645; } else { if (yych != 't') goto yy187; } } - YYDEBUG(641, *YYCURSOR); + YYDEBUG(644, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'U') goto yy654; - if (yych == 'u') goto yy654; + if (yych == 'U') goto yy657; + if (yych == 'u') goto yy657; goto yy187; -yy642: - YYDEBUG(642, *YYCURSOR); +yy645: + YYDEBUG(645, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'U') goto yy643; + if (yych == 'U') goto yy646; if (yych != 'u') goto yy187; -yy643: - YYDEBUG(643, *YYCURSOR); +yy646: + YYDEBUG(646, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy644; + if (yych == 'I') goto yy647; if (yych != 'i') goto yy187; -yy644: - YYDEBUG(644, *YYCURSOR); +yy647: + YYDEBUG(647, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy645; + if (yych == 'R') goto yy648; if (yych != 'r') goto yy187; -yy645: - YYDEBUG(645, *YYCURSOR); +yy648: + YYDEBUG(648, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy646; + if (yych == 'E') goto yy649; if (yych != 'e') goto yy187; -yy646: - YYDEBUG(646, *YYCURSOR); +yy649: + YYDEBUG(649, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '^') { if (yych <= '9') { if (yych >= '0') goto yy186; } else { - if (yych <= '@') goto yy647; + if (yych <= '@') goto yy650; if (yych <= 'Z') goto yy186; } } else { if (yych <= '`') { - if (yych <= '_') goto yy648; + if (yych <= '_') goto yy651; } else { if (yych <= 'z') goto yy186; if (yych >= 0x7F) goto yy186; } } -yy647: - YYDEBUG(647, *YYCURSOR); +yy650: + YYDEBUG(650, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1270 "Zend/zend_language_scanner.l" +#line 1262 "Zend/zend_language_scanner.l" { return T_REQUIRE; } -#line 6250 "Zend/zend_language_scanner.c" -yy648: - YYDEBUG(648, *YYCURSOR); +#line 6198 "Zend/zend_language_scanner.c" +yy651: + YYDEBUG(651, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy649; + if (yych == 'O') goto yy652; if (yych != 'o') goto yy187; -yy649: - YYDEBUG(649, *YYCURSOR); +yy652: + YYDEBUG(652, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy650; + if (yych == 'N') goto yy653; if (yych != 'n') goto yy187; -yy650: - YYDEBUG(650, *YYCURSOR); +yy653: + YYDEBUG(653, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy651; + if (yych == 'C') goto yy654; if (yych != 'c') goto yy187; -yy651: - YYDEBUG(651, *YYCURSOR); +yy654: + YYDEBUG(654, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy652; + if (yych == 'E') goto yy655; if (yych != 'e') goto yy187; -yy652: - YYDEBUG(652, *YYCURSOR); +yy655: + YYDEBUG(655, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(653, *YYCURSOR); + YYDEBUG(656, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1274 "Zend/zend_language_scanner.l" +#line 1266 "Zend/zend_language_scanner.l" { return T_REQUIRE_ONCE; } -#line 6283 "Zend/zend_language_scanner.c" -yy654: - YYDEBUG(654, *YYCURSOR); +#line 6231 "Zend/zend_language_scanner.c" +yy657: + YYDEBUG(657, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy655; + if (yych == 'R') goto yy658; if (yych != 'r') goto yy187; -yy655: - YYDEBUG(655, *YYCURSOR); +yy658: + YYDEBUG(658, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy656; + if (yych == 'N') goto yy659; if (yych != 'n') goto yy187; -yy656: - YYDEBUG(656, *YYCURSOR); +yy659: + YYDEBUG(659, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(657, *YYCURSOR); + YYDEBUG(660, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1040 "Zend/zend_language_scanner.l" +#line 1030 "Zend/zend_language_scanner.l" { return T_RETURN; } -#line 6306 "Zend/zend_language_scanner.c" -yy658: - YYDEBUG(658, *YYCURSOR); +#line 6254 "Zend/zend_language_scanner.c" +yy661: + YYDEBUG(661, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= 'L') { if (yych <= 'K') goto yy187; - goto yy681; + goto yy684; } else { if (yych <= 'R') goto yy187; - if (yych <= 'S') goto yy680; - goto yy679; + if (yych <= 'S') goto yy683; + goto yy682; } } else { if (yych <= 'r') { - if (yych == 'l') goto yy681; + if (yych == 'l') goto yy684; goto yy187; } else { - if (yych <= 's') goto yy680; - if (yych <= 't') goto yy679; + if (yych <= 's') goto yy683; + if (yych <= 't') goto yy682; goto yy187; } } -yy659: - YYDEBUG(659, *YYCURSOR); +yy662: + YYDEBUG(662, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { - if (yych == 'A') goto yy671; + if (yych == 'A') goto yy674; if (yych <= 'N') goto yy187; - goto yy672; + goto yy675; } else { if (yych <= 'a') { if (yych <= '`') goto yy187; - goto yy671; + goto yy674; } else { - if (yych == 'o') goto yy672; + if (yych == 'o') goto yy675; goto yy187; } } -yy660: - YYDEBUG(660, *YYCURSOR); +yy663: + YYDEBUG(663, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy661; + if (yych == 'N') goto yy664; if (yych != 'n') goto yy187; -yy661: - YYDEBUG(661, *YYCURSOR); +yy664: + YYDEBUG(664, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= 'R') goto yy187; - if (yych >= 'T') goto yy663; + if (yych >= 'T') goto yy666; } else { if (yych <= 'r') goto yy187; - if (yych <= 's') goto yy662; - if (yych <= 't') goto yy663; + if (yych <= 's') goto yy665; + if (yych <= 't') goto yy666; goto yy187; } -yy662: - YYDEBUG(662, *YYCURSOR); +yy665: + YYDEBUG(665, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy669; - if (yych == 't') goto yy669; + if (yych == 'T') goto yy672; + if (yych == 't') goto yy672; goto yy187; -yy663: - YYDEBUG(663, *YYCURSOR); +yy666: + YYDEBUG(666, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy664; + if (yych == 'I') goto yy667; if (yych != 'i') goto yy187; -yy664: - YYDEBUG(664, *YYCURSOR); +yy667: + YYDEBUG(667, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy665; + if (yych == 'N') goto yy668; if (yych != 'n') goto yy187; -yy665: - YYDEBUG(665, *YYCURSOR); +yy668: + YYDEBUG(668, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'U') goto yy666; + if (yych == 'U') goto yy669; if (yych != 'u') goto yy187; -yy666: - YYDEBUG(666, *YYCURSOR); +yy669: + YYDEBUG(669, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy667; + if (yych == 'E') goto yy670; if (yych != 'e') goto yy187; -yy667: - YYDEBUG(667, *YYCURSOR); +yy670: + YYDEBUG(670, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(668, *YYCURSOR); + YYDEBUG(671, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1144 "Zend/zend_language_scanner.l" +#line 1134 "Zend/zend_language_scanner.l" { return T_CONTINUE; } -#line 6400 "Zend/zend_language_scanner.c" -yy669: - YYDEBUG(669, *YYCURSOR); +#line 6348 "Zend/zend_language_scanner.c" +yy672: + YYDEBUG(672, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(670, *YYCURSOR); + YYDEBUG(673, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1036 "Zend/zend_language_scanner.l" +#line 1026 "Zend/zend_language_scanner.l" { return T_CONST; } -#line 6413 "Zend/zend_language_scanner.c" -yy671: - YYDEBUG(671, *YYCURSOR); +#line 6361 "Zend/zend_language_scanner.c" +yy674: + YYDEBUG(674, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy676; - if (yych == 's') goto yy676; + if (yych == 'S') goto yy679; + if (yych == 's') goto yy679; goto yy187; -yy672: - YYDEBUG(672, *YYCURSOR); +yy675: + YYDEBUG(675, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy673; + if (yych == 'N') goto yy676; if (yych != 'n') goto yy187; -yy673: - YYDEBUG(673, *YYCURSOR); +yy676: + YYDEBUG(676, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy674; + if (yych == 'E') goto yy677; if (yych != 'e') goto yy187; -yy674: - YYDEBUG(674, *YYCURSOR); +yy677: + YYDEBUG(677, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(675, *YYCURSOR); + YYDEBUG(678, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1222 "Zend/zend_language_scanner.l" +#line 1214 "Zend/zend_language_scanner.l" { return T_CLONE; } -#line 6442 "Zend/zend_language_scanner.c" -yy676: - YYDEBUG(676, *YYCURSOR); +#line 6390 "Zend/zend_language_scanner.c" +yy679: + YYDEBUG(679, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy677; + if (yych == 'S') goto yy680; if (yych != 's') goto yy187; -yy677: - YYDEBUG(677, *YYCURSOR); +yy680: + YYDEBUG(680, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(678, *YYCURSOR); + YYDEBUG(681, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1160 "Zend/zend_language_scanner.l" +#line 1150 "Zend/zend_language_scanner.l" { return T_CLASS; } -#line 6460 "Zend/zend_language_scanner.c" -yy679: - YYDEBUG(679, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'C') goto yy690; - if (yych == 'c') goto yy690; - goto yy187; -yy680: - YYDEBUG(680, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy688; - if (yych == 'e') goto yy688; - goto yy187; -yy681: - YYDEBUG(681, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'L') goto yy682; - if (yych != 'l') goto yy187; +#line 6408 "Zend/zend_language_scanner.c" yy682: YYDEBUG(682, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy683; - if (yych != 'a') goto yy187; + if (yych == 'C') goto yy693; + if (yych == 'c') goto yy693; + goto yy187; yy683: YYDEBUG(683, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'B') goto yy684; - if (yych != 'b') goto yy187; + if (yych == 'E') goto yy691; + if (yych == 'e') goto yy691; + goto yy187; yy684: YYDEBUG(684, *YYCURSOR); yych = *++YYCURSOR; @@ -6492,39 +6425,36 @@ yy684: yy685: YYDEBUG(685, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy686; - if (yych != 'e') goto yy187; + if (yych == 'A') goto yy686; + if (yych != 'a') goto yy187; yy686: YYDEBUG(686, *YYCURSOR); - ++YYCURSOR; - if (yybm[0+(yych = *YYCURSOR)] & 4) { - goto yy186; - } + yych = *++YYCURSOR; + if (yych == 'B') goto yy687; + if (yych != 'b') goto yy187; +yy687: YYDEBUG(687, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 1346 "Zend/zend_language_scanner.l" - { - return T_CALLABLE; -} -#line 6510 "Zend/zend_language_scanner.c" + yych = *++YYCURSOR; + if (yych == 'L') goto yy688; + if (yych != 'l') goto yy187; yy688: YYDEBUG(688, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'E') goto yy689; + if (yych != 'e') goto yy187; +yy689: + YYDEBUG(689, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(689, *YYCURSOR); + YYDEBUG(690, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1132 "Zend/zend_language_scanner.l" +#line 1338 "Zend/zend_language_scanner.l" { - return T_CASE; + return T_CALLABLE; } -#line 6523 "Zend/zend_language_scanner.c" -yy690: - YYDEBUG(690, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'H') goto yy691; - if (yych != 'h') goto yy187; +#line 6458 "Zend/zend_language_scanner.c" yy691: YYDEBUG(691, *YYCURSOR); ++YYCURSOR; @@ -6533,719 +6463,737 @@ yy691: } YYDEBUG(692, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1052 "Zend/zend_language_scanner.l" +#line 1122 "Zend/zend_language_scanner.l" { - return T_CATCH; + return T_CASE; } -#line 6541 "Zend/zend_language_scanner.c" +#line 6471 "Zend/zend_language_scanner.c" yy693: YYDEBUG(693, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy710; - if (yych == 'n') goto yy710; - goto yy187; + if (yych == 'H') goto yy694; + if (yych != 'h') goto yy187; yy694: YYDEBUG(694, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'R') goto yy703; - if (yych == 'r') goto yy703; - goto yy187; -yy695: + ++YYCURSOR; + if (yybm[0+(yych = *YYCURSOR)] & 4) { + goto yy186; + } YYDEBUG(695, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'N') goto yy696; - if (yych != 'n') goto yy187; + yyleng = YYCURSOR - SCNG(yy_text); +#line 1042 "Zend/zend_language_scanner.l" + { + return T_CATCH; +} +#line 6489 "Zend/zend_language_scanner.c" yy696: YYDEBUG(696, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy697; - if (yych != 'c') goto yy187; + if (yych == 'N') goto yy713; + if (yych == 'n') goto yy713; + goto yy187; yy697: YYDEBUG(697, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy698; - if (yych != 't') goto yy187; + if (yych == 'R') goto yy706; + if (yych == 'r') goto yy706; + goto yy187; yy698: YYDEBUG(698, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy699; - if (yych != 'i') goto yy187; + if (yych == 'N') goto yy699; + if (yych != 'n') goto yy187; yy699: YYDEBUG(699, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy700; - if (yych != 'o') goto yy187; + if (yych == 'C') goto yy700; + if (yych != 'c') goto yy187; yy700: YYDEBUG(700, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy701; - if (yych != 'n') goto yy187; + if (yych == 'T') goto yy701; + if (yych != 't') goto yy187; yy701: YYDEBUG(701, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'I') goto yy702; + if (yych != 'i') goto yy187; +yy702: + YYDEBUG(702, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'O') goto yy703; + if (yych != 'o') goto yy187; +yy703: + YYDEBUG(703, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'N') goto yy704; + if (yych != 'n') goto yy187; +yy704: + YYDEBUG(704, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(702, *YYCURSOR); + YYDEBUG(705, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1032 "Zend/zend_language_scanner.l" +#line 1022 "Zend/zend_language_scanner.l" { return T_FUNCTION; } -#line 6596 "Zend/zend_language_scanner.c" -yy703: - YYDEBUG(703, *YYCURSOR); +#line 6544 "Zend/zend_language_scanner.c" +yy706: + YYDEBUG(706, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '^') { if (yych <= '@') { - if (yych <= '/') goto yy704; + if (yych <= '/') goto yy707; if (yych <= '9') goto yy186; } else { - if (yych == 'E') goto yy705; + if (yych == 'E') goto yy708; if (yych <= 'Z') goto yy186; } } else { if (yych <= 'd') { if (yych != '`') goto yy186; } else { - if (yych <= 'e') goto yy705; + if (yych <= 'e') goto yy708; if (yych <= 'z') goto yy186; if (yych >= 0x7F) goto yy186; } } -yy704: - YYDEBUG(704, *YYCURSOR); +yy707: + YYDEBUG(707, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1092 "Zend/zend_language_scanner.l" +#line 1082 "Zend/zend_language_scanner.l" { return T_FOR; } -#line 6624 "Zend/zend_language_scanner.c" -yy705: - YYDEBUG(705, *YYCURSOR); +#line 6572 "Zend/zend_language_scanner.c" +yy708: + YYDEBUG(708, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy706; + if (yych == 'A') goto yy709; if (yych != 'a') goto yy187; -yy706: - YYDEBUG(706, *YYCURSOR); +yy709: + YYDEBUG(709, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy707; + if (yych == 'C') goto yy710; if (yych != 'c') goto yy187; -yy707: - YYDEBUG(707, *YYCURSOR); +yy710: + YYDEBUG(710, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy708; + if (yych == 'H') goto yy711; if (yych != 'h') goto yy187; -yy708: - YYDEBUG(708, *YYCURSOR); +yy711: + YYDEBUG(711, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(709, *YYCURSOR); + YYDEBUG(712, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1100 "Zend/zend_language_scanner.l" +#line 1090 "Zend/zend_language_scanner.l" { return T_FOREACH; } -#line 6652 "Zend/zend_language_scanner.c" -yy710: - YYDEBUG(710, *YYCURSOR); +#line 6600 "Zend/zend_language_scanner.c" +yy713: + YYDEBUG(713, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy711; + if (yych == 'A') goto yy714; if (yych != 'a') goto yy187; -yy711: - YYDEBUG(711, *YYCURSOR); +yy714: + YYDEBUG(714, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy712; + if (yych == 'L') goto yy715; if (yych != 'l') goto yy187; -yy712: - YYDEBUG(712, *YYCURSOR); +yy715: + YYDEBUG(715, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '^') { if (yych <= '@') { - if (yych <= '/') goto yy713; + if (yych <= '/') goto yy716; if (yych <= '9') goto yy186; } else { - if (yych == 'L') goto yy714; + if (yych == 'L') goto yy717; if (yych <= 'Z') goto yy186; } } else { if (yych <= 'k') { if (yych != '`') goto yy186; } else { - if (yych <= 'l') goto yy714; + if (yych <= 'l') goto yy717; if (yych <= 'z') goto yy186; if (yych >= 0x7F) goto yy186; } } -yy713: - YYDEBUG(713, *YYCURSOR); +yy716: + YYDEBUG(716, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1314 "Zend/zend_language_scanner.l" +#line 1306 "Zend/zend_language_scanner.l" { return T_FINAL; } -#line 6690 "Zend/zend_language_scanner.c" -yy714: - YYDEBUG(714, *YYCURSOR); +#line 6638 "Zend/zend_language_scanner.c" +yy717: + YYDEBUG(717, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'Y') goto yy715; + if (yych == 'Y') goto yy718; if (yych != 'y') goto yy187; -yy715: - YYDEBUG(715, *YYCURSOR); +yy718: + YYDEBUG(718, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(716, *YYCURSOR); + YYDEBUG(719, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1056 "Zend/zend_language_scanner.l" +#line 1046 "Zend/zend_language_scanner.l" { return T_FINALLY; } -#line 6708 "Zend/zend_language_scanner.c" -yy717: - YYDEBUG(717, *YYCURSOR); +#line 6656 "Zend/zend_language_scanner.c" +yy720: + YYDEBUG(720, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'F') { - if (yych == 'C') goto yy723; + if (yych == 'C') goto yy726; if (yych <= 'E') goto yy187; - goto yy724; + goto yy727; } else { if (yych <= 'c') { if (yych <= 'b') goto yy187; - goto yy723; + goto yy726; } else { - if (yych == 'f') goto yy724; + if (yych == 'f') goto yy727; goto yy187; } } -yy718: - YYDEBUG(718, *YYCURSOR); +yy721: + YYDEBUG(721, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy721; - if (yych == 'e') goto yy721; + if (yych == 'E') goto yy724; + if (yych == 'e') goto yy724; goto yy187; -yy719: - YYDEBUG(719, *YYCURSOR); +yy722: + YYDEBUG(722, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(720, *YYCURSOR); + YYDEBUG(723, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1088 "Zend/zend_language_scanner.l" +#line 1078 "Zend/zend_language_scanner.l" { return T_DO; } -#line 6743 "Zend/zend_language_scanner.c" -yy721: - YYDEBUG(721, *YYCURSOR); +#line 6691 "Zend/zend_language_scanner.c" +yy724: + YYDEBUG(724, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(722, *YYCURSOR); + YYDEBUG(725, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1028 "Zend/zend_language_scanner.l" +#line 1018 "Zend/zend_language_scanner.l" { return T_EXIT; } -#line 6756 "Zend/zend_language_scanner.c" -yy723: - YYDEBUG(723, *YYCURSOR); +#line 6704 "Zend/zend_language_scanner.c" +yy726: + YYDEBUG(726, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy730; - if (yych == 'l') goto yy730; + if (yych == 'L') goto yy733; + if (yych == 'l') goto yy733; goto yy187; -yy724: - YYDEBUG(724, *YYCURSOR); +yy727: + YYDEBUG(727, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy725; + if (yych == 'A') goto yy728; if (yych != 'a') goto yy187; -yy725: - YYDEBUG(725, *YYCURSOR); +yy728: + YYDEBUG(728, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'U') goto yy726; + if (yych == 'U') goto yy729; if (yych != 'u') goto yy187; -yy726: - YYDEBUG(726, *YYCURSOR); +yy729: + YYDEBUG(729, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy727; + if (yych == 'L') goto yy730; if (yych != 'l') goto yy187; -yy727: - YYDEBUG(727, *YYCURSOR); +yy730: + YYDEBUG(730, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy728; + if (yych == 'T') goto yy731; if (yych != 't') goto yy187; -yy728: - YYDEBUG(728, *YYCURSOR); +yy731: + YYDEBUG(731, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(729, *YYCURSOR); + YYDEBUG(732, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1136 "Zend/zend_language_scanner.l" +#line 1126 "Zend/zend_language_scanner.l" { return T_DEFAULT; } -#line 6795 "Zend/zend_language_scanner.c" -yy730: - YYDEBUG(730, *YYCURSOR); +#line 6743 "Zend/zend_language_scanner.c" +yy733: + YYDEBUG(733, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy731; + if (yych == 'A') goto yy734; if (yych != 'a') goto yy187; -yy731: - YYDEBUG(731, *YYCURSOR); +yy734: + YYDEBUG(734, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy732; + if (yych == 'R') goto yy735; if (yych != 'r') goto yy187; -yy732: - YYDEBUG(732, *YYCURSOR); +yy735: + YYDEBUG(735, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy733; + if (yych == 'E') goto yy736; if (yych != 'e') goto yy187; -yy733: - YYDEBUG(733, *YYCURSOR); +yy736: + YYDEBUG(736, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(734, *YYCURSOR); + YYDEBUG(737, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1108 "Zend/zend_language_scanner.l" +#line 1098 "Zend/zend_language_scanner.l" { return T_DECLARE; } -#line 6823 "Zend/zend_language_scanner.c" -yy735: - YYDEBUG(735, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'H') goto yy797; - if (yych == 'h') goto yy797; - goto yy187; -yy736: - YYDEBUG(736, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'S') goto yy791; - if (yych == 's') goto yy791; - goto yy187; -yy737: - YYDEBUG(737, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'P') goto yy787; - if (yych == 'p') goto yy787; - goto yy187; +#line 6771 "Zend/zend_language_scanner.c" yy738: YYDEBUG(738, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'D') goto yy753; - if (yych == 'd') goto yy753; + if (yych == 'H') goto yy800; + if (yych == 'h') goto yy800; goto yy187; yy739: YYDEBUG(739, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy750; - if (yych == 'a') goto yy750; + if (yych == 'S') goto yy794; + if (yych == 's') goto yy794; goto yy187; yy740: YYDEBUG(740, *YYCURSOR); yych = *++YYCURSOR; + if (yych == 'P') goto yy790; + if (yych == 'p') goto yy790; + goto yy187; +yy741: + YYDEBUG(741, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'D') goto yy756; + if (yych == 'd') goto yy756; + goto yy187; +yy742: + YYDEBUG(742, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'A') goto yy753; + if (yych == 'a') goto yy753; + goto yy187; +yy743: + YYDEBUG(743, *YYCURSOR); + yych = *++YYCURSOR; if (yych <= 'T') { - if (yych == 'I') goto yy741; + if (yych == 'I') goto yy744; if (yych <= 'S') goto yy187; - goto yy742; + goto yy745; } else { if (yych <= 'i') { if (yych <= 'h') goto yy187; } else { - if (yych == 't') goto yy742; + if (yych == 't') goto yy745; goto yy187; } } -yy741: - YYDEBUG(741, *YYCURSOR); +yy744: + YYDEBUG(744, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy748; - if (yych == 't') goto yy748; + if (yych == 'T') goto yy751; + if (yych == 't') goto yy751; goto yy187; -yy742: - YYDEBUG(742, *YYCURSOR); +yy745: + YYDEBUG(745, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy743; + if (yych == 'E') goto yy746; if (yych != 'e') goto yy187; -yy743: - YYDEBUG(743, *YYCURSOR); +yy746: + YYDEBUG(746, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'N') goto yy744; + if (yych == 'N') goto yy747; if (yych != 'n') goto yy187; -yy744: - YYDEBUG(744, *YYCURSOR); +yy747: + YYDEBUG(747, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'D') goto yy745; + if (yych == 'D') goto yy748; if (yych != 'd') goto yy187; -yy745: - YYDEBUG(745, *YYCURSOR); +yy748: + YYDEBUG(748, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'S') goto yy746; + if (yych == 'S') goto yy749; if (yych != 's') goto yy187; -yy746: - YYDEBUG(746, *YYCURSOR); +yy749: + YYDEBUG(749, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(747, *YYCURSOR); + YYDEBUG(750, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1172 "Zend/zend_language_scanner.l" +#line 1162 "Zend/zend_language_scanner.l" { return T_EXTENDS; } -#line 6907 "Zend/zend_language_scanner.c" -yy748: - YYDEBUG(748, *YYCURSOR); +#line 6855 "Zend/zend_language_scanner.c" +yy751: + YYDEBUG(751, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(749, *YYCURSOR); + YYDEBUG(752, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1024 "Zend/zend_language_scanner.l" +#line 1014 "Zend/zend_language_scanner.l" { return T_EXIT; } -#line 6920 "Zend/zend_language_scanner.c" -yy750: - YYDEBUG(750, *YYCURSOR); +#line 6868 "Zend/zend_language_scanner.c" +yy753: + YYDEBUG(753, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy751; + if (yych == 'L') goto yy754; if (yych != 'l') goto yy187; -yy751: - YYDEBUG(751, *YYCURSOR); +yy754: + YYDEBUG(754, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(752, *YYCURSOR); + YYDEBUG(755, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1258 "Zend/zend_language_scanner.l" +#line 1250 "Zend/zend_language_scanner.l" { return T_EVAL; } -#line 6938 "Zend/zend_language_scanner.c" -yy753: - YYDEBUG(753, *YYCURSOR); +#line 6886 "Zend/zend_language_scanner.c" +yy756: + YYDEBUG(756, *YYCURSOR); yych = *++YYCURSOR; YYDEBUG(-1, yych); switch (yych) { case 'D': - case 'd': goto yy754; + case 'd': goto yy757; case 'F': - case 'f': goto yy755; + case 'f': goto yy758; case 'I': - case 'i': goto yy756; + case 'i': goto yy759; case 'S': - case 's': goto yy757; + case 's': goto yy760; case 'W': - case 'w': goto yy758; + case 'w': goto yy761; default: goto yy187; } -yy754: - YYDEBUG(754, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'E') goto yy780; - if (yych == 'e') goto yy780; - goto yy187; -yy755: - YYDEBUG(755, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'O') goto yy772; - if (yych == 'o') goto yy772; - goto yy187; -yy756: - YYDEBUG(756, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == 'F') goto yy770; - if (yych == 'f') goto yy770; - goto yy187; yy757: YYDEBUG(757, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'W') goto yy764; - if (yych == 'w') goto yy764; + if (yych == 'E') goto yy783; + if (yych == 'e') goto yy783; goto yy187; yy758: YYDEBUG(758, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy759; - if (yych != 'h') goto yy187; + if (yych == 'O') goto yy775; + if (yych == 'o') goto yy775; + goto yy187; yy759: YYDEBUG(759, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy760; - if (yych != 'i') goto yy187; + if (yych == 'F') goto yy773; + if (yych == 'f') goto yy773; + goto yy187; yy760: YYDEBUG(760, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy761; - if (yych != 'l') goto yy187; + if (yych == 'W') goto yy767; + if (yych == 'w') goto yy767; + goto yy187; yy761: YYDEBUG(761, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy762; - if (yych != 'e') goto yy187; + if (yych == 'H') goto yy762; + if (yych != 'h') goto yy187; yy762: YYDEBUG(762, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'I') goto yy763; + if (yych != 'i') goto yy187; +yy763: + YYDEBUG(763, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'L') goto yy764; + if (yych != 'l') goto yy187; +yy764: + YYDEBUG(764, *YYCURSOR); + yych = *++YYCURSOR; + if (yych == 'E') goto yy765; + if (yych != 'e') goto yy187; +yy765: + YYDEBUG(765, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(763, *YYCURSOR); + YYDEBUG(766, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1084 "Zend/zend_language_scanner.l" +#line 1074 "Zend/zend_language_scanner.l" { return T_ENDWHILE; } -#line 7012 "Zend/zend_language_scanner.c" -yy764: - YYDEBUG(764, *YYCURSOR); +#line 6960 "Zend/zend_language_scanner.c" +yy767: + YYDEBUG(767, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'I') goto yy765; + if (yych == 'I') goto yy768; if (yych != 'i') goto yy187; -yy765: - YYDEBUG(765, *YYCURSOR); +yy768: + YYDEBUG(768, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy766; + if (yych == 'T') goto yy769; if (yych != 't') goto yy187; -yy766: - YYDEBUG(766, *YYCURSOR); +yy769: + YYDEBUG(769, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy767; + if (yych == 'C') goto yy770; if (yych != 'c') goto yy187; -yy767: - YYDEBUG(767, *YYCURSOR); +yy770: + YYDEBUG(770, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy768; + if (yych == 'H') goto yy771; if (yych != 'h') goto yy187; -yy768: - YYDEBUG(768, *YYCURSOR); +yy771: + YYDEBUG(771, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(769, *YYCURSOR); + YYDEBUG(772, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1128 "Zend/zend_language_scanner.l" +#line 1118 "Zend/zend_language_scanner.l" { return T_ENDSWITCH; } -#line 7045 "Zend/zend_language_scanner.c" -yy770: - YYDEBUG(770, *YYCURSOR); +#line 6993 "Zend/zend_language_scanner.c" +yy773: + YYDEBUG(773, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(771, *YYCURSOR); + YYDEBUG(774, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1072 "Zend/zend_language_scanner.l" +#line 1062 "Zend/zend_language_scanner.l" { return T_ENDIF; } -#line 7058 "Zend/zend_language_scanner.c" -yy772: - YYDEBUG(772, *YYCURSOR); +#line 7006 "Zend/zend_language_scanner.c" +yy775: + YYDEBUG(775, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy773; + if (yych == 'R') goto yy776; if (yych != 'r') goto yy187; -yy773: - YYDEBUG(773, *YYCURSOR); +yy776: + YYDEBUG(776, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '^') { if (yych <= '@') { - if (yych <= '/') goto yy774; + if (yych <= '/') goto yy777; if (yych <= '9') goto yy186; } else { - if (yych == 'E') goto yy775; + if (yych == 'E') goto yy778; if (yych <= 'Z') goto yy186; } } else { if (yych <= 'd') { if (yych != '`') goto yy186; } else { - if (yych <= 'e') goto yy775; + if (yych <= 'e') goto yy778; if (yych <= 'z') goto yy186; if (yych >= 0x7F) goto yy186; } } -yy774: - YYDEBUG(774, *YYCURSOR); +yy777: + YYDEBUG(777, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1096 "Zend/zend_language_scanner.l" +#line 1086 "Zend/zend_language_scanner.l" { return T_ENDFOR; } -#line 7091 "Zend/zend_language_scanner.c" -yy775: - YYDEBUG(775, *YYCURSOR); +#line 7039 "Zend/zend_language_scanner.c" +yy778: + YYDEBUG(778, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy776; + if (yych == 'A') goto yy779; if (yych != 'a') goto yy187; -yy776: - YYDEBUG(776, *YYCURSOR); +yy779: + YYDEBUG(779, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy777; + if (yych == 'C') goto yy780; if (yych != 'c') goto yy187; -yy777: - YYDEBUG(777, *YYCURSOR); +yy780: + YYDEBUG(780, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'H') goto yy778; + if (yych == 'H') goto yy781; if (yych != 'h') goto yy187; -yy778: - YYDEBUG(778, *YYCURSOR); +yy781: + YYDEBUG(781, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(779, *YYCURSOR); + YYDEBUG(782, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1104 "Zend/zend_language_scanner.l" +#line 1094 "Zend/zend_language_scanner.l" { return T_ENDFOREACH; } -#line 7119 "Zend/zend_language_scanner.c" -yy780: - YYDEBUG(780, *YYCURSOR); +#line 7067 "Zend/zend_language_scanner.c" +yy783: + YYDEBUG(783, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'C') goto yy781; + if (yych == 'C') goto yy784; if (yych != 'c') goto yy187; -yy781: - YYDEBUG(781, *YYCURSOR); +yy784: + YYDEBUG(784, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'L') goto yy782; + if (yych == 'L') goto yy785; if (yych != 'l') goto yy187; -yy782: - YYDEBUG(782, *YYCURSOR); +yy785: + YYDEBUG(785, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'A') goto yy783; + if (yych == 'A') goto yy786; if (yych != 'a') goto yy187; -yy783: - YYDEBUG(783, *YYCURSOR); +yy786: + YYDEBUG(786, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'R') goto yy784; + if (yych == 'R') goto yy787; if (yych != 'r') goto yy187; -yy784: - YYDEBUG(784, *YYCURSOR); +yy787: + YYDEBUG(787, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy785; + if (yych == 'E') goto yy788; if (yych != 'e') goto yy187; -yy785: - YYDEBUG(785, *YYCURSOR); +yy788: + YYDEBUG(788, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(786, *YYCURSOR); + YYDEBUG(789, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1112 "Zend/zend_language_scanner.l" +#line 1102 "Zend/zend_language_scanner.l" { return T_ENDDECLARE; } -#line 7157 "Zend/zend_language_scanner.c" -yy787: - YYDEBUG(787, *YYCURSOR); +#line 7105 "Zend/zend_language_scanner.c" +yy790: + YYDEBUG(790, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'T') goto yy788; + if (yych == 'T') goto yy791; if (yych != 't') goto yy187; -yy788: - YYDEBUG(788, *YYCURSOR); +yy791: + YYDEBUG(791, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'Y') goto yy789; + if (yych == 'Y') goto yy792; if (yych != 'y') goto yy187; -yy789: - YYDEBUG(789, *YYCURSOR); +yy792: + YYDEBUG(792, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(790, *YYCURSOR); + YYDEBUG(793, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1298 "Zend/zend_language_scanner.l" +#line 1290 "Zend/zend_language_scanner.l" { return T_EMPTY; } -#line 7180 "Zend/zend_language_scanner.c" -yy791: - YYDEBUG(791, *YYCURSOR); +#line 7128 "Zend/zend_language_scanner.c" +yy794: + YYDEBUG(794, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'E') goto yy792; + if (yych == 'E') goto yy795; if (yych != 'e') goto yy187; -yy792: - YYDEBUG(792, *YYCURSOR); +yy795: + YYDEBUG(795, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '^') { if (yych <= '@') { - if (yych <= '/') goto yy793; + if (yych <= '/') goto yy796; if (yych <= '9') goto yy186; } else { - if (yych == 'I') goto yy794; + if (yych == 'I') goto yy797; if (yych <= 'Z') goto yy186; } } else { if (yych <= 'h') { if (yych != '`') goto yy186; } else { - if (yych <= 'i') goto yy794; + if (yych <= 'i') goto yy797; if (yych <= 'z') goto yy186; if (yych >= 0x7F) goto yy186; } } -yy793: - YYDEBUG(793, *YYCURSOR); +yy796: + YYDEBUG(796, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1076 "Zend/zend_language_scanner.l" +#line 1066 "Zend/zend_language_scanner.l" { return T_ELSE; } -#line 7213 "Zend/zend_language_scanner.c" -yy794: - YYDEBUG(794, *YYCURSOR); +#line 7161 "Zend/zend_language_scanner.c" +yy797: + YYDEBUG(797, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'F') goto yy795; + if (yych == 'F') goto yy798; if (yych != 'f') goto yy187; -yy795: - YYDEBUG(795, *YYCURSOR); +yy798: + YYDEBUG(798, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(796, *YYCURSOR); + YYDEBUG(799, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1068 "Zend/zend_language_scanner.l" +#line 1058 "Zend/zend_language_scanner.l" { return T_ELSEIF; } -#line 7231 "Zend/zend_language_scanner.c" -yy797: - YYDEBUG(797, *YYCURSOR); +#line 7179 "Zend/zend_language_scanner.c" +yy800: + YYDEBUG(800, *YYCURSOR); yych = *++YYCURSOR; - if (yych == 'O') goto yy798; + if (yych == 'O') goto yy801; if (yych != 'o') goto yy187; -yy798: - YYDEBUG(798, *YYCURSOR); +yy801: + YYDEBUG(801, *YYCURSOR); ++YYCURSOR; if (yybm[0+(yych = *YYCURSOR)] & 4) { goto yy186; } - YYDEBUG(799, *YYCURSOR); + YYDEBUG(802, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1152 "Zend/zend_language_scanner.l" +#line 1142 "Zend/zend_language_scanner.l" { return T_ECHO; } -#line 7249 "Zend/zend_language_scanner.c" +#line 7197 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_LOOKING_FOR_PROPERTY: @@ -7284,115 +7232,113 @@ yyc_ST_LOOKING_FOR_PROPERTY: 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, }; - YYDEBUG(800, *YYCURSOR); + YYDEBUG(803, *YYCURSOR); YYFILL(2); yych = *YYCURSOR; if (yych <= '-') { if (yych <= '\r') { - if (yych <= 0x08) goto yy808; - if (yych <= '\n') goto yy802; - if (yych <= '\f') goto yy808; + if (yych <= 0x08) goto yy811; + if (yych <= '\n') goto yy805; + if (yych <= '\f') goto yy811; } else { - if (yych == ' ') goto yy802; - if (yych <= ',') goto yy808; - goto yy804; + if (yych == ' ') goto yy805; + if (yych <= ',') goto yy811; + goto yy807; } } else { if (yych <= '_') { - if (yych <= '@') goto yy808; - if (yych <= 'Z') goto yy806; - if (yych <= '^') goto yy808; - goto yy806; + if (yych <= '@') goto yy811; + if (yych <= 'Z') goto yy809; + if (yych <= '^') goto yy811; + goto yy809; } else { - if (yych <= '`') goto yy808; - if (yych <= 'z') goto yy806; - if (yych <= '~') goto yy808; - goto yy806; + if (yych <= '`') goto yy811; + if (yych <= 'z') goto yy809; + if (yych <= '~') goto yy811; + goto yy809; } } -yy802: - YYDEBUG(802, *YYCURSOR); +yy805: + YYDEBUG(805, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy814; -yy803: - YYDEBUG(803, *YYCURSOR); + goto yy817; +yy806: + YYDEBUG(806, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1185 "Zend/zend_language_scanner.l" +#line 1175 "Zend/zend_language_scanner.l" { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ HANDLE_NEWLINES(yytext, yyleng); return T_WHITESPACE; } -#line 7330 "Zend/zend_language_scanner.c" -yy804: - YYDEBUG(804, *YYCURSOR); +#line 7276 "Zend/zend_language_scanner.c" +yy807: + YYDEBUG(807, *YYCURSOR); ++YYCURSOR; - if ((yych = *YYCURSOR) == '>') goto yy811; -yy805: - YYDEBUG(805, *YYCURSOR); + if ((yych = *YYCURSOR) == '>') goto yy814; +yy808: + YYDEBUG(808, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1204 "Zend/zend_language_scanner.l" +#line 1192 "Zend/zend_language_scanner.l" { yyless(0); yy_pop_state(TSRMLS_C); goto restart; } -#line 7344 "Zend/zend_language_scanner.c" -yy806: - YYDEBUG(806, *YYCURSOR); +#line 7290 "Zend/zend_language_scanner.c" +yy809: + YYDEBUG(809, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy810; -yy807: - YYDEBUG(807, *YYCURSOR); + goto yy813; +yy810: + YYDEBUG(810, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1197 "Zend/zend_language_scanner.l" +#line 1185 "Zend/zend_language_scanner.l" { yy_pop_state(TSRMLS_C); zend_copy_value(zendlval, yytext, yyleng); zendlval->type = IS_STRING; return T_STRING; } -#line 7360 "Zend/zend_language_scanner.c" -yy808: - YYDEBUG(808, *YYCURSOR); +#line 7306 "Zend/zend_language_scanner.c" +yy811: + YYDEBUG(811, *YYCURSOR); yych = *++YYCURSOR; - goto yy805; -yy809: - YYDEBUG(809, *YYCURSOR); + goto yy808; +yy812: + YYDEBUG(812, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy810: - YYDEBUG(810, *YYCURSOR); +yy813: + YYDEBUG(813, *YYCURSOR); if (yybm[0+yych] & 64) { - goto yy809; + goto yy812; } - goto yy807; -yy811: - YYDEBUG(811, *YYCURSOR); + goto yy810; +yy814: + YYDEBUG(814, *YYCURSOR); ++YYCURSOR; - YYDEBUG(812, *YYCURSOR); + YYDEBUG(815, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1193 "Zend/zend_language_scanner.l" +#line 1181 "Zend/zend_language_scanner.l" { return T_OBJECT_OPERATOR; } -#line 7385 "Zend/zend_language_scanner.c" -yy813: - YYDEBUG(813, *YYCURSOR); +#line 7331 "Zend/zend_language_scanner.c" +yy816: + YYDEBUG(816, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy814: - YYDEBUG(814, *YYCURSOR); +yy817: + YYDEBUG(817, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy813; + goto yy816; } - goto yy803; + goto yy806; } /* *********************************** */ yyc_ST_LOOKING_FOR_VARNAME: @@ -7431,74 +7377,74 @@ yyc_ST_LOOKING_FOR_VARNAME: 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, }; - YYDEBUG(815, *YYCURSOR); + YYDEBUG(818, *YYCURSOR); YYFILL(2); yych = *YYCURSOR; if (yych <= '_') { - if (yych <= '@') goto yy819; - if (yych <= 'Z') goto yy817; - if (yych <= '^') goto yy819; + if (yych <= '@') goto yy822; + if (yych <= 'Z') goto yy820; + if (yych <= '^') goto yy822; } else { - if (yych <= '`') goto yy819; - if (yych <= 'z') goto yy817; - if (yych <= '~') goto yy819; + if (yych <= '`') goto yy822; + if (yych <= 'z') goto yy820; + if (yych <= '~') goto yy822; } -yy817: - YYDEBUG(817, *YYCURSOR); +yy820: + YYDEBUG(820, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '_') { if (yych <= '@') { - if (yych <= '/') goto yy818; - if (yych <= '9') goto yy821; + if (yych <= '/') goto yy821; + if (yych <= '9') goto yy824; } else { - if (yych <= '[') goto yy821; - if (yych >= '_') goto yy821; + if (yych <= '[') goto yy824; + if (yych >= '_') goto yy824; } } else { if (yych <= '|') { - if (yych <= '`') goto yy818; - if (yych <= 'z') goto yy821; + if (yych <= '`') goto yy821; + if (yych <= 'z') goto yy824; } else { - if (yych != '~') goto yy821; + if (yych != '~') goto yy824; } } -yy818: - YYDEBUG(818, *YYCURSOR); +yy821: + YYDEBUG(821, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1490 "Zend/zend_language_scanner.l" +#line 1482 "Zend/zend_language_scanner.l" { yyless(0); yy_pop_state(TSRMLS_C); yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); goto restart; } -#line 7477 "Zend/zend_language_scanner.c" -yy819: - YYDEBUG(819, *YYCURSOR); +#line 7423 "Zend/zend_language_scanner.c" +yy822: + YYDEBUG(822, *YYCURSOR); yych = *++YYCURSOR; - goto yy818; -yy820: - YYDEBUG(820, *YYCURSOR); + goto yy821; +yy823: + YYDEBUG(823, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy821: - YYDEBUG(821, *YYCURSOR); +yy824: + YYDEBUG(824, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy820; + goto yy823; } - if (yych == '[') goto yy823; - if (yych == '}') goto yy823; - YYDEBUG(822, *YYCURSOR); + if (yych == '[') goto yy826; + if (yych == '}') goto yy826; + YYDEBUG(825, *YYCURSOR); YYCURSOR = YYMARKER; - goto yy818; -yy823: - YYDEBUG(823, *YYCURSOR); + goto yy821; +yy826: + YYDEBUG(826, *YYCURSOR); ++YYCURSOR; - YYDEBUG(824, *YYCURSOR); + YYDEBUG(827, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1480 "Zend/zend_language_scanner.l" +#line 1472 "Zend/zend_language_scanner.l" { yyless(yyleng - 1); zend_copy_value(zendlval, yytext, yyleng); @@ -7507,18 +7453,18 @@ yy823: yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); return T_STRING_VARNAME; } -#line 7511 "Zend/zend_language_scanner.c" +#line 7457 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_NOWDOC: - YYDEBUG(825, *YYCURSOR); + YYDEBUG(828, *YYCURSOR); YYFILL(1); yych = *YYCURSOR; - YYDEBUG(827, *YYCURSOR); + YYDEBUG(830, *YYCURSOR); ++YYCURSOR; - YYDEBUG(828, *YYCURSOR); + YYDEBUG(831, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2374 "Zend/zend_language_scanner.l" +#line 2302 "Zend/zend_language_scanner.l" { int newline = 0; @@ -7575,7 +7521,7 @@ nowdoc_scan_done: HANDLE_NEWLINES(yytext, yyleng - newline); return T_ENCAPSED_AND_WHITESPACE; } -#line 7579 "Zend/zend_language_scanner.c" +#line 7525 "Zend/zend_language_scanner.c" /* *********************************** */ yyc_ST_VAR_OFFSET: { @@ -7613,162 +7559,159 @@ yyc_ST_VAR_OFFSET: 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, }; - YYDEBUG(829, *YYCURSOR); + YYDEBUG(832, *YYCURSOR); YYFILL(3); yych = *YYCURSOR; if (yych <= '/') { if (yych <= ' ') { if (yych <= '\f') { - if (yych <= 0x08) goto yy843; - if (yych <= '\n') goto yy839; - goto yy843; + if (yych <= 0x08) goto yy846; + if (yych <= '\n') goto yy842; + goto yy846; } else { - if (yych <= '\r') goto yy839; - if (yych <= 0x1F) goto yy843; - goto yy839; + if (yych <= '\r') goto yy842; + if (yych <= 0x1F) goto yy846; + goto yy842; } } else { if (yych <= '$') { - if (yych <= '"') goto yy838; - if (yych <= '#') goto yy839; - goto yy834; + if (yych <= '"') goto yy841; + if (yych <= '#') goto yy842; + goto yy837; } else { - if (yych == '\'') goto yy839; - goto yy838; + if (yych == '\'') goto yy842; + goto yy841; } } } else { if (yych <= '\\') { if (yych <= '@') { - if (yych <= '0') goto yy831; - if (yych <= '9') goto yy833; - goto yy838; + if (yych <= '0') goto yy834; + if (yych <= '9') goto yy836; + goto yy841; } else { - if (yych <= 'Z') goto yy841; - if (yych <= '[') goto yy838; - goto yy839; + if (yych <= 'Z') goto yy844; + if (yych <= '[') goto yy841; + goto yy842; } } else { if (yych <= '_') { - if (yych <= ']') goto yy836; - if (yych <= '^') goto yy838; - goto yy841; + if (yych <= ']') goto yy839; + if (yych <= '^') goto yy841; + goto yy844; } else { - if (yych <= '`') goto yy838; - if (yych <= 'z') goto yy841; - if (yych <= '~') goto yy838; - goto yy841; + if (yych <= '`') goto yy841; + if (yych <= 'z') goto yy844; + if (yych <= '~') goto yy841; + goto yy844; } } } -yy831: - YYDEBUG(831, *YYCURSOR); +yy834: + YYDEBUG(834, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'W') { if (yych <= '9') { - if (yych >= '0') goto yy855; + if (yych >= '0') goto yy858; } else { - if (yych == 'B') goto yy852; + if (yych == 'B') goto yy855; } } else { if (yych <= 'b') { - if (yych <= 'X') goto yy854; - if (yych >= 'b') goto yy852; + if (yych <= 'X') goto yy857; + if (yych >= 'b') goto yy855; } else { - if (yych == 'x') goto yy854; + if (yych == 'x') goto yy857; } } -yy832: - YYDEBUG(832, *YYCURSOR); +yy835: + YYDEBUG(835, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1568 "Zend/zend_language_scanner.l" +#line 1558 "Zend/zend_language_scanner.l" { /* Offset could be treated as a long */ if (yyleng < MAX_LENGTH_OF_LONG - 1 || (yyleng == MAX_LENGTH_OF_LONG - 1 && strcmp(yytext, long_min_digits) < 0)) { - zendlval->value.lval = strtol(yytext, NULL, 10); - zendlval->type = IS_LONG; + ZVAL_LONG(zendlval, strtol(yytext, NULL, 10)); } else { - zendlval->value.str.val = (char *)estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 1); } return T_NUM_STRING; } -#line 7698 "Zend/zend_language_scanner.c" -yy833: - YYDEBUG(833, *YYCURSOR); +#line 7641 "Zend/zend_language_scanner.c" +yy836: + YYDEBUG(836, *YYCURSOR); yych = *++YYCURSOR; - goto yy851; -yy834: - YYDEBUG(834, *YYCURSOR); + goto yy854; +yy837: + YYDEBUG(837, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '_') { - if (yych <= '@') goto yy835; - if (yych <= 'Z') goto yy847; - if (yych >= '_') goto yy847; + if (yych <= '@') goto yy838; + if (yych <= 'Z') goto yy850; + if (yych >= '_') goto yy850; } else { - if (yych <= '`') goto yy835; - if (yych <= 'z') goto yy847; - if (yych >= 0x7F) goto yy847; + if (yych <= '`') goto yy838; + if (yych <= 'z') goto yy850; + if (yych >= 0x7F) goto yy850; } -yy835: - YYDEBUG(835, *YYCURSOR); +yy838: + YYDEBUG(838, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1900 "Zend/zend_language_scanner.l" +#line 1834 "Zend/zend_language_scanner.l" { /* Only '[' can be valid, but returning other tokens will allow a more explicit parse error */ return yytext[0]; } -#line 7723 "Zend/zend_language_scanner.c" -yy836: - YYDEBUG(836, *YYCURSOR); +#line 7666 "Zend/zend_language_scanner.c" +yy839: + YYDEBUG(839, *YYCURSOR); ++YYCURSOR; - YYDEBUG(837, *YYCURSOR); + YYDEBUG(840, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1895 "Zend/zend_language_scanner.l" +#line 1829 "Zend/zend_language_scanner.l" { yy_pop_state(TSRMLS_C); return ']'; } -#line 7734 "Zend/zend_language_scanner.c" -yy838: - YYDEBUG(838, *YYCURSOR); +#line 7677 "Zend/zend_language_scanner.c" +yy841: + YYDEBUG(841, *YYCURSOR); yych = *++YYCURSOR; - goto yy835; -yy839: - YYDEBUG(839, *YYCURSOR); + goto yy838; +yy842: + YYDEBUG(842, *YYCURSOR); ++YYCURSOR; - YYDEBUG(840, *YYCURSOR); + YYDEBUG(843, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1905 "Zend/zend_language_scanner.l" +#line 1839 "Zend/zend_language_scanner.l" { /* Invalid rule to return a more explicit parse error with proper line number */ yyless(0); yy_pop_state(TSRMLS_C); return T_ENCAPSED_AND_WHITESPACE; } -#line 7751 "Zend/zend_language_scanner.c" -yy841: - YYDEBUG(841, *YYCURSOR); +#line 7694 "Zend/zend_language_scanner.c" +yy844: + YYDEBUG(844, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy846; -yy842: - YYDEBUG(842, *YYCURSOR); + goto yy849; +yy845: + YYDEBUG(845, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1912 "Zend/zend_language_scanner.l" +#line 1846 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, yytext, yyleng); zendlval->type = IS_STRING; return T_STRING; } -#line 7766 "Zend/zend_language_scanner.c" -yy843: - YYDEBUG(843, *YYCURSOR); +#line 7709 "Zend/zend_language_scanner.c" +yy846: + YYDEBUG(846, *YYCURSOR); ++YYCURSOR; - YYDEBUG(844, *YYCURSOR); + YYDEBUG(847, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2432 "Zend/zend_language_scanner.l" +#line 2360 "Zend/zend_language_scanner.l" { if (YYCURSOR > YYLIMIT) { return 0; @@ -7777,118 +7720,116 @@ yy843: zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE); goto restart; } -#line 7781 "Zend/zend_language_scanner.c" -yy845: - YYDEBUG(845, *YYCURSOR); +#line 7724 "Zend/zend_language_scanner.c" +yy848: + YYDEBUG(848, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy846: - YYDEBUG(846, *YYCURSOR); +yy849: + YYDEBUG(849, *YYCURSOR); if (yybm[0+yych] & 16) { - goto yy845; + goto yy848; } - goto yy842; -yy847: - YYDEBUG(847, *YYCURSOR); + goto yy845; +yy850: + YYDEBUG(850, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(848, *YYCURSOR); + YYDEBUG(851, *YYCURSOR); if (yych <= '^') { if (yych <= '9') { - if (yych >= '0') goto yy847; + if (yych >= '0') goto yy850; } else { - if (yych <= '@') goto yy849; - if (yych <= 'Z') goto yy847; + if (yych <= '@') goto yy852; + if (yych <= 'Z') goto yy850; } } else { if (yych <= '`') { - if (yych <= '_') goto yy847; + if (yych <= '_') goto yy850; } else { - if (yych <= 'z') goto yy847; - if (yych >= 0x7F) goto yy847; + if (yych <= 'z') goto yy850; + if (yych >= 0x7F) goto yy850; } } -yy849: - YYDEBUG(849, *YYCURSOR); +yy852: + YYDEBUG(852, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1889 "Zend/zend_language_scanner.l" +#line 1823 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); zendlval->type = IS_STRING; return T_VARIABLE; } -#line 7823 "Zend/zend_language_scanner.c" -yy850: - YYDEBUG(850, *YYCURSOR); +#line 7766 "Zend/zend_language_scanner.c" +yy853: + YYDEBUG(853, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy851: - YYDEBUG(851, *YYCURSOR); +yy854: + YYDEBUG(854, *YYCURSOR); if (yybm[0+yych] & 32) { - goto yy850; + goto yy853; } - goto yy832; -yy852: - YYDEBUG(852, *YYCURSOR); + goto yy835; +yy855: + YYDEBUG(855, *YYCURSOR); yych = *++YYCURSOR; if (yybm[0+yych] & 128) { - goto yy860; + goto yy863; } -yy853: - YYDEBUG(853, *YYCURSOR); +yy856: + YYDEBUG(856, *YYCURSOR); YYCURSOR = YYMARKER; - goto yy832; -yy854: - YYDEBUG(854, *YYCURSOR); + goto yy835; +yy857: + YYDEBUG(857, *YYCURSOR); yych = *++YYCURSOR; if (yybm[0+yych] & 64) { - goto yy858; + goto yy861; } - goto yy853; -yy855: - YYDEBUG(855, *YYCURSOR); + goto yy856; +yy858: + YYDEBUG(858, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(856, *YYCURSOR); - if (yych <= '/') goto yy857; - if (yych <= '9') goto yy855; -yy857: - YYDEBUG(857, *YYCURSOR); + YYDEBUG(859, *YYCURSOR); + if (yych <= '/') goto yy860; + if (yych <= '9') goto yy858; +yy860: + YYDEBUG(860, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1580 "Zend/zend_language_scanner.l" +#line 1567 "Zend/zend_language_scanner.l" { /* Offset must be treated as a string */ - zendlval->value.str.val = (char *)estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 1); return T_NUM_STRING; } -#line 7870 "Zend/zend_language_scanner.c" -yy858: - YYDEBUG(858, *YYCURSOR); +#line 7811 "Zend/zend_language_scanner.c" +yy861: + YYDEBUG(861, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(859, *YYCURSOR); + YYDEBUG(862, *YYCURSOR); if (yybm[0+yych] & 64) { - goto yy858; + goto yy861; } - goto yy857; -yy860: - YYDEBUG(860, *YYCURSOR); + goto yy860; +yy863: + YYDEBUG(863, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(861, *YYCURSOR); + YYDEBUG(864, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy860; + goto yy863; } - goto yy857; + goto yy860; } } -#line 2441 "Zend/zend_language_scanner.l" +#line 2369 "Zend/zend_language_scanner.l" } diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l index d2e7243bb2..736d7712d5 100644 --- a/Zend/zend_language_scanner.l +++ b/Zend/zend_language_scanner.l @@ -47,7 +47,7 @@ #include "zend_API.h" #include "zend_strtod.h" #include "zend_exceptions.h" -#include "tsrm_virtual_cwd.h" +#include "zend_virtual_cwd.h" #include "tsrm_config_common.h" #define YYCTYPE unsigned char @@ -562,10 +562,8 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR 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; - Z_UNSET_ISREF(retval_znode.u.constant); - Z_SET_REFCOUNT(retval_znode.u.constant, 1); + INIT_PZVAL(&retval_znode.u.constant); + ZVAL_LONG(&retval_znode.u.constant, 1); zend_save_lexical_state(&original_lex_state TSRMLS_CC); @@ -622,7 +620,7 @@ zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC) convert_to_string(&tmp); filename = &tmp; } - file_handle.filename = filename->value.str.val; + file_handle.filename = Z_STRVAL_P(filename); file_handle.free_filename = 0; file_handle.type = ZEND_HANDLE_FILENAME; file_handle.opened_path = NULL; @@ -633,7 +631,7 @@ zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC) int dummy = 1; if (!file_handle.opened_path) { - file_handle.opened_path = opened_path = estrndup(filename->value.str.val, filename->value.str.len); + file_handle.opened_path = opened_path = estrndup(Z_STRVAL_P(filename), Z_STRLEN_P(filename)); } zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL); @@ -655,22 +653,15 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D char *buf; size_t size; - /* enforce two trailing NULLs for flex... */ - if (IS_INTERNED(str->value.str.val)) { - char *tmp = safe_emalloc(1, str->value.str.len, ZEND_MMAP_AHEAD); - memcpy(tmp, str->value.str.val, str->value.str.len + ZEND_MMAP_AHEAD); - str->value.str.val = tmp; - } else { - str->value.str.val = safe_erealloc(str->value.str.val, 1, str->value.str.len, ZEND_MMAP_AHEAD); - } - - memset(str->value.str.val + str->value.str.len, 0, ZEND_MMAP_AHEAD); + /* enforce ZEND_MMAP_AHEAD trailing NULLs for flex... */ + Z_STRVAL_P(str) = str_erealloc(Z_STRVAL_P(str), Z_STRLEN_P(str) + ZEND_MMAP_AHEAD); + memset(Z_STRVAL_P(str) + Z_STRLEN_P(str), 0, ZEND_MMAP_AHEAD); SCNG(yy_in) = NULL; SCNG(yy_start) = NULL; - buf = str->value.str.val; - size = str->value.str.len; + buf = Z_STRVAL_P(str); + size = Z_STRLEN_P(str); if (CG(multibyte)) { SCNG(script_org) = (unsigned char*)buf; @@ -731,7 +722,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC) int compiler_result; zend_bool original_in_compilation = CG(in_compilation); - if (source_string->value.str.len==0) { + if (Z_STRLEN_P(source_string)==0) { efree(op_array); return NULL; } @@ -869,11 +860,11 @@ ZEND_API void zend_multibyte_yyinput_again(zend_encoding_filter old_input_filter # define zend_copy_value(zendlval, yytext, yyleng) \ if (SCNG(output_filter)) { \ size_t sz = 0; \ - SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); \ - zendlval->value.str.len = sz; \ + SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); \ + Z_STRLEN_P(zendlval) = sz; \ } else { \ - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); \ - zendlval->value.str.len = yyleng; \ + Z_STRVAL_P(zendlval) = (char *) estrndup(yytext, yyleng); \ + Z_STRLEN_P(zendlval) = yyleng; \ } static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quote_type TSRMLS_DC) @@ -884,8 +875,8 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo ZVAL_STRINGL(zendlval, str, len, 1); /* convert escape sequences */ - s = t = zendlval->value.str.val; - end = s+zendlval->value.str.len; + s = t = Z_STRVAL_P(zendlval); + end = s+Z_STRLEN_P(zendlval); while (s<end) { if (*s=='\\') { s++; @@ -897,23 +888,23 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo switch(*s) { case 'n': *t++ = '\n'; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; case 'r': *t++ = '\r'; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; case 't': *t++ = '\t'; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; case 'f': *t++ = '\f'; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; case 'v': *t++ = '\v'; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; case 'e': #ifdef PHP_WIN32 @@ -921,7 +912,7 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo #else *t++ = '\e'; #endif - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; case '"': case '`': @@ -933,20 +924,20 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo case '\\': case '$': *t++ = *s; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; case 'x': case 'X': if (ZEND_IS_HEX(*(s+1))) { char hex_buf[3] = { 0, 0, 0 }; - zendlval->value.str.len--; /* for the 'x' */ + Z_STRLEN_P(zendlval)--; /* for the 'x' */ hex_buf[0] = *(++s); - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; if (ZEND_IS_HEX(*(s+1))) { hex_buf[1] = *(++s); - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; } *t++ = (char) strtol(hex_buf, NULL, 16); } else { @@ -960,13 +951,13 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo char octal_buf[4] = { 0, 0, 0, 0 }; octal_buf[0] = *s; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; if (ZEND_IS_OCT(*(s+1))) { octal_buf[1] = *(++s); - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; if (ZEND_IS_OCT(*(s+1))) { octal_buf[2] = *(++s); - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; } } *t++ = (char) strtol(octal_buf, NULL, 8); @@ -988,9 +979,9 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo *t = 0; if (SCNG(output_filter)) { size_t sz = 0; - s = zendlval->value.str.val; - SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)s, (size_t)zendlval->value.str.len TSRMLS_CC); - zendlval->value.str.len = sz; + s = Z_STRVAL_P(zendlval); + SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval) TSRMLS_CC); + Z_STRLEN_P(zendlval) = sz; efree(s); } } @@ -1020,7 +1011,6 @@ NEWLINE ("\r"|"\n"|"\r\n") /* compute yyleng before each rule */ <!*> := yyleng = YYCURSOR - SCNG(yy_text); - <ST_IN_SCRIPTING>"exit" { return T_EXIT; } @@ -1183,9 +1173,7 @@ NEWLINE ("\r"|"\n"|"\r\n") } <ST_IN_SCRIPTING,ST_LOOKING_FOR_PROPERTY>{WHITESPACE}+ { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ HANDLE_NEWLINES(yytext, yyleng); return T_WHITESPACE; } @@ -1215,6 +1203,10 @@ NEWLINE ("\r"|"\n"|"\r\n") return T_NS_SEPARATOR; } +<ST_IN_SCRIPTING>"..." { + return T_ELLIPSIS; +} + <ST_IN_SCRIPTING>"new" { return T_NEW; } @@ -1506,30 +1498,29 @@ NEWLINE ("\r"|"\n"|"\r\n") if (len < SIZEOF_LONG * 8) { if (len == 0) { - zendlval->value.lval = 0; + Z_LVAL_P(zendlval) = 0; } else { - zendlval->value.lval = strtol(bin, NULL, 2); + Z_LVAL_P(zendlval) = strtol(bin, NULL, 2); } zendlval->type = IS_LONG; return T_LNUMBER; } else { - zendlval->value.dval = zend_bin_strtod(bin, NULL); - zendlval->type = IS_DOUBLE; + ZVAL_DOUBLE(zendlval, zend_bin_strtod(bin, NULL)); return T_DNUMBER; } } <ST_IN_SCRIPTING>{LNUM} { if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */ - zendlval->value.lval = strtol(yytext, NULL, 0); + Z_LVAL_P(zendlval) = strtol(yytext, NULL, 0); } else { errno = 0; - zendlval->value.lval = strtol(yytext, NULL, 0); + Z_LVAL_P(zendlval) = strtol(yytext, NULL, 0); if (errno == ERANGE) { /* Overflow */ if (yytext[0] == '0') { /* octal overflow */ - zendlval->value.dval = zend_oct_strtod(yytext, NULL); + Z_DVAL_P(zendlval) = zend_oct_strtod(yytext, NULL); } else { - zendlval->value.dval = zend_strtod(yytext, NULL); + Z_DVAL_P(zendlval) = zend_strtod(yytext, NULL); } zendlval->type = IS_DOUBLE; return T_DNUMBER; @@ -1552,120 +1543,80 @@ NEWLINE ("\r"|"\n"|"\r\n") if (len < SIZEOF_LONG * 2 || (len == SIZEOF_LONG * 2 && *hex <= '7')) { if (len == 0) { - zendlval->value.lval = 0; + Z_LVAL_P(zendlval) = 0; } else { - zendlval->value.lval = strtol(hex, NULL, 16); + Z_LVAL_P(zendlval) = strtol(hex, NULL, 16); } zendlval->type = IS_LONG; return T_LNUMBER; } else { - zendlval->value.dval = zend_hex_strtod(hex, NULL); - zendlval->type = IS_DOUBLE; + ZVAL_DOUBLE(zendlval, zend_hex_strtod(hex, NULL)); return T_DNUMBER; } } <ST_VAR_OFFSET>[0]|([1-9][0-9]*) { /* Offset could be treated as a long */ if (yyleng < MAX_LENGTH_OF_LONG - 1 || (yyleng == MAX_LENGTH_OF_LONG - 1 && strcmp(yytext, long_min_digits) < 0)) { - zendlval->value.lval = strtol(yytext, NULL, 10); - zendlval->type = IS_LONG; + ZVAL_LONG(zendlval, strtol(yytext, NULL, 10)); } else { - zendlval->value.str.val = (char *)estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 1); } return T_NUM_STRING; } <ST_VAR_OFFSET>{LNUM}|{HNUM}|{BNUM} { /* Offset must be treated as a string */ - zendlval->value.str.val = (char *)estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 1); return T_NUM_STRING; } <ST_IN_SCRIPTING>{DNUM}|{EXPONENT_DNUM} { - zendlval->value.dval = zend_strtod(yytext, NULL); - zendlval->type = IS_DOUBLE; + ZVAL_DOUBLE(zendlval, zend_strtod(yytext, NULL)); return T_DNUMBER; } <ST_IN_SCRIPTING>"__CLASS__" { - const char *class_name = NULL; - - if (CG(active_class_entry) - && (ZEND_ACC_TRAIT == - (CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT))) { + zend_class_entry *ce = CG(active_class_entry); + if (ce && ZEND_ACC_TRAIT == (ce->ce_flags & ZEND_ACC_TRAIT)) { /* We create a special __CLASS__ constant that is going to be resolved at run-time */ - zendlval->value.str.len = sizeof("__CLASS__")-1; - zendlval->value.str.val = estrndup("__CLASS__", zendlval->value.str.len); + Z_STRLEN_P(zendlval) = sizeof("__CLASS__")-1; + Z_STRVAL_P(zendlval) = estrndup("__CLASS__", Z_STRLEN_P(zendlval)); zendlval->type = IS_CONSTANT; } else { - if (CG(active_class_entry)) { - class_name = CG(active_class_entry)->name; - } - - if (!class_name) { - class_name = ""; + if (ce && ce->name) { + ZVAL_STRINGL(zendlval, ce->name, ce->name_length, 1); + } else { + ZVAL_EMPTY_STRING(zendlval); } - - 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; } <ST_IN_SCRIPTING>"__TRAIT__" { - const char *trait_name = NULL; - - if (CG(active_class_entry) - && (ZEND_ACC_TRAIT == - (CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT))) { - trait_name = CG(active_class_entry)->name; - } - - if (!trait_name) { - trait_name = ""; - } - - zendlval->value.str.len = strlen(trait_name); - zendlval->value.str.val = estrndup(trait_name, zendlval->value.str.len); - zendlval->type = IS_STRING; - + zend_class_entry *ce = CG(active_class_entry); + if (ce && ce->name && ZEND_ACC_TRAIT == (ce->ce_flags & ZEND_ACC_TRAIT)) { + ZVAL_STRINGL(zendlval, ce->name, ce->name_length, 1); + } else { + ZVAL_EMPTY_STRING(zendlval); + } return T_TRAIT_C; } <ST_IN_SCRIPTING>"__FUNCTION__" { - const char *func_name = NULL; - - if (CG(active_op_array)) { - func_name = CG(active_op_array)->function_name; - } - - if (!func_name) { - func_name = ""; + zend_op_array *op_array = CG(active_op_array); + if (op_array && op_array->function_name) { + ZVAL_STRING(zendlval, op_array->function_name, 1); + } else { + ZVAL_EMPTY_STRING(zendlval); } - 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; } <ST_IN_SCRIPTING>"__METHOD__" { const char *class_name = CG(active_class_entry) ? CG(active_class_entry)->name : NULL; const 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.len = zend_spprintf(&zendlval->value.str.val, 0, "%s%s%s", + Z_STRLEN_P(zendlval) = zend_spprintf(&Z_STRVAL_P(zendlval), 0, "%s%s%s", class_name ? class_name : "", class_name && func_name ? "::" : "", func_name ? func_name : "" @@ -1675,8 +1626,7 @@ NEWLINE ("\r"|"\n"|"\r\n") } <ST_IN_SCRIPTING>"__LINE__" { - zendlval->value.lval = CG(zend_lineno); - zendlval->type = IS_LONG; + ZVAL_LONG(zendlval, CG(zend_lineno)); return T_LINE; } @@ -1686,9 +1636,7 @@ NEWLINE ("\r"|"\n"|"\r\n") if (!filename) { filename = ""; } - zendlval->value.str.len = strlen(filename); - zendlval->value.str.val = estrndup(filename, zendlval->value.str.len); - zendlval->type = IS_STRING; + ZVAL_STRING(zendlval, filename, 1); return T_FILE; } @@ -1713,9 +1661,7 @@ NEWLINE ("\r"|"\n"|"\r\n") #endif } - zendlval->value.str.len = strlen(dirname); - zendlval->value.str.val = dirname; - zendlval->type = IS_STRING; + ZVAL_STRING(zendlval, dirname, 0); return T_DIR; } @@ -1739,9 +1685,7 @@ NEWLINE ("\r"|"\n"|"\r\n") } HANDLE_NEWLINES(yytext, yyleng); - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG; } @@ -1749,9 +1693,7 @@ NEWLINE ("\r"|"\n"|"\r\n") <INITIAL>"<%=" { if (CG(asp_tags)) { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG_WITH_ECHO; } else { @@ -1761,9 +1703,7 @@ NEWLINE ("\r"|"\n"|"\r\n") <INITIAL>"<?=" { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG_WITH_ECHO; } @@ -1771,9 +1711,7 @@ NEWLINE ("\r"|"\n"|"\r\n") <INITIAL>"<%" { if (CG(asp_tags)) { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG; } else { @@ -1783,9 +1721,7 @@ NEWLINE ("\r"|"\n"|"\r\n") <INITIAL>"<?php"([ \t]|{NEWLINE}) { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ HANDLE_NEWLINE(yytext[yyleng-1]); BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG; @@ -1794,9 +1730,7 @@ NEWLINE ("\r"|"\n"|"\r\n") <INITIAL>"<?" { if (CG(short_tags)) { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG; } else { @@ -1850,14 +1784,14 @@ inline_html: if (SCNG(output_filter)) { int readsize; size_t sz = 0; - readsize = SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); - zendlval->value.str.len = sz; + readsize = SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)yytext, (size_t)yyleng TSRMLS_CC); + Z_STRLEN_P(zendlval) = sz; if (readsize < yyleng) { yyless(readsize); } } else { - zendlval->value.str.val = (char *) estrndup(yytext, yyleng); - zendlval->value.str.len = yyleng; + Z_STRVAL_P(zendlval) = (char *) estrndup(yytext, yyleng); + Z_STRLEN_P(zendlval) = yyleng; } zendlval->type = IS_STRING; HANDLE_NEWLINES(yytext, yyleng); @@ -1985,9 +1919,7 @@ inline_html: } <ST_IN_SCRIPTING>("?>"|"</script"{WHITESPACE}*">"){NEWLINE}? { - zendlval->value.str.val = yytext; /* no copying - intentional */ - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ BEGIN(INITIAL); return T_CLOSE_TAG; /* implicit ';' at php-end tag */ } @@ -1996,9 +1928,7 @@ inline_html: <ST_IN_SCRIPTING>"%>"{NEWLINE}? { if (CG(asp_tags)) { BEGIN(INITIAL); - zendlval->value.str.len = yyleng; - zendlval->type = IS_STRING; - zendlval->value.str.val = yytext; /* no copying - intentional */ + ZVAL_STRINGL(zendlval, yytext, yyleng, 0); /* no copying - intentional */ return T_CLOSE_TAG; /* implicit ';' at php-end tag */ } else { yyless(1); @@ -2032,13 +1962,11 @@ inline_html: } } - zendlval->value.str.val = estrndup(yytext+bprefix+1, yyleng-bprefix-2); - zendlval->value.str.len = yyleng-bprefix-2; - zendlval->type = IS_STRING; + ZVAL_STRINGL(zendlval, yytext+bprefix+1, yyleng-bprefix-2, 1); /* convert escape sequences */ - s = t = zendlval->value.str.val; - end = s+zendlval->value.str.len; + s = t = Z_STRVAL_P(zendlval); + end = s+Z_STRLEN_P(zendlval); while (s<end) { if (*s=='\\') { s++; @@ -2047,7 +1975,7 @@ inline_html: case '\\': case '\'': *t++ = *s; - zendlval->value.str.len--; + Z_STRLEN_P(zendlval)--; break; default: *t++ = '\\'; @@ -2067,9 +1995,9 @@ inline_html: if (SCNG(output_filter)) { size_t sz = 0; - s = zendlval->value.str.val; - SCNG(output_filter)((unsigned char **)&(zendlval->value.str.val), &sz, (unsigned char *)s, (size_t)zendlval->value.str.len TSRMLS_CC); - zendlval->value.str.len = sz; + s = Z_STRVAL_P(zendlval); + SCNG(output_filter)((unsigned char **)&Z_STRVAL_P(zendlval), &sz, (unsigned char *)s, (size_t)Z_STRLEN_P(zendlval) TSRMLS_CC); + Z_STRLEN_P(zendlval) = sz; efree(s); } return T_CONSTANT_ENCAPSED_STRING; @@ -2187,7 +2115,7 @@ inline_html: <ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"{$" { - zendlval->value.lval = (long) '{'; + Z_LVAL_P(zendlval) = (long) '{'; yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); yyless(1); return T_CURLY_OPEN; diff --git a/Zend/zend_modules.h b/Zend/zend_modules.h index d4adcf5aac..00209a0ddc 100644 --- a/Zend/zend_modules.h +++ b/Zend/zend_modules.h @@ -33,7 +33,7 @@ #define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module TSRMLS_DC #define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module TSRMLS_CC -#define ZEND_MODULE_API_NO 20121212 +#define ZEND_MODULE_API_NO 20131106 #ifdef ZTS #define USING_ZTS 1 #else diff --git a/Zend/zend_multibyte.c b/Zend/zend_multibyte.c index dafcf18393..a75d074936 100644 --- a/Zend/zend_multibyte.c +++ b/Zend/zend_multibyte.c @@ -53,7 +53,7 @@ static size_t dummy_encoding_converter(unsigned char **to, size_t *to_length, co static int dummy_encoding_list_parser(const char *encoding_list, size_t encoding_list_len, const zend_encoding ***return_list, size_t *return_size, int persistent TSRMLS_DC) { *return_list = pemalloc(0, persistent); - return_size = 0; + *return_size = 0; return SUCCESS; } diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index f7be37036f..8beacdfd35 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -896,11 +896,8 @@ ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_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 (Z_ISREF_P(method_result_ptr) || Z_REFCOUNT_P(method_result_ptr) > 1) { - RETVAL_ZVAL(method_result_ptr, 1, 1); - } else { - RETVAL_ZVAL(method_result_ptr, 0, 1); - } + RETVAL_ZVAL_FAST(method_result_ptr); + zval_ptr_dtor(&method_result_ptr); } /* now destruct all auxiliaries */ @@ -1113,11 +1110,8 @@ ZEND_API void zend_std_callstatic_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{ zend_call_method_with_2_params(NULL, ce, &ce->__callstatic, ZEND_CALLSTATIC_FUNC_NAME, &method_result_ptr, method_name_ptr, method_args_ptr); if (method_result_ptr) { - if (Z_ISREF_P(method_result_ptr) || Z_REFCOUNT_P(method_result_ptr) > 1) { - RETVAL_ZVAL(method_result_ptr, 1, 1); - } else { - RETVAL_ZVAL(method_result_ptr, 0, 1); - } + RETVAL_ZVAL_FAST(method_result_ptr); + zval_ptr_dtor(&method_result_ptr); } /* now destruct all auxiliaries */ @@ -1651,6 +1645,8 @@ ZEND_API zend_object_handlers std_object_handlers = { NULL, /* get_debug_info */ zend_std_get_closure, /* get_closure */ zend_std_get_gc, /* get_gc */ + NULL, /* do_operation */ + NULL, /* compare */ }; /* diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h index 3ea6008350..07428737ff 100644 --- a/Zend/zend_object_handlers.h +++ b/Zend/zend_object_handlers.h @@ -100,6 +100,7 @@ typedef zend_object_value (*zend_object_clone_obj_t)(zval *object TSRMLS_DC); typedef zend_class_entry *(*zend_object_get_class_entry_t)(const zval *object TSRMLS_DC); typedef int (*zend_object_get_class_name_t)(const zval *object, const char **class_name, zend_uint *class_name_len, int parent TSRMLS_DC); typedef int (*zend_object_compare_t)(zval *object1, zval *object2 TSRMLS_DC); +typedef int (*zend_object_compare_zvals_t)(zval *resul, zval *op1, zval *op2 TSRMLS_DC); /* Cast an object to some other type */ @@ -113,6 +114,8 @@ typedef int (*zend_object_get_closure_t)(zval *obj, zend_class_entry **ce_ptr, u typedef HashTable *(*zend_object_get_gc_t)(zval *object, zval ***table, int *n TSRMLS_DC); +typedef int (*zend_object_do_operation_t)(zend_uchar opcode, zval *result, zval *op1, zval *op2 TSRMLS_DC); + struct _zend_object_handlers { /* general object functions */ zend_object_add_ref_t add_ref; @@ -142,6 +145,8 @@ struct _zend_object_handlers { zend_object_get_debug_info_t get_debug_info; zend_object_get_closure_t get_closure; zend_object_get_gc_t get_gc; + zend_object_do_operation_t do_operation; + zend_object_compare_zvals_t compare; }; extern ZEND_API zend_object_handlers std_object_handlers; diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index 2dfa9848b6..ac16e81ef1 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -546,11 +546,11 @@ static void zend_resolve_finally_call(zend_op_array *op_array, zend_uint op_num, while (i > 0) { i--; if (op_array->try_catch_array[i].finally_op && - op_num >= op_array->try_catch_array[i].try_op && - op_num < op_array->try_catch_array[i].finally_op - 1 && - (dst_num < op_array->try_catch_array[i].try_op || - dst_num > op_array->try_catch_array[i].finally_end)) { - + op_num >= op_array->try_catch_array[i].try_op && + op_num < op_array->try_catch_array[i].finally_op - 1 && + (dst_num < op_array->try_catch_array[i].try_op || + dst_num > op_array->try_catch_array[i].finally_end)) { + opline = get_next_op(op_array TSRMLS_CC); opline->opcode = ZEND_FAST_CALL; SET_UNUSED(opline->op1); @@ -570,7 +570,7 @@ static void zend_resolve_finally_call(zend_op_array *op_array, zend_uint op_num, SET_UNUSED(opline->op2); opline->op1.opline_num = start_op; - break; + break; } } } @@ -715,7 +715,7 @@ ZEND_API int pass_two(zend_op_array *op_array TSRMLS_DC) if (op_array->fn_flags & ZEND_ACC_GENERATOR) { if (opline->op1_type != IS_CONST || Z_TYPE_P(opline->op1.zv) != IS_NULL) { CG(zend_lineno) = opline->lineno; - zend_error(E_COMPILE_ERROR, "Generators cannot return values using \"return\""); + zend_error_noreturn(E_COMPILE_ERROR, "Generators cannot return values using \"return\""); } opline->opcode = ZEND_GENERATOR_RETURN; diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 5c84deb268..e8629291e5 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -192,7 +192,7 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC) /* {{{ */ if ((Z_TYPE_P(op)=is_numeric_string(strval, Z_STRLEN_P(op), &Z_LVAL_P(op), &Z_DVAL_P(op), 1)) == 0) { ZVAL_LONG(op, 0); } - STR_FREE(strval); + str_efree(strval); break; } case IS_BOOL: @@ -391,7 +391,7 @@ ZEND_API void convert_to_long_base(zval *op, int base) /* {{{ */ char *strval = Z_STRVAL_P(op); Z_LVAL_P(op) = strtol(strval, NULL, base); - STR_FREE(strval); + str_efree(strval); } break; case IS_ARRAY: @@ -451,7 +451,7 @@ ZEND_API void convert_to_double(zval *op) /* {{{ */ char *strval = Z_STRVAL_P(op); Z_DVAL_P(op) = zend_strtod(strval, NULL); - STR_FREE(strval); + str_efree(strval); } break; case IS_ARRAY: @@ -540,7 +540,7 @@ ZEND_API void convert_to_boolean(zval *op) /* {{{ */ } else { Z_LVAL_P(op) = 1; } - STR_FREE(strval); + str_efree(strval); } break; case IS_ARRAY: @@ -857,6 +857,8 @@ ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ * default: if (!converted) { + ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_ADD); + zendi_convert_scalar_to_number(op1, op1_copy, result); zendi_convert_scalar_to_number(op2, op2_copy, result); converted = 1; @@ -904,6 +906,8 @@ ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ * default: if (!converted) { + ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_SUB); + zendi_convert_scalar_to_number(op1, op1_copy, result); zendi_convert_scalar_to_number(op2, op2_copy, result); converted = 1; @@ -945,6 +949,8 @@ ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ * default: if (!converted) { + ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_MUL); + zendi_convert_scalar_to_number(op1, op1_copy, result); zendi_convert_scalar_to_number(op2, op2_copy, result); converted = 1; @@ -1010,6 +1016,8 @@ ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ * default: if (!converted) { + ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_DIV); + zendi_convert_scalar_to_number(op1, op1_copy, result); zendi_convert_scalar_to_number(op2, op2_copy, result); converted = 1; @@ -1027,9 +1035,15 @@ ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ * zval op1_copy, op2_copy; long op1_lval; - zendi_convert_to_long(op1, op1_copy, result); - op1_lval = Z_LVAL_P(op1); - zendi_convert_to_long(op2, op2_copy, result); + if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) { + ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_MOD); + + zendi_convert_to_long(op1, op1_copy, result); + op1_lval = Z_LVAL_P(op1); + zendi_convert_to_long(op2, op2_copy, result); + } else { + op1_lval = Z_LVAL_P(op1); + } if (Z_LVAL_P(op2) == 0) { zend_error(E_WARNING, "Division by zero"); @@ -1053,9 +1067,16 @@ ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) zval op1_copy, op2_copy; long op1_lval; - zendi_convert_to_boolean(op1, op1_copy, result); - op1_lval = Z_LVAL_P(op1); - zendi_convert_to_boolean(op2, op2_copy, result); + if (Z_TYPE_P(op1) != IS_BOOL || Z_TYPE_P(op2) != IS_BOOL) { + ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_BOOL_XOR); + + zendi_convert_to_boolean(op1, op1_copy, result); + op1_lval = Z_LVAL_P(op1); + zendi_convert_to_boolean(op2, op2_copy, result); + } else { + op1_lval = Z_LVAL_P(op1); + } + ZVAL_BOOL(result, op1_lval ^ Z_LVAL_P(op2)); return SUCCESS; } @@ -1065,7 +1086,12 @@ ZEND_API int boolean_not_function(zval *result, zval *op1 TSRMLS_DC) /* {{{ */ { zval op1_copy; - zendi_convert_to_boolean(op1, op1_copy, result); + if (Z_TYPE_P(op1) != IS_BOOL) { + ZEND_TRY_UNARY_OBJECT_OPERATION(ZEND_BOOL_NOT); + + zendi_convert_to_boolean(op1, op1_copy, result); + } + ZVAL_BOOL(result, !Z_LVAL_P(op1)); return SUCCESS; } @@ -1073,29 +1099,32 @@ ZEND_API int boolean_not_function(zval *result, zval *op1 TSRMLS_DC) /* {{{ */ ZEND_API int bitwise_not_function(zval *result, zval *op1 TSRMLS_DC) /* {{{ */ { - zval op1_copy = *op1; - - op1 = &op1_copy; - if (Z_TYPE_P(op1) == IS_LONG) { - ZVAL_LONG(result, ~Z_LVAL_P(op1)); - return SUCCESS; - } else if (Z_TYPE_P(op1) == IS_DOUBLE) { - ZVAL_LONG(result, ~zend_dval_to_lval(Z_DVAL_P(op1))); - return SUCCESS; - } else if (Z_TYPE_P(op1) == IS_STRING) { - int i; - - Z_TYPE_P(result) = IS_STRING; - Z_STRVAL_P(result) = estrndup(Z_STRVAL_P(op1), Z_STRLEN_P(op1)); - Z_STRLEN_P(result) = Z_STRLEN_P(op1); - for (i = 0; i < Z_STRLEN_P(op1); i++) { - Z_STRVAL_P(result)[i] = ~Z_STRVAL_P(op1)[i]; + switch (Z_TYPE_P(op1)) { + case IS_LONG: + ZVAL_LONG(result, ~Z_LVAL_P(op1)); + return SUCCESS; + case IS_DOUBLE: + ZVAL_LONG(result, ~zend_dval_to_lval(Z_DVAL_P(op1))); + return SUCCESS; + case IS_STRING: { + int i; + zval op1_copy = *op1; + + Z_TYPE_P(result) = IS_STRING; + Z_STRVAL_P(result) = estrndup(Z_STRVAL(op1_copy), Z_STRLEN(op1_copy)); + Z_STRLEN_P(result) = Z_STRLEN(op1_copy); + for (i = 0; i < Z_STRLEN(op1_copy); i++) { + Z_STRVAL_P(result)[i] = ~Z_STRVAL(op1_copy)[i]; + } + return SUCCESS; } - return SUCCESS; + default: + ZEND_TRY_UNARY_OBJECT_OPERATION(ZEND_BW_NOT); + + zend_error(E_ERROR, "Unsupported operand types"); + return FAILURE; } - zend_error(E_ERROR, "Unsupported operand types"); - return FAILURE; /* unknown datatype */ } /* }}} */ @@ -1124,15 +1153,22 @@ ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) / result_str[i] |= Z_STRVAL_P(shorter)[i]; } if (result==op1) { - STR_FREE(Z_STRVAL_P(result)); + str_efree(Z_STRVAL_P(result)); } Z_STRVAL_P(result) = result_str; Z_STRLEN_P(result) = result_len; return SUCCESS; } - zendi_convert_to_long(op1, op1_copy, result); - op1_lval = Z_LVAL_P(op1); - zendi_convert_to_long(op2, op2_copy, result); + + if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) { + ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_BW_OR); + + zendi_convert_to_long(op1, op1_copy, result); + op1_lval = Z_LVAL_P(op1); + zendi_convert_to_long(op2, op2_copy, result); + } else { + op1_lval = Z_LVAL_P(op1); + } ZVAL_LONG(result, op1_lval | Z_LVAL_P(op2)); return SUCCESS; @@ -1164,17 +1200,22 @@ ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) result_str[i] &= Z_STRVAL_P(longer)[i]; } if (result==op1) { - STR_FREE(Z_STRVAL_P(result)); + str_efree(Z_STRVAL_P(result)); } Z_STRVAL_P(result) = result_str; Z_STRLEN_P(result) = result_len; return SUCCESS; } + if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) { + ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_BW_AND); - zendi_convert_to_long(op1, op1_copy, result); - op1_lval = Z_LVAL_P(op1); - zendi_convert_to_long(op2, op2_copy, result); + zendi_convert_to_long(op1, op1_copy, result); + op1_lval = Z_LVAL_P(op1); + zendi_convert_to_long(op2, op2_copy, result); + } else { + op1_lval = Z_LVAL_P(op1); + } ZVAL_LONG(result, op1_lval & Z_LVAL_P(op2)); return SUCCESS; @@ -1206,16 +1247,22 @@ ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) result_str[i] ^= Z_STRVAL_P(longer)[i]; } if (result==op1) { - STR_FREE(Z_STRVAL_P(result)); + str_efree(Z_STRVAL_P(result)); } Z_STRVAL_P(result) = result_str; Z_STRLEN_P(result) = result_len; return SUCCESS; } - zendi_convert_to_long(op1, op1_copy, result); - op1_lval = Z_LVAL_P(op1); - zendi_convert_to_long(op2, op2_copy, result); + if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) { + ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_BW_XOR); + + zendi_convert_to_long(op1, op1_copy, result); + op1_lval = Z_LVAL_P(op1); + zendi_convert_to_long(op2, op2_copy, result); + } else { + op1_lval = Z_LVAL_P(op1); + } ZVAL_LONG(result, op1_lval ^ Z_LVAL_P(op2)); return SUCCESS; @@ -1227,9 +1274,16 @@ ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) / zval op1_copy, op2_copy; long op1_lval; - zendi_convert_to_long(op1, op1_copy, result); - op1_lval = Z_LVAL_P(op1); - zendi_convert_to_long(op2, op2_copy, result); + if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) { + ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_SL); + + zendi_convert_to_long(op1, op1_copy, result); + op1_lval = Z_LVAL_P(op1); + zendi_convert_to_long(op2, op2_copy, result); + } else { + op1_lval = Z_LVAL_P(op1); + } + ZVAL_LONG(result, op1_lval << Z_LVAL_P(op2)); return SUCCESS; } @@ -1240,9 +1294,16 @@ ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) zval op1_copy, op2_copy; long op1_lval; - zendi_convert_to_long(op1, op1_copy, result); - op1_lval = Z_LVAL_P(op1); - zendi_convert_to_long(op2, op2_copy, result); + if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) { + ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_SR); + + zendi_convert_to_long(op1, op1_copy, result); + op1_lval = Z_LVAL_P(op1); + zendi_convert_to_long(op2, op2_copy, result); + } else { + op1_lval = Z_LVAL_P(op1); + } + ZVAL_LONG(result, op1_lval >> Z_LVAL_P(op2)); return SUCCESS; } @@ -1252,14 +1313,8 @@ ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) ZEND_API int add_char_to_string(zval *result, const zval *op1, const zval *op2) /* {{{ */ { int length = Z_STRLEN_P(op1) + 1; - char *buf; + char *buf = str_erealloc(Z_STRVAL_P(op1), length + 1); - if (IS_INTERNED(Z_STRVAL_P(op1))) { - buf = (char *) emalloc(length + 1); - memcpy(buf, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); - } else { - buf = (char *) erealloc(Z_STRVAL_P(op1), length + 1); - } buf[length - 1] = (char) Z_LVAL_P(op2); buf[length] = 0; ZVAL_STRINGL(result, buf, length, 0); @@ -1271,14 +1326,8 @@ ZEND_API int add_char_to_string(zval *result, const zval *op1, const zval *op2) ZEND_API int add_string_to_string(zval *result, const zval *op1, const zval *op2) /* {{{ */ { int length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2); - char *buf; + char *buf = str_erealloc(Z_STRVAL_P(op1), length + 1); - if (IS_INTERNED(Z_STRVAL_P(op1))) { - buf = (char *) emalloc(length+1); - memcpy(buf, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); - } else { - buf = (char *) erealloc(Z_STRVAL_P(op1), length+1); - } memcpy(buf + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); buf[length] = 0; ZVAL_STRINGL(result, buf, length, 0); @@ -1291,11 +1340,15 @@ ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{ zval op1_copy, op2_copy; int use_copy1 = 0, use_copy2 = 0; - if (Z_TYPE_P(op1) != IS_STRING) { - zend_make_printable_zval(op1, &op1_copy, &use_copy1); - } - if (Z_TYPE_P(op2) != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); + if (Z_TYPE_P(op1) != IS_STRING || Z_TYPE_P(op2) != IS_STRING) { + ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_CONCAT); + + if (Z_TYPE_P(op1) != IS_STRING) { + zend_make_printable_zval(op1, &op1_copy, &use_copy1); + } + if (Z_TYPE_P(op2) != IS_STRING) { + zend_make_printable_zval(op2, &op2_copy, &use_copy2); + } } if (use_copy1) { @@ -1526,20 +1579,24 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* { ZVAL_LONG(result, -1); return SUCCESS; - case TYPE_PAIR(IS_OBJECT, IS_OBJECT): - /* If both are objects sharing the same comparision handler then use is */ - if (Z_OBJ_HANDLER_P(op1,compare_objects) == Z_OBJ_HANDLER_P(op2,compare_objects)) { + default: + if (Z_TYPE_P(op1) == IS_OBJECT && Z_OBJ_HANDLER_P(op1, compare)) { + return Z_OBJ_HANDLER_P(op1, compare)(result, op1, op2 TSRMLS_CC); + } else if (Z_TYPE_P(op2) == IS_OBJECT && Z_OBJ_HANDLER_P(op2, compare)) { + return Z_OBJ_HANDLER_P(op2, compare)(result, op1, op2 TSRMLS_CC); + } + + if (Z_TYPE_P(op1) == IS_OBJECT && Z_TYPE_P(op2) == IS_OBJECT) { if (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2)) { /* object handles are identical, apparently this is the same object */ ZVAL_LONG(result, 0); return SUCCESS; } - ZVAL_LONG(result, Z_OBJ_HT_P(op1)->compare_objects(op1, op2 TSRMLS_CC)); - return SUCCESS; + if (Z_OBJ_HANDLER_P(op1, compare_objects) == Z_OBJ_HANDLER_P(op2, compare_objects)) { + ZVAL_LONG(result, Z_OBJ_HANDLER_P(op1, compare_objects)(op1, op2 TSRMLS_CC)); + return SUCCESS; + } } - /* break missing intentionally */ - - default: if (Z_TYPE_P(op1) == IS_OBJECT) { if (Z_OBJ_HT_P(op1)->get) { op_free = Z_OBJ_HT_P(op1)->get(op1 TSRMLS_CC); @@ -1773,16 +1830,14 @@ static void increment_string(zval *str) /* {{{ */ int ch; if (Z_STRLEN_P(str) == 0) { - STR_FREE(Z_STRVAL_P(str)); + str_efree(Z_STRVAL_P(str)); Z_STRVAL_P(str) = estrndup("1", sizeof("1")-1); Z_STRLEN_P(str) = 1; return; } if (IS_INTERNED(s)) { - s = (char*) emalloc(Z_STRLEN_P(str) + 1); - memcpy(s, Z_STRVAL_P(str), Z_STRLEN_P(str) + 1); - Z_STRVAL_P(str) = s; + Z_STRVAL_P(str) = s = estrndup(s, Z_STRLEN_P(str)); } while (pos >= 0) { @@ -1840,7 +1895,7 @@ static void increment_string(zval *str) /* {{{ */ t[0] = 'a'; break; } - STR_FREE(Z_STRVAL_P(str)); + str_efree(Z_STRVAL_P(str)); Z_STRVAL_P(str) = t; } } @@ -1890,6 +1945,20 @@ ZEND_API int increment_function(zval *op1) /* {{{ */ } } break; + case IS_OBJECT: + if (Z_OBJ_HANDLER_P(op1, do_operation)) { + zval *op2; + int res; + TSRMLS_FETCH(); + + MAKE_STD_ZVAL(op2); + ZVAL_LONG(op2, 1); + res = Z_OBJ_HANDLER_P(op1, do_operation)(ZEND_ADD, op1, op1, op2 TSRMLS_CC); + zval_ptr_dtor(&op2); + + return res; + } + return FAILURE; default: return FAILURE; } @@ -1916,13 +1985,13 @@ ZEND_API int decrement_function(zval *op1) /* {{{ */ break; case IS_STRING: /* Like perl we only support string increment */ if (Z_STRLEN_P(op1) == 0) { /* consider as 0 */ - STR_FREE(Z_STRVAL_P(op1)); + str_efree(Z_STRVAL_P(op1)); ZVAL_LONG(op1, -1); break; } switch (is_numeric_string(Z_STRVAL_P(op1), Z_STRLEN_P(op1), &lval, &dval, 0)) { case IS_LONG: - STR_FREE(Z_STRVAL_P(op1)); + str_efree(Z_STRVAL_P(op1)); if (lval == LONG_MIN) { double d = (double)lval; ZVAL_DOUBLE(op1, d-1); @@ -1931,11 +2000,25 @@ ZEND_API int decrement_function(zval *op1) /* {{{ */ } break; case IS_DOUBLE: - STR_FREE(Z_STRVAL_P(op1)); + str_efree(Z_STRVAL_P(op1)); ZVAL_DOUBLE(op1, dval - 1); break; } break; + case IS_OBJECT: + if (Z_OBJ_HANDLER_P(op1, do_operation)) { + zval *op2; + int res; + TSRMLS_FETCH(); + + MAKE_STD_ZVAL(op2); + ZVAL_LONG(op2, 1); + res = Z_OBJ_HANDLER_P(op1, do_operation)(ZEND_SUB, op1, op1, op2 TSRMLS_CC); + zval_ptr_dtor(&op2); + + return res; + } + return FAILURE; default: return FAILURE; } diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index 815cf582b6..5c6fc869e7 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -269,11 +269,11 @@ static inline zend_uchar is_numeric_string(const char *str, int length, long *lv return is_numeric_string_ex(str, length, lval, dval, allow_errors, NULL); } -static inline char * -zend_memnstr(char *haystack, char *needle, int needle_len, char *end) +static inline const char * +zend_memnstr(const char *haystack, const char *needle, int needle_len, char *end) { - char *p = haystack; - char ne = needle[needle_len-1]; + const char *p = haystack; + const char ne = needle[needle_len-1]; if (needle_len == 1) { return (char *)memchr(p, *needle, (end-p)); @@ -443,6 +443,7 @@ END_EXTERN_C() #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_AST(zval) (zval).value.ast #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 @@ -458,6 +459,7 @@ END_EXTERN_C() #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_AST_P(zval_p) Z_AST(*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) @@ -473,6 +475,7 @@ END_EXTERN_C() #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_AST_PP(zval_p) Z_AST(**zval_p) #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) @@ -952,6 +955,24 @@ static zend_always_inline int fast_is_smaller_or_equal_function(zval *result, zv return Z_LVAL_P(result) <= 0; } +#define ZEND_TRY_BINARY_OBJECT_OPERATION(opcode) \ + if (Z_TYPE_P(op1) == IS_OBJECT && Z_OBJ_HANDLER_P(op1, do_operation)) { \ + if (SUCCESS == Z_OBJ_HANDLER_P(op1, do_operation)(opcode, result, op1, op2 TSRMLS_CC)) { \ + return SUCCESS; \ + } \ + } else if (Z_TYPE_P(op2) == IS_OBJECT && Z_OBJ_HANDLER_P(op2, do_operation)) { \ + if (SUCCESS == Z_OBJ_HANDLER_P(op2, do_operation)(opcode, result, op1, op2 TSRMLS_CC)) { \ + return SUCCESS; \ + } \ + } + +#define ZEND_TRY_UNARY_OBJECT_OPERATION(opcode) \ + if (Z_TYPE_P(op1) == IS_OBJECT && Z_OBJ_HANDLER_P(op1, do_operation) \ + && SUCCESS == Z_OBJ_HANDLER_P(op1, do_operation)(opcode, result, op1, NULL TSRMLS_CC) \ + ) { \ + return SUCCESS; \ + } + #endif /* diff --git a/Zend/zend_string.h b/Zend/zend_string.h index ebf8c816c1..27ba50be3d 100644 --- a/Zend/zend_string.h +++ b/Zend/zend_string.h @@ -56,12 +56,39 @@ END_EXTERN_C() } \ } while (0) +#define str_efree_rel(s) do { \ + if (!IS_INTERNED(s)) { \ + efree_rel((char *)s); \ + } \ + } while (0) + #define str_free(s) do { \ if (!IS_INTERNED(s)) { \ free((char*)s); \ } \ } while (0) +#define str_erealloc(str, new_len) \ + (IS_INTERNED(str) \ + ? _str_erealloc(str, new_len, INTERNED_LEN(str)) \ + : erealloc(str, new_len)) + +static inline char *_str_erealloc(char *str, size_t new_len, size_t old_len) { + char *buf = (char *) emalloc(new_len); + memcpy(buf, str, old_len); + return buf; +} + +#define str_estrndup(str, len) \ + (IS_INTERNED(str) ? (str) : estrndup((str), (len))) + +#define str_strndup(str, len) \ + (IS_INTERNED(str) ? (str) : zend_strndup((str), (len))); + +#define str_hash(str, len) \ + (IS_INTERNED(str) ? INTERNED_HASH(str) : zend_hash_func((str), (len)+1)) + + #endif /* ZEND_STRING_H */ /* diff --git a/Zend/zend_ts_hash.c b/Zend/zend_ts_hash.c index f517fe8560..337e289156 100644 --- a/Zend/zend_ts_hash.c +++ b/Zend/zend_ts_hash.c @@ -59,24 +59,24 @@ static void end_write(TsHashTable *ht) } /* 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) +ZEND_API int _zend_ts_hash_init(TsHashTable *ht, uint nSize, 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); + return _zend_hash_init(TS_HASH(ht), nSize, 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) +ZEND_API int _zend_ts_hash_init_ex(TsHashTable *ht, uint nSize, 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); + return _zend_hash_init_ex(TS_HASH(ht), nSize, pDestructor, persistent, bApplyProtection ZEND_FILE_LINE_RELAY_CC); } ZEND_API void zend_ts_hash_destroy(TsHashTable *ht) diff --git a/Zend/zend_ts_hash.h b/Zend/zend_ts_hash.h index 9a849e15ae..eda71c6081 100644 --- a/Zend/zend_ts_hash.h +++ b/Zend/zend_ts_hash.h @@ -37,15 +37,15 @@ 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 int _zend_ts_hash_init(TsHashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC); +ZEND_API int _zend_ts_hash_init_ex(TsHashTable *ht, uint nSize, 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) + _zend_ts_hash_init(ht, nSize, 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) + _zend_ts_hash_init_ex(ht, nSize, pDestructor, persistent, bApplyProtection ZEND_FILE_LINE_CC) /* additions/updates/changes */ diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c index c0e1849eef..3fa1b063a1 100644 --- a/Zend/zend_variables.c +++ b/Zend/zend_variables.c @@ -22,6 +22,7 @@ #include <stdio.h> #include "zend.h" #include "zend_API.h" +#include "zend_ast.h" #include "zend_globals.h" #include "zend_constants.h" #include "zend_list.h" @@ -33,7 +34,7 @@ ZEND_API void _zval_dtor_func(zval *zvalue ZEND_FILE_LINE_DC) case IS_STRING: case IS_CONSTANT: CHECK_ZVAL_STRING_REL(zvalue); - STR_FREE_REL(zvalue->value.str.val); + str_efree_rel(zvalue->value.str.val); break; case IS_ARRAY: case IS_CONSTANT_ARRAY: { @@ -47,6 +48,9 @@ ZEND_API void _zval_dtor_func(zval *zvalue ZEND_FILE_LINE_DC) } } break; + case IS_CONSTANT_AST: + zend_ast_destroy(Z_AST_P(zvalue)); + break; case IS_OBJECT: { TSRMLS_FETCH(); @@ -83,6 +87,7 @@ ZEND_API void _zval_internal_dtor(zval *zvalue ZEND_FILE_LINE_DC) break; case IS_ARRAY: case IS_CONSTANT_ARRAY: + case IS_CONSTANT_AST: case IS_OBJECT: case IS_RESOURCE: zend_error(E_CORE_ERROR, "Internal zval's can't be arrays, objects or resources"); @@ -139,6 +144,9 @@ ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC) zvalue->value.ht = tmp_ht; } break; + case IS_CONSTANT_AST: + Z_AST_P(zvalue) = zend_ast_copy(Z_AST_P(zvalue)); + break; case IS_OBJECT: { TSRMLS_FETCH(); diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c new file mode 100644 index 0000000000..d9da5cf4c0 --- /dev/null +++ b/Zend/zend_virtual_cwd.c @@ -0,0 +1,2005 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 5 | + +----------------------------------------------------------------------+ + | Copyright (c) 1997-2013 The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP 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.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans <andi@zend.com> | + | Sascha Schumann <sascha@schumann.cx> | + | Pierre Joye <pierre@php.net> | + +----------------------------------------------------------------------+ +*/ + +/* $Id$ */ + +#include <sys/types.h> +#include <sys/stat.h> +#include <string.h> +#include <stdio.h> +#include <limits.h> +#include <errno.h> +#include <stdlib.h> +#include <fcntl.h> +#include <time.h> + +#include "zend.h" +#include "zend_virtual_cwd.h" +#include "tsrm_strtok_r.h" + +#ifdef TSRM_WIN32 +#include <io.h> +#include "tsrm_win32.h" +# ifndef IO_REPARSE_TAG_SYMLINK +# define IO_REPARSE_TAG_SYMLINK 0xA000000C +# endif + +# ifndef IO_REPARSE_TAG_DEDUP +# define IO_REPARSE_TAG_DEDUP 0x80000013 +# endif + +# ifndef VOLUME_NAME_NT +# define VOLUME_NAME_NT 0x2 +# endif + +# ifndef VOLUME_NAME_DOS +# define VOLUME_NAME_DOS 0x0 +# endif +#endif + +#ifndef S_IFLNK +# define S_IFLNK 0120000 +#endif + +#ifdef NETWARE +#include <fsio.h> +#endif + +#ifndef HAVE_REALPATH +#define realpath(x,y) strcpy(y,x) +#endif + +#define VIRTUAL_CWD_DEBUG 0 + +#include "TSRM.h" + +/* Only need mutex for popen() in Windows and NetWare because it doesn't chdir() on UNIX */ +#if (defined(TSRM_WIN32) || defined(NETWARE)) && defined(ZTS) +MUTEX_T cwd_mutex; +#endif + +#ifdef ZTS +ts_rsrc_id cwd_globals_id; +#else +virtual_cwd_globals cwd_globals; +#endif + +cwd_state main_cwd_state; /* True global */ + +#ifndef TSRM_WIN32 +#include <unistd.h> +#else +#include <direct.h> +#endif + +#ifndef S_ISDIR +#define S_ISDIR(mode) ((mode) & _S_IFDIR) +#endif + +#ifndef S_ISREG +#define S_ISREG(mode) ((mode) & _S_IFREG) +#endif + +#ifdef TSRM_WIN32 +#include <tchar.h> +#define tsrm_strtok_r(a,b,c) _tcstok((a),(b)) +#define TOKENIZER_STRING "/\\" + +static int php_check_dots(const char *element, int n) +{ + while (n-- > 0) if (element[n] != '.') break; + + return (n != -1); +} + +#define IS_DIRECTORY_UP(element, len) \ + (len >= 2 && !php_check_dots(element, len)) + +#define IS_DIRECTORY_CURRENT(element, len) \ + (len == 1 && element[0] == '.') + +#elif defined(NETWARE) +/* NetWare has strtok() (in LibC) and allows both slashes in paths, like Windows -- + but rest of the stuff is like Unix */ +/* strtok() call in LibC is abending when used in a different address space -- hence using + PHP's version itself for now */ +/*#define tsrm_strtok_r(a,b,c) strtok((a),(b))*/ +#define TOKENIZER_STRING "/\\" + +#else +#define TOKENIZER_STRING "/" +#endif + +/* default macros */ + +#ifndef IS_DIRECTORY_UP +#define IS_DIRECTORY_UP(element, len) \ + (len == 2 && element[0] == '.' && element[1] == '.') +#endif + +#ifndef IS_DIRECTORY_CURRENT +#define IS_DIRECTORY_CURRENT(element, len) \ + (len == 1 && element[0] == '.') +#endif + +/* define this to check semantics */ +#define IS_DIR_OK(s) (1) + +#ifndef IS_DIR_OK +#define IS_DIR_OK(state) (php_is_dir_ok(state) == 0) +#endif + + +#define CWD_STATE_COPY(d, s) \ + (d)->cwd_length = (s)->cwd_length; \ + (d)->cwd = (char *) emalloc((s)->cwd_length+1); \ + memcpy((d)->cwd, (s)->cwd, (s)->cwd_length+1); + +#define CWD_STATE_FREE(s) \ + efree((s)->cwd); + +#ifdef TSRM_WIN32 +# define CWD_STATE_FREE_ERR(state) do { \ + DWORD last_error = GetLastError(); \ + CWD_STATE_FREE(state); \ + SetLastError(last_error); \ + } while (0) +#else +# define CWD_STATE_FREE_ERR(state) CWD_STATE_FREE(state) +#endif + +#ifdef TSRM_WIN32 + +#ifdef CTL_CODE +#undef CTL_CODE +#endif +#define CTL_CODE(DeviceType,Function,Method,Access) (((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method)) +#define FILE_DEVICE_FILE_SYSTEM 0x00000009 +#define METHOD_BUFFERED 0 +#define FILE_ANY_ACCESS 0 +#define FSCTL_GET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define MAXIMUM_REPARSE_DATA_BUFFER_SIZE ( 16 * 1024 ) + +typedef struct { + unsigned long ReparseTag; + unsigned short ReparseDataLength; + unsigned short Reserved; + union { + struct { + unsigned short SubstituteNameOffset; + unsigned short SubstituteNameLength; + unsigned short PrintNameOffset; + unsigned short PrintNameLength; + unsigned long Flags; + wchar_t ReparseTarget[1]; + } SymbolicLinkReparseBuffer; + struct { + unsigned short SubstituteNameOffset; + unsigned short SubstituteNameLength; + unsigned short PrintNameOffset; + unsigned short PrintNameLength; + wchar_t ReparseTarget[1]; + } MountPointReparseBuffer; + struct { + unsigned char ReparseTarget[1]; + } GenericReparseBuffer; + }; +} REPARSE_DATA_BUFFER; + +#define SECS_BETWEEN_EPOCHS (__int64)11644473600 +#define SECS_TO_100NS (__int64)10000000 +static inline time_t FileTimeToUnixTime(const FILETIME FileTime) +{ + __int64 UnixTime; + long *nsec = NULL; + SYSTEMTIME SystemTime; + FileTimeToSystemTime(&FileTime, &SystemTime); + + UnixTime = ((__int64)FileTime.dwHighDateTime << 32) + + FileTime.dwLowDateTime; + + UnixTime -= (SECS_BETWEEN_EPOCHS * SECS_TO_100NS); + + if (nsec) { + *nsec = (UnixTime % SECS_TO_100NS) * (__int64)100; + } + + UnixTime /= SECS_TO_100NS; /* now convert to seconds */ + + if ((time_t)UnixTime != UnixTime) { + UnixTime = 0; + } + return (time_t)UnixTime; +} + +CWD_API int php_sys_readlink(const char *link, char *target, size_t target_len){ /* {{{ */ + HINSTANCE kernel32; + HANDLE hFile; + DWORD dwRet; + + typedef BOOL (WINAPI *gfpnh_func)(HANDLE, LPTSTR, DWORD, DWORD); + gfpnh_func pGetFinalPathNameByHandle; + + kernel32 = LoadLibrary("kernel32.dll"); + + if (kernel32) { + pGetFinalPathNameByHandle = (gfpnh_func)GetProcAddress(kernel32, "GetFinalPathNameByHandleA"); + if (pGetFinalPathNameByHandle == NULL) { + return -1; + } + } else { + return -1; + } + + hFile = CreateFile(link, // file to open + GENERIC_READ, // open for reading + FILE_SHARE_READ, // share for reading + NULL, // default security + OPEN_EXISTING, // existing file only + FILE_FLAG_BACKUP_SEMANTICS, // normal file + NULL); // no attr. template + + if( hFile == INVALID_HANDLE_VALUE) { + return -1; + } + + dwRet = pGetFinalPathNameByHandle(hFile, target, MAXPATHLEN, VOLUME_NAME_DOS); + if(dwRet >= MAXPATHLEN) { + return -1; + } + + CloseHandle(hFile); + + if(dwRet > 4) { + /* Skip first 4 characters if they are "\??\" */ + if(target[0] == '\\' && target[1] == '\\' && target[2] == '?' && target[3] == '\\') { + char tmp[MAXPATHLEN]; + unsigned int offset = 4; + dwRet -= 4; + + /* \??\UNC\ */ + if (dwRet > 7 && target[4] == 'U' && target[5] == 'N' && target[6] == 'C') { + offset += 2; + dwRet -= 2; + target[offset] = '\\'; + } + + memcpy(tmp, target + offset, dwRet); + memcpy(target, tmp, dwRet); + } + } + + target[dwRet] = '\0'; + return dwRet; +} +/* }}} */ + +CWD_API int php_sys_stat_ex(const char *path, struct stat *buf, int lstat) /* {{{ */ +{ + WIN32_FILE_ATTRIBUTE_DATA data; + __int64 t; + const size_t path_len = strlen(path); + ALLOCA_FLAG(use_heap_large); + + if (!GetFileAttributesEx(path, GetFileExInfoStandard, &data)) { + return stat(path, buf); + } + + if (path_len >= 1 && path[1] == ':') { + if (path[0] >= 'A' && path[0] <= 'Z') { + buf->st_dev = buf->st_rdev = path[0] - 'A'; + } else { + buf->st_dev = buf->st_rdev = path[0] - 'a'; + } + } else if (IS_UNC_PATH(path, path_len)) { + buf->st_dev = buf->st_rdev = 0; + } else { + char cur_path[MAXPATHLEN+1]; + DWORD len = sizeof(cur_path); + char *tmp = cur_path; + + while(1) { + DWORD r = GetCurrentDirectory(len, tmp); + if (r < len) { + if (tmp[1] == ':') { + if (path[0] >= 'A' && path[0] <= 'Z') { + buf->st_dev = buf->st_rdev = path[0] - 'A'; + } else { + buf->st_dev = buf->st_rdev = path[0] - 'a'; + } + } else { + buf->st_dev = buf->st_rdev = -1; + } + break; + } else if (!r) { + buf->st_dev = buf->st_rdev = -1; + break; + } else { + len = r+1; + tmp = (char*)malloc(len); + } + } + if (tmp != cur_path) { + free(tmp); + } + } + + buf->st_uid = buf->st_gid = buf->st_ino = 0; + + if (lstat && data.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) { + /* File is a reparse point. Get the target */ + HANDLE hLink = NULL; + REPARSE_DATA_BUFFER * pbuffer; + unsigned int retlength = 0; + + hLink = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS, NULL); + if(hLink == INVALID_HANDLE_VALUE) { + return -1; + } + + pbuffer = (REPARSE_DATA_BUFFER *)do_alloca(MAXIMUM_REPARSE_DATA_BUFFER_SIZE, use_heap_large); + if(!DeviceIoControl(hLink, FSCTL_GET_REPARSE_POINT, NULL, 0, pbuffer, MAXIMUM_REPARSE_DATA_BUFFER_SIZE, &retlength, NULL)) { + free_alloca(pbuffer, use_heap_large); + CloseHandle(hLink); + return -1; + } + + CloseHandle(hLink); + + if(pbuffer->ReparseTag == IO_REPARSE_TAG_SYMLINK) { + buf->st_mode = S_IFLNK; + buf->st_mode |= (data.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ? (S_IREAD|(S_IREAD>>3)|(S_IREAD>>6)) : (S_IREAD|(S_IREAD>>3)|(S_IREAD>>6)|S_IWRITE|(S_IWRITE>>3)|(S_IWRITE>>6)); + } + +#if 0 /* Not used yet */ + else if(pbuffer->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) { + buf->st_mode |=; + } +#endif + free_alloca(pbuffer, use_heap_large); + } else { + buf->st_mode = (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? (S_IFDIR|S_IEXEC|(S_IEXEC>>3)|(S_IEXEC>>6)) : S_IFREG; + buf->st_mode |= (data.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ? (S_IREAD|(S_IREAD>>3)|(S_IREAD>>6)) : (S_IREAD|(S_IREAD>>3)|(S_IREAD>>6)|S_IWRITE|(S_IWRITE>>3)|(S_IWRITE>>6)); + } + + if ((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) { + int len = strlen(path); + + if (path[len-4] == '.') { + if (_memicmp(path+len-3, "exe", 3) == 0 || + _memicmp(path+len-3, "com", 3) == 0 || + _memicmp(path+len-3, "bat", 3) == 0 || + _memicmp(path+len-3, "cmd", 3) == 0) { + buf->st_mode |= (S_IEXEC|(S_IEXEC>>3)|(S_IEXEC>>6)); + } + } + } + + buf->st_nlink = 1; + t = data.nFileSizeHigh; + t = t << 32; + t |= data.nFileSizeLow; + buf->st_size = t; + buf->st_atime = FileTimeToUnixTime(data.ftLastAccessTime); + buf->st_ctime = FileTimeToUnixTime(data.ftCreationTime); + buf->st_mtime = FileTimeToUnixTime(data.ftLastWriteTime); + return 0; +} +/* }}} */ +#endif + +static int php_is_dir_ok(const cwd_state *state) /* {{{ */ +{ + struct stat buf; + + if (php_sys_stat(state->cwd, &buf) == 0 && S_ISDIR(buf.st_mode)) + return (0); + + return (1); +} +/* }}} */ + +static int php_is_file_ok(const cwd_state *state) /* {{{ */ +{ + struct stat buf; + + if (php_sys_stat(state->cwd, &buf) == 0 && S_ISREG(buf.st_mode)) + return (0); + + return (1); +} +/* }}} */ + +static void cwd_globals_ctor(virtual_cwd_globals *cwd_g TSRMLS_DC) /* {{{ */ +{ + CWD_STATE_COPY(&cwd_g->cwd, &main_cwd_state); + cwd_g->realpath_cache_size = 0; + cwd_g->realpath_cache_size_limit = REALPATH_CACHE_SIZE; + cwd_g->realpath_cache_ttl = REALPATH_CACHE_TTL; + memset(cwd_g->realpath_cache, 0, sizeof(cwd_g->realpath_cache)); +} +/* }}} */ + +static void cwd_globals_dtor(virtual_cwd_globals *cwd_g TSRMLS_DC) /* {{{ */ +{ + realpath_cache_clean(TSRMLS_C); +} +/* }}} */ + +CWD_API void virtual_cwd_startup(void) /* {{{ */ +{ + char cwd[MAXPATHLEN]; + char *result; + +#ifdef NETWARE + result = getcwdpath(cwd, NULL, 1); + if(result) + { + char *c=cwd; + while(c = strchr(c, '\\')) + { + *c='/'; + ++c; + } + } +#else + result = getcwd(cwd, sizeof(cwd)); +#endif + if (!result) { + cwd[0] = '\0'; + } + + main_cwd_state.cwd_length = strlen(cwd); +#ifdef TSRM_WIN32 + if (main_cwd_state.cwd_length >= 2 && cwd[1] == ':') { + cwd[0] = toupper(cwd[0]); + } +#endif + main_cwd_state.cwd = strdup(cwd); + +#ifdef ZTS + ts_allocate_id(&cwd_globals_id, sizeof(virtual_cwd_globals), (ts_allocate_ctor) cwd_globals_ctor, (ts_allocate_dtor) cwd_globals_dtor); +#else + cwd_globals_ctor(&cwd_globals TSRMLS_CC); +#endif + +#if (defined(TSRM_WIN32) || defined(NETWARE)) && defined(ZTS) + cwd_mutex = tsrm_mutex_alloc(); +#endif +} +/* }}} */ + +CWD_API void virtual_cwd_shutdown(void) /* {{{ */ +{ +#ifndef ZTS + cwd_globals_dtor(&cwd_globals TSRMLS_CC); +#endif +#if (defined(TSRM_WIN32) || defined(NETWARE)) && defined(ZTS) + tsrm_mutex_free(cwd_mutex); +#endif + + free(main_cwd_state.cwd); /* Don't use CWD_STATE_FREE because the non global states will probably use emalloc()/efree() */ +} +/* }}} */ + +CWD_API int virtual_cwd_activate(TSRMLS_D) /* {{{ */ +{ + if (CWDG(cwd).cwd == NULL) { + CWD_STATE_COPY(&CWDG(cwd), &main_cwd_state); + } + return 0; +} +/* }}} */ + +CWD_API int virtual_cwd_deactivate(TSRMLS_D) /* {{{ */ +{ + if (CWDG(cwd).cwd != NULL) { + CWD_STATE_FREE(&CWDG(cwd)); + CWDG(cwd).cwd = NULL; + } + return 0; +} +/* }}} */ + +CWD_API char *virtual_getcwd_ex(size_t *length TSRMLS_DC) /* {{{ */ +{ + cwd_state *state; + + state = &CWDG(cwd); + + if (state->cwd_length == 0) { + char *retval; + + *length = 1; + retval = (char *) emalloc(2); + if (retval == NULL) { + return NULL; + } + retval[0] = DEFAULT_SLASH; + retval[1] = '\0'; + return retval; + } + +#ifdef TSRM_WIN32 + /* If we have something like C: */ + if (state->cwd_length == 2 && state->cwd[state->cwd_length-1] == ':') { + char *retval; + + *length = state->cwd_length+1; + retval = (char *) emalloc(*length+1); + if (retval == NULL) { + return NULL; + } + memcpy(retval, state->cwd, *length); + retval[0] = toupper(retval[0]); + retval[*length-1] = DEFAULT_SLASH; + retval[*length] = '\0'; + return retval; + } +#endif + *length = state->cwd_length; + return estrdup(state->cwd); +} +/* }}} */ + +/* Same semantics as UNIX getcwd() */ +CWD_API char *virtual_getcwd(char *buf, size_t size TSRMLS_DC) /* {{{ */ +{ + size_t length; + char *cwd; + + cwd = virtual_getcwd_ex(&length TSRMLS_CC); + + if (buf == NULL) { + return cwd; + } + if (length > size-1) { + efree(cwd); + errno = ERANGE; /* Is this OK? */ + return NULL; + } + memcpy(buf, cwd, length+1); + efree(cwd); + return buf; +} +/* }}} */ + +#ifdef PHP_WIN32 +static inline unsigned long realpath_cache_key(const char *path, int path_len TSRMLS_DC) /* {{{ */ +{ + register unsigned long h; + char *bucket_key_start = tsrm_win32_get_path_sid_key(path TSRMLS_CC); + char *bucket_key = (char *)bucket_key_start; + const char *e = bucket_key + strlen(bucket_key); + + if (!bucket_key) { + return 0; + } + + for (h = 2166136261U; bucket_key < e;) { + h *= 16777619; + h ^= *bucket_key++; + } + HeapFree(GetProcessHeap(), 0, (LPVOID)bucket_key_start); + return h; +} +/* }}} */ +#else +static inline unsigned long realpath_cache_key(const char *path, int path_len) /* {{{ */ +{ + register unsigned long h; + const char *e = path + path_len; + + for (h = 2166136261U; path < e;) { + h *= 16777619; + h ^= *path++; + } + + return h; +} +/* }}} */ +#endif /* defined(PHP_WIN32) */ + +CWD_API void realpath_cache_clean(TSRMLS_D) /* {{{ */ +{ + int i; + + for (i = 0; i < sizeof(CWDG(realpath_cache))/sizeof(CWDG(realpath_cache)[0]); i++) { + realpath_cache_bucket *p = CWDG(realpath_cache)[i]; + while (p != NULL) { + realpath_cache_bucket *r = p; + p = p->next; + free(r); + } + CWDG(realpath_cache)[i] = NULL; + } + CWDG(realpath_cache_size) = 0; +} +/* }}} */ + +CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC) /* {{{ */ +{ +#ifdef PHP_WIN32 + unsigned long key = realpath_cache_key(path, path_len TSRMLS_CC); +#else + unsigned long key = realpath_cache_key(path, path_len); +#endif + unsigned long n = key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0])); + realpath_cache_bucket **bucket = &CWDG(realpath_cache)[n]; + + while (*bucket != NULL) { + if (key == (*bucket)->key && path_len == (*bucket)->path_len && + memcmp(path, (*bucket)->path, path_len) == 0) { + realpath_cache_bucket *r = *bucket; + *bucket = (*bucket)->next; + + /* if the pointers match then only subtract the length of the path */ + if(r->path == r->realpath) { + CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1; + } else { + CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1; + } + + free(r); + return; + } else { + bucket = &(*bucket)->next; + } + } +} +/* }}} */ + +static inline void realpath_cache_add(const char *path, int path_len, const char *realpath, int realpath_len, int is_dir, time_t t TSRMLS_DC) /* {{{ */ +{ + long size = sizeof(realpath_cache_bucket) + path_len + 1; + int same = 1; + + if (realpath_len != path_len || + memcmp(path, realpath, path_len) != 0) { + size += realpath_len + 1; + same = 0; + } + + if (CWDG(realpath_cache_size) + size <= CWDG(realpath_cache_size_limit)) { + realpath_cache_bucket *bucket = malloc(size); + unsigned long n; + + if (bucket == NULL) { + return; + } + +#ifdef PHP_WIN32 + bucket->key = realpath_cache_key(path, path_len TSRMLS_CC); +#else + bucket->key = realpath_cache_key(path, path_len); +#endif + bucket->path = (char*)bucket + sizeof(realpath_cache_bucket); + memcpy(bucket->path, path, path_len+1); + bucket->path_len = path_len; + if (same) { + bucket->realpath = bucket->path; + } else { + bucket->realpath = bucket->path + (path_len + 1); + memcpy(bucket->realpath, realpath, realpath_len+1); + } + bucket->realpath_len = realpath_len; + bucket->is_dir = is_dir; +#ifdef PHP_WIN32 + bucket->is_rvalid = 0; + bucket->is_readable = 0; + bucket->is_wvalid = 0; + bucket->is_writable = 0; +#endif + bucket->expires = t + CWDG(realpath_cache_ttl); + n = bucket->key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0])); + bucket->next = CWDG(realpath_cache)[n]; + CWDG(realpath_cache)[n] = bucket; + CWDG(realpath_cache_size) += size; + } +} +/* }}} */ + +static inline realpath_cache_bucket* realpath_cache_find(const char *path, int path_len, time_t t TSRMLS_DC) /* {{{ */ +{ +#ifdef PHP_WIN32 + unsigned long key = realpath_cache_key(path, path_len TSRMLS_CC); +#else + unsigned long key = realpath_cache_key(path, path_len); +#endif + + unsigned long n = key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0])); + realpath_cache_bucket **bucket = &CWDG(realpath_cache)[n]; + + while (*bucket != NULL) { + if (CWDG(realpath_cache_ttl) && (*bucket)->expires < t) { + realpath_cache_bucket *r = *bucket; + *bucket = (*bucket)->next; + + /* if the pointers match then only subtract the length of the path */ + if(r->path == r->realpath) { + CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1; + } else { + CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1; + } + free(r); + } else if (key == (*bucket)->key && path_len == (*bucket)->path_len && + memcmp(path, (*bucket)->path, path_len) == 0) { + return *bucket; + } else { + bucket = &(*bucket)->next; + } + } + return NULL; +} +/* }}} */ + +CWD_API realpath_cache_bucket* realpath_cache_lookup(const char *path, int path_len, time_t t TSRMLS_DC) /* {{{ */ +{ + return realpath_cache_find(path, path_len, t TSRMLS_CC); +} +/* }}} */ + +CWD_API int realpath_cache_size(TSRMLS_D) +{ + return CWDG(realpath_cache_size); +} + +CWD_API int realpath_cache_max_buckets(TSRMLS_D) +{ + return (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0])); +} + +CWD_API realpath_cache_bucket** realpath_cache_get_buckets(TSRMLS_D) +{ + return CWDG(realpath_cache); +} + + +#undef LINK_MAX +#define LINK_MAX 32 + +static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, int use_realpath, int is_dir, int *link_is_dir TSRMLS_DC) /* {{{ */ +{ + int i, j, save; + int directory = 0; +#ifdef TSRM_WIN32 + WIN32_FIND_DATA data; + HANDLE hFind; + ALLOCA_FLAG(use_heap_large) +#else + struct stat st; +#endif + realpath_cache_bucket *bucket; + char *tmp; + ALLOCA_FLAG(use_heap) + + while (1) { + if (len <= start) { + if (link_is_dir) { + *link_is_dir = 1; + } + return start; + } + + i = len; + while (i > start && !IS_SLASH(path[i-1])) { + i--; + } + + if (i == len || + (i == len - 1 && path[i] == '.')) { + /* remove double slashes and '.' */ + len = i - 1; + is_dir = 1; + continue; + } else if (i == len - 2 && path[i] == '.' && path[i+1] == '.') { + /* remove '..' and previous directory */ + is_dir = 1; + if (link_is_dir) { + *link_is_dir = 1; + } + if (i - 1 <= start) { + return start ? start : len; + } + j = tsrm_realpath_r(path, start, i-1, ll, t, use_realpath, 1, NULL TSRMLS_CC); + if (j > start) { + j--; + while (j > start && !IS_SLASH(path[j])) { + j--; + } + if (!start) { + /* leading '..' must not be removed in case of relative path */ + if (j == 0 && path[0] == '.' && path[1] == '.' && + IS_SLASH(path[2])) { + path[3] = '.'; + path[4] = '.'; + path[5] = DEFAULT_SLASH; + j = 5; + } else if (j > 0 && + path[j+1] == '.' && path[j+2] == '.' && + IS_SLASH(path[j+3])) { + j += 4; + path[j++] = '.'; + path[j++] = '.'; + path[j] = DEFAULT_SLASH; + } + } + } else if (!start && !j) { + /* leading '..' must not be removed in case of relative path */ + path[0] = '.'; + path[1] = '.'; + path[2] = DEFAULT_SLASH; + j = 2; + } + return j; + } + + path[len] = 0; + + save = (use_realpath != CWD_EXPAND); + + if (start && save && CWDG(realpath_cache_size_limit)) { + /* cache lookup for absolute path */ + if (!*t) { + *t = time(0); + } + if ((bucket = realpath_cache_find(path, len, *t TSRMLS_CC)) != NULL) { + if (is_dir && !bucket->is_dir) { + /* not a directory */ + return -1; + } else { + if (link_is_dir) { + *link_is_dir = bucket->is_dir; + } + memcpy(path, bucket->realpath, bucket->realpath_len + 1); + return bucket->realpath_len; + } + } + } + +#ifdef TSRM_WIN32 + if (save && (hFind = FindFirstFile(path, &data)) == INVALID_HANDLE_VALUE) { + if (use_realpath == CWD_REALPATH) { + /* file not found */ + return -1; + } + /* continue resolution anyway but don't save result in the cache */ + save = 0; + } + + if (save) { + FindClose(hFind); + } + + tmp = do_alloca(len+1, use_heap); + memcpy(tmp, path, len+1); + + if(save && + !(IS_UNC_PATH(path, len) && len >= 3 && path[2] != '?') && + (data.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)) { + /* File is a reparse point. Get the target */ + HANDLE hLink = NULL; + REPARSE_DATA_BUFFER * pbuffer; + unsigned int retlength = 0; + int bufindex = 0, isabsolute = 0; + wchar_t * reparsetarget; + BOOL isVolume = FALSE; + char printname[MAX_PATH]; + char substitutename[MAX_PATH]; + int printname_len, substitutename_len; + int substitutename_off = 0; + + if(++(*ll) > LINK_MAX) { + return -1; + } + + hLink = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS, NULL); + if(hLink == INVALID_HANDLE_VALUE) { + return -1; + } + + pbuffer = (REPARSE_DATA_BUFFER *)do_alloca(MAXIMUM_REPARSE_DATA_BUFFER_SIZE, use_heap_large); + if (pbuffer == NULL) { + return -1; + } + if(!DeviceIoControl(hLink, FSCTL_GET_REPARSE_POINT, NULL, 0, pbuffer, MAXIMUM_REPARSE_DATA_BUFFER_SIZE, &retlength, NULL)) { + free_alloca(pbuffer, use_heap_large); + CloseHandle(hLink); + return -1; + } + + CloseHandle(hLink); + + if(pbuffer->ReparseTag == IO_REPARSE_TAG_SYMLINK) { + reparsetarget = pbuffer->SymbolicLinkReparseBuffer.ReparseTarget; + printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR); + isabsolute = (pbuffer->SymbolicLinkReparseBuffer.Flags == 0) ? 1 : 0; + if (!WideCharToMultiByte(CP_THREAD_ACP, 0, + reparsetarget + pbuffer->MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR), + printname_len + 1, + printname, MAX_PATH, NULL, NULL + )) { + free_alloca(pbuffer, use_heap_large); + return -1; + }; + printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR); + printname[printname_len] = 0; + + substitutename_len = pbuffer->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR); + if (!WideCharToMultiByte(CP_THREAD_ACP, 0, + reparsetarget + pbuffer->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR), + substitutename_len + 1, + substitutename, MAX_PATH, NULL, NULL + )) { + free_alloca(pbuffer, use_heap_large); + return -1; + }; + substitutename[substitutename_len] = 0; + } + else if(pbuffer->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) { + isabsolute = 1; + reparsetarget = pbuffer->MountPointReparseBuffer.ReparseTarget; + printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR); + if (!WideCharToMultiByte(CP_THREAD_ACP, 0, + reparsetarget + pbuffer->MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR), + printname_len + 1, + printname, MAX_PATH, NULL, NULL + )) { + free_alloca(pbuffer, use_heap_large); + return -1; + }; + printname[pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR)] = 0; + + substitutename_len = pbuffer->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR); + if (!WideCharToMultiByte(CP_THREAD_ACP, 0, + reparsetarget + pbuffer->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR), + substitutename_len + 1, + substitutename, MAX_PATH, NULL, NULL + )) { + free_alloca(pbuffer, use_heap_large); + return -1; + }; + substitutename[substitutename_len] = 0; + } + else if (pbuffer->ReparseTag == IO_REPARSE_TAG_DEDUP) { + isabsolute = 1; + memcpy(substitutename, path, len + 1); + substitutename_len = len; + } else { + free_alloca(pbuffer, use_heap_large); + return -1; + } + + if(isabsolute && substitutename_len > 4) { + /* Do not resolve volumes (for now). A mounted point can + target a volume without a drive, it is not certain that + all IO functions we use in php and its deps support + path with volume GUID instead of the DOS way, like: + d:\test\mnt\foo + \\?\Volume{62d1c3f8-83b9-11de-b108-806e6f6e6963}\foo + */ + if (strncmp(substitutename, "\\??\\Volume{",11) == 0 + || strncmp(substitutename, "\\\\?\\Volume{",11) == 0 + || strncmp(substitutename, "\\??\\UNC\\", 8) == 0 + ) { + isVolume = TRUE; + substitutename_off = 0; + } else + /* do not use the \??\ and \\?\ prefix*/ + if (strncmp(substitutename, "\\??\\", 4) == 0 + || strncmp(substitutename, "\\\\?\\", 4) == 0) { + substitutename_off = 4; + } + } + + if (!isVolume) { + char * tmp2 = substitutename + substitutename_off; + for(bufindex = 0; bufindex < (substitutename_len - substitutename_off); bufindex++) { + *(path + bufindex) = *(tmp2 + bufindex); + } + + *(path + bufindex) = 0; + j = bufindex; + } else { + j = len; + } + + +#if VIRTUAL_CWD_DEBUG + fprintf(stderr, "reparse: print: %s ", printname); + fprintf(stderr, "sub: %s ", substitutename); + fprintf(stderr, "resolved: %s ", path); +#endif + free_alloca(pbuffer, use_heap_large); + + if(isabsolute == 1) { + if (!((j == 3) && (path[1] == ':') && (path[2] == '\\'))) { + /* use_realpath is 0 in the call below coz path is absolute*/ + j = tsrm_realpath_r(path, 0, j, ll, t, 0, is_dir, &directory TSRMLS_CC); + if(j < 0) { + free_alloca(tmp, use_heap); + return -1; + } + } + } + else { + if(i + j >= MAXPATHLEN - 1) { + free_alloca(tmp, use_heap); + return -1; + } + + memmove(path+i, path, j+1); + memcpy(path, tmp, i-1); + path[i-1] = DEFAULT_SLASH; + j = tsrm_realpath_r(path, start, i + j, ll, t, use_realpath, is_dir, &directory TSRMLS_CC); + if(j < 0) { + free_alloca(tmp, use_heap); + return -1; + } + } + directory = (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY); + + if(link_is_dir) { + *link_is_dir = directory; + } + } + else { + if (save) { + directory = (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0; + if (is_dir && !directory) { + /* not a directory */ + return -1; + } + } + +#elif defined(NETWARE) + save = 0; + tmp = do_alloca(len+1, use_heap); + memcpy(tmp, path, len+1); +#else + if (save && php_sys_lstat(path, &st) < 0) { + if (use_realpath == CWD_REALPATH) { + /* file not found */ + return -1; + } + /* continue resolution anyway but don't save result in the cache */ + save = 0; + } + + tmp = do_alloca(len+1, use_heap); + memcpy(tmp, path, len+1); + + if (save && S_ISLNK(st.st_mode)) { + if (++(*ll) > LINK_MAX || (j = php_sys_readlink(tmp, path, MAXPATHLEN)) < 0) { + /* too many links or broken symlinks */ + free_alloca(tmp, use_heap); + return -1; + } + path[j] = 0; + if (IS_ABSOLUTE_PATH(path, j)) { + j = tsrm_realpath_r(path, 1, j, ll, t, use_realpath, is_dir, &directory TSRMLS_CC); + if (j < 0) { + free_alloca(tmp, use_heap); + return -1; + } + } else { + if (i + j >= MAXPATHLEN-1) { + free_alloca(tmp, use_heap); + return -1; /* buffer overflow */ + } + memmove(path+i, path, j+1); + memcpy(path, tmp, i-1); + path[i-1] = DEFAULT_SLASH; + j = tsrm_realpath_r(path, start, i + j, ll, t, use_realpath, is_dir, &directory TSRMLS_CC); + if (j < 0) { + free_alloca(tmp, use_heap); + return -1; + } + } + if (link_is_dir) { + *link_is_dir = directory; + } + } else { + if (save) { + directory = S_ISDIR(st.st_mode); + if (link_is_dir) { + *link_is_dir = directory; + } + if (is_dir && !directory) { + /* not a directory */ + free_alloca(tmp, use_heap); + return -1; + } + } +#endif + if (i - 1 <= start) { + j = start; + } else { + /* some leading directories may be unaccessable */ + j = tsrm_realpath_r(path, start, i-1, ll, t, save ? CWD_FILEPATH : use_realpath, 1, NULL TSRMLS_CC); + if (j > start) { + path[j++] = DEFAULT_SLASH; + } + } +#ifdef TSRM_WIN32 + if (j < 0 || j + len - i >= MAXPATHLEN-1) { + free_alloca(tmp, use_heap); + return -1; + } + if (save) { + i = strlen(data.cFileName); + memcpy(path+j, data.cFileName, i+1); + j += i; + } else { + /* use the original file or directory name as it wasn't found */ + memcpy(path+j, tmp+i, len-i+1); + j += (len-i); + } + } +#else + if (j < 0 || j + len - i >= MAXPATHLEN-1) { + free_alloca(tmp, use_heap); + return -1; + } + memcpy(path+j, tmp+i, len-i+1); + j += (len-i); + } +#endif + + if (save && start && CWDG(realpath_cache_size_limit)) { + /* save absolute path in the cache */ + realpath_cache_add(tmp, len, path, j, directory, *t TSRMLS_CC); + } + + free_alloca(tmp, use_heap); + return j; + } +} +/* }}} */ + +/* Resolve path relatively to state and put the real path into state */ +/* returns 0 for ok, 1 for error */ +CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath TSRMLS_DC) /* {{{ */ +{ + int path_length = strlen(path); + char resolved_path[MAXPATHLEN]; + int start = 1; + int ll = 0; + time_t t; + int ret; + int add_slash; + void *tmp; + + if (path_length == 0 || path_length >= MAXPATHLEN-1) { +#ifdef TSRM_WIN32 +# if _MSC_VER < 1300 + errno = EINVAL; +# else + _set_errno(EINVAL); +# endif +#else + errno = EINVAL; +#endif + return 1; + } + +#if VIRTUAL_CWD_DEBUG + fprintf(stderr,"cwd = %s path = %s\n", state->cwd, path); +#endif + + /* cwd_length can be 0 when getcwd() fails. + * This can happen under solaris when a dir does not have read permissions + * but *does* have execute permissions */ + if (!IS_ABSOLUTE_PATH(path, path_length)) { + if (state->cwd_length == 0) { + /* resolve relative path */ + start = 0; + memcpy(resolved_path , path, path_length + 1); + } else { + int state_cwd_length = state->cwd_length; + +#ifdef TSRM_WIN32 + if (IS_SLASH(path[0])) { + if (state->cwd[1] == ':') { + /* Copy only the drive name */ + state_cwd_length = 2; + } else if (IS_UNC_PATH(state->cwd, state->cwd_length)) { + /* Copy only the share name */ + state_cwd_length = 2; + while (IS_SLASH(state->cwd[state_cwd_length])) { + state_cwd_length++; + } + while (state->cwd[state_cwd_length] && + !IS_SLASH(state->cwd[state_cwd_length])) { + state_cwd_length++; + } + while (IS_SLASH(state->cwd[state_cwd_length])) { + state_cwd_length++; + } + while (state->cwd[state_cwd_length] && + !IS_SLASH(state->cwd[state_cwd_length])) { + state_cwd_length++; + } + } + } +#endif + if (path_length + state_cwd_length + 1 >= MAXPATHLEN-1) { + return 1; + } + memcpy(resolved_path, state->cwd, state_cwd_length); + if (resolved_path[state_cwd_length-1] == DEFAULT_SLASH) { + memcpy(resolved_path + state_cwd_length, path, path_length + 1); + path_length += state_cwd_length; + } else { + resolved_path[state_cwd_length] = DEFAULT_SLASH; + memcpy(resolved_path + state_cwd_length + 1, path, path_length + 1); + path_length += state_cwd_length + 1; + } + } + } else { +#ifdef TSRM_WIN32 + if (path_length > 2 && path[1] == ':' && !IS_SLASH(path[2])) { + resolved_path[0] = path[0]; + resolved_path[1] = ':'; + resolved_path[2] = DEFAULT_SLASH; + memcpy(resolved_path + 3, path + 2, path_length - 1); + path_length++; + } else +#endif + memcpy(resolved_path, path, path_length + 1); + } + +#ifdef TSRM_WIN32 + if (memchr(resolved_path, '*', path_length) || + memchr(resolved_path, '?', path_length)) { + return 1; + } +#endif + +#ifdef TSRM_WIN32 + if (IS_UNC_PATH(resolved_path, path_length)) { + /* skip UNC name */ + resolved_path[0] = DEFAULT_SLASH; + resolved_path[1] = DEFAULT_SLASH; + start = 2; + while (!IS_SLASH(resolved_path[start])) { + if (resolved_path[start] == 0) { + goto verify; + } + resolved_path[start] = toupper(resolved_path[start]); + start++; + } + resolved_path[start++] = DEFAULT_SLASH; + while (!IS_SLASH(resolved_path[start])) { + if (resolved_path[start] == 0) { + goto verify; + } + resolved_path[start] = toupper(resolved_path[start]); + start++; + } + resolved_path[start++] = DEFAULT_SLASH; + } else if (IS_ABSOLUTE_PATH(resolved_path, path_length)) { + /* skip DRIVE name */ + resolved_path[0] = toupper(resolved_path[0]); + resolved_path[2] = DEFAULT_SLASH; + start = 3; + } +#elif defined(NETWARE) + if (IS_ABSOLUTE_PATH(resolved_path, path_length)) { + /* skip VOLUME name */ + start = 0; + while (start != ':') { + if (resolved_path[start] == 0) return -1; + start++; + } + start++; + if (!IS_SLASH(resolved_path[start])) return -1; + resolved_path[start++] = DEFAULT_SLASH; + } +#endif + + add_slash = (use_realpath != CWD_REALPATH) && path_length > 0 && IS_SLASH(resolved_path[path_length-1]); + t = CWDG(realpath_cache_ttl) ? 0 : -1; + path_length = tsrm_realpath_r(resolved_path, start, path_length, &ll, &t, use_realpath, 0, NULL TSRMLS_CC); + + if (path_length < 0) { + errno = ENOENT; + return 1; + } + + if (!start && !path_length) { + resolved_path[path_length++] = '.'; + } + if (add_slash && path_length && !IS_SLASH(resolved_path[path_length-1])) { + if (path_length >= MAXPATHLEN-1) { + return -1; + } + resolved_path[path_length++] = DEFAULT_SLASH; + } + resolved_path[path_length] = 0; + +#ifdef TSRM_WIN32 +verify: +#endif + if (verify_path) { + cwd_state old_state; + + CWD_STATE_COPY(&old_state, state); + state->cwd_length = path_length; + + tmp = erealloc(state->cwd, state->cwd_length+1); + if (tmp == NULL) { +#if VIRTUAL_CWD_DEBUG + fprintf (stderr, "Out of memory\n"); +#endif + return 1; + } + state->cwd = (char *) tmp; + + memcpy(state->cwd, resolved_path, state->cwd_length+1); + if (verify_path(state)) { + CWD_STATE_FREE(state); + *state = old_state; + ret = 1; + } else { + CWD_STATE_FREE(&old_state); + ret = 0; + } + } else { + state->cwd_length = path_length; + tmp = erealloc(state->cwd, state->cwd_length+1); + if (tmp == NULL) { +#if VIRTUAL_CWD_DEBUG + fprintf (stderr, "Out of memory\n"); +#endif + return 1; + } + state->cwd = (char *) tmp; + + memcpy(state->cwd, resolved_path, state->cwd_length+1); + ret = 0; + } + +#if VIRTUAL_CWD_DEBUG + fprintf (stderr, "virtual_file_ex() = %s\n",state->cwd); +#endif + return (ret); +} +/* }}} */ + +CWD_API int virtual_chdir(const char *path TSRMLS_DC) /* {{{ */ +{ + return virtual_file_ex(&CWDG(cwd), path, php_is_dir_ok, CWD_REALPATH TSRMLS_CC)?-1:0; +} +/* }}} */ + +CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path TSRMLS_DC) TSRMLS_DC) /* {{{ */ +{ + int length = strlen(path); + char *temp; + int retval; + ALLOCA_FLAG(use_heap) + + if (length == 0) { + return 1; /* Can't cd to empty string */ + } + while(--length >= 0 && !IS_SLASH(path[length])) { + } + + if (length == -1) { + /* No directory only file name */ + errno = ENOENT; + return -1; + } + + if (length == COPY_WHEN_ABSOLUTE(path) && IS_ABSOLUTE_PATH(path, length+1)) { /* Also use trailing slash if this is absolute */ + length++; + } + temp = (char *) do_alloca(length+1, use_heap); + memcpy(temp, path, length); + temp[length] = 0; +#if VIRTUAL_CWD_DEBUG + fprintf (stderr, "Changing directory to %s\n", temp); +#endif + retval = p_chdir(temp TSRMLS_CC); + free_alloca(temp, use_heap); + return retval; +} +/* }}} */ + +CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC) /* {{{ */ +{ + cwd_state new_state; + char *retval; + char cwd[MAXPATHLEN]; + + /* realpath("") returns CWD */ + if (!*path) { + new_state.cwd = (char*)emalloc(1); + if (new_state.cwd == NULL) { + retval = NULL; + goto end; + } + new_state.cwd[0] = '\0'; + new_state.cwd_length = 0; + if (VCWD_GETCWD(cwd, MAXPATHLEN)) { + path = cwd; + } + } else if (!IS_ABSOLUTE_PATH(path, strlen(path))) { + CWD_STATE_COPY(&new_state, &CWDG(cwd)); + } else { + new_state.cwd = (char*)emalloc(1); + if (new_state.cwd == NULL) { + retval = NULL; + goto end; + } + new_state.cwd[0] = '\0'; + new_state.cwd_length = 0; + } + + if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH TSRMLS_CC)==0) { + int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length; + + memcpy(real_path, new_state.cwd, len); + real_path[len] = '\0'; + retval = real_path; + } else { + retval = NULL; + } + + CWD_STATE_FREE(&new_state); +end: + return retval; +} +/* }}} */ + +CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path TSRMLS_DC) /* {{{ */ +{ + cwd_state new_state; + int retval; + + CWD_STATE_COPY(&new_state, &CWDG(cwd)); + retval = virtual_file_ex(&new_state, path, verify_path, CWD_FILEPATH TSRMLS_CC); + + *filepath = new_state.cwd; + + return retval; + +} +/* }}} */ + +CWD_API int virtual_filepath(const char *path, char **filepath TSRMLS_DC) /* {{{ */ +{ + return virtual_filepath_ex(path, filepath, php_is_file_ok TSRMLS_CC); +} +/* }}} */ + +CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC) /* {{{ */ +{ + cwd_state new_state; + FILE *f; + + if (path[0] == '\0') { /* Fail to open empty path */ + return NULL; + } + + CWD_STATE_COPY(&new_state, &CWDG(cwd)); + if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND TSRMLS_CC)) { + CWD_STATE_FREE_ERR(&new_state); + return NULL; + } + + f = fopen(new_state.cwd, mode); + + CWD_STATE_FREE_ERR(&new_state); + + return f; +} +/* }}} */ + +CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC) /* {{{ */ +{ + cwd_state new_state; + int ret; + + CWD_STATE_COPY(&new_state, &CWDG(cwd)); + if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH TSRMLS_CC)) { + CWD_STATE_FREE_ERR(&new_state); + return -1; + } + +#if defined(TSRM_WIN32) + ret = tsrm_win32_access(new_state.cwd, mode TSRMLS_CC); +#else + ret = access(new_state.cwd, mode); +#endif + + CWD_STATE_FREE_ERR(&new_state); + + return ret; +} +/* }}} */ + +#if HAVE_UTIME +#ifdef TSRM_WIN32 +static void UnixTimeToFileTime(time_t t, LPFILETIME pft) /* {{{ */ +{ + // Note that LONGLONG is a 64-bit value + LONGLONG ll; + + ll = Int32x32To64(t, 10000000) + 116444736000000000; + pft->dwLowDateTime = (DWORD)ll; + pft->dwHighDateTime = ll >> 32; +} +/* }}} */ + +TSRM_API int win32_utime(const char *filename, struct utimbuf *buf) /* {{{ */ +{ + FILETIME mtime, atime; + HANDLE hFile; + + hFile = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL, + OPEN_ALWAYS, FILE_FLAG_BACKUP_SEMANTICS, NULL); + + /* OPEN_ALWAYS mode sets the last error to ERROR_ALREADY_EXISTS but + the CreateFile operation succeeds */ + if (GetLastError() == ERROR_ALREADY_EXISTS) { + SetLastError(0); + } + + if ( hFile == INVALID_HANDLE_VALUE ) { + return -1; + } + + if (!buf) { + SYSTEMTIME st; + GetSystemTime(&st); + SystemTimeToFileTime(&st, &mtime); + atime = mtime; + } else { + UnixTimeToFileTime(buf->modtime, &mtime); + UnixTimeToFileTime(buf->actime, &atime); + } + if (!SetFileTime(hFile, NULL, &atime, &mtime)) { + CloseHandle(hFile); + return -1; + } + CloseHandle(hFile); + return 1; +} +/* }}} */ +#endif + +CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC) /* {{{ */ +{ + cwd_state new_state; + int ret; + + CWD_STATE_COPY(&new_state, &CWDG(cwd)); + if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH TSRMLS_CC)) { + CWD_STATE_FREE_ERR(&new_state); + return -1; + } + +#ifdef TSRM_WIN32 + ret = win32_utime(new_state.cwd, buf); +#else + ret = utime(new_state.cwd, buf); +#endif + + CWD_STATE_FREE_ERR(&new_state); + return ret; +} +/* }}} */ +#endif + +CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC) /* {{{ */ +{ + cwd_state new_state; + int ret; + + CWD_STATE_COPY(&new_state, &CWDG(cwd)); + if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH TSRMLS_CC)) { + CWD_STATE_FREE_ERR(&new_state); + return -1; + } + + ret = chmod(new_state.cwd, mode); + + CWD_STATE_FREE_ERR(&new_state); + return ret; +} +/* }}} */ + +#if !defined(TSRM_WIN32) && !defined(NETWARE) +CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int link TSRMLS_DC) /* {{{ */ +{ + cwd_state new_state; + int ret; + + CWD_STATE_COPY(&new_state, &CWDG(cwd)); + if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH TSRMLS_CC)) { + CWD_STATE_FREE_ERR(&new_state); + return -1; + } + + if (link) { +#if HAVE_LCHOWN + ret = lchown(new_state.cwd, owner, group); +#else + ret = -1; +#endif + } else { + ret = chown(new_state.cwd, owner, group); + } + + CWD_STATE_FREE_ERR(&new_state); + return ret; +} +/* }}} */ +#endif + +CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...) /* {{{ */ +{ + cwd_state new_state; + int f; + + CWD_STATE_COPY(&new_state, &CWDG(cwd)); + if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH TSRMLS_CC)) { + CWD_STATE_FREE_ERR(&new_state); + return -1; + } + + if (flags & O_CREAT) { + mode_t mode; + va_list arg; + + va_start(arg, flags); + mode = (mode_t) va_arg(arg, int); + va_end(arg); + + f = open(new_state.cwd, flags, mode); + } else { + f = open(new_state.cwd, flags); + } + CWD_STATE_FREE_ERR(&new_state); + return f; +} +/* }}} */ + +CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC) /* {{{ */ +{ + cwd_state new_state; + int f; + + CWD_STATE_COPY(&new_state, &CWDG(cwd)); + if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH TSRMLS_CC)) { + CWD_STATE_FREE_ERR(&new_state); + return -1; + } + + f = creat(new_state.cwd, mode); + + CWD_STATE_FREE_ERR(&new_state); + return f; +} +/* }}} */ + +CWD_API int virtual_rename(const char *oldname, const char *newname TSRMLS_DC) /* {{{ */ +{ + cwd_state old_state; + cwd_state new_state; + int retval; + + CWD_STATE_COPY(&old_state, &CWDG(cwd)); + if (virtual_file_ex(&old_state, oldname, NULL, CWD_EXPAND TSRMLS_CC)) { + CWD_STATE_FREE_ERR(&old_state); + return -1; + } + oldname = old_state.cwd; + + CWD_STATE_COPY(&new_state, &CWDG(cwd)); + if (virtual_file_ex(&new_state, newname, NULL, CWD_EXPAND TSRMLS_CC)) { + CWD_STATE_FREE_ERR(&old_state); + CWD_STATE_FREE_ERR(&new_state); + return -1; + } + newname = new_state.cwd; + + /* rename on windows will fail if newname already exists. + MoveFileEx has to be used */ +#ifdef TSRM_WIN32 + /* MoveFileEx returns 0 on failure, other way 'round for this function */ + retval = (MoveFileEx(oldname, newname, MOVEFILE_REPLACE_EXISTING|MOVEFILE_COPY_ALLOWED) == 0) ? -1 : 0; +#else + retval = rename(oldname, newname); +#endif + + CWD_STATE_FREE_ERR(&old_state); + CWD_STATE_FREE_ERR(&new_state); + + return retval; +} +/* }}} */ + +CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC) /* {{{ */ +{ + cwd_state new_state; + int retval; + + CWD_STATE_COPY(&new_state, &CWDG(cwd)); + if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH TSRMLS_CC)) { + CWD_STATE_FREE_ERR(&new_state); + return -1; + } + + retval = php_sys_stat(new_state.cwd, buf); + + CWD_STATE_FREE_ERR(&new_state); + return retval; +} +/* }}} */ + +CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC) /* {{{ */ +{ + cwd_state new_state; + int retval; + + CWD_STATE_COPY(&new_state, &CWDG(cwd)); + if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND TSRMLS_CC)) { + CWD_STATE_FREE_ERR(&new_state); + return -1; + } + + retval = php_sys_lstat(new_state.cwd, buf); + + CWD_STATE_FREE_ERR(&new_state); + return retval; +} +/* }}} */ + +CWD_API int virtual_unlink(const char *path TSRMLS_DC) /* {{{ */ +{ + cwd_state new_state; + int retval; + + CWD_STATE_COPY(&new_state, &CWDG(cwd)); + if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND TSRMLS_CC)) { + CWD_STATE_FREE_ERR(&new_state); + return -1; + } + + retval = unlink(new_state.cwd); + + CWD_STATE_FREE_ERR(&new_state); + return retval; +} +/* }}} */ + +CWD_API int virtual_mkdir(const char *pathname, mode_t mode TSRMLS_DC) /* {{{ */ +{ + cwd_state new_state; + int retval; + + CWD_STATE_COPY(&new_state, &CWDG(cwd)); + if (virtual_file_ex(&new_state, pathname, NULL, CWD_FILEPATH TSRMLS_CC)) { + CWD_STATE_FREE_ERR(&new_state); + return -1; + } + +#ifdef TSRM_WIN32 + retval = mkdir(new_state.cwd); +#else + retval = mkdir(new_state.cwd, mode); +#endif + CWD_STATE_FREE_ERR(&new_state); + return retval; +} +/* }}} */ + +CWD_API int virtual_rmdir(const char *pathname TSRMLS_DC) /* {{{ */ +{ + cwd_state new_state; + int retval; + + CWD_STATE_COPY(&new_state, &CWDG(cwd)); + if (virtual_file_ex(&new_state, pathname, NULL, CWD_EXPAND TSRMLS_CC)) { + CWD_STATE_FREE_ERR(&new_state); + return -1; + } + + retval = rmdir(new_state.cwd); + + CWD_STATE_FREE_ERR(&new_state); + return retval; +} +/* }}} */ + +#ifdef TSRM_WIN32 +DIR *opendir(const char *name); +#endif + +CWD_API DIR *virtual_opendir(const char *pathname TSRMLS_DC) /* {{{ */ +{ + cwd_state new_state; + DIR *retval; + + CWD_STATE_COPY(&new_state, &CWDG(cwd)); + if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH TSRMLS_CC)) { + CWD_STATE_FREE_ERR(&new_state); + return NULL; + } + + retval = opendir(new_state.cwd); + + CWD_STATE_FREE_ERR(&new_state); + return retval; +} +/* }}} */ + +#ifdef TSRM_WIN32 +CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) /* {{{ */ +{ + return popen_ex(command, type, CWDG(cwd).cwd, NULL TSRMLS_CC); +} +/* }}} */ +#elif defined(NETWARE) +/* On NetWare, the trick of prepending "cd cwd; " doesn't work so we need to perform + a VCWD_CHDIR() and mutex it + */ +CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) /* {{{ */ +{ + char prev_cwd[MAXPATHLEN]; + char *getcwd_result; + FILE *retval; + + getcwd_result = VCWD_GETCWD(prev_cwd, MAXPATHLEN); + if (!getcwd_result) { + return NULL; + } + +#ifdef ZTS + tsrm_mutex_lock(cwd_mutex); +#endif + + VCWD_CHDIR(CWDG(cwd).cwd); + retval = popen(command, type); + VCWD_CHDIR(prev_cwd); + +#ifdef ZTS + tsrm_mutex_unlock(cwd_mutex); +#endif + + return retval; +} +/* }}} */ +#else /* Unix */ +CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC) /* {{{ */ +{ + int command_length; + int dir_length, extra = 0; + char *command_line; + char *ptr, *dir; + FILE *retval; + + command_length = strlen(command); + + dir_length = CWDG(cwd).cwd_length; + dir = CWDG(cwd).cwd; + while (dir_length > 0) { + if (*dir == '\'') extra+=3; + dir++; + dir_length--; + } + dir_length = CWDG(cwd).cwd_length; + dir = CWDG(cwd).cwd; + + ptr = command_line = (char *) emalloc(command_length + sizeof("cd '' ; ") + dir_length + extra+1+1); + if (!command_line) { + return NULL; + } + memcpy(ptr, "cd ", sizeof("cd ")-1); + ptr += sizeof("cd ")-1; + + if (CWDG(cwd).cwd_length == 0) { + *ptr++ = DEFAULT_SLASH; + } else { + *ptr++ = '\''; + while (dir_length > 0) { + switch (*dir) { + case '\'': + *ptr++ = '\''; + *ptr++ = '\\'; + *ptr++ = '\''; + /* fall-through */ + default: + *ptr++ = *dir; + } + dir++; + dir_length--; + } + *ptr++ = '\''; + } + + *ptr++ = ' '; + *ptr++ = ';'; + *ptr++ = ' '; + + memcpy(ptr, command, command_length+1); + retval = popen(command_line, type); + + efree(command_line); + return retval; +} +/* }}} */ +#endif + +CWD_API char *tsrm_realpath(const char *path, char *real_path TSRMLS_DC) /* {{{ */ +{ + cwd_state new_state; + char cwd[MAXPATHLEN]; + + /* realpath("") returns CWD */ + if (!*path) { + new_state.cwd = (char*)emalloc(1); + if (new_state.cwd == NULL) { + return NULL; + } + new_state.cwd[0] = '\0'; + new_state.cwd_length = 0; + if (VCWD_GETCWD(cwd, MAXPATHLEN)) { + path = cwd; + } + } else if (!IS_ABSOLUTE_PATH(path, strlen(path)) && + VCWD_GETCWD(cwd, MAXPATHLEN)) { + new_state.cwd = estrdup(cwd); + new_state.cwd_length = strlen(cwd); + } else { + new_state.cwd = (char*)emalloc(1); + if (new_state.cwd == NULL) { + return NULL; + } + new_state.cwd[0] = '\0'; + new_state.cwd_length = 0; + } + + if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH TSRMLS_CC)) { + efree(new_state.cwd); + return NULL; + } + + if (real_path) { + int copy_len = new_state.cwd_length>MAXPATHLEN-1 ? MAXPATHLEN-1 : new_state.cwd_length; + memcpy(real_path, new_state.cwd, copy_len); + real_path[copy_len] = '\0'; + efree(new_state.cwd); + return real_path; + } else { + return new_state.cwd; + } +} +/* }}} */ + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + */ diff --git a/Zend/zend_virtual_cwd.h b/Zend/zend_virtual_cwd.h new file mode 100644 index 0000000000..a6ac0aeef7 --- /dev/null +++ b/Zend/zend_virtual_cwd.h @@ -0,0 +1,340 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 5 | + +----------------------------------------------------------------------+ + | Copyright (c) 1997-2013 The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP 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.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans <andi@zend.com> | + | Sascha Schumann <sascha@schumann.cx> | + | Pierre Joye <pierre@php.net> | + +----------------------------------------------------------------------+ +*/ + +/* $Id$ */ + +#ifndef VIRTUAL_CWD_H +#define VIRTUAL_CWD_H + +#include "TSRM.h" +#include "tsrm_config_common.h" + +#include <sys/types.h> +#include <sys/stat.h> +#include <ctype.h> + +#ifdef HAVE_UTIME_H +#include <utime.h> +#endif + +#ifdef HAVE_STDARG_H +#include <stdarg.h> +#endif + +#ifdef ZTS +#define VIRTUAL_DIR +#endif + +#ifndef TSRM_WIN32 +#include <unistd.h> +#else +#include <direct.h> +#endif + +#if defined(__osf__) || defined(_AIX) +#include <errno.h> +#endif + +#ifdef TSRM_WIN32 +#include "readdir.h" +#include <sys/utime.h> +/* mode_t isn't defined on Windows */ +typedef unsigned short mode_t; + +#define DEFAULT_SLASH '\\' +#define DEFAULT_DIR_SEPARATOR ';' +#define IS_SLASH(c) ((c) == '/' || (c) == '\\') +#define IS_SLASH_P(c) (*(c) == '/' || \ + (*(c) == '\\' && !IsDBCSLeadByte(*(c-1)))) + +/* COPY_WHEN_ABSOLUTE is 2 under Win32 because by chance both regular absolute paths + in the file system and UNC paths need copying of two characters */ +#define COPY_WHEN_ABSOLUTE(path) 2 +#define IS_UNC_PATH(path, len) \ + (len >= 2 && IS_SLASH(path[0]) && IS_SLASH(path[1])) +#define IS_ABSOLUTE_PATH(path, len) \ + (len >= 2 && ((isalpha(path[0]) && path[1] == ':') || IS_UNC_PATH(path, len))) + +#elif defined(NETWARE) +#ifdef HAVE_DIRENT_H +#include <dirent.h> +#endif + +#define DEFAULT_SLASH '/' +#define DEFAULT_DIR_SEPARATOR ';' +#define IS_SLASH(c) ((c) == '/' || (c) == '\\') +#define IS_SLASH_P(c) IS_SLASH(*(c)) +/* Colon indicates volume name, either first character should be forward slash or backward slash */ +#define IS_ABSOLUTE_PATH(path, len) \ + ((strchr(path, ':') != NULL) || ((len >= 1) && ((path[0] == '/') || (path[0] == '\\')))) + +#else +#ifdef HAVE_DIRENT_H +#include <dirent.h> +#endif + +#define DEFAULT_SLASH '/' + +#ifdef __riscos__ +#define DEFAULT_DIR_SEPARATOR ';' +#else +#define DEFAULT_DIR_SEPARATOR ':' +#endif + +#define IS_SLASH(c) ((c) == '/') +#define IS_SLASH_P(c) (*(c) == '/') + +#endif + + +#ifndef COPY_WHEN_ABSOLUTE +#define COPY_WHEN_ABSOLUTE(path) 0 +#endif + +#ifndef IS_ABSOLUTE_PATH +#define IS_ABSOLUTE_PATH(path, len) \ + (IS_SLASH(path[0])) +#endif + +#ifdef TSRM_EXPORTS +#define CWD_EXPORTS +#endif + +#ifdef TSRM_WIN32 +# ifdef CWD_EXPORTS +# define CWD_API __declspec(dllexport) +# else +# define CWD_API __declspec(dllimport) +# endif +#elif defined(__GNUC__) && __GNUC__ >= 4 +# define CWD_API __attribute__ ((visibility("default"))) +#else +# define CWD_API +#endif + +#ifdef TSRM_WIN32 +CWD_API int php_sys_stat_ex(const char *path, struct stat *buf, int lstat); +# define php_sys_stat(path, buf) php_sys_stat_ex(path, buf, 0) +# define php_sys_lstat(path, buf) php_sys_stat_ex(path, buf, 1) +CWD_API int php_sys_readlink(const char *link, char *target, size_t target_len); +#else +# define php_sys_stat stat +# define php_sys_lstat lstat +# ifdef HAVE_SYMLINK +# define php_sys_readlink(link, target, target_len) readlink(link, target, target_len) +# endif +#endif + +typedef struct _cwd_state { + char *cwd; + int cwd_length; +} cwd_state; + +typedef int (*verify_path_func)(const cwd_state *); + +CWD_API void virtual_cwd_startup(void); +CWD_API void virtual_cwd_shutdown(void); +CWD_API int virtual_cwd_activate(TSRMLS_D); +CWD_API int virtual_cwd_deactivate(TSRMLS_D); +CWD_API char *virtual_getcwd_ex(size_t *length TSRMLS_DC); +CWD_API char *virtual_getcwd(char *buf, size_t size TSRMLS_DC); +CWD_API int virtual_chdir(const char *path TSRMLS_DC); +CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path TSRMLS_DC) TSRMLS_DC); +CWD_API int virtual_filepath(const char *path, char **filepath TSRMLS_DC); +CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path TSRMLS_DC); +CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC); +CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC); +CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...); +CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC); +CWD_API int virtual_rename(const char *oldname, const char *newname TSRMLS_DC); +CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC); +CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC); +CWD_API int virtual_unlink(const char *path TSRMLS_DC); +CWD_API int virtual_mkdir(const char *pathname, mode_t mode TSRMLS_DC); +CWD_API int virtual_rmdir(const char *pathname TSRMLS_DC); +CWD_API DIR *virtual_opendir(const char *pathname TSRMLS_DC); +CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC); +CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC); +#if defined(TSRM_WIN32) +/* these are not defined in win32 headers */ +#ifndef W_OK +#define W_OK 0x02 +#endif +#ifndef R_OK +#define R_OK 0x04 +#endif +#ifndef X_OK +#define X_OK 0x01 +#endif +#ifndef F_OK +#define F_OK 0x00 +#endif +#endif + +#if HAVE_UTIME +CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC); +#endif +CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC); +#if !defined(TSRM_WIN32) && !defined(NETWARE) +CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int link TSRMLS_DC); +#endif + +/* One of the following constants must be used as the last argument + in virtual_file_ex() call. */ + +#define CWD_EXPAND 0 /* expand "." and ".." but dont resolve symlinks */ +#define CWD_FILEPATH 1 /* resolve symlinks if file is exist otherwise expand */ +#define CWD_REALPATH 2 /* call realpath(), resolve symlinks. File must exist */ + +CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath TSRMLS_DC); + +CWD_API char *tsrm_realpath(const char *path, char *real_path TSRMLS_DC); + +#define REALPATH_CACHE_TTL (2*60) /* 2 minutes */ +#define REALPATH_CACHE_SIZE 0 /* disabled while php.ini isn't loaded */ + +typedef struct _realpath_cache_bucket { + unsigned long key; + char *path; + int path_len; + char *realpath; + int realpath_len; + int is_dir; + time_t expires; +#ifdef PHP_WIN32 + unsigned char is_rvalid; + unsigned char is_readable; + unsigned char is_wvalid; + unsigned char is_writable; +#endif + struct _realpath_cache_bucket *next; +} realpath_cache_bucket; + +typedef struct _virtual_cwd_globals { + cwd_state cwd; + long realpath_cache_size; + long realpath_cache_size_limit; + long realpath_cache_ttl; + realpath_cache_bucket *realpath_cache[1024]; +} virtual_cwd_globals; + +#ifdef ZTS +extern ts_rsrc_id cwd_globals_id; +# define CWDG(v) TSRMG(cwd_globals_id, virtual_cwd_globals *, v) +#else +extern virtual_cwd_globals cwd_globals; +# define CWDG(v) (cwd_globals.v) +#endif + +CWD_API void realpath_cache_clean(TSRMLS_D); +CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC); +CWD_API realpath_cache_bucket* realpath_cache_lookup(const char *path, int path_len, time_t t TSRMLS_DC); +CWD_API int realpath_cache_size(TSRMLS_D); +CWD_API int realpath_cache_max_buckets(TSRMLS_D); +CWD_API realpath_cache_bucket** realpath_cache_get_buckets(TSRMLS_D); + +/* The actual macros to be used in programs using TSRM + * If the program defines VIRTUAL_DIR it will use the + * virtual_* functions + */ + +#ifdef VIRTUAL_DIR + +#define VCWD_GETCWD(buff, size) virtual_getcwd(buff, size TSRMLS_CC) +#define VCWD_FOPEN(path, mode) virtual_fopen(path, mode TSRMLS_CC) +/* Because open() has two modes, we have to macros to replace it */ +#define VCWD_OPEN(path, flags) virtual_open(path TSRMLS_CC, flags) +#define VCWD_OPEN_MODE(path, flags, mode) virtual_open(path TSRMLS_CC, flags, mode) +#define VCWD_CREAT(path, mode) virtual_creat(path, mode TSRMLS_CC) +#define VCWD_CHDIR(path) virtual_chdir(path TSRMLS_CC) +#define VCWD_CHDIR_FILE(path) virtual_chdir_file(path, virtual_chdir TSRMLS_CC) +#define VCWD_GETWD(buf) +#define VCWD_REALPATH(path, real_path) virtual_realpath(path, real_path TSRMLS_CC) +#define VCWD_RENAME(oldname, newname) virtual_rename(oldname, newname TSRMLS_CC) +#define VCWD_STAT(path, buff) virtual_stat(path, buff TSRMLS_CC) +# define VCWD_LSTAT(path, buff) virtual_lstat(path, buff TSRMLS_CC) +#define VCWD_UNLINK(path) virtual_unlink(path TSRMLS_CC) +#define VCWD_MKDIR(pathname, mode) virtual_mkdir(pathname, mode TSRMLS_CC) +#define VCWD_RMDIR(pathname) virtual_rmdir(pathname TSRMLS_CC) +#define VCWD_OPENDIR(pathname) virtual_opendir(pathname TSRMLS_CC) +#define VCWD_POPEN(command, type) virtual_popen(command, type TSRMLS_CC) +#define VCWD_ACCESS(pathname, mode) virtual_access(pathname, mode TSRMLS_CC) +#if HAVE_UTIME +#define VCWD_UTIME(path, time) virtual_utime(path, time TSRMLS_CC) +#endif +#define VCWD_CHMOD(path, mode) virtual_chmod(path, mode TSRMLS_CC) +#if !defined(TSRM_WIN32) && !defined(NETWARE) +#define VCWD_CHOWN(path, owner, group) virtual_chown(path, owner, group, 0 TSRMLS_CC) +#if HAVE_LCHOWN +#define VCWD_LCHOWN(path, owner, group) virtual_chown(path, owner, group, 1 TSRMLS_CC) +#endif +#endif + +#else + +#define VCWD_GETCWD(buff, size) getcwd(buff, size) +#define VCWD_FOPEN(path, mode) fopen(path, mode) +#define VCWD_OPEN(path, flags) open(path, flags) +#define VCWD_OPEN_MODE(path, flags, mode) open(path, flags, mode) +#define VCWD_CREAT(path, mode) creat(path, mode) +/* rename on windows will fail if newname already exists. + MoveFileEx has to be used */ +#if defined(TSRM_WIN32) +# define VCWD_RENAME(oldname, newname) (MoveFileEx(oldname, newname, MOVEFILE_REPLACE_EXISTING|MOVEFILE_COPY_ALLOWED) == 0 ? -1 : 0) +#else +# define VCWD_RENAME(oldname, newname) rename(oldname, newname) +#endif +#define VCWD_CHDIR(path) chdir(path) +#define VCWD_CHDIR_FILE(path) virtual_chdir_file(path, chdir) +#define VCWD_GETWD(buf) getwd(buf) +#define VCWD_STAT(path, buff) php_sys_stat(path, buff) +#define VCWD_LSTAT(path, buff) lstat(path, buff) +#define VCWD_UNLINK(path) unlink(path) +#define VCWD_MKDIR(pathname, mode) mkdir(pathname, mode) +#define VCWD_RMDIR(pathname) rmdir(pathname) +#define VCWD_OPENDIR(pathname) opendir(pathname) +#define VCWD_POPEN(command, type) popen(command, type) +#if defined(TSRM_WIN32) +#define VCWD_ACCESS(pathname, mode) tsrm_win32_access(pathname, mode TSRMLS_CC) +#else +#define VCWD_ACCESS(pathname, mode) access(pathname, mode) +#endif + +#define VCWD_REALPATH(path, real_path) tsrm_realpath(path, real_path TSRMLS_CC) + +#if HAVE_UTIME +# ifdef TSRM_WIN32 +# define VCWD_UTIME(path, time) win32_utime(path, time) +# else +# define VCWD_UTIME(path, time) utime(path, time) +# endif +#endif + +#define VCWD_CHMOD(path, mode) chmod(path, mode) +#if !defined(TSRM_WIN32) && !defined(NETWARE) +#define VCWD_CHOWN(path, owner, group) chown(path, owner, group) +#if HAVE_LCHOWN +#define VCWD_LCHOWN(path, owner, group) lchown(path, owner, group) +#endif +#endif + +#endif + +#endif /* VIRTUAL_CWD_H */ diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 9db6ea19f9..5385f3eec9 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -352,7 +352,6 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } else { /* here we are sure we are dealing with an object */ @@ -372,7 +371,6 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*zptr); EX_T(opline->result.var).var.ptr = *zptr; - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -411,7 +409,6 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(z); EX_T(opline->result.var).var.ptr = z; - EX_T(opline->result.var).var.ptr_ptr = NULL; } zval_ptr_dtor(&z); } else { @@ -419,7 +416,6 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -484,7 +480,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_helper, VAR|UNUSED|CV, CONST|TMP|VAR|UNU if (UNEXPECTED(*var_ptr == &EG(error_zval))) { if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } FREE_OP2(); FREE_OP1_VAR_PTR(); @@ -512,7 +508,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_helper, VAR|UNUSED|CV, CONST|TMP|VAR|UNU if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*var_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *var_ptr); + EX_T(opline->result.var).var.ptr = *var_ptr; } FREE_OP2(); @@ -805,7 +801,7 @@ ZEND_VM_HANDLER(34, ZEND_PRE_INC, VAR|CV, ANY) if (OP1_TYPE == IS_VAR && UNEXPECTED(*var_ptr == &EG(error_zval))) { if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } FREE_OP1_VAR_PTR(); CHECK_EXCEPTION(); @@ -829,7 +825,7 @@ ZEND_VM_HANDLER(34, ZEND_PRE_INC, VAR|CV, ANY) if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*var_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *var_ptr); + EX_T(opline->result.var).var.ptr = *var_ptr; } FREE_OP1_VAR_PTR(); @@ -852,7 +848,7 @@ ZEND_VM_HANDLER(35, ZEND_PRE_DEC, VAR|CV, ANY) if (OP1_TYPE == IS_VAR && UNEXPECTED(*var_ptr == &EG(error_zval))) { if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } FREE_OP1_VAR_PTR(); CHECK_EXCEPTION(); @@ -876,7 +872,7 @@ ZEND_VM_HANDLER(35, ZEND_PRE_DEC, VAR|CV, ANY) if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*var_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *var_ptr); + EX_T(opline->result.var).var.ptr = *var_ptr; } FREE_OP1_VAR_PTR(); @@ -1052,10 +1048,8 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, UNUSED|CONST| */ if (OP1_TYPE == IS_CONST) { hash_value = Z_HASH_P(varname); - } else if (IS_INTERNED(Z_STRVAL_P(varname))) { - hash_value = INTERNED_HASH(Z_STRVAL_P(varname)); } else { - hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1); + hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname)); } if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) { @@ -1108,7 +1102,7 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, UNUSED|CONST| switch (type) { case BP_VAR_R: case BP_VAR_IS: - AI_SET_PTR(&EX_T(opline->result.var), *retval); + EX_T(opline->result.var).var.ptr = *retval; break; case BP_VAR_UNSET: { zend_free_op free_res; @@ -1169,14 +1163,12 @@ ZEND_VM_HANDLER(81, ZEND_FETCH_DIM_R, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) zval *container; SAVE_OPLINE(); - - if (OP1_TYPE == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } container = GET_OP1_ZVAL_PTR(BP_VAR_R); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE, BP_VAR_R TSRMLS_CC); FREE_OP2(); - FREE_OP1(); + if (OP1_TYPE != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + FREE_OP1(); + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -1343,7 +1335,7 @@ ZEND_VM_HELPER(zend_fetch_property_address_read_helper, VAR|UNUSED|CV, CONST|TMP UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { zend_error(E_NOTICE, "Trying to get property of non-object"); PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); FREE_OP2(); } else { zval *retval; @@ -1356,7 +1348,7 @@ ZEND_VM_HELPER(zend_fetch_property_address_read_helper, VAR|UNUSED|CV, CONST|TMP retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); PZVAL_LOCK(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; if (IS_OP2_TMP_FREE()) { zval_ptr_dtor(&offset); @@ -1465,7 +1457,7 @@ ZEND_VM_HANDLER(91, ZEND_FETCH_OBJ_IS, VAR|UNUSED|CV, CONST|TMP|VAR|CV) if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); FREE_OP2(); } else { zval *retval; @@ -1478,7 +1470,7 @@ ZEND_VM_HANDLER(91, ZEND_FETCH_OBJ_IS, VAR|UNUSED|CV, CONST|TMP|VAR|CV) retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); PZVAL_LOCK(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; if (IS_OP2_TMP_FREE()) { zval_ptr_dtor(&offset); @@ -1583,13 +1575,13 @@ ZEND_VM_HANDLER(98, ZEND_FETCH_DIM_TMP_VAR, CONST|TMP, CONST) if (UNEXPECTED(Z_TYPE_P(container) != IS_ARRAY)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } else { zend_free_op free_op2; zval *value = *zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE, BP_VAR_R TSRMLS_CC); PZVAL_LOCK(value); - AI_SET_PTR(&EX_T(opline->result.var), value); + EX_T(opline->result.var).var.ptr = value; FREE_OP2(); } CHECK_EXCEPTION(); @@ -1670,11 +1662,11 @@ ZEND_VM_HANDLER(147, ZEND_ASSIGN_DIM, VAR|CV, CONST|TMP|VAR|UNUSED|CV) ALLOC_ZVAL(retval); ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1); INIT_PZVAL(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } } else if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) { if (IS_TMP_FREE(free_op_data1)) { @@ -1682,7 +1674,7 @@ ZEND_VM_HANDLER(147, ZEND_ASSIGN_DIM, VAR|CV, CONST|TMP|VAR|UNUSED|CV) } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else { if ((opline+1)->op1_type == IS_TMP_VAR) { @@ -1694,7 +1686,7 @@ ZEND_VM_HANDLER(147, ZEND_ASSIGN_DIM, VAR|CV, CONST|TMP|VAR|UNUSED|CV) } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(value); - AI_SET_PTR(&EX_T(opline->result.var), value); + EX_T(opline->result.var).var.ptr = value; } } FREE_OP_VAR_PTR(free_op_data2); @@ -1726,11 +1718,11 @@ ZEND_VM_HANDLER(38, ZEND_ASSIGN, VAR|CV, CONST|TMP|VAR|CV) ALLOC_ZVAL(retval); ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1); INIT_PZVAL(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } } else if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else if (OP1_TYPE == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) { if (IS_OP2_TMP_FREE()) { @@ -1738,7 +1730,7 @@ ZEND_VM_HANDLER(38, ZEND_ASSIGN, VAR|CV, CONST|TMP|VAR|CV) } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else { if (OP2_TYPE == IS_TMP_VAR) { @@ -1750,7 +1742,7 @@ ZEND_VM_HANDLER(38, ZEND_ASSIGN, VAR|CV, CONST|TMP|VAR|CV) } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(value); - AI_SET_PTR(&EX_T(opline->result.var), value); + EX_T(opline->result.var).var.ptr = value; } } @@ -1807,7 +1799,7 @@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV) if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*variable_ptr_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *variable_ptr_ptr); + EX_T(opline->result.var).var.ptr = *variable_ptr_ptr; } FREE_OP1_VAR_PTR(); @@ -1825,7 +1817,7 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY) EG(current_execute_data) = EX(prev_execute_data); EG(opline_ptr) = NULL; if (!EG(active_symbol_table)) { - i_free_compiled_variables(execute_data); + i_free_compiled_variables(execute_data TSRMLS_CC); } zend_vm_stack_free((char*)execute_data - (ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * op_array->T) TSRMLS_CC); @@ -1916,14 +1908,15 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY) if (UNEXPECTED((fbc->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) != 0)) { if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_ABSTRACT) != 0)) { zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", fbc->common.scope->name, fbc->common.function_name); - CHECK_EXCEPTION(); - ZEND_VM_NEXT_OPCODE(); /* Never reached */ } if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) { zend_error(E_DEPRECATED, "Function %s%s%s() is deprecated", fbc->common.scope ? fbc->common.scope->name : "", fbc->common.scope ? "::" : "", fbc->common.function_name); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } } } if (fbc->common.scope && @@ -1933,6 +1926,9 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY) if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { /* FIXME: output identifiers properly */ zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically", fbc->common.scope->name, fbc->common.function_name); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } } else { /* FIXME: output identifiers properly */ /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ @@ -1955,7 +1951,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY) LOAD_OPLINE(); if (fbc->type == ZEND_INTERNAL_FUNCTION) { - if (fbc->common.arg_info) { + if (fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) { zend_uint i=0; zval **p = (zval**)EX(function_state).arguments; ulong arg_count = opline->extended_value; @@ -1976,7 +1972,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY) if (!zend_execute_internal) { /* saves one function call if zend_execute_internal is not used */ - fbc->internal_function.handler(opline->extended_value, ret->var.ptr, (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? &ret->var.ptr : NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC); + fbc->internal_function.handler(opline->extended_value, ret->var.ptr, &ret->var.ptr, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC); } else { zend_execute_internal(execute_data, NULL, RETURN_VALUE_USED(opline) TSRMLS_CC); } @@ -2595,7 +2591,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -2670,7 +2666,7 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV) if (call->object) { Z_ADDREF_P(call->object); } - if (OP2_TYPE == IS_VAR && OP2_FREE && + if (OP2_TYPE == IS_VAR && OP2_FREE && Z_REFCOUNT_P(function_name) == 1 && call->fbc->common.fn_flags & ZEND_ACC_CLOSURE) { /* Delay closure destruction until its invocation */ call->fbc->common.prototype = (zend_function*)function_name; @@ -2830,9 +2826,7 @@ ZEND_VM_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY) retval_ptr = GET_OP1_ZVAL_PTR(BP_VAR_R); if (!EG(return_value_ptr_ptr)) { - if (OP1_TYPE == IS_TMP_VAR) { - FREE_OP1(); - } + FREE_OP1(); } else { if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_TMP_VAR || @@ -2845,18 +2839,23 @@ ZEND_VM_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY) zval_copy_ctor(ret); } *EG(return_value_ptr_ptr) = ret; + FREE_OP1_IF_VAR(); } else if ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) && retval_ptr == &EG(uninitialized_zval)) { zval *ret; + if (OP1_TYPE == IS_VAR) { + Z_DELREF_P(retval_ptr); + } ALLOC_INIT_ZVAL(ret); *EG(return_value_ptr_ptr) = ret; } else { *EG(return_value_ptr_ptr) = retval_ptr; - Z_ADDREF_P(retval_ptr); + if (OP1_TYPE == IS_CV) { + Z_ADDREF_P(retval_ptr); + } } } - FREE_OP1_IF_VAR(); ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper); } @@ -2870,7 +2869,8 @@ ZEND_VM_HANDLER(111, ZEND_RETURN_BY_REF, CONST|TMP|VAR|CV, ANY) SAVE_OPLINE(); do { - if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_TMP_VAR) { + if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_TMP_VAR || + (OP1_TYPE == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) { /* Not supposed to happen, but we'll allow it */ zend_error(E_NOTICE, "Only variable references should be returned by reference"); @@ -2927,7 +2927,7 @@ ZEND_VM_HANDLER(111, ZEND_RETURN_BY_REF, CONST|TMP|VAR|CV, ANY) } } while (0); - FREE_OP1_IF_VAR(); + FREE_OP1_VAR_PTR(); ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper); } @@ -3070,21 +3070,26 @@ ZEND_VM_HELPER(zend_send_by_var_helper, VAR|CV, ANY) varptr = GET_OP1_ZVAL_PTR(BP_VAR_R); if (varptr == &EG(uninitialized_zval)) { - ALLOC_ZVAL(varptr); - INIT_ZVAL(*varptr); - Z_SET_REFCOUNT_P(varptr, 0); + if (OP1_TYPE == IS_VAR) { + Z_DELREF_P(varptr); + } + ALLOC_INIT_ZVAL(varptr); } else if (PZVAL_IS_REF(varptr)) { - zval *original_var = varptr; + if (OP1_TYPE == IS_CV || + (OP1_TYPE == IS_VAR && Z_REFCOUNT_P(varptr) > 2)) { + zval *original_var = varptr; - ALLOC_ZVAL(varptr); - ZVAL_COPY_VALUE(varptr, original_var); - Z_UNSET_ISREF_P(varptr); - Z_SET_REFCOUNT_P(varptr, 0); - zval_copy_ctor(varptr); + ALLOC_ZVAL(varptr); + INIT_PZVAL_COPY(varptr, original_var); + zval_copy_ctor(varptr); + FREE_OP1(); + } else { + Z_UNSET_ISREF_P(varptr); + } + } else if (OP1_TYPE == IS_CV) { + Z_ADDREF_P(varptr); } - Z_ADDREF_P(varptr); zend_vm_stack_push(varptr TSRMLS_CC); - FREE_OP1(); /* for string offsets */ CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -3105,22 +3110,15 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY) ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper); } - if (OP1_TYPE == IS_VAR && - (opline->extended_value & ZEND_ARG_SEND_FUNCTION) && - EX_T(opline->op1.var).var.fcall_returned_reference && - EX_T(opline->op1.var).var.ptr) { - varptr = EX_T(opline->op1.var).var.ptr; - PZVAL_UNLOCK_EX(varptr, &free_op1, 0); - } else { - varptr = GET_OP1_ZVAL_PTR(BP_VAR_R); - } + varptr = GET_OP1_ZVAL_PTR(BP_VAR_R); if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) || EX_T(opline->op1.var).var.fcall_returned_reference) && varptr != &EG(uninitialized_zval) && - (PZVAL_IS_REF(varptr) || - (Z_REFCOUNT_P(varptr) == 1 && (OP1_TYPE == IS_CV || free_op1.var)))) { + (PZVAL_IS_REF(varptr) || Z_REFCOUNT_P(varptr) == 1)) { Z_SET_ISREF_P(varptr); - Z_ADDREF_P(varptr); + if (OP1_TYPE == IS_CV) { + Z_ADDREF_P(varptr); + } zend_vm_stack_push(varptr TSRMLS_CC); } else { zval *valptr; @@ -3135,9 +3133,9 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY) if (!IS_OP1_TMP_FREE()) { zval_copy_ctor(valptr); } + FREE_OP1_IF_VAR(); zend_vm_stack_push(valptr TSRMLS_CC); } - FREE_OP1_IF_VAR(); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -3244,8 +3242,7 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST) if (param == NULL) { ALLOC_ZVAL(assignment_value); *assignment_value = *opline->op2.zv; - if ((Z_TYPE_P(assignment_value) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT || - Z_TYPE_P(assignment_value)==IS_CONSTANT_ARRAY) { + if (IS_CONSTANT_TYPE(Z_TYPE_P(assignment_value))) { Z_SET_REFCOUNT_P(assignment_value, 1); zval_update_constant(&assignment_value, 0 TSRMLS_CC); } else { @@ -3266,6 +3263,37 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST) ZEND_VM_NEXT_OPCODE(); } +ZEND_VM_HANDLER(164, ZEND_RECV_VARIADIC, ANY, ANY) +{ + USE_OPLINE + zend_uint arg_num = opline->op1.num; + zend_uint arg_count = zend_vm_stack_get_args_count(TSRMLS_C); + zval **var_ptr, *params; + + SAVE_OPLINE(); + + var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC); + Z_DELREF_PP(var_ptr); + MAKE_STD_ZVAL(params); + *var_ptr = params; + + if (arg_num <= arg_count) { + array_init_size(params, arg_count - arg_num + 1); + } else { + array_init(params); + } + + for (; arg_num <= arg_count; ++arg_num) { + zval **param = zend_vm_stack_get_arg(arg_num TSRMLS_CC); + zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value TSRMLS_CC); + zend_hash_next_index_insert(Z_ARRVAL_P(params), param, sizeof(zval *), NULL); + Z_ADDREF_PP(param); + } + + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); +} + ZEND_VM_HANDLER(52, ZEND_BOOL, CONST|TMP|VAR|CV, ANY) { USE_OPLINE @@ -3336,9 +3364,6 @@ ZEND_VM_HANDLER(48, ZEND_CASE, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) zend_free_op free_op1, free_op2; SAVE_OPLINE(); - if (OP1_TYPE==IS_VAR) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } is_equal_function(&EX_T(opline->result.var).tmp_var, GET_OP1_ZVAL_PTR(BP_VAR_R), GET_OP2_ZVAL_PTR(BP_VAR_R) TSRMLS_CC); @@ -3466,7 +3491,7 @@ ZEND_VM_HANDLER(110, ZEND_CLONE, CONST|TMP|VAR|UNUSED|CV, ANY) if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(&retval); } else { - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } } FREE_OP1_IF_VAR(); @@ -3544,8 +3569,7 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST) } if (EXPECTED(zend_hash_quick_find(&ce->constants_table, Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv)+1, Z_HASH_P(opline->op2.zv), (void **) &value) == SUCCESS)) { - if (Z_TYPE_PP(value) == IS_CONSTANT_ARRAY || - (Z_TYPE_PP(value) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) { + if (IS_CONSTANT_TYPE(Z_TYPE_PP(value))) { zend_class_entry *old_scope = EG(scope); EG(scope) = ce; @@ -3602,7 +3626,8 @@ ZEND_VM_HANDLER(72, ZEND_ADD_ARRAY_ELEMENT, CONST|TMP|VAR|CV, CONST|TMP|VAR|UNUS INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - } else { + FREE_OP1_IF_VAR(); + } else if (OP1_TYPE == IS_CV) { Z_ADDREF_P(expr_ptr); } } @@ -3627,11 +3652,7 @@ ZEND_VM_C_LABEL(num_index): hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, ZEND_VM_C_GOTO(num_index)); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -3650,8 +3671,6 @@ ZEND_VM_C_LABEL(num_index): } if ((OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) && opline->extended_value) { FREE_OP1_VAR_PTR(); - } else { - FREE_OP1_IF_VAR(); } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -3821,7 +3840,6 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY) EX(original_return_value) = EG(return_value_ptr_ptr); EG(active_op_array) = new_op_array; if (RETURN_VALUE_USED(opline)) { - EX_T(opline->result.var).var.ptr = NULL; EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr; EG(return_value_ptr_ptr) = EX_T(opline->result.var).var.ptr_ptr; } else { @@ -3859,7 +3877,7 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY) ALLOC_ZVAL(retval); ZVAL_BOOL(retval, failure_retval); INIT_PZVAL(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } ZEND_VM_NEXT_OPCODE(); } @@ -3981,11 +3999,7 @@ ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|CV) hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, ZEND_VM_C_GOTO(num_index_dim)); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (ht == &EG(symbol_table)) { zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC); @@ -4140,19 +4154,27 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY) } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { ce = Z_OBJCE_P(array_ptr); if (!ce || !ce->get_iterator) { - Z_ADDREF_P(array_ptr); + if (OP1_TYPE == IS_CV) { + Z_ADDREF_P(array_ptr); + } } } else if (OP1_TYPE == IS_CONST || - ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) && + (OP1_TYPE == IS_CV && + !Z_ISREF_P(array_ptr) && + Z_REFCOUNT_P(array_ptr) > 1) || + (OP1_TYPE == IS_VAR && !Z_ISREF_P(array_ptr) && - Z_REFCOUNT_P(array_ptr) > 1)) { + Z_REFCOUNT_P(array_ptr) > 2)) { zval *tmp; + if (OP1_TYPE == IS_VAR) { + Z_DELREF_P(array_ptr); + } ALLOC_ZVAL(tmp); INIT_PZVAL_COPY(tmp, array_ptr); zval_copy_ctor(tmp); array_ptr = tmp; - } else { + } else if (OP1_TYPE == IS_CV) { Z_ADDREF_P(array_ptr); } } @@ -4160,10 +4182,15 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY) if (ce && ce->get_iterator) { iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC); + if (OP1_TYPE == IS_VAR && !(opline->extended_value & ZEND_FE_RESET_VARIABLE)) { + FREE_OP1_IF_VAR(); + } if (iter && EXPECTED(EG(exception) == NULL)) { array_ptr = zend_iterator_wrap(iter TSRMLS_CC); } else { - FREE_OP1_IF_VAR(); + if (OP1_TYPE == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + FREE_OP1_VAR_PTR(); + } if (!EG(exception)) { zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name); } @@ -4180,14 +4207,18 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY) iter->funcs->rewind(iter TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(&array_ptr); - FREE_OP1_IF_VAR(); + if (OP1_TYPE == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + FREE_OP1_VAR_PTR(); + } HANDLE_EXCEPTION(); } } is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(&array_ptr); - FREE_OP1_IF_VAR(); + if (OP1_TYPE == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + FREE_OP1_VAR_PTR(); + } HANDLE_EXCEPTION(); } iter->index = -1; /* will be set to 0 before using next handler */ @@ -4217,7 +4248,9 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY) is_empty = 1; } - FREE_OP1_IF_VAR(); + if (OP1_TYPE == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + FREE_OP1_VAR_PTR(); + } if (is_empty) { ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num); } else { @@ -4349,7 +4382,7 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY) Z_ADDREF_PP(value); } else { PZVAL_LOCK(*value); - AI_SET_PTR(&EX_T(opline->result.var), *value); + EX_T(opline->result.var).var.ptr = *value; } CHECK_EXCEPTION(); @@ -4454,7 +4487,6 @@ ZEND_VM_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, VAR|UNUSED|CV, CONST| SAVE_OPLINE(); container = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_IS); - offset = GET_OP2_ZVAL_PTR(BP_VAR_R); if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) { @@ -4481,11 +4513,7 @@ ZEND_VM_C_LABEL(num_index_prop): hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, ZEND_VM_C_GOTO(num_index_prop)); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) { isset = 1; @@ -4578,7 +4606,7 @@ ZEND_VM_C_LABEL(num_index_prop): Z_LVAL(EX_T(opline->result.var).tmp_var) = !result; } - FREE_OP1_VAR_PTR(); + FREE_OP1_IF_VAR(); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -4993,7 +5021,7 @@ 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 = 0, finally_op_num = 0; + zend_uint catch_op_num = 0, finally_op_num = 0, finally_op_end = 0; void **stack_frame; /* Figure out where the next stack frame (which maybe contains pushed @@ -5018,6 +5046,10 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY) if (op_num < EG(active_op_array)->try_catch_array[i].finally_op) { finally_op_num = EX(op_array)->try_catch_array[i].finally_op; } + if (op_num >= EG(active_op_array)->try_catch_array[i].finally_op && + op_num < EG(active_op_array)->try_catch_array[i].finally_end) { + finally_op_end = EG(active_op_array)->try_catch_array[i].finally_end; + } } if (EX(call) >= EX(call_slots)) { @@ -5079,14 +5111,29 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY) EX(old_error_reporting) = NULL; if (finally_op_num && (!catch_op_num || catch_op_num >= finally_op_num)) { - zend_exception_save(TSRMLS_C); + if (EX(delayed_exception)) { + zend_exception_set_previous(EG(exception), EX(delayed_exception) TSRMLS_CC); + } + EX(delayed_exception) = EG(exception); + EG(exception) = NULL; EX(fast_ret) = NULL; ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[finally_op_num]); ZEND_VM_CONTINUE(); } else if (catch_op_num) { + if (finally_op_end && catch_op_num > finally_op_end) { + /* we are going out of current finally scope */ + if (EX(delayed_exception)) { + zend_exception_set_previous(EG(exception), EX(delayed_exception) TSRMLS_CC); + EX(delayed_exception) = NULL; + } + } ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[catch_op_num]); ZEND_VM_CONTINUE(); } else { + if (EX(delayed_exception)) { + zend_exception_set_previous(EG(exception), EX(delayed_exception) TSRMLS_CC); + EX(delayed_exception) = NULL; + } if (UNEXPECTED((EX(op_array)->fn_flags & ZEND_ACC_GENERATOR) != 0)) { ZEND_VM_DISPATCH_TO_HANDLER(ZEND_GENERATOR_RETURN); } else { @@ -5146,7 +5193,7 @@ ZEND_VM_HANDLER(143, ZEND_DECLARE_CONST, CONST, CONST) name = GET_OP1_ZVAL_PTR(BP_VAR_R); val = GET_OP2_ZVAL_PTR(BP_VAR_R); - if ((Z_TYPE_P(val) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT || Z_TYPE_P(val) == IS_CONSTANT_ARRAY) { + if (IS_CONSTANT_TYPE(Z_TYPE_P(val))) { zval tmp; zval *tmp_ptr = &tmp; @@ -5162,7 +5209,7 @@ ZEND_VM_HANDLER(143, ZEND_DECLARE_CONST, CONST, CONST) zval_copy_ctor(&c.value); } c.flags = CONST_CS; /* non persistent, case sensetive */ - c.name = IS_INTERNED(Z_STRVAL_P(name)) ? Z_STRVAL_P(name) : zend_strndup(Z_STRVAL_P(name), Z_STRLEN_P(name)); + c.name = str_strndup(Z_STRVAL_P(name), Z_STRLEN_P(name)); c.name_len = Z_STRLEN_P(name)+1; c.module_number = PHP_USER_CONSTANT; @@ -5280,14 +5327,14 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE generator->value = *value_ptr; } - FREE_OP1_IF_VAR(); + FREE_OP1_VAR_PTR(); } } else { zval *value = GET_OP1_ZVAL_PTR(BP_VAR_R); /* Consts, temporary variables and references need copying */ if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_TMP_VAR - || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) + || PZVAL_IS_REF(value) ) { zval *copy; @@ -5300,12 +5347,13 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE } generator->value = copy; + FREE_OP1_IF_VAR(); } else { - Z_ADDREF_P(value); + if (OP1_TYPE == IS_CV) { + Z_ADDREF_P(value); + } generator->value = value; } - - FREE_OP1_IF_VAR(); } } else { /* If no value was specified yield null */ @@ -5376,10 +5424,10 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE ZEND_VM_HANDLER(159, ZEND_DISCARD_EXCEPTION, ANY, ANY) { - if (EG(prev_exception) != NULL) { + if (EX(delayed_exception) != NULL) { /* discard the previously thrown exception */ - zval_ptr_dtor(&EG(prev_exception)); - EG(prev_exception) = NULL; + zval_ptr_dtor(&EX(delayed_exception)); + EX(delayed_exception) = NULL; } ZEND_VM_NEXT_OPCODE(); @@ -5396,6 +5444,7 @@ ZEND_VM_HANDLER(162, ZEND_FAST_CALL, ANY, ANY) ZEND_VM_CONTINUE(); } EX(fast_ret) = opline + 1; + EX(delayed_exception) = NULL; ZEND_VM_SET_OPCODE(opline->op1.jmp_addr); ZEND_VM_CONTINUE(); } @@ -5412,16 +5461,17 @@ ZEND_VM_HANDLER(163, ZEND_FAST_RET, ANY, ANY) if (opline->extended_value == ZEND_FAST_RET_TO_FINALLY) { ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]); ZEND_VM_CONTINUE(); - } else if (opline->extended_value == ZEND_FAST_RET_TO_CATCH) { - zend_exception_restore(TSRMLS_C); - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]); - ZEND_VM_CONTINUE(); - } else if (UNEXPECTED((EX(op_array)->fn_flags & ZEND_ACC_GENERATOR) != 0)) { - zend_exception_restore(TSRMLS_C); - ZEND_VM_DISPATCH_TO_HANDLER(ZEND_GENERATOR_RETURN); } else { - zend_exception_restore(TSRMLS_C); - ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper); + EG(exception) = EX(delayed_exception); + EX(delayed_exception) = NULL; + if (opline->extended_value == ZEND_FAST_RET_TO_CATCH) { + ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]); + ZEND_VM_CONTINUE(); + } else if (UNEXPECTED((EX(op_array)->fn_flags & ZEND_ACC_GENERATOR) != 0)) { + ZEND_VM_DISPATCH_TO_HANDLER(ZEND_GENERATOR_RETURN); + } else { + ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper); + } } } } diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 3a0a70e946..02f8acb6be 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -396,7 +396,7 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) EG(current_execute_data) = EX(prev_execute_data); EG(opline_ptr) = NULL; if (!EG(active_symbol_table)) { - i_free_compiled_variables(execute_data); + i_free_compiled_variables(execute_data TSRMLS_CC); } zend_vm_stack_free((char*)execute_data - (ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * op_array->T) TSRMLS_CC); @@ -487,14 +487,15 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR if (UNEXPECTED((fbc->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) != 0)) { if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_ABSTRACT) != 0)) { zend_error_noreturn(E_ERROR, "Cannot call abstract method %s::%s()", fbc->common.scope->name, fbc->common.function_name); - CHECK_EXCEPTION(); - ZEND_VM_NEXT_OPCODE(); /* Never reached */ } if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_DEPRECATED) != 0)) { zend_error(E_DEPRECATED, "Function %s%s%s() is deprecated", fbc->common.scope ? fbc->common.scope->name : "", fbc->common.scope ? "::" : "", fbc->common.function_name); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } } } if (fbc->common.scope && @@ -504,6 +505,9 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { /* FIXME: output identifiers properly */ zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically", fbc->common.scope->name, fbc->common.function_name); + if (UNEXPECTED(EG(exception) != NULL)) { + HANDLE_EXCEPTION(); + } } else { /* FIXME: output identifiers properly */ /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ @@ -526,7 +530,7 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR LOAD_OPLINE(); if (fbc->type == ZEND_INTERNAL_FUNCTION) { - if (fbc->common.arg_info) { + if (fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) { zend_uint i=0; zval **p = (zval**)EX(function_state).arguments; ulong arg_count = opline->extended_value; @@ -547,7 +551,7 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR if (!zend_execute_internal) { /* saves one function call if zend_execute_internal is not used */ - fbc->internal_function.handler(opline->extended_value, ret->var.ptr, (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? &ret->var.ptr : NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC); + fbc->internal_function.handler(opline->extended_value, ret->var.ptr, &ret->var.ptr, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC); } else { zend_execute_internal(execute_data, NULL, RETURN_VALUE_USED(opline) TSRMLS_CC); } @@ -738,6 +742,37 @@ static int ZEND_FASTCALL ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) ZEND_VM_NEXT_OPCODE(); } +static int ZEND_FASTCALL ZEND_RECV_VARIADIC_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + zend_uint arg_num = opline->op1.num; + zend_uint arg_count = zend_vm_stack_get_args_count(TSRMLS_C); + zval **var_ptr, *params; + + SAVE_OPLINE(); + + var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC); + Z_DELREF_PP(var_ptr); + MAKE_STD_ZVAL(params); + *var_ptr = params; + + if (arg_num <= arg_count) { + array_init_size(params, arg_count - arg_num + 1); + } else { + array_init(params); + } + + for (; arg_num <= arg_count; ++arg_num) { + zval **param = zend_vm_stack_get_arg(arg_num TSRMLS_CC); + zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value TSRMLS_CC); + zend_hash_next_index_insert(Z_ARRVAL_P(params), param, sizeof(zval *), NULL); + Z_ADDREF_PP(param); + } + + CHECK_EXCEPTION(); + ZEND_VM_NEXT_OPCODE(); +} + static int ZEND_FASTCALL ZEND_NEW_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -981,7 +1016,7 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER { zend_uint op_num = EG(opline_before_exception)-EG(active_op_array)->opcodes; int i; - zend_uint catch_op_num = 0, finally_op_num = 0; + zend_uint catch_op_num = 0, finally_op_num = 0, finally_op_end = 0; void **stack_frame; /* Figure out where the next stack frame (which maybe contains pushed @@ -1006,6 +1041,10 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER if (op_num < EG(active_op_array)->try_catch_array[i].finally_op) { finally_op_num = EX(op_array)->try_catch_array[i].finally_op; } + if (op_num >= EG(active_op_array)->try_catch_array[i].finally_op && + op_num < EG(active_op_array)->try_catch_array[i].finally_end) { + finally_op_end = EG(active_op_array)->try_catch_array[i].finally_end; + } } if (EX(call) >= EX(call_slots)) { @@ -1067,14 +1106,29 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER EX(old_error_reporting) = NULL; if (finally_op_num && (!catch_op_num || catch_op_num >= finally_op_num)) { - zend_exception_save(TSRMLS_C); + if (EX(delayed_exception)) { + zend_exception_set_previous(EG(exception), EX(delayed_exception) TSRMLS_CC); + } + EX(delayed_exception) = EG(exception); + EG(exception) = NULL; EX(fast_ret) = NULL; ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[finally_op_num]); ZEND_VM_CONTINUE(); } else if (catch_op_num) { + if (finally_op_end && catch_op_num > finally_op_end) { + /* we are going out of current finally scope */ + if (EX(delayed_exception)) { + zend_exception_set_previous(EG(exception), EX(delayed_exception) TSRMLS_CC); + EX(delayed_exception) = NULL; + } + } ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[catch_op_num]); ZEND_VM_CONTINUE(); } else { + if (EX(delayed_exception)) { + zend_exception_set_previous(EG(exception), EX(delayed_exception) TSRMLS_CC); + EX(delayed_exception) = NULL; + } if (UNEXPECTED((EX(op_array)->fn_flags & ZEND_ACC_GENERATOR) != 0)) { return ZEND_GENERATOR_RETURN_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } else { @@ -1124,10 +1178,10 @@ static int ZEND_FASTCALL ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS static int ZEND_FASTCALL ZEND_DISCARD_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { - if (EG(prev_exception) != NULL) { + if (EX(delayed_exception) != NULL) { /* discard the previously thrown exception */ - zval_ptr_dtor(&EG(prev_exception)); - EG(prev_exception) = NULL; + zval_ptr_dtor(&EX(delayed_exception)); + EX(delayed_exception) = NULL; } ZEND_VM_NEXT_OPCODE(); @@ -1144,6 +1198,7 @@ static int ZEND_FASTCALL ZEND_FAST_CALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) ZEND_VM_CONTINUE(); } EX(fast_ret) = opline + 1; + EX(delayed_exception) = NULL; ZEND_VM_SET_OPCODE(opline->op1.jmp_addr); ZEND_VM_CONTINUE(); } @@ -1160,16 +1215,17 @@ static int ZEND_FASTCALL ZEND_FAST_RET_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (opline->extended_value == ZEND_FAST_RET_TO_FINALLY) { ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]); ZEND_VM_CONTINUE(); - } else if (opline->extended_value == ZEND_FAST_RET_TO_CATCH) { - zend_exception_restore(TSRMLS_C); - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]); - ZEND_VM_CONTINUE(); - } else if (UNEXPECTED((EX(op_array)->fn_flags & ZEND_ACC_GENERATOR) != 0)) { - zend_exception_restore(TSRMLS_C); - return ZEND_GENERATOR_RETURN_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } else { - zend_exception_restore(TSRMLS_C); - return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + EG(exception) = EX(delayed_exception); + EX(delayed_exception) = NULL; + if (opline->extended_value == ZEND_FAST_RET_TO_CATCH) { + ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]); + ZEND_VM_CONTINUE(); + } else if (UNEXPECTED((EX(op_array)->fn_flags & ZEND_ACC_GENERATOR) != 0)) { + return ZEND_GENERATOR_RETURN_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + } else { + return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + } } } } @@ -1270,7 +1326,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE if (call->object) { Z_ADDREF_P(call->object); } - if (IS_CONST == IS_VAR && 0 && + if (IS_CONST == IS_VAR && 0 && Z_REFCOUNT_P(function_name) == 1 && call->fbc->common.fn_flags & ZEND_ACC_CLOSURE) { /* Delay closure destruction until its invocation */ call->fbc->common.prototype = (zend_function*)function_name; @@ -1400,8 +1456,7 @@ static int ZEND_FASTCALL ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ if (param == NULL) { ALLOC_ZVAL(assignment_value); *assignment_value = *opline->op2.zv; - if ((Z_TYPE_P(assignment_value) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT || - Z_TYPE_P(assignment_value)==IS_CONSTANT_ARRAY) { + if (IS_CONSTANT_TYPE(Z_TYPE_P(assignment_value))) { Z_SET_REFCOUNT_P(assignment_value, 1); zval_update_constant(&assignment_value, 0 TSRMLS_CC); } else { @@ -1595,7 +1650,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H if (call->object) { Z_ADDREF_P(call->object); } - if (IS_TMP_VAR == IS_VAR && 1 && + if (IS_TMP_VAR == IS_VAR && 1 && Z_REFCOUNT_P(function_name) == 1 && call->fbc->common.fn_flags & ZEND_ACC_CLOSURE) { /* Delay closure destruction until its invocation */ call->fbc->common.prototype = (zend_function*)function_name; @@ -1719,7 +1774,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ zend_error_noreturn(E_ERROR, "Class name must be a valid object or a string"); } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -1768,7 +1823,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H zend_error_noreturn(E_ERROR, "Call to undefined function %s()", function_name_strval); } efree(lcname); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); call->object = NULL; call->called_scope = NULL; call->is_ctor_call = 0; @@ -1782,12 +1837,12 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H if (call->object) { Z_ADDREF_P(call->object); } - if (IS_VAR == IS_VAR && (free_op2.var != NULL) && + if (IS_VAR == IS_VAR && (free_op2.var != NULL) && Z_REFCOUNT_P(function_name) == 1 && call->fbc->common.fn_flags & ZEND_ACC_CLOSURE) { /* Delay closure destruction until its invocation */ call->fbc->common.prototype = (zend_function*)function_name; } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } call->is_ctor_call = 0; EX(call) = call; @@ -1858,7 +1913,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H } call->is_ctor_call = 0; EX(call) = call; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { @@ -2007,7 +2062,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HA if (call->object) { Z_ADDREF_P(call->object); } - if (IS_CV == IS_VAR && 0 && + if (IS_CV == IS_VAR && 0 && Z_REFCOUNT_P(function_name) == 1 && call->fbc->common.fn_flags & ZEND_ACC_CLOSURE) { /* Delay closure destruction until its invocation */ call->fbc->common.prototype = (zend_function*)function_name; @@ -2339,9 +2394,7 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG retval_ptr = opline->op1.zv; if (!EG(return_value_ptr_ptr)) { - if (IS_CONST == IS_TMP_VAR) { - } } else { if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR || @@ -2354,18 +2407,23 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG zval_copy_ctor(ret); } *EG(return_value_ptr_ptr) = ret; + } else if ((IS_CONST == IS_CV || IS_CONST == IS_VAR) && retval_ptr == &EG(uninitialized_zval)) { zval *ret; + if (IS_CONST == IS_VAR) { + Z_DELREF_P(retval_ptr); + } ALLOC_INIT_ZVAL(ret); *EG(return_value_ptr_ptr) = ret; } else { *EG(return_value_ptr_ptr) = retval_ptr; - Z_ADDREF_P(retval_ptr); + if (IS_CONST == IS_CV) { + Z_ADDREF_P(retval_ptr); + } } } - return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } @@ -2379,7 +2437,8 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CONST_HANDLER(ZEND_OPCODE_HAND SAVE_OPLINE(); do { - if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) { + if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR || + (IS_CONST == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) { /* Not supposed to happen, but we'll allow it */ zend_error(E_NOTICE, "Only variable references should be returned by reference"); @@ -2570,7 +2629,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(&retval); } else { - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } } @@ -2728,7 +2787,6 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA EX(original_return_value) = EG(return_value_ptr_ptr); EG(active_op_array) = new_op_array; if (RETURN_VALUE_USED(opline)) { - EX_T(opline->result.var).var.ptr = NULL; EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr; EG(return_value_ptr_ptr) = EX_T(opline->result.var).var.ptr_ptr; } else { @@ -2766,7 +2824,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA ALLOC_ZVAL(retval); ZVAL_BOOL(retval, failure_retval); INIT_PZVAL(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } ZEND_VM_NEXT_OPCODE(); } @@ -2828,19 +2886,27 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { ce = Z_OBJCE_P(array_ptr); if (!ce || !ce->get_iterator) { - Z_ADDREF_P(array_ptr); + if (IS_CONST == IS_CV) { + Z_ADDREF_P(array_ptr); + } } } else if (IS_CONST == IS_CONST || - ((IS_CONST == IS_CV || IS_CONST == IS_VAR) && + (IS_CONST == IS_CV && + !Z_ISREF_P(array_ptr) && + Z_REFCOUNT_P(array_ptr) > 1) || + (IS_CONST == IS_VAR && !Z_ISREF_P(array_ptr) && - Z_REFCOUNT_P(array_ptr) > 1)) { + Z_REFCOUNT_P(array_ptr) > 2)) { zval *tmp; + if (IS_CONST == IS_VAR) { + Z_DELREF_P(array_ptr); + } ALLOC_ZVAL(tmp); INIT_PZVAL_COPY(tmp, array_ptr); zval_copy_ctor(tmp); array_ptr = tmp; - } else { + } else if (IS_CONST == IS_CV) { Z_ADDREF_P(array_ptr); } } @@ -2848,10 +2914,15 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A if (ce && ce->get_iterator) { iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC); + if (IS_CONST == IS_VAR && !(opline->extended_value & ZEND_FE_RESET_VARIABLE)) { + + } if (iter && EXPECTED(EG(exception) == NULL)) { array_ptr = zend_iterator_wrap(iter TSRMLS_CC); } else { + if (IS_CONST == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + } if (!EG(exception)) { zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name); } @@ -2868,14 +2939,18 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A iter->funcs->rewind(iter TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(&array_ptr); + if (IS_CONST == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + } HANDLE_EXCEPTION(); } } is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(&array_ptr); + if (IS_CONST == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + } HANDLE_EXCEPTION(); } iter->index = -1; /* will be set to 0 before using next handler */ @@ -2905,6 +2980,9 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A is_empty = 1; } + if (IS_CONST == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + + } if (is_empty) { ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num); } else { @@ -3370,10 +3448,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_CONST(int type */ if (IS_CONST == IS_CONST) { hash_value = Z_HASH_P(varname); - } else if (IS_INTERNED(Z_STRVAL_P(varname))) { - hash_value = INTERNED_HASH(Z_STRVAL_P(varname)); } else { - hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1); + hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname)); } if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) { @@ -3426,7 +3502,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_CONST(int type switch (type) { case BP_VAR_R: case BP_VAR_IS: - AI_SET_PTR(&EX_T(opline->result.var), *retval); + EX_T(opline->result.var).var.ptr = *retval; break; case BP_VAR_UNSET: { zend_free_op free_res; @@ -3486,14 +3562,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_ zval *container; SAVE_OPLINE(); - - if (IS_CONST == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } container = opline->op1.zv; zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC); + if (IS_CONST != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -3509,13 +3583,13 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_TMP_VAR_SPEC_CONST_CONST_HANDLER(ZEND_O if (UNEXPECTED(Z_TYPE_P(container) != IS_ARRAY)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } else { zval *value = *zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC); PZVAL_LOCK(value); - AI_SET_PTR(&EX_T(opline->result.var), value); + EX_T(opline->result.var).var.ptr = value; } CHECK_EXCEPTION(); @@ -3627,7 +3701,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER( /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -3651,9 +3725,6 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER SAVE_OPLINE(); - if (IS_CONST==IS_VAR) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } is_equal_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, opline->op2.zv TSRMLS_CC); @@ -3732,8 +3803,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO } if (EXPECTED(zend_hash_quick_find(&ce->constants_table, Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv)+1, Z_HASH_P(opline->op2.zv), (void **) &value) == SUCCESS)) { - if (Z_TYPE_PP(value) == IS_CONSTANT_ARRAY || - (Z_TYPE_PP(value) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) { + if (IS_CONSTANT_TYPE(Z_TYPE_PP(value))) { zend_class_entry *old_scope = EG(scope); EG(scope) = ce; @@ -3790,7 +3860,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_O INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - } else { + + } else if (IS_CONST == IS_CV) { Z_ADDREF_P(expr_ptr); } } @@ -3815,11 +3886,7 @@ num_index: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -3838,8 +3905,6 @@ num_index: } if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && opline->extended_value) { - } else { - } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -4034,7 +4099,7 @@ static int ZEND_FASTCALL ZEND_DECLARE_CONST_SPEC_CONST_CONST_HANDLER(ZEND_OPCOD name = opline->op1.zv; val = opline->op2.zv; - if ((Z_TYPE_P(val) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT || Z_TYPE_P(val) == IS_CONSTANT_ARRAY) { + if (IS_CONSTANT_TYPE(Z_TYPE_P(val))) { zval tmp; zval *tmp_ptr = &tmp; @@ -4050,7 +4115,7 @@ static int ZEND_FASTCALL ZEND_DECLARE_CONST_SPEC_CONST_CONST_HANDLER(ZEND_OPCOD zval_copy_ctor(&c.value); } c.flags = CONST_CS; /* non persistent, case sensetive */ - c.name = IS_INTERNED(Z_STRVAL_P(name)) ? Z_STRVAL_P(name) : zend_strndup(Z_STRVAL_P(name), Z_STRLEN_P(name)); + c.name = str_strndup(Z_STRVAL_P(name), Z_STRLEN_P(name)); c.name_len = Z_STRLEN_P(name)+1; c.module_number = PHP_USER_CONSTANT; @@ -4134,7 +4199,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLE /* Consts, temporary variables and references need copying */ if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR - || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) + || PZVAL_IS_REF(value) ) { zval *copy; @@ -4147,11 +4212,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLE } generator->value = copy; + } else { - Z_ADDREF_P(value); + if (IS_CONST == IS_CV) { + Z_ADDREF_P(value); + } generator->value = value; } - } } else { /* If no value was specified yield null */ @@ -4502,14 +4569,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HA zval *container; SAVE_OPLINE(); - - if (IS_CONST == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } container = opline->op1.zv; zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC); zval_dtor(free_op2.var); + if (IS_CONST != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -4619,7 +4684,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -4643,9 +4708,6 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_A zend_free_op free_op2; SAVE_OPLINE(); - if (IS_CONST==IS_VAR) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } is_equal_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); @@ -4686,7 +4748,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPC INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - } else { + + } else if (IS_CONST == IS_CV) { Z_ADDREF_P(expr_ptr); } } @@ -4711,11 +4774,7 @@ num_index: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -4734,8 +4793,6 @@ num_index: } if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && opline->extended_value) { - } else { - } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -4827,7 +4884,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ /* Consts, temporary variables and references need copying */ if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR - || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) + || PZVAL_IS_REF(value) ) { zval *copy; @@ -4840,11 +4897,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ } generator->value = copy; + } else { - Z_ADDREF_P(value); + if (IS_CONST == IS_CV) { + Z_ADDREF_P(value); + } generator->value = value; } - } } else { /* If no value was specified yield null */ @@ -4922,7 +4981,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -4937,7 +4996,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -4952,7 +5011,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -4967,7 +5026,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -4982,7 +5041,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -4997,7 +5056,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5012,7 +5071,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5027,7 +5086,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5042,7 +5101,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_H opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5059,7 +5118,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCO _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); Z_LVAL_P(result) = !Z_LVAL_P(result); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5075,7 +5134,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDL opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5091,7 +5150,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_H opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5107,7 +5166,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HAN opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5123,7 +5182,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_O opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5138,7 +5197,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5153,7 +5212,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5168,7 +5227,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5183,7 +5242,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDL opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5243,10 +5302,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_VAR(int type, */ if (IS_CONST == IS_CONST) { hash_value = Z_HASH_P(varname); - } else if (IS_INTERNED(Z_STRVAL_P(varname))) { - hash_value = INTERNED_HASH(Z_STRVAL_P(varname)); } else { - hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1); + hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname)); } if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) { @@ -5299,7 +5356,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_VAR(int type, switch (type) { case BP_VAR_R: case BP_VAR_IS: - AI_SET_PTR(&EX_T(opline->result.var), *retval); + EX_T(opline->result.var).var.ptr = *retval; break; case BP_VAR_UNSET: { zend_free_op free_res; @@ -5359,14 +5416,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HA zval *container; SAVE_OPLINE(); - - if (IS_CONST == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } container = opline->op1.zv; zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); + if (IS_CONST != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5455,7 +5510,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE } } if (IS_VAR != IS_CONST) { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } } else { if (UNEXPECTED(ce->constructor == NULL)) { @@ -5476,7 +5531,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -5500,14 +5555,11 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_A zend_free_op free_op2; SAVE_OPLINE(); - if (IS_CONST==IS_VAR) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } is_equal_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -5543,7 +5595,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPC INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - } else { + + } else if (IS_CONST == IS_CV) { Z_ADDREF_P(expr_ptr); } } @@ -5568,11 +5621,7 @@ num_index: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -5585,14 +5634,12 @@ num_index: /* do nothing */ break; } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } else { zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL); } if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && opline->extended_value) { - } else { - } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -5847,7 +5894,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ /* Consts, temporary variables and references need copying */ if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR - || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) + || PZVAL_IS_REF(value) ) { zval *copy; @@ -5860,11 +5907,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ } generator->value = copy; + } else { - Z_ADDREF_P(value); + if (IS_CONST == IS_CV) { + Z_ADDREF_P(value); + } generator->value = value; } - } } else { /* If no value was specified yield null */ @@ -5903,7 +5952,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ generator->largest_used_integer_key = Z_LVAL_P(generator->key); } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } else { /* If no key was specified we use auto-increment keys */ generator->largest_used_integer_key++; @@ -5988,10 +6037,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_UNUSED(int typ */ if (IS_CONST == IS_CONST) { hash_value = Z_HASH_P(varname); - } else if (IS_INTERNED(Z_STRVAL_P(varname))) { - hash_value = INTERNED_HASH(Z_STRVAL_P(varname)); } else { - hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1); + hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname)); } if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) { @@ -6044,7 +6091,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_UNUSED(int typ switch (type) { case BP_VAR_R: case BP_VAR_IS: - AI_SET_PTR(&EX_T(opline->result.var), *retval); + EX_T(opline->result.var).var.ptr = *retval; break; case BP_VAR_UNSET: { zend_free_op free_res; @@ -6202,7 +6249,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -6251,7 +6298,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_ INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - } else { + + } else if (IS_CONST == IS_CV) { Z_ADDREF_P(expr_ptr); } } @@ -6276,11 +6324,7 @@ num_index: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -6299,8 +6343,6 @@ num_index: } if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && opline->extended_value) { - } else { - } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -6573,7 +6615,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDL /* Consts, temporary variables and references need copying */ if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR - || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) + || PZVAL_IS_REF(value) ) { zval *copy; @@ -6586,11 +6628,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDL } generator->value = copy; + } else { - Z_ADDREF_P(value); + if (IS_CONST == IS_CV) { + Z_ADDREF_P(value); + } generator->value = value; } - } } else { /* If no value was specified yield null */ @@ -6941,14 +6985,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HAN zval *container; SAVE_OPLINE(); - - if (IS_CONST == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } container = opline->op1.zv; zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC); + if (IS_CONST != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -7058,7 +7100,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -7142,9 +7184,6 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); - if (IS_CONST==IS_VAR) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } is_equal_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); @@ -7184,7 +7223,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCO INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - } else { + + } else if (IS_CONST == IS_CV) { Z_ADDREF_P(expr_ptr); } } @@ -7209,11 +7249,7 @@ num_index: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -7232,8 +7268,6 @@ num_index: } if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && opline->extended_value) { - } else { - } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -7325,7 +7359,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A /* Consts, temporary variables and references need copying */ if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR - || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) + || PZVAL_IS_REF(value) ) { zval *copy; @@ -7338,11 +7372,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A } generator->value = copy; + } else { - Z_ADDREF_P(value); + if (IS_CONST == IS_CV) { + Z_ADDREF_P(value); + } generator->value = value; } - } } else { /* If no value was specified yield null */ @@ -7643,9 +7679,7 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) retval_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (!EG(return_value_ptr_ptr)) { - if (IS_TMP_VAR == IS_TMP_VAR) { - zval_dtor(free_op1.var); - } + zval_dtor(free_op1.var); } else { if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR || @@ -7658,18 +7692,23 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zval_copy_ctor(ret); } *EG(return_value_ptr_ptr) = ret; + } else if ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) && retval_ptr == &EG(uninitialized_zval)) { zval *ret; + if (IS_TMP_VAR == IS_VAR) { + Z_DELREF_P(retval_ptr); + } ALLOC_INIT_ZVAL(ret); *EG(return_value_ptr_ptr) = ret; } else { *EG(return_value_ptr_ptr) = retval_ptr; - Z_ADDREF_P(retval_ptr); + if (IS_TMP_VAR == IS_CV) { + Z_ADDREF_P(retval_ptr); + } } } - return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } @@ -7683,7 +7722,8 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLE SAVE_OPLINE(); do { - if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) { + if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR || + (IS_TMP_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) { /* Not supposed to happen, but we'll allow it */ zend_error(E_NOTICE, "Only variable references should be returned by reference"); @@ -7875,7 +7915,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(&retval); } else { - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } } @@ -8033,7 +8073,6 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND EX(original_return_value) = EG(return_value_ptr_ptr); EG(active_op_array) = new_op_array; if (RETURN_VALUE_USED(opline)) { - EX_T(opline->result.var).var.ptr = NULL; EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr; EG(return_value_ptr_ptr) = EX_T(opline->result.var).var.ptr_ptr; } else { @@ -8071,7 +8110,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND ALLOC_ZVAL(retval); ZVAL_BOOL(retval, failure_retval); INIT_PZVAL(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } ZEND_VM_NEXT_OPCODE(); } @@ -8133,19 +8172,27 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { ce = Z_OBJCE_P(array_ptr); if (!ce || !ce->get_iterator) { - Z_ADDREF_P(array_ptr); + if (IS_TMP_VAR == IS_CV) { + Z_ADDREF_P(array_ptr); + } } } else if (IS_TMP_VAR == IS_CONST || - ((IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) && + (IS_TMP_VAR == IS_CV && !Z_ISREF_P(array_ptr) && - Z_REFCOUNT_P(array_ptr) > 1)) { + Z_REFCOUNT_P(array_ptr) > 1) || + (IS_TMP_VAR == IS_VAR && + !Z_ISREF_P(array_ptr) && + Z_REFCOUNT_P(array_ptr) > 2)) { zval *tmp; + if (IS_TMP_VAR == IS_VAR) { + Z_DELREF_P(array_ptr); + } ALLOC_ZVAL(tmp); INIT_PZVAL_COPY(tmp, array_ptr); zval_copy_ctor(tmp); array_ptr = tmp; - } else { + } else if (IS_TMP_VAR == IS_CV) { Z_ADDREF_P(array_ptr); } } @@ -8153,10 +8200,15 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG if (ce && ce->get_iterator) { iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC); + if (IS_TMP_VAR == IS_VAR && !(opline->extended_value & ZEND_FE_RESET_VARIABLE)) { + + } if (iter && EXPECTED(EG(exception) == NULL)) { array_ptr = zend_iterator_wrap(iter TSRMLS_CC); } else { + if (IS_TMP_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + } if (!EG(exception)) { zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name); } @@ -8173,14 +8225,18 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG iter->funcs->rewind(iter TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(&array_ptr); + if (IS_TMP_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + } HANDLE_EXCEPTION(); } } is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(&array_ptr); + if (IS_TMP_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + } HANDLE_EXCEPTION(); } iter->index = -1; /* will be set to 0 before using next handler */ @@ -8210,6 +8266,9 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG is_empty = 1; } + if (IS_TMP_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + + } if (is_empty) { ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num); } else { @@ -8727,10 +8786,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_CONST(int type, */ if (IS_TMP_VAR == IS_CONST) { hash_value = Z_HASH_P(varname); - } else if (IS_INTERNED(Z_STRVAL_P(varname))) { - hash_value = INTERNED_HASH(Z_STRVAL_P(varname)); } else { - hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1); + hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname)); } if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) { @@ -8783,7 +8840,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_CONST(int type, switch (type) { case BP_VAR_R: case BP_VAR_IS: - AI_SET_PTR(&EX_T(opline->result.var), *retval); + EX_T(opline->result.var).var.ptr = *retval; break; case BP_VAR_UNSET: { zend_free_op free_res; @@ -8843,14 +8900,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HA zval *container; SAVE_OPLINE(); - - if (IS_TMP_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC); - zval_dtor(free_op1.var); + if (IS_TMP_VAR != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + zval_dtor(free_op1.var); + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -8866,13 +8921,13 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_TMP_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPC if (UNEXPECTED(Z_TYPE_P(container) != IS_ARRAY)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } else { zval *value = *zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC); PZVAL_LOCK(value); - AI_SET_PTR(&EX_T(opline->result.var), value); + EX_T(opline->result.var).var.ptr = value; } CHECK_EXCEPTION(); @@ -9010,9 +9065,6 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_A zend_free_op free_op1; SAVE_OPLINE(); - if (IS_TMP_VAR==IS_VAR) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } is_equal_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); @@ -9052,7 +9104,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPC INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - } else { + + } else if (IS_TMP_VAR == IS_CV) { Z_ADDREF_P(expr_ptr); } } @@ -9077,11 +9130,7 @@ num_index: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -9100,8 +9149,6 @@ num_index: } if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && opline->extended_value) { - } else { - } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -9356,7 +9403,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ /* Consts, temporary variables and references need copying */ if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR - || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) + || PZVAL_IS_REF(value) ) { zval *copy; @@ -9369,11 +9416,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ } generator->value = copy; + } else { - Z_ADDREF_P(value); + if (IS_TMP_VAR == IS_CV) { + Z_ADDREF_P(value); + } generator->value = value; } - } } else { /* If no value was specified yield null */ @@ -9724,14 +9773,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HAND zval *container; SAVE_OPLINE(); - - if (IS_TMP_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC); zval_dtor(free_op2.var); - zval_dtor(free_op1.var); + if (IS_TMP_VAR != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + zval_dtor(free_op1.var); + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -9867,9 +9914,6 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG zend_free_op free_op1, free_op2; SAVE_OPLINE(); - if (IS_TMP_VAR==IS_VAR) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } is_equal_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); @@ -9910,7 +9954,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCOD INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - } else { + + } else if (IS_TMP_VAR == IS_CV) { Z_ADDREF_P(expr_ptr); } } @@ -9935,11 +9980,7 @@ num_index: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -9958,8 +9999,6 @@ num_index: } if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && opline->extended_value) { - } else { - } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -10051,7 +10090,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR /* Consts, temporary variables and references need copying */ if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR - || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) + || PZVAL_IS_REF(value) ) { zval *copy; @@ -10064,11 +10103,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR } generator->value = copy; + } else { - Z_ADDREF_P(value); + if (IS_TMP_VAR == IS_CV) { + Z_ADDREF_P(value); + } generator->value = value; } - } } else { /* If no value was specified yield null */ @@ -10146,7 +10187,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10161,7 +10202,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10176,7 +10217,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10191,7 +10232,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10206,7 +10247,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10221,7 +10262,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10236,7 +10277,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10251,7 +10292,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_A _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10266,7 +10307,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAN _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10283,7 +10324,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); Z_LVAL_P(result) = !Z_LVAL_P(result); zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10299,7 +10340,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10315,7 +10356,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAN _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10331,7 +10372,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDL _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10347,7 +10388,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPC _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10362,7 +10403,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10377,7 +10418,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_A _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10392,7 +10433,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_A _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10407,7 +10448,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10467,10 +10508,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_VAR(int type, ZE */ if (IS_TMP_VAR == IS_CONST) { hash_value = Z_HASH_P(varname); - } else if (IS_INTERNED(Z_STRVAL_P(varname))) { - hash_value = INTERNED_HASH(Z_STRVAL_P(varname)); } else { - hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1); + hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname)); } if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) { @@ -10523,7 +10562,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_VAR(int type, ZE switch (type) { case BP_VAR_R: case BP_VAR_IS: - AI_SET_PTR(&EX_T(opline->result.var), *retval); + EX_T(opline->result.var).var.ptr = *retval; break; case BP_VAR_UNSET: { zend_free_op free_res; @@ -10583,14 +10622,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAND zval *container; SAVE_OPLINE(); - - if (IS_TMP_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - zval_dtor(free_op1.var); + zval_ptr_dtor_nogc(&free_op2.var); + if (IS_TMP_VAR != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + zval_dtor(free_op1.var); + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10634,7 +10671,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ * 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);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -10692,7 +10729,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE } } else { if (UNEXPECTED(EG(exception) != NULL)) { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); HANDLE_EXCEPTION(); } zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); @@ -10714,7 +10751,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE call->is_ctor_call = 0; EX(call) = call; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -10726,14 +10763,11 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG zend_free_op free_op1, free_op2; SAVE_OPLINE(); - if (IS_TMP_VAR==IS_VAR) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } is_equal_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -10769,7 +10803,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCOD INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - } else { + + } else if (IS_TMP_VAR == IS_CV) { Z_ADDREF_P(expr_ptr); } } @@ -10794,11 +10829,7 @@ num_index: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -10811,14 +10842,12 @@ num_index: /* do nothing */ break; } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } else { zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL); } if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && opline->extended_value) { - } else { - } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -11073,7 +11102,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR /* Consts, temporary variables and references need copying */ if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR - || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) + || PZVAL_IS_REF(value) ) { zval *copy; @@ -11086,11 +11115,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR } generator->value = copy; + } else { - Z_ADDREF_P(value); + if (IS_TMP_VAR == IS_CV) { + Z_ADDREF_P(value); + } generator->value = value; } - } } else { /* If no value was specified yield null */ @@ -11129,7 +11160,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR generator->largest_used_integer_key = Z_LVAL_P(generator->key); } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } else { /* If no key was specified we use auto-increment keys */ generator->largest_used_integer_key++; @@ -11214,10 +11245,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_UNUSED(int type, */ if (IS_TMP_VAR == IS_CONST) { hash_value = Z_HASH_P(varname); - } else if (IS_INTERNED(Z_STRVAL_P(varname))) { - hash_value = INTERNED_HASH(Z_STRVAL_P(varname)); } else { - hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1); + hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname)); } if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) { @@ -11270,7 +11299,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_UNUSED(int type, switch (type) { case BP_VAR_R: case BP_VAR_IS: - AI_SET_PTR(&EX_T(opline->result.var), *retval); + EX_T(opline->result.var).var.ptr = *retval; break; case BP_VAR_UNSET: { zend_free_op free_res; @@ -11354,7 +11383,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OP INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - } else { + + } else if (IS_TMP_VAR == IS_CV) { Z_ADDREF_P(expr_ptr); } } @@ -11379,11 +11409,7 @@ num_index: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -11402,8 +11428,6 @@ num_index: } if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && opline->extended_value) { - } else { - } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -11658,7 +11682,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER /* Consts, temporary variables and references need copying */ if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR - || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) + || PZVAL_IS_REF(value) ) { zval *copy; @@ -11671,11 +11695,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER } generator->value = copy; + } else { - Z_ADDREF_P(value); + if (IS_TMP_VAR == IS_CV) { + Z_ADDREF_P(value); + } generator->value = value; } - } } else { /* If no value was specified yield null */ @@ -12026,14 +12052,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDL zval *container; SAVE_OPLINE(); - - if (IS_TMP_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC); - zval_dtor(free_op1.var); + if (IS_TMP_VAR != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + zval_dtor(free_op1.var); + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -12167,9 +12191,6 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS zend_free_op free_op1; SAVE_OPLINE(); - if (IS_TMP_VAR==IS_VAR) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } is_equal_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); @@ -12209,7 +12230,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - } else { + + } else if (IS_TMP_VAR == IS_CV) { Z_ADDREF_P(expr_ptr); } } @@ -12234,11 +12256,7 @@ num_index: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -12257,8 +12275,6 @@ num_index: } if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && opline->extended_value) { - } else { - } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -12350,7 +12366,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG /* Consts, temporary variables and references need copying */ if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR - || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) + || PZVAL_IS_REF(value) ) { zval *copy; @@ -12363,11 +12379,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG } generator->value = copy; + } else { - Z_ADDREF_P(value); + if (IS_TMP_VAR == IS_CV) { + Z_ADDREF_P(value); + } generator->value = value; } - } } else { /* If no value was specified yield null */ @@ -12443,7 +12461,7 @@ static int ZEND_FASTCALL ZEND_BW_NOT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); bitwise_not_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -12456,7 +12474,7 @@ static int ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); boolean_not_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -12476,9 +12494,9 @@ static int ZEND_FASTCALL ZEND_PRE_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS if (IS_VAR == IS_VAR && UNEXPECTED(*var_ptr == &EG(error_zval))) { if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -12500,10 +12518,10 @@ static int ZEND_FASTCALL ZEND_PRE_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*var_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *var_ptr); + EX_T(opline->result.var).var.ptr = *var_ptr; } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -12523,9 +12541,9 @@ static int ZEND_FASTCALL ZEND_PRE_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS if (IS_VAR == IS_VAR && UNEXPECTED(*var_ptr == &EG(error_zval))) { if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -12547,10 +12565,10 @@ static int ZEND_FASTCALL ZEND_PRE_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*var_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *var_ptr); + EX_T(opline->result.var).var.ptr = *var_ptr; } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -12569,7 +12587,7 @@ static int ZEND_FASTCALL ZEND_POST_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG } if (IS_VAR == IS_VAR && UNEXPECTED(*var_ptr == &EG(error_zval))) { ZVAL_NULL(&EX_T(opline->result.var).tmp_var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -12593,7 +12611,7 @@ static int ZEND_FASTCALL ZEND_POST_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG fast_increment_function(*var_ptr); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -12612,7 +12630,7 @@ static int ZEND_FASTCALL ZEND_POST_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG } if (IS_VAR == IS_VAR && UNEXPECTED(*var_ptr == &EG(error_zval))) { ZVAL_NULL(&EX_T(opline->result.var).tmp_var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -12636,7 +12654,7 @@ static int ZEND_FASTCALL ZEND_POST_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG fast_decrement_function(*var_ptr); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -12655,7 +12673,7 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) } zend_print_variable(z); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -12682,7 +12700,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) ret = Z_LVAL_P(val); } else { ret = i_zend_is_true(val); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } @@ -12712,7 +12730,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) ret = Z_LVAL_P(val); } else { ret = i_zend_is_true(val); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } @@ -12742,7 +12760,7 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) retval = Z_LVAL_P(val); } else { retval = i_zend_is_true(val); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } @@ -12776,7 +12794,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS retval = Z_LVAL_P(val); } else { retval = i_zend_is_true(val); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } @@ -12807,7 +12825,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG retval = Z_LVAL_P(val); } else { retval = i_zend_is_true(val); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } @@ -12848,9 +12866,7 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) retval_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (!EG(return_value_ptr_ptr)) { - if (IS_VAR == IS_TMP_VAR) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } + zval_ptr_dtor_nogc(&free_op1.var); } else { if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR || @@ -12863,18 +12879,23 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zval_copy_ctor(ret); } *EG(return_value_ptr_ptr) = ret; + zval_ptr_dtor_nogc(&free_op1.var); } else if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) && retval_ptr == &EG(uninitialized_zval)) { zval *ret; + if (IS_VAR == IS_VAR) { + Z_DELREF_P(retval_ptr); + } ALLOC_INIT_ZVAL(ret); *EG(return_value_ptr_ptr) = ret; } else { *EG(return_value_ptr_ptr) = retval_ptr; - Z_ADDREF_P(retval_ptr); + if (IS_VAR == IS_CV) { + Z_ADDREF_P(retval_ptr); + } } } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } @@ -12888,14 +12909,15 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLE SAVE_OPLINE(); do { - if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) { + if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR || + (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) { /* Not supposed to happen, but we'll allow it */ zend_error(E_NOTICE, "Only variable references should be returned by reference"); retval_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (!EG(return_value_ptr_ptr)) { if (IS_VAR == IS_TMP_VAR) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); } } else if (!0) { /* Not a temp var */ zval *ret; @@ -12945,7 +12967,7 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLE } } while (0); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } @@ -12976,7 +12998,7 @@ static int ZEND_FASTCALL ZEND_THROW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zend_throw_exception_object(exception TSRMLS_CC); zend_exception_restore(TSRMLS_C); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); HANDLE_EXCEPTION(); } @@ -12988,21 +13010,26 @@ static int ZEND_FASTCALL zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_AR varptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (varptr == &EG(uninitialized_zval)) { - ALLOC_ZVAL(varptr); - INIT_ZVAL(*varptr); - Z_SET_REFCOUNT_P(varptr, 0); + if (IS_VAR == IS_VAR) { + Z_DELREF_P(varptr); + } + ALLOC_INIT_ZVAL(varptr); } else if (PZVAL_IS_REF(varptr)) { - zval *original_var = varptr; + if (IS_VAR == IS_CV || + (IS_VAR == IS_VAR && Z_REFCOUNT_P(varptr) > 2)) { + zval *original_var = varptr; - ALLOC_ZVAL(varptr); - ZVAL_COPY_VALUE(varptr, original_var); - Z_UNSET_ISREF_P(varptr); - Z_SET_REFCOUNT_P(varptr, 0); - zval_copy_ctor(varptr); + ALLOC_ZVAL(varptr); + INIT_PZVAL_COPY(varptr, original_var); + zval_copy_ctor(varptr); + zval_ptr_dtor_nogc(&free_op1.var); + } else { + Z_UNSET_ISREF_P(varptr); + } + } else if (IS_VAR == IS_CV) { + Z_ADDREF_P(varptr); } - Z_ADDREF_P(varptr); zend_vm_stack_push(varptr TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; /* for string offsets */ CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -13023,22 +13050,15 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } - if (IS_VAR == IS_VAR && - (opline->extended_value & ZEND_ARG_SEND_FUNCTION) && - EX_T(opline->op1.var).var.fcall_returned_reference && - EX_T(opline->op1.var).var.ptr) { - varptr = EX_T(opline->op1.var).var.ptr; - PZVAL_UNLOCK_EX(varptr, &free_op1, 0); - } else { - varptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - } + varptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) || EX_T(opline->op1.var).var.fcall_returned_reference) && varptr != &EG(uninitialized_zval) && - (PZVAL_IS_REF(varptr) || - (Z_REFCOUNT_P(varptr) == 1 && (IS_VAR == IS_CV || free_op1.var)))) { + (PZVAL_IS_REF(varptr) || Z_REFCOUNT_P(varptr) == 1)) { Z_SET_ISREF_P(varptr); - Z_ADDREF_P(varptr); + if (IS_VAR == IS_CV) { + Z_ADDREF_P(varptr); + } zend_vm_stack_push(varptr TSRMLS_CC); } else { zval *valptr; @@ -13053,9 +13073,9 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND if (!0) { zval_copy_ctor(valptr); } + zval_ptr_dtor_nogc(&free_op1.var); zend_vm_stack_push(valptr TSRMLS_CC); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -13092,7 +13112,7 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG Z_ADDREF_P(varptr); zend_vm_stack_push(varptr TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -13118,7 +13138,7 @@ static int ZEND_FASTCALL ZEND_BOOL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); /* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */ ZVAL_BOOL(retval, i_zend_is_true(_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC))); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -13192,10 +13212,10 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(&retval); } else { - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -13237,7 +13257,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (use_copy) { ZVAL_COPY_VALUE(result, &var_copy); if (0) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); } } else { ZVAL_COPY_VALUE(result, expr); @@ -13254,7 +13274,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) convert_to_object(result); break; } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -13343,14 +13363,13 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND if (tmp_inc_filename) { zval_ptr_dtor(&tmp_inc_filename); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); } else if (EXPECTED(new_op_array != NULL)) { EX(original_return_value) = EG(return_value_ptr_ptr); EG(active_op_array) = new_op_array; if (RETURN_VALUE_USED(opline)) { - EX_T(opline->result.var).var.ptr = NULL; EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr; EG(return_value_ptr_ptr) = EX_T(opline->result.var).var.ptr_ptr; } else { @@ -13388,7 +13407,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND ALLOC_ZVAL(retval); ZVAL_BOOL(retval, failure_retval); INIT_PZVAL(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } ZEND_VM_NEXT_OPCODE(); } @@ -13450,19 +13469,27 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { ce = Z_OBJCE_P(array_ptr); if (!ce || !ce->get_iterator) { - Z_ADDREF_P(array_ptr); + if (IS_VAR == IS_CV) { + Z_ADDREF_P(array_ptr); + } } } else if (IS_VAR == IS_CONST || - ((IS_VAR == IS_CV || IS_VAR == IS_VAR) && + (IS_VAR == IS_CV && !Z_ISREF_P(array_ptr) && - Z_REFCOUNT_P(array_ptr) > 1)) { + Z_REFCOUNT_P(array_ptr) > 1) || + (IS_VAR == IS_VAR && + !Z_ISREF_P(array_ptr) && + Z_REFCOUNT_P(array_ptr) > 2)) { zval *tmp; + if (IS_VAR == IS_VAR) { + Z_DELREF_P(array_ptr); + } ALLOC_ZVAL(tmp); INIT_PZVAL_COPY(tmp, array_ptr); zval_copy_ctor(tmp); array_ptr = tmp; - } else { + } else if (IS_VAR == IS_CV) { Z_ADDREF_P(array_ptr); } } @@ -13470,10 +13497,15 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG if (ce && ce->get_iterator) { iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC); + if (IS_VAR == IS_VAR && !(opline->extended_value & ZEND_FE_RESET_VARIABLE)) { + zval_ptr_dtor_nogc(&free_op1.var); + } if (iter && EXPECTED(EG(exception) == NULL)) { array_ptr = zend_iterator_wrap(iter TSRMLS_CC); } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + if (free_op1.var) {zval_ptr_dtor_nogc(&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); } @@ -13490,14 +13522,18 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG iter->funcs->rewind(iter TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(&array_ptr); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; + } HANDLE_EXCEPTION(); } } is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(&array_ptr); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; + } HANDLE_EXCEPTION(); } iter->index = -1; /* will be set to 0 before using next handler */ @@ -13527,7 +13563,9 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG is_empty = 1; } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (IS_VAR == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; + } if (is_empty) { ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num); } else { @@ -13659,7 +13697,7 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG Z_ADDREF_PP(value); } else { PZVAL_LOCK(*value); - AI_SET_PTR(&EX_T(opline->result.var), *value); + EX_T(opline->result.var).var.ptr = *value; } CHECK_EXCEPTION(); @@ -13682,7 +13720,7 @@ static int ZEND_FASTCALL ZEND_EXIT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) } else { zend_print_variable(ptr); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); } #endif zend_bailout(); @@ -13703,14 +13741,14 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS if (!0) { zendi_zval_copy_ctor(EX_T(opline->result.var).tmp_var); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); #if DEBUG_ZEND>=2 printf("Conditional jmp to %d\n", opline->op2.opline_num); #endif ZEND_VM_JMP(opline->op2.jmp_addr); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -13738,14 +13776,14 @@ static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ zval_copy_ctor(EX_T(opline->result.var).var.ptr); } } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); #if DEBUG_ZEND>=2 printf("Conditional jmp to %d\n", opline->op2.opline_num); #endif ZEND_VM_JMP(opline->op2.jmp_addr); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -13763,7 +13801,7 @@ static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR if (!0) { zval_copy_ctor(&EX_T(opline->result.var).tmp_var); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -13791,7 +13829,7 @@ static int ZEND_FASTCALL ZEND_QM_ASSIGN_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLE } } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -13812,7 +13850,7 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_A result = 0; } ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -13826,7 +13864,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR fast_add_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -13841,7 +13879,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR fast_sub_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -13856,7 +13894,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR fast_mul_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -13871,7 +13909,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR fast_div_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -13886,7 +13924,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR fast_mod_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -13901,7 +13939,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG shift_left_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -13916,7 +13954,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG shift_right_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -13931,7 +13969,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER concat_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -13946,7 +13984,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H is_identical_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -13963,7 +14001,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCO _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); Z_LVAL_P(result) = !Z_LVAL_P(result); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -13979,7 +14017,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDL ZVAL_BOOL(result, fast_equal_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC)); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -13995,7 +14033,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H ZVAL_BOOL(result, fast_not_equal_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC)); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14011,7 +14049,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN ZVAL_BOOL(result, fast_is_smaller_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC)); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14027,7 +14065,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_O ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC)); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14042,7 +14080,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ bitwise_or_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14057,7 +14095,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER bitwise_and_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14072,7 +14110,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER bitwise_xor_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14087,7 +14125,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDL boolean_xor_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14118,7 +14156,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } else { /* here we are sure we are dealing with an object */ @@ -14138,7 +14175,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*zptr); EX_T(opline->result.var).var.ptr = *zptr; - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -14177,7 +14213,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(z); EX_T(opline->result.var).var.ptr = z; - EX_T(opline->result.var).var.ptr_ptr = NULL; } zval_ptr_dtor(&z); } else { @@ -14185,7 +14220,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -14198,7 +14232,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b FREE_OP(free_op_data1); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* assign_obj has two opcodes! */ CHECK_EXCEPTION(); ZEND_VM_INC_OPCODE(); @@ -14250,10 +14284,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CONST(int (*binar if (UNEXPECTED(*var_ptr == &EG(error_zval))) { if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); if (opline->extended_value == ZEND_ASSIGN_DIM) { ZEND_VM_INC_OPCODE(); @@ -14278,17 +14312,17 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CONST(int (*binar if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*var_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *var_ptr); + EX_T(opline->result.var).var.ptr = *var_ptr; } if (opline->extended_value == ZEND_ASSIGN_DIM) { FREE_OP(free_op_data1); FREE_OP_VAR_PTR(free_op_data2); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_INC_OPCODE(); } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); } ZEND_VM_NEXT_OPCODE(); @@ -14378,7 +14412,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t PZVAL_LOCK(&EG(uninitialized_zval)); *retval = &EG(uninitialized_zval); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -14438,7 +14472,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t } else { } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -14479,7 +14513,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_ zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); ZVAL_NULL(retval); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -14540,7 +14574,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_ } else { } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -14589,7 +14623,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_CONST(int type, if (IS_VAR != IS_CONST && varname == &tmp_varname) { zval_dtor(&tmp_varname); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -14599,7 +14633,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_CONST(int type, ce = EX_T(opline->op2.var).class_entry; } retval = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0, ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); } else { target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC); /* @@ -14610,10 +14644,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_CONST(int type, */ if (IS_VAR == IS_CONST) { hash_value = Z_HASH_P(varname); - } else if (IS_INTERNED(Z_STRVAL_P(varname))) { - hash_value = INTERNED_HASH(Z_STRVAL_P(varname)); } else { - hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1); + hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname)); } if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) { @@ -14638,11 +14670,11 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_CONST(int type, switch (opline->extended_value & ZEND_FETCH_TYPE_MASK) { case ZEND_FETCH_GLOBAL: if (IS_VAR != IS_TMP_VAR) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); } break; case ZEND_FETCH_LOCAL: - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); break; case ZEND_FETCH_STATIC: zval_update_constant(retval, (void*) 1 TSRMLS_CC); @@ -14666,7 +14698,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_CONST(int type, switch (type) { case BP_VAR_R: case BP_VAR_IS: - AI_SET_PTR(&EX_T(opline->result.var), *retval); + EX_T(opline->result.var).var.ptr = *retval; break; case BP_VAR_UNSET: { zend_free_op free_res; @@ -14726,14 +14758,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA zval *container; SAVE_OPLINE(); - - if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (IS_VAR != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + zval_ptr_dtor_nogc(&free_op1.var); + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -14755,7 +14785,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* We are going to assign the result by reference */ if (UNEXPECTED(opline->extended_value != 0)) { @@ -14789,7 +14819,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -14804,7 +14834,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_IS TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -14827,7 +14857,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; } else { zval *container; @@ -14837,7 +14867,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -14865,7 +14895,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCOD if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; if (UNEXPECTED(EX_T(opline->result.var).var.ptr_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); ZEND_VM_NEXT_OPCODE(); @@ -14900,7 +14930,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_CONST( UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { zend_error(E_NOTICE, "Trying to get property of non-object"); PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } else { zval *retval; @@ -14913,7 +14943,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_CONST( retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); PZVAL_LOCK(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; if (0) { zval_ptr_dtor(&offset); @@ -14922,7 +14952,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_CONST( } } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -14959,7 +14989,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* We are going to assign the result by reference */ if (opline->extended_value & ZEND_FETCH_MAKE_REF) { @@ -15002,7 +15032,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -15022,7 +15052,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } else { zval *retval; @@ -15035,7 +15065,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); PZVAL_LOCK(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; if (0) { zval_ptr_dtor(&offset); @@ -15044,7 +15074,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H } } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -15078,7 +15108,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { @@ -15117,7 +15147,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCOD if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res); if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { @@ -15152,7 +15182,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN } else { } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* assign_obj has two opcodes! */ CHECK_EXCEPTION(); ZEND_VM_INC_OPCODE(); @@ -15202,11 +15232,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN ALLOC_ZVAL(retval); ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1); INIT_PZVAL(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } } else if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) { if (IS_TMP_FREE(free_op_data1)) { @@ -15214,7 +15244,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else { if ((opline+1)->op1_type == IS_TMP_VAR) { @@ -15226,13 +15256,13 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(value); - AI_SET_PTR(&EX_T(opline->result.var), value); + EX_T(opline->result.var).var.ptr = value; } } FREE_OP_VAR_PTR(free_op_data2); FREE_OP_IF_VAR(free_op_data1); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* assign_dim has two opcodes! */ CHECK_EXCEPTION(); ZEND_VM_INC_OPCODE(); @@ -15258,11 +15288,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER ALLOC_ZVAL(retval); ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1); INIT_PZVAL(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } } else if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else if (IS_VAR == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) { if (0) { @@ -15270,7 +15300,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else { if (IS_CONST == IS_TMP_VAR) { @@ -15282,11 +15312,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(value); - AI_SET_PTR(&EX_T(opline->result.var), value); + EX_T(opline->result.var).var.ptr = value; } } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* zend_assign_to_variable() always takes care of op2, never free it! */ @@ -15368,7 +15398,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZEND_OPCO call->is_ctor_call = 0; EX(call) = call; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -15479,7 +15509,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -15503,9 +15533,6 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_A zend_free_op free_op1; SAVE_OPLINE(); - if (IS_VAR==IS_VAR) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } is_equal_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); @@ -15584,8 +15611,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE } if (EXPECTED(zend_hash_quick_find(&ce->constants_table, Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv)+1, Z_HASH_P(opline->op2.zv), (void **) &value) == SUCCESS)) { - if (Z_TYPE_PP(value) == IS_CONSTANT_ARRAY || - (Z_TYPE_PP(value) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) { + if (IS_CONSTANT_TYPE(Z_TYPE_PP(value))) { zend_class_entry *old_scope = EG(scope); EG(scope) = ce; @@ -15642,7 +15668,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPC INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - } else { + zval_ptr_dtor_nogc(&free_op1.var); + } else if (IS_VAR == IS_CV) { Z_ADDREF_P(expr_ptr); } } @@ -15667,11 +15694,7 @@ num_index: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -15689,9 +15712,7 @@ num_index: zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL); } if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -15760,7 +15781,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { zval_ptr_dtor(&varname); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); HANDLE_EXCEPTION(); } if (UNEXPECTED(ce == NULL)) { @@ -15784,7 +15805,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { zval_ptr_dtor(&varname); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -15828,11 +15849,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (ht == &EG(symbol_table)) { zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC); @@ -15883,7 +15900,7 @@ num_index_dim: } else { } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -15924,7 +15941,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND } else { } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -15994,7 +16011,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPC if (IS_VAR != IS_CONST && varname == &tmp) { zval_dtor(&tmp); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); } if (opline->extended_value & ZEND_ISSET) { @@ -16027,7 +16044,6 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CONST( SAVE_OPLINE(); container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - offset = opline->op2.zv; if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) { @@ -16054,11 +16070,7 @@ num_index_prop: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) { isset = 1; @@ -16151,7 +16163,7 @@ num_index_prop: Z_LVAL(EX_T(opline->result.var).tmp_var) = !result; } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16233,14 +16245,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ generator->value = *value_ptr; } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; } } else { zval *value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR - || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) + || PZVAL_IS_REF(value) ) { zval *copy; @@ -16253,12 +16265,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ } generator->value = copy; + zval_ptr_dtor_nogc(&free_op1.var); } else { - Z_ADDREF_P(value); + if (IS_VAR == IS_CV) { + Z_ADDREF_P(value); + } generator->value = value; } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } } else { /* If no value was specified yield null */ @@ -16335,7 +16348,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_add_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16350,7 +16363,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_sub_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16365,7 +16378,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_mul_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16380,7 +16393,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_div_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16395,7 +16408,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_mod_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16410,7 +16423,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) shift_left_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16425,7 +16438,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) shift_right_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16440,7 +16453,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A concat_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16455,7 +16468,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN is_identical_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16472,7 +16485,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); Z_LVAL_P(result) = !Z_LVAL_P(result); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16488,7 +16501,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER ZVAL_BOOL(result, fast_equal_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16504,7 +16517,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN ZVAL_BOOL(result, fast_not_equal_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16520,7 +16533,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL ZVAL_BOOL(result, fast_is_smaller_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16536,7 +16549,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPC ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16551,7 +16564,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR bitwise_or_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16566,7 +16579,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A bitwise_and_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16581,7 +16594,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A bitwise_xor_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16596,7 +16609,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER boolean_xor_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -16627,7 +16640,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*bin if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } else { /* here we are sure we are dealing with an object */ @@ -16647,7 +16659,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*bin if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*zptr); EX_T(opline->result.var).var.ptr = *zptr; - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -16686,7 +16697,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*bin if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(z); EX_T(opline->result.var).var.ptr = z; - EX_T(opline->result.var).var.ptr_ptr = NULL; } zval_ptr_dtor(&z); } else { @@ -16694,7 +16704,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*bin if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -16707,7 +16716,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*bin FREE_OP(free_op_data1); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* assign_obj has two opcodes! */ CHECK_EXCEPTION(); ZEND_VM_INC_OPCODE(); @@ -16759,10 +16768,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_TMP(int (*binary_ if (UNEXPECTED(*var_ptr == &EG(error_zval))) { if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } zval_dtor(free_op2.var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); if (opline->extended_value == ZEND_ASSIGN_DIM) { ZEND_VM_INC_OPCODE(); @@ -16787,18 +16796,18 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_TMP(int (*binary_ if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*var_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *var_ptr); + EX_T(opline->result.var).var.ptr = *var_ptr; } zval_dtor(free_op2.var); if (opline->extended_value == ZEND_ASSIGN_DIM) { FREE_OP(free_op_data1); FREE_OP_VAR_PTR(free_op_data2); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_INC_OPCODE(); } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); } ZEND_VM_NEXT_OPCODE(); @@ -16888,7 +16897,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_TMP(incdec_t i PZVAL_LOCK(&EG(uninitialized_zval)); *retval = &EG(uninitialized_zval); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -16948,7 +16957,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_TMP(incdec_t i } else { zval_dtor(free_op2.var); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -16989,7 +16998,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_TMP(incdec_t zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); zval_dtor(free_op2.var); ZVAL_NULL(retval); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -17050,7 +17059,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_TMP(incdec_t } else { zval_dtor(free_op2.var); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -17072,14 +17081,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND zval *container; SAVE_OPLINE(); - - if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC); zval_dtor(free_op2.var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (IS_VAR != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + zval_ptr_dtor_nogc(&free_op1.var); + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -17101,7 +17108,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* We are going to assign the result by reference */ if (UNEXPECTED(opline->extended_value != 0)) { @@ -17135,7 +17142,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -17150,7 +17157,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_IS TSRMLS_CC); zval_dtor(free_op2.var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -17173,7 +17180,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCO EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } zval_dtor(free_op2.var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; } else { zval *container; @@ -17183,7 +17190,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCO container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC); zval_dtor(free_op2.var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -17211,7 +17218,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_ if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; if (UNEXPECTED(EX_T(opline->result.var).var.ptr_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); ZEND_VM_NEXT_OPCODE(); @@ -17246,7 +17253,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_TMP(ZE UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { zend_error(E_NOTICE, "Trying to get property of non-object"); PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); zval_dtor(free_op2.var); } else { zval *retval; @@ -17259,7 +17266,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_TMP(ZE retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); PZVAL_LOCK(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; if (1) { zval_ptr_dtor(&offset); @@ -17268,7 +17275,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_TMP(ZE } } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -17305,7 +17312,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* We are going to assign the result by reference */ if (opline->extended_value & ZEND_FETCH_MAKE_REF) { @@ -17348,7 +17355,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -17368,7 +17375,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); zval_dtor(free_op2.var); } else { zval *retval; @@ -17381,7 +17388,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); PZVAL_LOCK(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; if (1) { zval_ptr_dtor(&offset); @@ -17390,7 +17397,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN } } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -17424,7 +17431,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCO if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { @@ -17463,7 +17470,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_ if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res); if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { @@ -17498,7 +17505,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL } else { zval_dtor(free_op2.var); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* assign_obj has two opcodes! */ CHECK_EXCEPTION(); ZEND_VM_INC_OPCODE(); @@ -17549,11 +17556,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL ALLOC_ZVAL(retval); ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1); INIT_PZVAL(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } } else if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) { if (IS_TMP_FREE(free_op_data1)) { @@ -17561,7 +17568,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else { if ((opline+1)->op1_type == IS_TMP_VAR) { @@ -17573,13 +17580,13 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(value); - AI_SET_PTR(&EX_T(opline->result.var), value); + EX_T(opline->result.var).var.ptr = value; } } FREE_OP_VAR_PTR(free_op_data2); FREE_OP_IF_VAR(free_op_data1); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* assign_dim has two opcodes! */ CHECK_EXCEPTION(); ZEND_VM_INC_OPCODE(); @@ -17605,11 +17612,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A ALLOC_ZVAL(retval); ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1); INIT_PZVAL(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } } else if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else if (IS_VAR == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) { if (1) { @@ -17617,7 +17624,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else { if (IS_TMP_VAR == IS_TMP_VAR) { @@ -17629,11 +17636,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(value); - AI_SET_PTR(&EX_T(opline->result.var), value); + EX_T(opline->result.var).var.ptr = value; } } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* zend_assign_to_variable() always takes care of op2, never free it! */ @@ -17716,7 +17723,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE EX(call) = call; zval_dtor(free_op2.var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -17827,7 +17834,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -17851,9 +17858,6 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG zend_free_op free_op1, free_op2; SAVE_OPLINE(); - if (IS_VAR==IS_VAR) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } is_equal_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); @@ -17894,7 +17898,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCOD INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - } else { + zval_ptr_dtor_nogc(&free_op1.var); + } else if (IS_VAR == IS_CV) { Z_ADDREF_P(expr_ptr); } } @@ -17919,11 +17924,7 @@ num_index: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -17941,9 +17942,7 @@ num_index: zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL); } if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -18002,11 +18001,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (ht == &EG(symbol_table)) { zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC); @@ -18057,7 +18052,7 @@ num_index_dim: } else { zval_dtor(free_op2.var); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -18098,7 +18093,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE } else { zval_dtor(free_op2.var); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -18116,7 +18111,6 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(in SAVE_OPLINE(); container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) { @@ -18143,11 +18137,7 @@ num_index_prop: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) { isset = 1; @@ -18240,7 +18230,7 @@ num_index_prop: Z_LVAL(EX_T(opline->result.var).tmp_var) = !result; } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -18322,14 +18312,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR generator->value = *value_ptr; } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; } } else { zval *value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR - || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) + || PZVAL_IS_REF(value) ) { zval *copy; @@ -18342,12 +18332,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR } generator->value = copy; + zval_ptr_dtor_nogc(&free_op1.var); } else { - Z_ADDREF_P(value); + if (IS_VAR == IS_CV) { + Z_ADDREF_P(value); + } generator->value = value; } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } } else { /* If no value was specified yield null */ @@ -18424,8 +18415,8 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_add_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &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);}; + zval_ptr_dtor_nogc(&free_op1.var); + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18439,8 +18430,8 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_sub_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &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);}; + zval_ptr_dtor_nogc(&free_op1.var); + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18454,8 +18445,8 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_mul_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &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);}; + zval_ptr_dtor_nogc(&free_op1.var); + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18469,8 +18460,8 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_div_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &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);}; + zval_ptr_dtor_nogc(&free_op1.var); + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18484,8 +18475,8 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS fast_mod_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &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);}; + zval_ptr_dtor_nogc(&free_op1.var); + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18499,8 +18490,8 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) shift_left_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &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);}; + zval_ptr_dtor_nogc(&free_op1.var); + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18514,8 +18505,8 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) shift_right_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &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);}; + zval_ptr_dtor_nogc(&free_op1.var); + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18529,8 +18520,8 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A concat_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &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);}; + zval_ptr_dtor_nogc(&free_op1.var); + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18544,8 +18535,8 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN is_identical_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &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);}; + zval_ptr_dtor_nogc(&free_op1.var); + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18561,8 +18552,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); Z_LVAL_P(result) = !Z_LVAL_P(result); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op1.var); + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18577,8 +18568,8 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER ZVAL_BOOL(result, fast_equal_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &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);}; + zval_ptr_dtor_nogc(&free_op1.var); + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18593,8 +18584,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN ZVAL_BOOL(result, fast_not_equal_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &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);}; + zval_ptr_dtor_nogc(&free_op1.var); + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18609,8 +18600,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL ZVAL_BOOL(result, fast_is_smaller_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &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);}; + zval_ptr_dtor_nogc(&free_op1.var); + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18625,8 +18616,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPC ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &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);}; + zval_ptr_dtor_nogc(&free_op1.var); + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18640,8 +18631,8 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR bitwise_or_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &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);}; + zval_ptr_dtor_nogc(&free_op1.var); + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18655,8 +18646,8 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A bitwise_and_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &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);}; + zval_ptr_dtor_nogc(&free_op1.var); + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18670,8 +18661,8 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A bitwise_xor_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &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);}; + zval_ptr_dtor_nogc(&free_op1.var); + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18685,8 +18676,8 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER boolean_xor_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &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);}; + zval_ptr_dtor_nogc(&free_op1.var); + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -18710,13 +18701,12 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*bin if (UNEXPECTED(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);}; + zval_ptr_dtor_nogc(&free_op2.var); FREE_OP(free_op_data1); if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } else { /* here we are sure we are dealing with an object */ @@ -18736,7 +18726,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*bin if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*zptr); EX_T(opline->result.var).var.ptr = *zptr; - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -18775,7 +18764,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*bin if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(z); EX_T(opline->result.var).var.ptr = z; - EX_T(opline->result.var).var.ptr_ptr = NULL; } zval_ptr_dtor(&z); } else { @@ -18783,7 +18771,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*bin if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -18791,12 +18778,12 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*bin if (0) { zval_ptr_dtor(&property); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } FREE_OP(free_op_data1); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* assign_obj has two opcodes! */ CHECK_EXCEPTION(); ZEND_VM_INC_OPCODE(); @@ -18848,10 +18835,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_VAR(int (*binary_ if (UNEXPECTED(*var_ptr == &EG(error_zval))) { if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op2.var); + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); if (opline->extended_value == ZEND_ASSIGN_DIM) { ZEND_VM_INC_OPCODE(); @@ -18876,18 +18863,18 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_VAR(int (*binary_ if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*var_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *var_ptr); + EX_T(opline->result.var).var.ptr = *var_ptr; } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); if (opline->extended_value == ZEND_ASSIGN_DIM) { FREE_OP(free_op_data1); FREE_OP_VAR_PTR(free_op_data2); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_INC_OPCODE(); } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); } ZEND_VM_NEXT_OPCODE(); @@ -18972,12 +18959,12 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_VAR(incdec_t i if (UNEXPECTED(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);}; + zval_ptr_dtor_nogc(&free_op2.var); if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); *retval = &EG(uninitialized_zval); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19035,9 +19022,9 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_VAR(incdec_t i if (0) { zval_ptr_dtor(&property); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19076,9 +19063,9 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_VAR(incdec_t if (UNEXPECTED(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);}; + zval_ptr_dtor_nogc(&free_op2.var); ZVAL_NULL(retval); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19137,9 +19124,9 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_VAR(incdec_t if (0) { zval_ptr_dtor(&property); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19188,7 +19175,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_VAR(int type, ZE if (IS_VAR != IS_CONST && varname == &tmp_varname) { zval_dtor(&tmp_varname); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19198,7 +19185,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_VAR(int type, ZE ce = EX_T(opline->op2.var).class_entry; } retval = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0, ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); } else { target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC); /* @@ -19209,10 +19196,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_VAR(int type, ZE */ if (IS_VAR == IS_CONST) { hash_value = Z_HASH_P(varname); - } else if (IS_INTERNED(Z_STRVAL_P(varname))) { - hash_value = INTERNED_HASH(Z_STRVAL_P(varname)); } else { - hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1); + hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname)); } if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) { @@ -19237,11 +19222,11 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_VAR(int type, ZE switch (opline->extended_value & ZEND_FETCH_TYPE_MASK) { case ZEND_FETCH_GLOBAL: if (IS_VAR != IS_TMP_VAR) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); } break; case ZEND_FETCH_LOCAL: - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); break; case ZEND_FETCH_STATIC: zval_update_constant(retval, (void*) 1 TSRMLS_CC); @@ -19265,7 +19250,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_VAR(int type, ZE switch (type) { case BP_VAR_R: case BP_VAR_IS: - AI_SET_PTR(&EX_T(opline->result.var), *retval); + EX_T(opline->result.var).var.ptr = *retval; break; case BP_VAR_UNSET: { zend_free_op free_res; @@ -19325,14 +19310,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAND zval *container; SAVE_OPLINE(); - - if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, 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);}; + zval_ptr_dtor_nogc(&free_op2.var); + if (IS_VAR != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + zval_ptr_dtor_nogc(&free_op1.var); + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19350,11 +19333,11 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAND zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_W TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* We are going to assign the result by reference */ if (UNEXPECTED(opline->extended_value != 0)) { @@ -19384,11 +19367,11 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_RW TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19402,8 +19385,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN SAVE_OPLINE(); container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, 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);}; + zval_ptr_dtor_nogc(&free_op2.var); + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19425,8 +19408,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCO if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op2.var); + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; } else { zval *container; @@ -19435,8 +19418,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCO } container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, 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);}; + zval_ptr_dtor_nogc(&free_op2.var); + zval_ptr_dtor_nogc(&free_op1.var); } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -19460,11 +19443,11 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_ zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_UNSET TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; if (UNEXPECTED(EX_T(opline->result.var).var.ptr_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); ZEND_VM_NEXT_OPCODE(); @@ -19499,8 +19482,8 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_VAR(ZE UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { zend_error(E_NOTICE, "Trying to get property of non-object"); PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); + zval_ptr_dtor_nogc(&free_op2.var); } else { zval *retval; @@ -19512,16 +19495,16 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_VAR(ZE retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); PZVAL_LOCK(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; if (0) { zval_ptr_dtor(&offset); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19553,12 +19536,12 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAND if (0) { zval_ptr_dtor(&property); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* We are going to assign the result by reference */ if (opline->extended_value & ZEND_FETCH_MAKE_REF) { @@ -19596,12 +19579,12 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN if (0) { zval_ptr_dtor(&property); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19621,8 +19604,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); + zval_ptr_dtor_nogc(&free_op2.var); } else { zval *retval; @@ -19634,16 +19617,16 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); PZVAL_LOCK(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; if (0) { zval_ptr_dtor(&offset); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19672,12 +19655,12 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCO if (0) { zval_ptr_dtor(&property); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { @@ -19711,12 +19694,12 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_ if (0) { zval_ptr_dtor(&property); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res); if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { @@ -19749,9 +19732,9 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL if (0) { zval_ptr_dtor(&property_name); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* assign_obj has two opcodes! */ CHECK_EXCEPTION(); ZEND_VM_INC_OPCODE(); @@ -19781,7 +19764,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL if (0) { zval_ptr_dtor(&property_name); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } } else { zend_free_op free_op2, free_op_data1, free_op_data2; @@ -19790,7 +19773,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL zval **variable_ptr_ptr; zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), object_ptr, dim, IS_VAR, BP_VAR_W TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); @@ -19802,11 +19785,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL ALLOC_ZVAL(retval); ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1); INIT_PZVAL(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } } else if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) { if (IS_TMP_FREE(free_op_data1)) { @@ -19814,7 +19797,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else { if ((opline+1)->op1_type == IS_TMP_VAR) { @@ -19826,13 +19809,13 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(value); - AI_SET_PTR(&EX_T(opline->result.var), value); + EX_T(opline->result.var).var.ptr = value; } } FREE_OP_VAR_PTR(free_op_data2); FREE_OP_IF_VAR(free_op_data1); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* assign_dim has two opcodes! */ CHECK_EXCEPTION(); ZEND_VM_INC_OPCODE(); @@ -19858,11 +19841,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A ALLOC_ZVAL(retval); ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1); INIT_PZVAL(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } } else if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else if (IS_VAR == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) { if (0) { @@ -19870,7 +19853,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else { if (IS_VAR == IS_TMP_VAR) { @@ -19882,14 +19865,14 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(value); - AI_SET_PTR(&EX_T(opline->result.var), value); + EX_T(opline->result.var).var.ptr = value; } } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* zend_assign_to_variable() always takes care of op2, never free it! */ - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -19915,7 +19898,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL } zend_error(E_STRICT, "Only variables should be assigned by reference"); if (UNEXPECTED(EG(exception) != NULL)) { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + if (free_op2.var) {zval_ptr_dtor_nogc(&free_op2.var);}; HANDLE_EXCEPTION(); } return ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); @@ -19939,11 +19922,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*variable_ptr_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *variable_ptr_ptr); + EX_T(opline->result.var).var.ptr = *variable_ptr_ptr; } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; + if (free_op2.var) {zval_ptr_dtor_nogc(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -20001,7 +19984,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE } } else { if (UNEXPECTED(EG(exception) != NULL)) { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); HANDLE_EXCEPTION(); } zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); @@ -20023,8 +20006,8 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE call->is_ctor_call = 0; EX(call) = call; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op2.var); + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -20114,7 +20097,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND } } if (IS_VAR != IS_CONST) { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } } else { if (UNEXPECTED(ce->constructor == NULL)) { @@ -20135,7 +20118,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -20159,14 +20142,11 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG zend_free_op free_op1, free_op2; SAVE_OPLINE(); - if (IS_VAR==IS_VAR) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } is_equal_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -20202,7 +20182,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCOD INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - } else { + zval_ptr_dtor_nogc(&free_op1.var); + } else if (IS_VAR == IS_CV) { Z_ADDREF_P(expr_ptr); } } @@ -20227,11 +20208,7 @@ num_index: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -20244,14 +20221,12 @@ num_index: /* do nothing */ break; } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } else { zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL); } if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -20320,7 +20295,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { zval_ptr_dtor(&varname); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); HANDLE_EXCEPTION(); } if (UNEXPECTED(ce == NULL)) { @@ -20344,7 +20319,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { zval_ptr_dtor(&varname); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -20388,11 +20363,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (ht == &EG(symbol_table)) { zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC); @@ -20416,7 +20387,7 @@ num_index_dim: zend_error(E_WARNING, "Illegal offset type in unset"); break; } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); break; } case IS_OBJECT: @@ -20430,20 +20401,20 @@ num_index_dim: if (0) { zval_ptr_dtor(&offset); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&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);}; + zval_ptr_dtor_nogc(&free_op2.var); break; } } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -20476,15 +20447,15 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE if (0) { zval_ptr_dtor(&offset); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -20554,7 +20525,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCOD if (IS_VAR != IS_CONST && varname == &tmp) { zval_dtor(&tmp); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); } if (opline->extended_value & ZEND_ISSET) { @@ -20587,7 +20558,6 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(in SAVE_OPLINE(); container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) { @@ -20614,11 +20584,7 @@ num_index_prop: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) { isset = 1; @@ -20647,7 +20613,7 @@ num_index_prop: result = 1; } } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } else if (Z_TYPE_P(container) == IS_OBJECT) { if (0) { MAKE_REAL_ZVAL_PTR(offset); @@ -20670,7 +20636,7 @@ num_index_prop: if (0) { zval_ptr_dtor(&offset); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } } else if (Z_TYPE_P(container) == IS_STRING && !prop_dim) { /* string offsets */ zval tmp; @@ -20699,9 +20665,9 @@ num_index_prop: } } } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL; @@ -20711,7 +20677,7 @@ num_index_prop: Z_LVAL(EX_T(opline->result.var).tmp_var) = !result; } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -20793,14 +20759,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR generator->value = *value_ptr; } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; } } else { zval *value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR - || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) + || PZVAL_IS_REF(value) ) { zval *copy; @@ -20813,12 +20779,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR } generator->value = copy; + zval_ptr_dtor_nogc(&free_op1.var); } else { - Z_ADDREF_P(value); + if (IS_VAR == IS_CV) { + Z_ADDREF_P(value); + } generator->value = value; } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } } else { /* If no value was specified yield null */ @@ -20857,7 +20824,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR generator->largest_used_integer_key = Z_LVAL_P(generator->key); } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } else { /* If no key was specified we use auto-increment keys */ generator->largest_used_integer_key++; @@ -20912,7 +20879,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (* if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } else { /* here we are sure we are dealing with an object */ @@ -20932,7 +20898,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (* if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*zptr); EX_T(opline->result.var).var.ptr = *zptr; - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -20971,7 +20936,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (* if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(z); EX_T(opline->result.var).var.ptr = z; - EX_T(opline->result.var).var.ptr_ptr = NULL; } zval_ptr_dtor(&z); } else { @@ -20979,7 +20943,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (* if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -20992,7 +20955,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (* FREE_OP(free_op_data1); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* assign_obj has two opcodes! */ CHECK_EXCEPTION(); ZEND_VM_INC_OPCODE(); @@ -21044,10 +21007,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_UNUSED(int (*bina if (UNEXPECTED(*var_ptr == &EG(error_zval))) { if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); if (opline->extended_value == ZEND_ASSIGN_DIM) { ZEND_VM_INC_OPCODE(); @@ -21072,17 +21035,17 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_UNUSED(int (*bina if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*var_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *var_ptr); + EX_T(opline->result.var).var.ptr = *var_ptr; } if (opline->extended_value == ZEND_ASSIGN_DIM) { FREE_OP(free_op_data1); FREE_OP_VAR_PTR(free_op_data2); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_INC_OPCODE(); } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); } ZEND_VM_NEXT_OPCODE(); @@ -21177,7 +21140,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_UNUSED(int type, if (IS_VAR != IS_CONST && varname == &tmp_varname) { zval_dtor(&tmp_varname); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -21187,7 +21150,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_UNUSED(int type, ce = EX_T(opline->op2.var).class_entry; } retval = zend_std_get_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), 0, ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); } else { target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC); /* @@ -21198,10 +21161,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_UNUSED(int type, */ if (IS_VAR == IS_CONST) { hash_value = Z_HASH_P(varname); - } else if (IS_INTERNED(Z_STRVAL_P(varname))) { - hash_value = INTERNED_HASH(Z_STRVAL_P(varname)); } else { - hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1); + hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname)); } if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) { @@ -21226,11 +21187,11 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_UNUSED(int type, switch (opline->extended_value & ZEND_FETCH_TYPE_MASK) { case ZEND_FETCH_GLOBAL: if (IS_VAR != IS_TMP_VAR) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); } break; case ZEND_FETCH_LOCAL: - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); break; case ZEND_FETCH_STATIC: zval_update_constant(retval, (void*) 1 TSRMLS_CC); @@ -21254,7 +21215,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_UNUSED(int type, switch (type) { case BP_VAR_R: case BP_VAR_IS: - AI_SET_PTR(&EX_T(opline->result.var), *retval); + EX_T(opline->result.var).var.ptr = *retval; break; case BP_VAR_UNSET: { zend_free_op free_res; @@ -21324,7 +21285,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_H if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* We are going to assign the result by reference */ if (UNEXPECTED(opline->extended_value != 0)) { @@ -21358,7 +21319,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_ if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -21381,7 +21342,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_O EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; } else { zval *container; @@ -21391,7 +21352,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_O container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, NULL, IS_UNUSED, BP_VAR_R TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -21440,11 +21401,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HA ALLOC_ZVAL(retval); ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1); INIT_PZVAL(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } } else if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) { if (IS_TMP_FREE(free_op_data1)) { @@ -21452,7 +21413,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HA } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else { if ((opline+1)->op1_type == IS_TMP_VAR) { @@ -21464,13 +21425,13 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HA } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(value); - AI_SET_PTR(&EX_T(opline->result.var), value); + EX_T(opline->result.var).var.ptr = value; } } FREE_OP_VAR_PTR(free_op_data2); FREE_OP_IF_VAR(free_op_data1); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* assign_dim has two opcodes! */ CHECK_EXCEPTION(); ZEND_VM_INC_OPCODE(); @@ -21582,7 +21543,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -21631,7 +21592,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OP INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - } else { + zval_ptr_dtor_nogc(&free_op1.var); + } else if (IS_VAR == IS_CV) { Z_ADDREF_P(expr_ptr); } } @@ -21656,11 +21618,7 @@ num_index: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -21678,9 +21636,7 @@ num_index: zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL); } if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -21749,7 +21705,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HAN } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { zval_ptr_dtor(&varname); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); HANDLE_EXCEPTION(); } if (UNEXPECTED(ce == NULL)) { @@ -21773,7 +21729,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HAN } else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { zval_ptr_dtor(&varname); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -21842,7 +21798,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OP if (IS_VAR != IS_CONST && varname == &tmp) { zval_dtor(&tmp); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); } if (opline->extended_value & ZEND_ISSET) { @@ -21950,14 +21906,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER generator->value = *value_ptr; } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; } } else { zval *value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR - || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) + || PZVAL_IS_REF(value) ) { zval *copy; @@ -21970,12 +21926,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER } generator->value = copy; + zval_ptr_dtor_nogc(&free_op1.var); } else { - Z_ADDREF_P(value); + if (IS_VAR == IS_CV) { + Z_ADDREF_P(value); + } generator->value = value; } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } } else { /* If no value was specified yield null */ @@ -22052,7 +22009,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) fast_add_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22067,7 +22024,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) fast_sub_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22082,7 +22039,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) fast_mul_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22097,7 +22054,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) fast_div_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22112,7 +22069,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) fast_mod_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22127,7 +22084,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) shift_left_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22142,7 +22099,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) shift_right_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22157,7 +22114,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR concat_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22172,7 +22129,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND is_identical_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22189,7 +22146,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_ _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); Z_LVAL_P(result) = !Z_LVAL_P(result); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22205,7 +22162,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ ZVAL_BOOL(result, fast_equal_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC)); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22221,7 +22178,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND ZVAL_BOOL(result, fast_not_equal_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC)); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22237,7 +22194,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE ZVAL_BOOL(result, fast_is_smaller_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC)); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22253,7 +22210,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCO ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC)); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22268,7 +22225,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG bitwise_or_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22283,7 +22240,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR bitwise_and_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22298,7 +22255,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR bitwise_xor_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22313,7 +22270,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ boolean_xor_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22344,7 +22301,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } else { /* here we are sure we are dealing with an object */ @@ -22364,7 +22320,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*zptr); EX_T(opline->result.var).var.ptr = *zptr; - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -22403,7 +22358,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(z); EX_T(opline->result.var).var.ptr = z; - EX_T(opline->result.var).var.ptr_ptr = NULL; } zval_ptr_dtor(&z); } else { @@ -22411,7 +22365,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -22424,7 +22377,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina FREE_OP(free_op_data1); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* assign_obj has two opcodes! */ CHECK_EXCEPTION(); ZEND_VM_INC_OPCODE(); @@ -22476,10 +22429,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CV(int (*binary_o if (UNEXPECTED(*var_ptr == &EG(error_zval))) { if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); if (opline->extended_value == ZEND_ASSIGN_DIM) { ZEND_VM_INC_OPCODE(); @@ -22504,17 +22457,17 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CV(int (*binary_o if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*var_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *var_ptr); + EX_T(opline->result.var).var.ptr = *var_ptr; } if (opline->extended_value == ZEND_ASSIGN_DIM) { FREE_OP(free_op_data1); FREE_OP_VAR_PTR(free_op_data2); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_INC_OPCODE(); } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); } ZEND_VM_NEXT_OPCODE(); @@ -22604,7 +22557,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t in PZVAL_LOCK(&EG(uninitialized_zval)); *retval = &EG(uninitialized_zval); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -22664,7 +22617,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t in } else { } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -22705,7 +22658,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t i zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); ZVAL_NULL(retval); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -22766,7 +22719,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t i } else { } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -22788,14 +22741,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL zval *container; SAVE_OPLINE(); - - if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (IS_VAR != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + zval_ptr_dtor_nogc(&free_op1.var); + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -22817,7 +22768,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* We are going to assign the result by reference */ if (UNEXPECTED(opline->extended_value != 0)) { @@ -22851,7 +22802,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -22866,7 +22817,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_IS TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -22889,7 +22840,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCOD EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; } else { zval *container; @@ -22899,7 +22850,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCOD container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -22927,7 +22878,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_H if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; if (UNEXPECTED(EX_T(opline->result.var).var.ptr_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); ZEND_VM_NEXT_OPCODE(); @@ -22962,7 +22913,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_CV(ZEN UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { zend_error(E_NOTICE, "Trying to get property of non-object"); PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } else { zval *retval; @@ -22975,7 +22926,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_CV(ZEN retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); PZVAL_LOCK(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; if (0) { zval_ptr_dtor(&offset); @@ -22984,7 +22935,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_CV(ZEN } } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -23021,7 +22972,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* We are going to assign the result by reference */ if (opline->extended_value & ZEND_FETCH_MAKE_REF) { @@ -23064,7 +23015,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -23084,7 +23035,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } else { zval *retval; @@ -23097,7 +23048,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); PZVAL_LOCK(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; if (0) { zval_ptr_dtor(&offset); @@ -23106,7 +23057,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND } } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -23140,7 +23091,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCOD if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { @@ -23179,7 +23130,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_H if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; PZVAL_UNLOCK(*EX_T(opline->result.var).var.ptr_ptr, &free_res); if (EX_T(opline->result.var).var.ptr_ptr != &EG(uninitialized_zval_ptr)) { @@ -23214,7 +23165,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE } else { } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* assign_obj has two opcodes! */ CHECK_EXCEPTION(); ZEND_VM_INC_OPCODE(); @@ -23264,11 +23215,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE ALLOC_ZVAL(retval); ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1); INIT_PZVAL(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } } else if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) { if (IS_TMP_FREE(free_op_data1)) { @@ -23276,7 +23227,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else { if ((opline+1)->op1_type == IS_TMP_VAR) { @@ -23288,13 +23239,13 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(value); - AI_SET_PTR(&EX_T(opline->result.var), value); + EX_T(opline->result.var).var.ptr = value; } } FREE_OP_VAR_PTR(free_op_data2); FREE_OP_IF_VAR(free_op_data1); } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* assign_dim has two opcodes! */ CHECK_EXCEPTION(); ZEND_VM_INC_OPCODE(); @@ -23320,11 +23271,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR ALLOC_ZVAL(retval); ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1); INIT_PZVAL(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } } else if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else if (IS_VAR == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) { if (0) { @@ -23332,7 +23283,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else { if (IS_CV == IS_TMP_VAR) { @@ -23344,11 +23295,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(value); - AI_SET_PTR(&EX_T(opline->result.var), value); + EX_T(opline->result.var).var.ptr = value; } } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; /* zend_assign_to_variable() always takes care of op2, never free it! */ @@ -23400,10 +23351,10 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*variable_ptr_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *variable_ptr_ptr); + EX_T(opline->result.var).var.ptr = *variable_ptr_ptr; } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -23483,7 +23434,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_ call->is_ctor_call = 0; EX(call) = call; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -23594,7 +23545,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_ /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ if (call->fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - zend_error(E_STRICT, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); + zend_error(E_DEPRECATED, "Non-static method %s::%s() should not be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); } else { /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ zend_error_noreturn(E_ERROR, "Non-static method %s::%s() cannot be called statically, assuming $this from incompatible context", call->fbc->common.scope->name, call->fbc->common.function_name); @@ -23618,9 +23569,6 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS zend_free_op free_op1; SAVE_OPLINE(); - if (IS_VAR==IS_VAR) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } is_equal_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); @@ -23660,7 +23608,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - } else { + zval_ptr_dtor_nogc(&free_op1.var); + } else if (IS_VAR == IS_CV) { Z_ADDREF_P(expr_ptr); } } @@ -23685,11 +23634,7 @@ num_index: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -23707,9 +23652,7 @@ num_index: zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL); } if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - } else { - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -23768,11 +23711,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (ht == &EG(symbol_table)) { zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC); @@ -23823,7 +23762,7 @@ num_index_dim: } else { } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -23864,7 +23803,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER } else { } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -23882,7 +23821,6 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CV(int SAVE_OPLINE(); container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) { @@ -23909,11 +23847,7 @@ num_index_prop: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) { isset = 1; @@ -24006,7 +23940,7 @@ num_index_prop: Z_LVAL(EX_T(opline->result.var).tmp_var) = !result; } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + zval_ptr_dtor_nogc(&free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -24088,14 +24022,14 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG generator->value = *value_ptr; } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}; } } else { zval *value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR - || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) + || PZVAL_IS_REF(value) ) { zval *copy; @@ -24108,12 +24042,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG } generator->value = copy; + zval_ptr_dtor_nogc(&free_op1.var); } else { - Z_ADDREF_P(value); + if (IS_VAR == IS_CV) { + Z_ADDREF_P(value); + } generator->value = value; } - - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } } else { /* If no value was specified yield null */ @@ -24239,7 +24174,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARG if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(&retval); } else { - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } } @@ -24294,7 +24229,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } else { /* here we are sure we are dealing with an object */ @@ -24314,7 +24248,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*zptr); EX_T(opline->result.var).var.ptr = *zptr; - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -24353,7 +24286,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(z); EX_T(opline->result.var).var.ptr = z; - EX_T(opline->result.var).var.ptr_ptr = NULL; } zval_ptr_dtor(&z); } else { @@ -24361,7 +24293,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -24425,7 +24356,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_CONST(int (*bi if (UNEXPECTED(*var_ptr == &EG(error_zval))) { if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } @@ -24453,7 +24384,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_CONST(int (*bi if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*var_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *var_ptr); + EX_T(opline->result.var).var.ptr = *var_ptr; } if (opline->extended_value == ZEND_ASSIGN_DIM) { @@ -24746,7 +24677,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_CON UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { zend_error(E_NOTICE, "Trying to get property of non-object"); PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } else { zval *retval; @@ -24759,7 +24690,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_CON retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); PZVAL_LOCK(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; if (0) { zval_ptr_dtor(&offset); @@ -24866,7 +24797,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCOD if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } else { zval *retval; @@ -24879,7 +24810,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCOD retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); PZVAL_LOCK(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; if (0) { zval_ptr_dtor(&offset); @@ -25196,8 +25127,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPC } if (EXPECTED(zend_hash_quick_find(&ce->constants_table, Z_STRVAL_P(opline->op2.zv), Z_STRLEN_P(opline->op2.zv)+1, Z_HASH_P(opline->op2.zv), (void **) &value) == SUCCESS)) { - if (Z_TYPE_PP(value) == IS_CONSTANT_ARRAY || - (Z_TYPE_PP(value) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) { + if (IS_CONSTANT_TYPE(Z_TYPE_PP(value))) { zend_class_entry *old_scope = EG(scope); EG(scope) = ce; @@ -25276,11 +25206,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_H hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (ht == &EG(symbol_table)) { zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC); @@ -25388,7 +25314,6 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CON SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(TSRMLS_C); - offset = opline->op2.zv; if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) { @@ -25415,11 +25340,7 @@ num_index_prop: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) { isset = 1; @@ -25598,7 +25519,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDL /* Consts, temporary variables and references need copying */ if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR - || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) + || PZVAL_IS_REF(value) ) { zval *copy; @@ -25611,11 +25532,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDL } generator->value = copy; + } else { - Z_ADDREF_P(value); + if (IS_UNUSED == IS_CV) { + Z_ADDREF_P(value); + } generator->value = value; } - } } else { /* If no value was specified yield null */ @@ -25708,7 +25631,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (* if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } else { /* here we are sure we are dealing with an object */ @@ -25728,7 +25650,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (* if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*zptr); EX_T(opline->result.var).var.ptr = *zptr; - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -25767,7 +25688,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (* if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(z); EX_T(opline->result.var).var.ptr = z; - EX_T(opline->result.var).var.ptr_ptr = NULL; } zval_ptr_dtor(&z); } else { @@ -25775,7 +25695,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (* if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -25839,7 +25758,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_TMP(int (*bina if (UNEXPECTED(*var_ptr == &EG(error_zval))) { if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } zval_dtor(free_op2.var); @@ -25867,7 +25786,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_TMP(int (*bina if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*var_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *var_ptr); + EX_T(opline->result.var).var.ptr = *var_ptr; } zval_dtor(free_op2.var); @@ -26161,7 +26080,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { zend_error(E_NOTICE, "Trying to get property of non-object"); PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); zval_dtor(free_op2.var); } else { zval *retval; @@ -26174,7 +26093,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); PZVAL_LOCK(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; if (1) { zval_ptr_dtor(&offset); @@ -26281,7 +26200,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_ if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); zval_dtor(free_op2.var); } else { zval *retval; @@ -26294,7 +26213,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); PZVAL_LOCK(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; if (1) { zval_ptr_dtor(&offset); @@ -26594,11 +26513,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HAN hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (ht == &EG(symbol_table)) { zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC); @@ -26706,7 +26621,6 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_TMP SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(TSRMLS_C); - offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) { @@ -26733,11 +26647,7 @@ num_index_prop: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) { isset = 1; @@ -26916,7 +26826,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER /* Consts, temporary variables and references need copying */ if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR - || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) + || PZVAL_IS_REF(value) ) { zval *copy; @@ -26929,11 +26839,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER } generator->value = copy; + } else { - Z_ADDREF_P(value); + if (IS_UNUSED == IS_CV) { + Z_ADDREF_P(value); + } generator->value = value; } - } } else { /* If no value was specified yield null */ @@ -27020,13 +26932,12 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (* if (UNEXPECTED(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);}; + zval_ptr_dtor_nogc(&free_op2.var); FREE_OP(free_op_data1); if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } else { /* here we are sure we are dealing with an object */ @@ -27046,7 +26957,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (* if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*zptr); EX_T(opline->result.var).var.ptr = *zptr; - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -27085,7 +26995,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (* if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(z); EX_T(opline->result.var).var.ptr = z; - EX_T(opline->result.var).var.ptr_ptr = NULL; } zval_ptr_dtor(&z); } else { @@ -27093,7 +27002,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (* if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -27101,7 +27009,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (* if (0) { zval_ptr_dtor(&property); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } FREE_OP(free_op_data1); } @@ -27157,9 +27065,9 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_VAR(int (*bina if (UNEXPECTED(*var_ptr == &EG(error_zval))) { if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); if (opline->extended_value == ZEND_ASSIGN_DIM) { @@ -27185,9 +27093,9 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_VAR(int (*bina if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*var_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *var_ptr); + EX_T(opline->result.var).var.ptr = *var_ptr; } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); if (opline->extended_value == ZEND_ASSIGN_DIM) { FREE_OP(free_op_data1); @@ -27281,7 +27189,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(incdec_ if (UNEXPECTED(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);}; + zval_ptr_dtor_nogc(&free_op2.var); if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); *retval = &EG(uninitialized_zval); @@ -27344,7 +27252,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(incdec_ if (0) { zval_ptr_dtor(&property); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } CHECK_EXCEPTION(); @@ -27385,7 +27293,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_VAR(incdec if (UNEXPECTED(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);}; + zval_ptr_dtor_nogc(&free_op2.var); ZVAL_NULL(retval); CHECK_EXCEPTION(); @@ -27446,7 +27354,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_VAR(incdec if (0) { zval_ptr_dtor(&property); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } CHECK_EXCEPTION(); @@ -27479,8 +27387,8 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { zend_error(E_NOTICE, "Trying to get property of non-object"); PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); + zval_ptr_dtor_nogc(&free_op2.var); } else { zval *retval; @@ -27492,12 +27400,12 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); PZVAL_LOCK(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; if (0) { zval_ptr_dtor(&offset); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } } @@ -27532,7 +27440,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_H if (0) { zval_ptr_dtor(&property); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -27574,7 +27482,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_ if (0) { zval_ptr_dtor(&property); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -27599,8 +27507,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_ if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); + zval_ptr_dtor_nogc(&free_op2.var); } else { zval *retval; @@ -27612,12 +27520,12 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_ retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); PZVAL_LOCK(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; if (0) { zval_ptr_dtor(&offset); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } } @@ -27649,7 +27557,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_VAR_HANDLER(ZEND_O if (0) { zval_ptr_dtor(&property); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -27688,7 +27596,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCO if (0) { zval_ptr_dtor(&property); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } if (IS_UNUSED == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -27725,7 +27633,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HA if (0) { zval_ptr_dtor(&property_name); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } /* assign_obj has two opcodes! */ @@ -27773,7 +27681,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDL * 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);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -27831,7 +27739,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPC } } else { if (UNEXPECTED(EG(exception) != NULL)) { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); HANDLE_EXCEPTION(); } zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); @@ -27853,7 +27761,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPC call->is_ctor_call = 0; EX(call) = call; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -27912,11 +27820,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (ht == &EG(symbol_table)) { zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC); @@ -27940,7 +27844,7 @@ num_index_dim: zend_error(E_WARNING, "Illegal offset type in unset"); break; } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); break; } case IS_OBJECT: @@ -27954,18 +27858,18 @@ num_index_dim: if (0) { zval_ptr_dtor(&offset); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&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);}; + zval_ptr_dtor_nogc(&free_op2.var); break; } } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } CHECK_EXCEPTION(); @@ -27999,13 +27903,13 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN if (0) { zval_ptr_dtor(&offset); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } CHECK_EXCEPTION(); @@ -28024,7 +27928,6 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(TSRMLS_C); - offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) { @@ -28051,11 +27954,7 @@ num_index_prop: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) { isset = 1; @@ -28084,7 +27983,7 @@ num_index_prop: result = 1; } } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } else if (Z_TYPE_P(container) == IS_OBJECT) { if (0) { MAKE_REAL_ZVAL_PTR(offset); @@ -28107,7 +28006,7 @@ num_index_prop: if (0) { zval_ptr_dtor(&offset); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } } else if (Z_TYPE_P(container) == IS_STRING && !prop_dim) { /* string offsets */ zval tmp; @@ -28136,9 +28035,9 @@ num_index_prop: } } } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL; @@ -28234,7 +28133,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER /* Consts, temporary variables and references need copying */ if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR - || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) + || PZVAL_IS_REF(value) ) { zval *copy; @@ -28247,11 +28146,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER } generator->value = copy; + } else { - Z_ADDREF_P(value); + if (IS_UNUSED == IS_CV) { + Z_ADDREF_P(value); + } generator->value = value; } - } } else { /* If no value was specified yield null */ @@ -28290,7 +28191,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER generator->largest_used_integer_key = Z_LVAL_P(generator->key); } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } else { /* If no key was specified we use auto-increment keys */ generator->largest_used_integer_key++; @@ -28345,7 +28246,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } else { /* here we are sure we are dealing with an object */ @@ -28365,7 +28265,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*zptr); EX_T(opline->result.var).var.ptr = *zptr; - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -28404,7 +28303,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(z); EX_T(opline->result.var).var.ptr = z; - EX_T(opline->result.var).var.ptr_ptr = NULL; } zval_ptr_dtor(&z); } else { @@ -28412,7 +28310,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -28476,7 +28373,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(int (*b if (UNEXPECTED(*var_ptr == &EG(error_zval))) { if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } @@ -28504,7 +28401,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(int (*b if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*var_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *var_ptr); + EX_T(opline->result.var).var.ptr = *var_ptr; } if (opline->extended_value == ZEND_ASSIGN_DIM) { @@ -28661,7 +28558,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HAND /* Consts, temporary variables and references need copying */ if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR - || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) + || PZVAL_IS_REF(value) ) { zval *copy; @@ -28674,11 +28571,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HAND } generator->value = copy; + } else { - Z_ADDREF_P(value); + if (IS_UNUSED == IS_CV) { + Z_ADDREF_P(value); + } generator->value = value; } - } } else { /* If no value was specified yield null */ @@ -28771,7 +28670,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*b if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } else { /* here we are sure we are dealing with an object */ @@ -28791,7 +28689,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*b if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*zptr); EX_T(opline->result.var).var.ptr = *zptr; - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -28830,7 +28727,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*b if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(z); EX_T(opline->result.var).var.ptr = z; - EX_T(opline->result.var).var.ptr_ptr = NULL; } zval_ptr_dtor(&z); } else { @@ -28838,7 +28734,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*b if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -28902,7 +28797,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_CV(int (*binar if (UNEXPECTED(*var_ptr == &EG(error_zval))) { if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } @@ -28930,7 +28825,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_CV(int (*binar if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*var_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *var_ptr); + EX_T(opline->result.var).var.ptr = *var_ptr; } if (opline->extended_value == ZEND_ASSIGN_DIM) { @@ -29223,7 +29118,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_CV( UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { zend_error(E_NOTICE, "Trying to get property of non-object"); PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } else { zval *retval; @@ -29236,7 +29131,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_CV( retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); PZVAL_LOCK(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; if (0) { zval_ptr_dtor(&offset); @@ -29343,7 +29238,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_H if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } else { zval *retval; @@ -29356,7 +29251,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_H retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); PZVAL_LOCK(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; if (0) { zval_ptr_dtor(&offset); @@ -29654,11 +29549,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (ht == &EG(symbol_table)) { zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC); @@ -29766,7 +29657,6 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CV( SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(TSRMLS_C); - offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) { @@ -29793,11 +29683,7 @@ num_index_prop: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) { isset = 1; @@ -29976,7 +29862,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ /* Consts, temporary variables and references need copying */ if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR - || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) + || PZVAL_IS_REF(value) ) { zval *copy; @@ -29989,11 +29875,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ } generator->value = copy; + } else { - Z_ADDREF_P(value); + if (IS_UNUSED == IS_CV) { + Z_ADDREF_P(value); + } generator->value = value; } - } } else { /* If no value was specified yield null */ @@ -30102,7 +29990,7 @@ static int ZEND_FASTCALL ZEND_PRE_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (IS_CV == IS_VAR && UNEXPECTED(*var_ptr == &EG(error_zval))) { if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } CHECK_EXCEPTION(); @@ -30126,7 +30014,7 @@ static int ZEND_FASTCALL ZEND_PRE_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*var_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *var_ptr); + EX_T(opline->result.var).var.ptr = *var_ptr; } CHECK_EXCEPTION(); @@ -30148,7 +30036,7 @@ static int ZEND_FASTCALL ZEND_PRE_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (IS_CV == IS_VAR && UNEXPECTED(*var_ptr == &EG(error_zval))) { if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } CHECK_EXCEPTION(); @@ -30172,7 +30060,7 @@ static int ZEND_FASTCALL ZEND_PRE_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*var_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *var_ptr); + EX_T(opline->result.var).var.ptr = *var_ptr; } CHECK_EXCEPTION(); @@ -30455,9 +30343,7 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) retval_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (!EG(return_value_ptr_ptr)) { - if (IS_CV == IS_TMP_VAR) { - } } else { if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR || @@ -30470,18 +30356,23 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zval_copy_ctor(ret); } *EG(return_value_ptr_ptr) = ret; + } else if ((IS_CV == IS_CV || IS_CV == IS_VAR) && retval_ptr == &EG(uninitialized_zval)) { zval *ret; + if (IS_CV == IS_VAR) { + Z_DELREF_P(retval_ptr); + } ALLOC_INIT_ZVAL(ret); *EG(return_value_ptr_ptr) = ret; } else { *EG(return_value_ptr_ptr) = retval_ptr; - Z_ADDREF_P(retval_ptr); + if (IS_CV == IS_CV) { + Z_ADDREF_P(retval_ptr); + } } } - return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } @@ -30495,7 +30386,8 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER SAVE_OPLINE(); do { - if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) { + if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR || + (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_VALUE)) { /* Not supposed to happen, but we'll allow it */ zend_error(E_NOTICE, "Only variable references should be returned by reference"); @@ -30594,21 +30486,26 @@ static int ZEND_FASTCALL zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARG varptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (varptr == &EG(uninitialized_zval)) { - ALLOC_ZVAL(varptr); - INIT_ZVAL(*varptr); - Z_SET_REFCOUNT_P(varptr, 0); + if (IS_CV == IS_VAR) { + Z_DELREF_P(varptr); + } + ALLOC_INIT_ZVAL(varptr); } else if (PZVAL_IS_REF(varptr)) { - zval *original_var = varptr; + if (IS_CV == IS_CV || + (IS_CV == IS_VAR && Z_REFCOUNT_P(varptr) > 2)) { + zval *original_var = varptr; + + ALLOC_ZVAL(varptr); + INIT_PZVAL_COPY(varptr, original_var); + zval_copy_ctor(varptr); - ALLOC_ZVAL(varptr); - ZVAL_COPY_VALUE(varptr, original_var); - Z_UNSET_ISREF_P(varptr); - Z_SET_REFCOUNT_P(varptr, 0); - zval_copy_ctor(varptr); + } else { + Z_UNSET_ISREF_P(varptr); + } + } else if (IS_CV == IS_CV) { + Z_ADDREF_P(varptr); } - Z_ADDREF_P(varptr); zend_vm_stack_push(varptr TSRMLS_CC); - ; /* for string offsets */ CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -30617,7 +30514,7 @@ static int ZEND_FASTCALL zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARG static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE - zend_free_op free_op1; + zval *varptr; SAVE_OPLINE(); @@ -30629,22 +30526,15 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } - if (IS_CV == IS_VAR && - (opline->extended_value & ZEND_ARG_SEND_FUNCTION) && - EX_T(opline->op1.var).var.fcall_returned_reference && - EX_T(opline->op1.var).var.ptr) { - varptr = EX_T(opline->op1.var).var.ptr; - PZVAL_UNLOCK_EX(varptr, &free_op1, 0); - } else { - varptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); - } + varptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) || EX_T(opline->op1.var).var.fcall_returned_reference) && varptr != &EG(uninitialized_zval) && - (PZVAL_IS_REF(varptr) || - (Z_REFCOUNT_P(varptr) == 1 && (IS_CV == IS_CV || free_op1.var)))) { + (PZVAL_IS_REF(varptr) || Z_REFCOUNT_P(varptr) == 1)) { Z_SET_ISREF_P(varptr); - Z_ADDREF_P(varptr); + if (IS_CV == IS_CV) { + Z_ADDREF_P(varptr); + } zend_vm_stack_push(varptr TSRMLS_CC); } else { zval *valptr; @@ -30659,9 +30549,9 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL if (!0) { zval_copy_ctor(valptr); } + zend_vm_stack_push(valptr TSRMLS_CC); } - CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -30786,7 +30676,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) if (!RETURN_VALUE_USED(opline) || UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(&retval); } else { - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } } @@ -30944,7 +30834,6 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL EX(original_return_value) = EG(return_value_ptr_ptr); EG(active_op_array) = new_op_array; if (RETURN_VALUE_USED(opline)) { - EX_T(opline->result.var).var.ptr = NULL; EX_T(opline->result.var).var.ptr_ptr = &EX_T(opline->result.var).var.ptr; EG(return_value_ptr_ptr) = EX_T(opline->result.var).var.ptr_ptr; } else { @@ -30982,7 +30871,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL ALLOC_ZVAL(retval); ZVAL_BOOL(retval, failure_retval); INIT_PZVAL(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } ZEND_VM_NEXT_OPCODE(); } @@ -31044,19 +30933,27 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS } else if (Z_TYPE_P(array_ptr) == IS_OBJECT) { ce = Z_OBJCE_P(array_ptr); if (!ce || !ce->get_iterator) { - Z_ADDREF_P(array_ptr); + if (IS_CV == IS_CV) { + Z_ADDREF_P(array_ptr); + } } } else if (IS_CV == IS_CONST || - ((IS_CV == IS_CV || IS_CV == IS_VAR) && + (IS_CV == IS_CV && !Z_ISREF_P(array_ptr) && - Z_REFCOUNT_P(array_ptr) > 1)) { + Z_REFCOUNT_P(array_ptr) > 1) || + (IS_CV == IS_VAR && + !Z_ISREF_P(array_ptr) && + Z_REFCOUNT_P(array_ptr) > 2)) { zval *tmp; + if (IS_CV == IS_VAR) { + Z_DELREF_P(array_ptr); + } ALLOC_ZVAL(tmp); INIT_PZVAL_COPY(tmp, array_ptr); zval_copy_ctor(tmp); array_ptr = tmp; - } else { + } else if (IS_CV == IS_CV) { Z_ADDREF_P(array_ptr); } } @@ -31064,10 +30961,15 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS if (ce && ce->get_iterator) { iter = ce->get_iterator(ce, array_ptr, opline->extended_value & ZEND_FE_RESET_REFERENCE TSRMLS_CC); + if (IS_CV == IS_VAR && !(opline->extended_value & ZEND_FE_RESET_VARIABLE)) { + + } if (iter && EXPECTED(EG(exception) == NULL)) { array_ptr = zend_iterator_wrap(iter TSRMLS_CC); } else { + if (IS_CV == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + } if (!EG(exception)) { zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name); } @@ -31084,14 +30986,18 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS iter->funcs->rewind(iter TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(&array_ptr); + if (IS_CV == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + } HANDLE_EXCEPTION(); } } is_empty = iter->funcs->valid(iter TSRMLS_CC) != SUCCESS; if (UNEXPECTED(EG(exception) != NULL)) { zval_ptr_dtor(&array_ptr); + if (IS_CV == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + } HANDLE_EXCEPTION(); } iter->index = -1; /* will be set to 0 before using next handler */ @@ -31121,6 +31027,9 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS is_empty = 1; } + if (IS_CV == IS_VAR && opline->extended_value & ZEND_FE_RESET_VARIABLE) { + + } if (is_empty) { ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.opline_num); } else { @@ -31577,7 +31486,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*bi if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } else { /* here we are sure we are dealing with an object */ @@ -31597,7 +31505,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*bi if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*zptr); EX_T(opline->result.var).var.ptr = *zptr; - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -31636,7 +31543,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*bi if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(z); EX_T(opline->result.var).var.ptr = z; - EX_T(opline->result.var).var.ptr_ptr = NULL; } zval_ptr_dtor(&z); } else { @@ -31644,7 +31550,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*bi if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -31708,7 +31613,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_CONST(int (*binary if (UNEXPECTED(*var_ptr == &EG(error_zval))) { if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } @@ -31736,7 +31641,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_CONST(int (*binary if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*var_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *var_ptr); + EX_T(opline->result.var).var.ptr = *var_ptr; } if (opline->extended_value == ZEND_ASSIGN_DIM) { @@ -32068,10 +31973,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_CONST(int type, Z */ if (IS_CV == IS_CONST) { hash_value = Z_HASH_P(varname); - } else if (IS_INTERNED(Z_STRVAL_P(varname))) { - hash_value = INTERNED_HASH(Z_STRVAL_P(varname)); } else { - hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1); + hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname)); } if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) { @@ -32124,7 +32027,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_CONST(int type, Z switch (type) { case BP_VAR_R: case BP_VAR_IS: - AI_SET_PTR(&EX_T(opline->result.var), *retval); + EX_T(opline->result.var).var.ptr = *retval; break; case BP_VAR_UNSET: { zend_free_op free_res; @@ -32184,14 +32087,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN zval *container; SAVE_OPLINE(); - - if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC); + if (IS_CV != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -32357,7 +32258,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_CONST(Z UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { zend_error(E_NOTICE, "Trying to get property of non-object"); PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } else { zval *retval; @@ -32370,7 +32271,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_CONST(Z retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); PZVAL_LOCK(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; if (0) { zval_ptr_dtor(&offset); @@ -32477,7 +32378,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HA if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } else { zval *retval; @@ -32490,7 +32391,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HA retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); PZVAL_LOCK(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; if (0) { zval_ptr_dtor(&offset); @@ -32655,11 +32556,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAND ALLOC_ZVAL(retval); ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1); INIT_PZVAL(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } } else if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) { if (IS_TMP_FREE(free_op_data1)) { @@ -32667,7 +32568,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAND } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else { if ((opline+1)->op1_type == IS_TMP_VAR) { @@ -32679,7 +32580,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAND } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(value); - AI_SET_PTR(&EX_T(opline->result.var), value); + EX_T(opline->result.var).var.ptr = value; } } FREE_OP_VAR_PTR(free_op_data2); @@ -32711,11 +32612,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ ALLOC_ZVAL(retval); ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1); INIT_PZVAL(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } } else if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else if (IS_CV == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) { if (0) { @@ -32723,7 +32624,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else { if (IS_CONST == IS_TMP_VAR) { @@ -32735,7 +32636,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(value); - AI_SET_PTR(&EX_T(opline->result.var), value); + EX_T(opline->result.var).var.ptr = value; } } @@ -32830,9 +32731,6 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); - if (IS_CV==IS_VAR) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } is_equal_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), opline->op2.zv TSRMLS_CC); @@ -32872,7 +32770,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCO INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - } else { + + } else if (IS_CV == IS_CV) { Z_ADDREF_P(expr_ptr); } } @@ -32897,11 +32796,7 @@ num_index: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -32920,8 +32815,6 @@ num_index: } if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) { - } else { - } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -33058,11 +32951,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (ht == &EG(symbol_table)) { zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC); @@ -33255,7 +33144,6 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CONST(i SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC); - offset = opline->op2.zv; if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) { @@ -33282,11 +33170,7 @@ num_index_prop: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) { isset = 1; @@ -33465,7 +33349,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_A /* Consts, temporary variables and references need copying */ if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR - || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) + || PZVAL_IS_REF(value) ) { zval *copy; @@ -33478,11 +33362,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_A } generator->value = copy; + } else { - Z_ADDREF_P(value); + if (IS_CV == IS_CV) { + Z_ADDREF_P(value); + } generator->value = value; } - } } else { /* If no value was specified yield null */ @@ -33851,7 +33737,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*bina if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } else { /* here we are sure we are dealing with an object */ @@ -33871,7 +33756,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*bina if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*zptr); EX_T(opline->result.var).var.ptr = *zptr; - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -33910,7 +33794,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*bina if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(z); EX_T(opline->result.var).var.ptr = z; - EX_T(opline->result.var).var.ptr_ptr = NULL; } zval_ptr_dtor(&z); } else { @@ -33918,7 +33801,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*bina if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -33982,7 +33864,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_TMP(int (*binary_o if (UNEXPECTED(*var_ptr == &EG(error_zval))) { if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } zval_dtor(free_op2.var); @@ -34010,7 +33892,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_TMP(int (*binary_o if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*var_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *var_ptr); + EX_T(opline->result.var).var.ptr = *var_ptr; } zval_dtor(free_op2.var); @@ -34295,14 +34177,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDL zval *container; SAVE_OPLINE(); - - if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC); zval_dtor(free_op2.var); + if (IS_CV != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -34468,7 +34348,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_TMP(ZEN UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { zend_error(E_NOTICE, "Trying to get property of non-object"); PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); zval_dtor(free_op2.var); } else { zval *retval; @@ -34481,7 +34361,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_TMP(ZEN retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); PZVAL_LOCK(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; if (1) { zval_ptr_dtor(&offset); @@ -34588,7 +34468,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); zval_dtor(free_op2.var); } else { zval *retval; @@ -34601,7 +34481,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); PZVAL_LOCK(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; if (1) { zval_ptr_dtor(&offset); @@ -34767,11 +34647,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLE ALLOC_ZVAL(retval); ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1); INIT_PZVAL(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } } else if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) { if (IS_TMP_FREE(free_op_data1)) { @@ -34779,7 +34659,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLE } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else { if ((opline+1)->op1_type == IS_TMP_VAR) { @@ -34791,7 +34671,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLE } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(value); - AI_SET_PTR(&EX_T(opline->result.var), value); + EX_T(opline->result.var).var.ptr = value; } } FREE_OP_VAR_PTR(free_op_data2); @@ -34823,11 +34703,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR ALLOC_ZVAL(retval); ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1); INIT_PZVAL(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } } else if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else if (IS_CV == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) { if (1) { @@ -34835,7 +34715,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else { if (IS_TMP_VAR == IS_TMP_VAR) { @@ -34847,7 +34727,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(value); - AI_SET_PTR(&EX_T(opline->result.var), value); + EX_T(opline->result.var).var.ptr = value; } } @@ -34943,9 +34823,6 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS zend_free_op free_op2; SAVE_OPLINE(); - if (IS_CV==IS_VAR) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } is_equal_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); @@ -34986,7 +34863,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - } else { + + } else if (IS_CV == IS_CV) { Z_ADDREF_P(expr_ptr); } } @@ -35011,11 +34889,7 @@ num_index: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -35034,8 +34908,6 @@ num_index: } if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) { - } else { - } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -35094,11 +34966,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (ht == &EG(symbol_table)) { zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC); @@ -35206,7 +35074,6 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_TMP(int SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC); - offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) { @@ -35233,11 +35100,7 @@ num_index_prop: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) { isset = 1; @@ -35416,7 +35279,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG /* Consts, temporary variables and references need copying */ if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR - || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) + || PZVAL_IS_REF(value) ) { zval *copy; @@ -35429,11 +35292,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG } generator->value = copy; + } else { - Z_ADDREF_P(value); + if (IS_CV == IS_CV) { + Z_ADDREF_P(value); + } generator->value = value; } - } } else { /* If no value was specified yield null */ @@ -35511,7 +35376,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35526,7 +35391,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35541,7 +35406,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35556,7 +35421,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35571,7 +35436,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35586,7 +35451,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35601,7 +35466,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35616,7 +35481,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35631,7 +35496,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35648,7 +35513,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_ _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); Z_LVAL_P(result) = !Z_LVAL_P(result); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35664,7 +35529,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35680,7 +35545,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35696,7 +35561,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35712,7 +35577,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCO _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35727,7 +35592,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35742,7 +35607,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35757,7 +35622,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35772,7 +35637,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35796,13 +35661,12 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*bina if (UNEXPECTED(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);}; + zval_ptr_dtor_nogc(&free_op2.var); FREE_OP(free_op_data1); if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } else { /* here we are sure we are dealing with an object */ @@ -35822,7 +35686,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*bina if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*zptr); EX_T(opline->result.var).var.ptr = *zptr; - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -35861,7 +35724,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*bina if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(z); EX_T(opline->result.var).var.ptr = z; - EX_T(opline->result.var).var.ptr_ptr = NULL; } zval_ptr_dtor(&z); } else { @@ -35869,7 +35731,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*bina if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -35877,7 +35738,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*bina if (0) { zval_ptr_dtor(&property); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } FREE_OP(free_op_data1); } @@ -35933,9 +35794,9 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_VAR(int (*binary_o if (UNEXPECTED(*var_ptr == &EG(error_zval))) { if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); if (opline->extended_value == ZEND_ASSIGN_DIM) { @@ -35961,9 +35822,9 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_VAR(int (*binary_o if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*var_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *var_ptr); + EX_T(opline->result.var).var.ptr = *var_ptr; } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); if (opline->extended_value == ZEND_ASSIGN_DIM) { FREE_OP(free_op_data1); @@ -36057,7 +35918,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_VAR(incdec_t in if (UNEXPECTED(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);}; + zval_ptr_dtor_nogc(&free_op2.var); if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); *retval = &EG(uninitialized_zval); @@ -36120,7 +35981,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_VAR(incdec_t in if (0) { zval_ptr_dtor(&property); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } CHECK_EXCEPTION(); @@ -36161,7 +36022,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_VAR(incdec_t i if (UNEXPECTED(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);}; + zval_ptr_dtor_nogc(&free_op2.var); ZVAL_NULL(retval); CHECK_EXCEPTION(); @@ -36222,7 +36083,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_VAR(incdec_t i if (0) { zval_ptr_dtor(&property); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } CHECK_EXCEPTION(); @@ -36294,10 +36155,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_VAR(int type, ZEN */ if (IS_CV == IS_CONST) { hash_value = Z_HASH_P(varname); - } else if (IS_INTERNED(Z_STRVAL_P(varname))) { - hash_value = INTERNED_HASH(Z_STRVAL_P(varname)); } else { - hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1); + hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname)); } if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) { @@ -36350,7 +36209,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_VAR(int type, ZEN switch (type) { case BP_VAR_R: case BP_VAR_IS: - AI_SET_PTR(&EX_T(opline->result.var), *retval); + EX_T(opline->result.var).var.ptr = *retval; break; case BP_VAR_UNSET: { zend_free_op free_res; @@ -36410,14 +36269,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDL zval *container; SAVE_OPLINE(); - - if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); + if (IS_CV != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -36435,7 +36292,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDL zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_W TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } @@ -36468,7 +36325,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_RW TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } @@ -36486,7 +36343,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_IS TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -36509,7 +36366,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCOD if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } else { zval *container; @@ -36519,7 +36376,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCOD } container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } CHECK_EXCEPTION(); @@ -36544,7 +36401,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_H zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_UNSET TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } @@ -36583,8 +36440,8 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_VAR(ZEN UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { zend_error(E_NOTICE, "Trying to get property of non-object"); PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); + zval_ptr_dtor_nogc(&free_op2.var); } else { zval *retval; @@ -36596,12 +36453,12 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_VAR(ZEN retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); PZVAL_LOCK(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; if (0) { zval_ptr_dtor(&offset); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } } @@ -36636,7 +36493,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDL if (0) { zval_ptr_dtor(&property); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -36678,7 +36535,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND if (0) { zval_ptr_dtor(&property); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -36703,8 +36560,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); + zval_ptr_dtor_nogc(&free_op2.var); } else { zval *retval; @@ -36716,12 +36573,12 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); PZVAL_LOCK(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; if (0) { zval_ptr_dtor(&offset); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } } @@ -36753,7 +36610,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCOD if (0) { zval_ptr_dtor(&property); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -36792,7 +36649,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_H if (0) { zval_ptr_dtor(&property); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -36829,7 +36686,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE if (0) { zval_ptr_dtor(&property_name); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } /* assign_obj has two opcodes! */ @@ -36861,7 +36718,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE if (0) { zval_ptr_dtor(&property_name); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } } else { zend_free_op free_op2, free_op_data1, free_op_data2; @@ -36870,7 +36727,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE zval **variable_ptr_ptr; zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), object_ptr, dim, IS_VAR, BP_VAR_W TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); @@ -36882,11 +36739,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE ALLOC_ZVAL(retval); ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1); INIT_PZVAL(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } } else if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) { if (IS_TMP_FREE(free_op_data1)) { @@ -36894,7 +36751,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else { if ((opline+1)->op1_type == IS_TMP_VAR) { @@ -36906,7 +36763,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(value); - AI_SET_PTR(&EX_T(opline->result.var), value); + EX_T(opline->result.var).var.ptr = value; } } FREE_OP_VAR_PTR(free_op_data2); @@ -36938,11 +36795,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR ALLOC_ZVAL(retval); ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1); INIT_PZVAL(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } } else if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else if (IS_CV == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) { if (0) { @@ -36950,7 +36807,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else { if (IS_VAR == IS_TMP_VAR) { @@ -36962,12 +36819,12 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(value); - AI_SET_PTR(&EX_T(opline->result.var), value); + EX_T(opline->result.var).var.ptr = value; } } /* zend_assign_to_variable() always takes care of op2, never free it! */ - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -36993,7 +36850,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE } zend_error(E_STRICT, "Only variables should be assigned by reference"); if (UNEXPECTED(EG(exception) != NULL)) { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + if (free_op2.var) {zval_ptr_dtor_nogc(&free_op2.var);}; HANDLE_EXCEPTION(); } return ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); @@ -37017,10 +36874,10 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*variable_ptr_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *variable_ptr_ptr); + EX_T(opline->result.var).var.ptr = *variable_ptr_ptr; } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + if (free_op2.var) {zval_ptr_dtor_nogc(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -37078,7 +36935,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_ } } else { if (UNEXPECTED(EG(exception) != NULL)) { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); HANDLE_EXCEPTION(); } zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); @@ -37100,7 +36957,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_ call->is_ctor_call = 0; EX(call) = call; - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -37112,14 +36969,11 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS zend_free_op free_op2; SAVE_OPLINE(); - if (IS_CV==IS_VAR) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } is_equal_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -37155,7 +37009,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - } else { + + } else if (IS_CV == IS_CV) { Z_ADDREF_P(expr_ptr); } } @@ -37180,11 +37035,7 @@ num_index: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -37197,14 +37048,12 @@ num_index: /* do nothing */ break; } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } else { zend_hash_next_index_insert(Z_ARRVAL(EX_T(opline->result.var).tmp_var), &expr_ptr, sizeof(zval *), NULL); } if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) { - } else { - } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -37341,11 +37190,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (ht == &EG(symbol_table)) { zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC); @@ -37369,7 +37214,7 @@ num_index_dim: zend_error(E_WARNING, "Illegal offset type in unset"); break; } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); break; } case IS_OBJECT: @@ -37383,18 +37228,18 @@ num_index_dim: if (0) { zval_ptr_dtor(&offset); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&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);}; + zval_ptr_dtor_nogc(&free_op2.var); break; } } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } CHECK_EXCEPTION(); @@ -37428,13 +37273,13 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER if (0) { zval_ptr_dtor(&offset); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } CHECK_EXCEPTION(); @@ -37538,7 +37383,6 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(int SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC); - offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) { @@ -37565,11 +37409,7 @@ num_index_prop: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) { isset = 1; @@ -37598,7 +37438,7 @@ num_index_prop: result = 1; } } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } else if (Z_TYPE_P(container) == IS_OBJECT) { if (0) { MAKE_REAL_ZVAL_PTR(offset); @@ -37621,7 +37461,7 @@ num_index_prop: if (0) { zval_ptr_dtor(&offset); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } } else if (Z_TYPE_P(container) == IS_STRING && !prop_dim) { /* string offsets */ zval tmp; @@ -37650,9 +37490,9 @@ num_index_prop: } } } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } else { - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } Z_TYPE(EX_T(opline->result.var).tmp_var) = IS_BOOL; @@ -37748,7 +37588,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG /* Consts, temporary variables and references need copying */ if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR - || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) + || PZVAL_IS_REF(value) ) { zval *copy; @@ -37761,11 +37601,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG } generator->value = copy; + } else { - Z_ADDREF_P(value); + if (IS_CV == IS_CV) { + Z_ADDREF_P(value); + } generator->value = value; } - } } else { /* If no value was specified yield null */ @@ -37804,7 +37646,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG generator->largest_used_integer_key = Z_LVAL_P(generator->key); } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + zval_ptr_dtor_nogc(&free_op2.var); } else { /* If no key was specified we use auto-increment keys */ generator->largest_used_integer_key++; @@ -37859,7 +37701,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int (*b if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } else { /* here we are sure we are dealing with an object */ @@ -37879,7 +37720,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int (*b if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*zptr); EX_T(opline->result.var).var.ptr = *zptr; - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -37918,7 +37758,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int (*b if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(z); EX_T(opline->result.var).var.ptr = z; - EX_T(opline->result.var).var.ptr_ptr = NULL; } zval_ptr_dtor(&z); } else { @@ -37926,7 +37765,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int (*b if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -37990,7 +37828,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_UNUSED(int (*binar if (UNEXPECTED(*var_ptr == &EG(error_zval))) { if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } @@ -38018,7 +37856,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_UNUSED(int (*binar if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*var_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *var_ptr); + EX_T(opline->result.var).var.ptr = *var_ptr; } if (opline->extended_value == ZEND_ASSIGN_DIM) { @@ -38144,10 +37982,8 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_UNUSED(int type, */ if (IS_CV == IS_CONST) { hash_value = Z_HASH_P(varname); - } else if (IS_INTERNED(Z_STRVAL_P(varname))) { - hash_value = INTERNED_HASH(Z_STRVAL_P(varname)); } else { - hash_value = zend_hash_func(Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1); + hash_value = str_hash(Z_STRVAL_P(varname), Z_STRLEN_P(varname)); } if (zend_hash_quick_find(target_symbol_table, Z_STRVAL_P(varname), Z_STRLEN_P(varname)+1, hash_value, (void **) &retval) == FAILURE) { @@ -38200,7 +38036,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_UNUSED(int type, switch (type) { case BP_VAR_R: case BP_VAR_IS: - AI_SET_PTR(&EX_T(opline->result.var), *retval); + EX_T(opline->result.var).var.ptr = *retval; break; case BP_VAR_UNSET: { zend_free_op free_res; @@ -38385,11 +38221,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAN ALLOC_ZVAL(retval); ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1); INIT_PZVAL(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } } else if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) { if (IS_TMP_FREE(free_op_data1)) { @@ -38397,7 +38233,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAN } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else { if ((opline+1)->op1_type == IS_TMP_VAR) { @@ -38409,7 +38245,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAN } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(value); - AI_SET_PTR(&EX_T(opline->result.var), value); + EX_T(opline->result.var).var.ptr = value; } } FREE_OP_VAR_PTR(free_op_data2); @@ -38453,7 +38289,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPC INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - } else { + + } else if (IS_CV == IS_CV) { Z_ADDREF_P(expr_ptr); } } @@ -38478,11 +38315,7 @@ num_index: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -38501,8 +38334,6 @@ num_index: } if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) { - } else { - } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -38757,7 +38588,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ /* Consts, temporary variables and references need copying */ if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR - || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) + || PZVAL_IS_REF(value) ) { zval *copy; @@ -38770,11 +38601,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ } generator->value = copy; + } else { - Z_ADDREF_P(value); + if (IS_CV == IS_CV) { + Z_ADDREF_P(value); + } generator->value = value; } - } } else { /* If no value was specified yield null */ @@ -39143,7 +38976,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binar if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } else { /* here we are sure we are dealing with an object */ @@ -39163,7 +38995,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binar if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*zptr); EX_T(opline->result.var).var.ptr = *zptr; - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -39202,7 +39033,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binar if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(z); EX_T(opline->result.var).var.ptr = z; - EX_T(opline->result.var).var.ptr_ptr = NULL; } zval_ptr_dtor(&z); } else { @@ -39210,7 +39040,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binar if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); - EX_T(opline->result.var).var.ptr_ptr = NULL; } } } @@ -39274,7 +39103,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_CV(int (*binary_op if (UNEXPECTED(*var_ptr == &EG(error_zval))) { if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } @@ -39302,7 +39131,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_CV(int (*binary_op if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*var_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *var_ptr); + EX_T(opline->result.var).var.ptr = *var_ptr; } if (opline->extended_value == ZEND_ASSIGN_DIM) { @@ -39586,14 +39415,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLE zval *container; SAVE_OPLINE(); - - if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC); + if (IS_CV != IS_VAR || !(opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -39759,7 +39586,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_CV(ZEND UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { zend_error(E_NOTICE, "Trying to get property of non-object"); PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } else { zval *retval; @@ -39772,7 +39599,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_CV(ZEND retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_R, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); PZVAL_LOCK(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; if (0) { zval_ptr_dtor(&offset); @@ -39879,7 +39706,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDL if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } else { zval *retval; @@ -39892,7 +39719,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDL retval = Z_OBJ_HT_P(container)->read_property(container, offset, BP_VAR_IS, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); PZVAL_LOCK(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; if (0) { zval_ptr_dtor(&offset); @@ -40057,11 +39884,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER ALLOC_ZVAL(retval); ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T((opline+1)->op2.var).str_offset.str)+EX_T((opline+1)->op2.var).str_offset.offset, 1, 1); INIT_PZVAL(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } } else if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else if (UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) { if (IS_TMP_FREE(free_op_data1)) { @@ -40069,7 +39896,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else { if ((opline+1)->op1_type == IS_TMP_VAR) { @@ -40081,7 +39908,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(value); - AI_SET_PTR(&EX_T(opline->result.var), value); + EX_T(opline->result.var).var.ptr = value; } } FREE_OP_VAR_PTR(free_op_data2); @@ -40113,11 +39940,11 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG ALLOC_ZVAL(retval); ZVAL_STRINGL(retval, Z_STRVAL_P(EX_T(opline->op1.var).str_offset.str)+EX_T(opline->op1.var).str_offset.offset, 1, 1); INIT_PZVAL(retval); - AI_SET_PTR(&EX_T(opline->result.var), retval); + EX_T(opline->result.var).var.ptr = retval; } } else if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else if (IS_CV == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval))) { if (0) { @@ -40125,7 +39952,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(&EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).var.ptr = &EG(uninitialized_zval); } } else { if (IS_CV == IS_TMP_VAR) { @@ -40137,7 +39964,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG } if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(value); - AI_SET_PTR(&EX_T(opline->result.var), value); + EX_T(opline->result.var).var.ptr = value; } } @@ -40191,7 +40018,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(*variable_ptr_ptr); - AI_SET_PTR(&EX_T(opline->result.var), *variable_ptr_ptr); + EX_T(opline->result.var).var.ptr = *variable_ptr_ptr; } @@ -40284,9 +40111,6 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); - if (IS_CV==IS_VAR) { - PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); - } is_equal_function(&EX_T(opline->result.var).tmp_var, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); @@ -40326,7 +40150,8 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_ INIT_PZVAL_COPY(new_expr, expr_ptr); expr_ptr = new_expr; zendi_zval_copy_ctor(*expr_ptr); - } else { + + } else if (IS_CV == IS_CV) { Z_ADDREF_P(expr_ptr); } } @@ -40351,11 +40176,7 @@ num_index: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } zend_hash_quick_update(Z_ARRVAL(EX_T(opline->result.var).tmp_var), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, &expr_ptr, sizeof(zval *), NULL); break; @@ -40374,8 +40195,6 @@ num_index: } if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) { - } else { - } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -40434,11 +40253,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_dim); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (ht == &EG(symbol_table)) { zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC); @@ -40546,7 +40361,6 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CV(int SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC); - offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) { @@ -40573,11 +40387,7 @@ num_index_prop: hval = Z_HASH_P(offset); } else { ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index_prop); - if (IS_INTERNED(Z_STRVAL_P(offset))) { - hval = INTERNED_HASH(Z_STRVAL_P(offset)); - } else { - hval = zend_hash_func(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1); - } + hval = str_hash(Z_STRVAL_P(offset), Z_STRLEN_P(offset)); } if (zend_hash_quick_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, (void **) &value) == SUCCESS) { isset = 1; @@ -40756,7 +40566,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS /* Consts, temporary variables and references need copying */ if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR - || (PZVAL_IS_REF(value) && Z_REFCOUNT_P(value) > 0) + || PZVAL_IS_REF(value) ) { zval *copy; @@ -40769,11 +40579,13 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS } generator->value = copy; + } else { - Z_ADDREF_P(value); + if (IS_CV == IS_CV) { + Z_ADDREF_P(value); + } generator->value = value; } - } } else { /* If no value was specified yield null */ @@ -44951,6 +44763,31 @@ void zend_init_opcodes_handlers(void) ZEND_FAST_RET_SPEC_HANDLER, ZEND_FAST_RET_SPEC_HANDLER, ZEND_FAST_RET_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, + ZEND_RECV_VARIADIC_SPEC_HANDLER, ZEND_NULL_HANDLER }; zend_opcode_handlers = (opcode_handler_t*)labels; diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php index f29b3c4533..697c6504f0 100644 --- a/Zend/zend_vm_gen.php +++ b/Zend/zend_vm_gen.php @@ -143,6 +143,8 @@ $op1_get_zval_ptr_ptr = array( "UNUSED" => "NULL", "CV" => "_get_zval_ptr_ptr_cv_\\1(execute_data, opline->op1.var TSRMLS_CC)", ); +$op1_get_zval_ptr_ptr_fast = $op1_get_zval_ptr_ptr; +$op1_get_zval_ptr_ptr_fast["VAR"] = "_get_zval_ptr_ptr_var_fast(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)"; $op2_get_zval_ptr_ptr = array( "ANY" => "get_zval_ptr_ptr(opline->op2_type, &opline->op2, execute_data, &free_op2, \\1)", @@ -152,6 +154,8 @@ $op2_get_zval_ptr_ptr = array( "UNUSED" => "NULL", "CV" => "_get_zval_ptr_ptr_cv_\\1(execute_data, opline->op2.var TSRMLS_CC)", ); +$op2_get_zval_ptr_ptr_fast = $op2_get_zval_ptr_ptr; +$op2_get_zval_ptr_ptr_fast["VAR"] = "_get_zval_ptr_ptr_var_fast(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)"; $op1_get_obj_zval_ptr = array( "ANY" => "get_obj_zval_ptr(opline->op1_type, &opline->op1, execute_data, &free_op1, \\1)", @@ -179,6 +183,8 @@ $op1_get_obj_zval_ptr_ptr = array( "UNUSED" => "_get_obj_zval_ptr_ptr_unused(TSRMLS_C)", "CV" => "_get_zval_ptr_ptr_cv_\\1(execute_data, opline->op1.var TSRMLS_CC)", ); +$op1_get_obj_zval_ptr_ptr_fast = $op1_get_obj_zval_ptr_ptr; +$op1_get_obj_zval_ptr_ptr_fast["VAR"] = "_get_zval_ptr_ptr_var_fast(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)"; $op2_get_obj_zval_ptr_ptr = array( "ANY" => "get_obj_zval_ptr_ptr(opline->op2_type, &opline->op2, execute_data, &free_op2, \\1)", @@ -188,6 +194,8 @@ $op2_get_obj_zval_ptr_ptr = array( "UNUSED" => "_get_obj_zval_ptr_ptr_unused(TSRMLS_C)", "CV" => "_get_zval_ptr_ptr_cv_\\1(execute_data, opline->op2.var TSRMLS_CC)", ); +$op2_get_obj_zval_ptr_ptr_fast = $op2_get_obj_zval_ptr_ptr; +$op2_get_obj_zval_ptr_ptr_fast["VAR"] = "_get_zval_ptr_ptr_var_fast(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)"; $op1_is_tmp_free = array( "ANY" => "IS_TMP_FREE(free_op1)", @@ -210,7 +218,7 @@ $op2_is_tmp_free = array( $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);}", + "VAR" => "zval_ptr_dtor_nogc(&free_op1.var)", "CONST" => "", "UNUSED" => "", "CV" => "", @@ -219,7 +227,7 @@ $op1_free_op = array( $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);}", + "VAR" => "zval_ptr_dtor_nogc(&free_op2.var)", "CONST" => "", "UNUSED" => "", "CV" => "", @@ -228,7 +236,7 @@ $op2_free_op = array( $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);}", + "VAR" => "zval_ptr_dtor_nogc(&free_op1.var)", "CONST" => "", "UNUSED" => "", "CV" => "", @@ -237,29 +245,33 @@ $op1_free_op_if_var = array( $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);}", + "VAR" => "zval_ptr_dtor_nogc(&free_op2.var)", "CONST" => "", "UNUSED" => "", "CV" => "", ); $op1_free_op_var_ptr = array( - "ANY" => "if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}", + "ANY" => "if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}", "TMP" => "", - "VAR" => "if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}", + "VAR" => "if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}", "CONST" => "", "UNUSED" => "", "CV" => "", ); +$op1_free_op_var_ptr_fast = $op1_free_op_var_ptr; +$op1_free_op_var_ptr_fast["VAR"] = "zval_ptr_dtor_nogc(&free_op1.var)"; $op2_free_op_var_ptr = array( - "ANY" => "if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}", + "ANY" => "if (free_op2.var) {zval_ptr_dtor_nogc(&free_op2.var);}", "TMP" => "", - "VAR" => "if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}", + "VAR" => "if (free_op2.var) {zval_ptr_dtor_nogc(&free_op2.var);}", "CONST" => "", "UNUSED" => "", "CV" => "", ); +$op2_free_op_var_ptr_fast = $op2_free_op_var_ptr; +$op2_free_op_var_ptr_fast["VAR"] = "zval_ptr_dtor_nogc(&free_op2.var)"; $list = array(); // list of opcode handlers and helpers in original order $opcodes = array(); // opcode handlers by code @@ -311,7 +323,10 @@ function gen_code($f, $spec, $kind, $export, $code, $op1, $op2, $name) { $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; + $op1_free_op_var_ptr, $op2_free_op_var_ptr, $prefix, + $op1_get_zval_ptr_ptr_fast, $op2_get_zval_ptr_ptr_fast, + $op1_get_obj_zval_ptr_ptr_fast, $op2_get_obj_zval_ptr_ptr_fast, + $op1_free_op_var_ptr_fast, $op2_free_op_var_ptr_fast; // Specializing $code = preg_replace( @@ -336,6 +351,12 @@ function gen_code($f, $spec, $kind, $export, $code, $op1, $op2, $name) { "/FREE_OP2_IF_VAR\(\)/", "/FREE_OP1_VAR_PTR\(\)/", "/FREE_OP2_VAR_PTR\(\)/", + "/GET_OP1_ZVAL_PTR_PTR_FAST\(([^)]*)\)/", + "/GET_OP2_ZVAL_PTR_PTR_FAST\(([^)]*)\)/", + "/GET_OP1_OBJ_ZVAL_PTR_PTR_FAST\(([^)]*)\)/", + "/GET_OP2_OBJ_ZVAL_PTR_PTR_FAST\(([^)]*)\)/", + "/FREE_OP1_VAR_PTR_FAST\(\)/", + "/FREE_OP2_VAR_PTR_FAST\(\)/", "/^#ifdef\s+ZEND_VM_SPEC\s*\n/m", "/^#ifndef\s+ZEND_VM_SPEC\s*\n/m", "/\!defined\(ZEND_VM_SPEC\)/m", @@ -368,6 +389,12 @@ function gen_code($f, $spec, $kind, $export, $code, $op1, $op2, $name) { $op2_free_op_if_var[$op2], $op1_free_op_var_ptr[$op1], $op2_free_op_var_ptr[$op2], + $op1_get_zval_ptr_ptr_fast[$op1], + $op2_get_zval_ptr_ptr_fast[$op2], + $op1_get_obj_zval_ptr_ptr_fast[$op1], + $op2_get_obj_zval_ptr_ptr_fast[$op2], + $op1_free_op_var_ptr_fast[$op1], + $op2_free_op_var_ptr_fast[$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", diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h index 859258a440..7624ec192d 100644 --- a/Zend/zend_vm_opcodes.h +++ b/Zend/zend_vm_opcodes.h @@ -164,3 +164,4 @@ #define ZEND_GENERATOR_RETURN 161 #define ZEND_FAST_CALL 162 #define ZEND_FAST_RET 163 +#define ZEND_RECV_VARIADIC 164 |