diff options
author | Ondřej Surý <ondrej@sury.org> | 2013-01-16 09:02:55 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2013-01-16 09:02:55 +0100 |
commit | 8572aeb0703107705fc7dde35961cd6a5f89c0c8 (patch) | |
tree | 833d2a593591ac362a7dfe90971bef61d155bfaa /Zend | |
parent | 0b82e05fe264306004119e30119e665365331e17 (diff) | |
download | php-8572aeb0703107705fc7dde35961cd6a5f89c0c8.tar.gz |
Imported Upstream version 5.5.0~alpha3upstream/5.5.0_alpha3
Diffstat (limited to 'Zend')
145 files changed, 6189 insertions, 5858 deletions
diff --git a/Zend/Makefile.am b/Zend/Makefile.am index e5757fac5..6417f3eb1 100644 --- a/Zend/Makefile.am +++ b/Zend/Makefile.am @@ -32,7 +32,7 @@ zend_ini_scanner.lo: zend_ini_parser.h # Language parser/scanner rules zend_language_scanner.c: $(srcdir)/zend_language_scanner.l - $(RE2C) $(RE2C_FLAGS) --case-inverted -cbdFt $(srcdir)/zend_language_scanner_defs.h -o$@ $(srcdir)/zend_language_scanner.l + $(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt $(srcdir)/zend_language_scanner_defs.h -o$@ $(srcdir)/zend_language_scanner.l zend_language_parser.h: zend_language_parser.c zend_language_parser.c: $(srcdir)/zend_language_parser.y @@ -44,7 +44,7 @@ zend_ini_parser.c: $(srcdir)/zend_ini_parser.y $(YACC) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o zend_ini_parser.c zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l - $(RE2C) $(RE2C_FLAGS) --case-inverted -cbdFt $(srcdir)/zend_ini_scanner_defs.h -o$@ $(srcdir)/zend_ini_scanner.l + $(RE2C) $(RE2C_FLAGS) --no-generation-date --case-inverted -cbdFt $(srcdir)/zend_ini_scanner_defs.h -o$@ $(srcdir)/zend_ini_scanner.l zend_ini_parser.h: zend_ini_parser.c diff --git a/Zend/tests/bug63468.phpt b/Zend/tests/bug63468.phpt new file mode 100644 index 000000000..00b5a41c9 --- /dev/null +++ b/Zend/tests/bug63468.phpt @@ -0,0 +1,30 @@ +--TEST-- +Bug #63468 (wrong called method as callback with inheritance) +--FILE-- +<?php +class Foo +{ + public function run() + { + return call_user_func(array('Bar', 'getValue')); + } + + private static function getValue() + { + return 'Foo'; + } +} + +class Bar extends Foo +{ + public static function getValue() + { + return 'Bar'; + } +} + +$x = new Bar; +var_dump($x->run()); +--EXPECT-- +string(3) "Bar" + diff --git a/Zend/tests/bug63635.phpt b/Zend/tests/bug63635.phpt new file mode 100644 index 000000000..6f6fc6a44 --- /dev/null +++ b/Zend/tests/bug63635.phpt @@ -0,0 +1,58 @@ +--TEST-- +Bug #63635 (Segfault in gc_collect_cycles) +--FILE-- +<?php +class Node { + public $parent = NULL; + public $childs = array(); + + function __construct(Node $parent=NULL) { + if ($parent) { + $parent->childs[] = $this; + } + $this->childs[] = $this; + } + + function __destruct() { + $this->childs = NULL; + } +} + +define("MAX", 16); + +for ($n = 0; $n < 20; $n++) { + $top = new Node(); + for ($i=0 ; $i<MAX ; $i++) { + $ci = new Node($top); + for ($j=0 ; $j<MAX ; $j++) { + $cj = new Node($ci); + for ($k=0 ; $k<MAX ; $k++) { + $ck = new Node($cj); + } + } + } + echo "$n\n"; +} +echo "ok\n"; +--EXPECT-- +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +ok diff --git a/Zend/tests/bug63741.phpt b/Zend/tests/bug63741.phpt new file mode 100644 index 000000000..fc04c9e79 --- /dev/null +++ b/Zend/tests/bug63741.phpt @@ -0,0 +1,50 @@ +--TEST-- +Bug #63741 (Crash when autoloading from spl) +--FILE-- +<?php +file_put_contents(dirname(__FILE__)."/bug63741.tmp.php", +<<<'EOT' +<?php +if (isset($autoloading)) +{ + class ClassToLoad + { + static function func () + { + print "OK!\n"; + } + } + return; +} +else +{ + class autoloader + { + static function autoload($classname) + { + print "autoloading...\n"; + $autoloading = true; + include __FILE__; + } + } + + spl_autoload_register(["autoloader", "autoload"]); + + function start() + { + ClassToLoad::func(); + } + + start(); +} +?> +EOT +); + +include dirname(__FILE__)."/bug63741.tmp.php"; +?> +--CLEAN-- +<?php unlink(dirname(__FILE__)."/bug63741.tmp.php"); ?> +--EXPECT-- +autoloading... +OK! diff --git a/Zend/tests/bug63762.phpt b/Zend/tests/bug63762.phpt new file mode 100644 index 000000000..8de177dcf --- /dev/null +++ b/Zend/tests/bug63762.phpt @@ -0,0 +1,53 @@ +--TEST-- +Bug #63762 - Sigsegv when Exception::$trace is changed by user +--FILE-- +<?php +$e = new Exception(); + +$ref = new ReflectionProperty($e, 'trace'); +$ref->setAccessible(TRUE); + +echo "Array of NULL:\n"; +$ref->setValue($e, array(NULL)); + +var_dump($e->getTraceAsString()); + +echo "\nArray of empty array:\n"; +$ref->setValue($e, array(array())); +var_dump($e->getTraceAsString()); + +echo "\nArray of array of NULL values:\n"; +$ref->setValue($e, array(array( + 'file' => NULL, + 'line' => NULL, + 'class' => NULL, + 'type' => NULL, + 'function' => NULL, + 'args' => NULL +))); +var_dump($e->getTraceAsString()); +?> +--EXPECTF-- +Array of NULL: + +Warning: Expected array for frame 0 in %s on line %d +string(9) "#0 {main}" + +Array of empty array: +string(36) "#0 [internal function]: () +#1 {main}" + +Array of array of NULL values: + +Warning: Function name is no string in %s on line %d + +Warning: Value for class is no string in %s on line %d + +Warning: Value for type is no string in %s on line %d + +Warning: Value for function is no string in %s on line %d + +Warning: args element is no array in %s on line %d +string(60) "#0 [unknown function][unknown][unknown][unknown]() +#1 {main}" + diff --git a/Zend/tests/bug63882.phpt b/Zend/tests/bug63882.phpt new file mode 100644 index 000000000..0cc1babd4 --- /dev/null +++ b/Zend/tests/bug63882.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #63882 (zend_std_compare_objects crash on recursion) +--FILE-- +<?php +class Test { public $x = 5; } + +$testobj1 = new Test; +$testobj2 = new Test; +$testobj1->x = $testobj1; +$testobj2->x = $testobj2; + +var_dump($testobj1 == $testobj2); +?> +--EXPECTF-- +Fatal error: Nesting level too deep - recursive dependency? in %sbug63882.php on line 9 diff --git a/Zend/tests/catch_finally_006.phpt b/Zend/tests/catch_finally_006.phpt index 9759eab37..216219b6a 100644 --- a/Zend/tests/catch_finally_006.phpt +++ b/Zend/tests/catch_finally_006.phpt @@ -25,4 +25,4 @@ try { --EXPECT-- string(4) "para" string(7) "finally" -string(2) "ex" +string(6) "return" diff --git a/Zend/tests/generators/bug63066.phpt b/Zend/tests/generators/bug63066.phpt new file mode 100644 index 000000000..8c4c8b4a8 --- /dev/null +++ b/Zend/tests/generators/bug63066.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #63066 (Calling an undefined method in a generator results in a seg fault) +--FILE-- +<?php +function gen($o) +{ + yield 'foo'; + $o->fatalError(); +} + +foreach(gen(new stdClass()) as $value) + echo $value, "\n"; +--EXPECTF-- +foo + +Fatal error: Call to undefined method stdClass::fatalError() in %sbug63066.php on line 5 diff --git a/Zend/tests/generators/clone_after_object_call.phpt b/Zend/tests/generators/clone_after_object_call.phpt new file mode 100644 index 000000000..0a424268c --- /dev/null +++ b/Zend/tests/generators/clone_after_object_call.phpt @@ -0,0 +1,20 @@ +--TEST-- +Cloning a generator after an object method was called +--FILE-- +<?php + +class A { public function b() { } } + +function gen() { + $a = new A; + $a->b(); + yield; +} + +$g1 = gen(); +$g1->rewind(); +$g2 = clone $g1; + +echo "Done"; +--EXPECT-- +Done diff --git a/Zend/tests/generators/finally/finally_ran_on_close.phpt b/Zend/tests/generators/finally/finally_ran_on_close.phpt new file mode 100644 index 000000000..04a0561c8 --- /dev/null +++ b/Zend/tests/generators/finally/finally_ran_on_close.phpt @@ -0,0 +1,30 @@ +--TEST-- +finally is run even if a generator is closed mid-execution +--FILE-- +<?php + +function gen() { + try { + try { + echo "before yield\n"; + yield; + echo "after yield\n"; + } finally { + echo "finally run\n"; + } + echo "code after finally\n"; + } finally { + echo "second finally run\n"; + } + echo "code after second finally\n"; +} + +$gen = gen(); +$gen->rewind(); +unset($gen); + +?> +--EXPECT-- +before yield +finally run +second finally run diff --git a/Zend/tests/generators/finally_with_return.phpt b/Zend/tests/generators/finally/return_return.phpt index b26a49f32..02e2739de 100644 --- a/Zend/tests/generators/finally_with_return.phpt +++ b/Zend/tests/generators/finally/return_return.phpt @@ -1,5 +1,5 @@ --TEST-- -Use of finally in generator with return +try { return } finally { return } in generator --FILE-- <?php diff --git a/Zend/tests/generators/finally/return_yield.phpt b/Zend/tests/generators/finally/return_yield.phpt new file mode 100644 index 000000000..c4f348598 --- /dev/null +++ b/Zend/tests/generators/finally/return_yield.phpt @@ -0,0 +1,18 @@ +--TEST-- +try { return } finally { yield } +--FILE-- +<?php +function foo($f, $t) { + for ($i = $f; $i <= $t; $i++) { + try { + return; + } finally { + yield $i; + } + } +} +foreach (foo(1, 5) as $x) { + echo $x, "\n"; +} +--EXPECT-- +1 diff --git a/Zend/tests/generators/finally/throw_yield.phpt b/Zend/tests/generators/finally/throw_yield.phpt new file mode 100644 index 000000000..2013c3ee1 --- /dev/null +++ b/Zend/tests/generators/finally/throw_yield.phpt @@ -0,0 +1,24 @@ +--TEST-- +try { throw } finally { yield } +--FILE-- +<?php +function foo($f, $t) { + for ($i = $f; $i <= $t; $i++) { + try { + throw new Exception; + } finally { + yield $i; + } + } +} +foreach (foo(1, 5) as $x) { + echo $x, "\n"; +} +--EXPECTF-- +1 + +Fatal error: Uncaught exception 'Exception' in %s:%d +Stack trace: +#0 %s(%d): foo(1, 5) +#1 {main} + thrown in %s on line %d diff --git a/Zend/tests/generators/finally/yield_return.phpt b/Zend/tests/generators/finally/yield_return.phpt new file mode 100644 index 000000000..e3e1bec35 --- /dev/null +++ b/Zend/tests/generators/finally/yield_return.phpt @@ -0,0 +1,18 @@ +--TEST-- +try { yield } finally { return } +--FILE-- +<?php +function foo($f, $t) { + for ($i = $f; $i <= $t; $i++) { + try { + yield $i; + } finally { + return; + } + } +} +foreach (foo(1, 5) as $x) { + echo $x, "\n"; +} +--EXPECT-- +1 diff --git a/Zend/tests/generators/finally/yield_throw.phpt b/Zend/tests/generators/finally/yield_throw.phpt new file mode 100644 index 000000000..0ead4501a --- /dev/null +++ b/Zend/tests/generators/finally/yield_throw.phpt @@ -0,0 +1,24 @@ +--TEST-- +try { yield } finally { throw } +--FILE-- +<?php +function foo($f, $t) { + for ($i = $f; $i <= $t; $i++) { + try { + yield $i; + } finally { + throw new Exception; + } + } +} +foreach (foo(1, 5) as $x) { + echo $x, "\n"; +} +--EXPECTF-- +1 + +Fatal error: Uncaught exception 'Exception' in %s:%d +Stack trace: +#0 %s(%d): foo(1, 5) +#1 {main} + thrown in %s on line %d diff --git a/Zend/tests/generators/finally/yield_yield.phpt b/Zend/tests/generators/finally/yield_yield.phpt new file mode 100644 index 000000000..76610ef1a --- /dev/null +++ b/Zend/tests/generators/finally/yield_yield.phpt @@ -0,0 +1,22 @@ +--TEST-- +Try { yield } finally { yield } +--FILE-- +<?php + +function foo() { + try { + echo "1"; + yield "2"; + echo "3"; + } finally { + echo "4"; + yield "5"; + echo "6"; + } + echo "7"; +} +foreach (foo() as $x) { + echo $x; +} +--EXPECT-- +1234567 diff --git a/Zend/tests/generators/finally_ran_on_close.phpt b/Zend/tests/generators/finally_ran_on_close.phpt deleted file mode 100644 index 44a84fae5..000000000 --- a/Zend/tests/generators/finally_ran_on_close.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -finally is run even if a generator is closed mid-execution ---FILE-- -<?php - -function gen() { - try { - echo "before yield\n"; - yield; - echo "after yield\n"; - } finally { - echo "finally run\n"; - } - - echo "code after finally\n"; -} - -$gen = gen(); -$gen->rewind(); -unset($gen); - -?> ---EXPECT-- -before yield -finally run diff --git a/Zend/tests/generators/finally_uninterrupted.phpt b/Zend/tests/generators/finally_uninterrupted.phpt deleted file mode 100644 index 64c94382a..000000000 --- a/Zend/tests/generators/finally_uninterrupted.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Use of finally in generator without interrupt ---FILE-- -<?php - -function gen() { - try { - throw new Exception; - } finally { - echo "finally run\n"; - } - - yield; // force generator -} - -$gen = gen(); -$gen->rewind(); // force run - -?> ---EXPECTF-- -finally run - -Fatal error: Uncaught exception 'Exception' in %s:%d -Stack trace: -#0 [internal function]: gen() -#1 %s(%d): Generator->rewind() -#2 {main} - thrown in %s on line %d diff --git a/Zend/tests/generators/ignored_send_leak.phpt b/Zend/tests/generators/ignored_send_leak.phpt new file mode 100644 index 000000000..352ba406b --- /dev/null +++ b/Zend/tests/generators/ignored_send_leak.phpt @@ -0,0 +1,17 @@ +--TEST-- +Ignoring a sent value shouldn't leak memory +--FILE-- +<?php + +function gen() { + yield; +} + +$gen = gen(); +$gen->send(NULL); + +echo "DONE"; + +?> +--EXPECT-- +DONE diff --git a/Zend/tests/generators/throw_already_closed.phpt b/Zend/tests/generators/throw_already_closed.phpt new file mode 100644 index 000000000..e918e540a --- /dev/null +++ b/Zend/tests/generators/throw_already_closed.phpt @@ -0,0 +1,23 @@ +--TEST-- +Generator::throw() on an already closed generator +--FILE-- +<?php + +function gen() { + yield; +} + +$gen = gen(); +$gen->next(); +$gen->next(); +var_dump($gen->valid()); +$gen->throw(new Exception('test')); + +?> +--EXPECTF-- +bool(false) + +Fatal error: Uncaught exception 'Exception' with message 'test' in %s:%d +Stack trace: +#0 {main} + thrown in %s on line %d diff --git a/Zend/tests/generators/throw_caught.phpt b/Zend/tests/generators/throw_caught.phpt new file mode 100644 index 000000000..0c3f8e9b2 --- /dev/null +++ b/Zend/tests/generators/throw_caught.phpt @@ -0,0 +1,25 @@ +--TEST-- +Generator::throw() where the exception is caught in the generator +--FILE-- +<?php + +function gen() { + try { + yield; + } catch (RuntimeException $e) { + echo $e, "\n\n"; + } + + yield 'result'; +} + +$gen = gen(); +var_dump($gen->throw(new RuntimeException('Test'))); + +?> +--EXPECTF-- +exception 'RuntimeException' with message 'Test' in %s:%d +Stack trace: +#0 {main} + +string(6) "result" diff --git a/Zend/tests/generators/throw_not_an_exception.phpt b/Zend/tests/generators/throw_not_an_exception.phpt new file mode 100644 index 000000000..d93903e21 --- /dev/null +++ b/Zend/tests/generators/throw_not_an_exception.phpt @@ -0,0 +1,15 @@ +--TEST-- +Generator::throw() with something that's not an exception +--FILE-- +<?php + +function gen() { + yield; +} + +$gen = gen(); +$gen->throw(new stdClass); + +?> +--EXPECTF-- +Fatal error: Exceptions must be valid objects derived from the Exception base class in %s on line %d diff --git a/Zend/tests/generators/throw_rethrow.phpt b/Zend/tests/generators/throw_rethrow.phpt new file mode 100644 index 000000000..267f5f0db --- /dev/null +++ b/Zend/tests/generators/throw_rethrow.phpt @@ -0,0 +1,32 @@ +--TEST-- +Generator::throw() where the generator throws a different exception +--FILE-- +<?php + +function gen() { + try { + yield; + } catch (RuntimeException $e) { + echo 'Caught: ', $e, "\n\n"; + + throw new LogicException('new throw'); + } +} + +$gen = gen(); +var_dump($gen->throw(new RuntimeException('throw'))); + +?> +--EXPECTF-- +Caught: exception 'RuntimeException' with message 'throw' in %s:%d +Stack trace: +#0 {main} + + +Fatal error: Uncaught exception 'LogicException' with message 'new throw' in %s:%d +Stack trace: +#0 [internal function]: gen() +#1 %s(%d): Generator->throw(Object(RuntimeException)) +#2 {main} + thrown in %s on line %d + diff --git a/Zend/tests/generators/throw_uncaught.phpt b/Zend/tests/generators/throw_uncaught.phpt new file mode 100644 index 000000000..f06cff1b8 --- /dev/null +++ b/Zend/tests/generators/throw_uncaught.phpt @@ -0,0 +1,19 @@ +--TEST-- +Generator::throw() where the exception is not caught in the generator +--FILE-- +<?php + +function gen() { + yield 'thisThrows'; + yield 'notReached'; +} + +$gen = gen(); +var_dump($gen->throw(new RuntimeException('test'))); + +?> +--EXPECTF-- +Fatal error: Uncaught exception 'RuntimeException' with message 'test' in %s:%d +Stack trace: +#0 {main} + thrown in %s on line %d diff --git a/Zend/tests/generators/yield_closure.phpt b/Zend/tests/generators/yield_closure.phpt new file mode 100644 index 000000000..e380b2994 --- /dev/null +++ b/Zend/tests/generators/yield_closure.phpt @@ -0,0 +1,17 @@ +--TEST-- +Generator shouldn't crash if last yielded value is a closure +--FILE-- +<?php + +function gen() { + yield function() {}; +} + +$gen = gen(); +$gen->next(); + +echo "Done!"; + +?> +--EXPECT-- +Done! diff --git a/Zend/tests/traits/bug60153.phpt b/Zend/tests/traits/bug60153.phpt index 8f01e72c2..979eced1f 100644 --- a/Zend/tests/traits/bug60153.phpt +++ b/Zend/tests/traits/bug60153.phpt @@ -16,4 +16,4 @@ class C implements IFoo { } --EXPECTF-- -Fatal error: Declaration of C::oneArgument() must be compatible with IFoo::oneArgument($a) in %s on line %d +Fatal error: Declaration of TFoo::oneArgument() must be compatible with IFoo::oneArgument($a) in %s on line %d diff --git a/Zend/tests/traits/bug60217b.phpt b/Zend/tests/traits/bug60217b.phpt index f03955020..eb852a4fb 100644 --- a/Zend/tests/traits/bug60217b.phpt +++ b/Zend/tests/traits/bug60217b.phpt @@ -23,4 +23,4 @@ $o = new CBroken; $o->foo(1); --EXPECTF-- -Fatal error: Declaration of TBroken1::foo($a) must be compatible with TBroken2::foo($a, $b = 0) in %s on line %d +Fatal error: Declaration of TBroken2::foo($a, $b = 0) must be compatible with TBroken1::foo($a) in %s on line %d diff --git a/Zend/tests/traits/bug60217c.phpt b/Zend/tests/traits/bug60217c.phpt index ce8980775..baa4314a6 100644 --- a/Zend/tests/traits/bug60217c.phpt +++ b/Zend/tests/traits/bug60217c.phpt @@ -23,4 +23,4 @@ $o = new CBroken; $o->foo(1); --EXPECTF-- -Fatal error: Declaration of TBroken1::foo($a, $b = 0) must be compatible with TBroken2::foo($a) in %s on line %d +Fatal error: Declaration of TBroken2::foo($a) must be compatible with TBroken1::foo($a, $b = 0) in %s on line %d diff --git a/Zend/tests/traits/bugs/abstract-methods05.phpt b/Zend/tests/traits/bugs/abstract-methods05.phpt index e90ce39a3..9a1315f86 100644 --- a/Zend/tests/traits/bugs/abstract-methods05.phpt +++ b/Zend/tests/traits/bugs/abstract-methods05.phpt @@ -22,4 +22,4 @@ class TraitsTest1 { ?> --EXPECTF-- -Fatal error: Declaration of THelloB::hello() must be compatible with THelloA::hello($a) in %s on line %d
\ No newline at end of file +Fatal error: Declaration of THelloA::hello($a) must be compatible with THelloB::hello() in %s on line %d diff --git a/Zend/tests/traits/bugs/abstract-methods06.phpt b/Zend/tests/traits/bugs/abstract-methods06.phpt index 28ed67272..8569aefb3 100644 --- a/Zend/tests/traits/bugs/abstract-methods06.phpt +++ b/Zend/tests/traits/bugs/abstract-methods06.phpt @@ -23,4 +23,4 @@ class TraitsTest1 { ?> --EXPECTF-- -Fatal error: Declaration of THelloA::hello($a) must be compatible with THelloB::hello() in %s on line %d
\ No newline at end of file +Fatal error: Declaration of THelloB::hello() must be compatible with THelloA::hello($a) in %s on line %d diff --git a/Zend/tests/traits/error_010.phpt b/Zend/tests/traits/error_010.phpt index 8f3f7dddf..de3741ea5 100644 --- a/Zend/tests/traits/error_010.phpt +++ b/Zend/tests/traits/error_010.phpt @@ -10,13 +10,9 @@ trait c { public function test() { return 2; } } -trait b { - public function test() { return 1; } -} - class bar { - use foo, c { c::test insteadof foo, b; } - use foo, c { c::test insteadof foo, b; } + use foo, c { c::test insteadof foo; } + use foo, c { c::test insteadof foo; } } $x = new bar; diff --git a/Zend/tests/traits/inheritance003.phpt b/Zend/tests/traits/inheritance003.phpt index a41c4e484..22ff6e243 100644 --- a/Zend/tests/traits/inheritance003.phpt +++ b/Zend/tests/traits/inheritance003.phpt @@ -35,4 +35,4 @@ $o->sayHello(array()); --EXPECTF-- World! -Fatal error: Declaration of MyHelloWorld::sayHello() must be compatible with Base::sayHello(array $a) in %s on line %d +Fatal error: Declaration of SayWorld::sayHello(Base $d) must be compatible with Base::sayHello(array $a) in %s on line %d diff --git a/Zend/tests/traits/language014.phpt b/Zend/tests/traits/language014.phpt new file mode 100644 index 000000000..102b9aed4 --- /dev/null +++ b/Zend/tests/traits/language014.phpt @@ -0,0 +1,30 @@ +--TEST-- +Aliasing leading to conflict should result in error message +--FILE-- +<?php +error_reporting(E_ALL); + +trait Hello { + public function hello() { + echo 'Hello'; + } +} + +trait World { + public function world() { + echo ' World!'; + } +} + + +class MyClass { + use Hello, World { world as hello; } +} + +$o = new MyClass(); +$o->hello(); +$o->world(); + +?> +--EXPECTF-- +Fatal error: Trait method hello has not been applied, because there are collisions with other trait methods on MyClass in %s on line %d diff --git a/Zend/tests/traits/language015.phpt b/Zend/tests/traits/language015.phpt new file mode 100644 index 000000000..df1f74484 --- /dev/null +++ b/Zend/tests/traits/language015.phpt @@ -0,0 +1,17 @@ +--TEST-- +Invalid conflict resolution (unused trait as lhs of "insteadof") +--FILE-- +<?php +trait T1 { + function foo() {echo "T1\n";} +} +trait T2 { + function foo() {echo "T2\n";} +} +class C { + use T1 { + T2::foo insteadof T1; + } +} +--EXPECTF-- +Fatal error: Trait T2 is not used in %s on line %d diff --git a/Zend/tests/traits/language016.phpt b/Zend/tests/traits/language016.phpt new file mode 100644 index 000000000..e9281198e --- /dev/null +++ b/Zend/tests/traits/language016.phpt @@ -0,0 +1,17 @@ +--TEST-- +Invalid conflict resolution (unused trait as rhs of "insteadof") +--FILE-- +<?php +trait T1 { + function foo() {echo "T1\n";} +} +trait T2 { + function foo() {echo "T2\n";} +} +class C { + use T1 { + T1::foo insteadof T2; + } +} +--EXPECTF-- +Fatal error: Trait T2 is not used in %s on line %d diff --git a/Zend/tests/traits/language017.phpt b/Zend/tests/traits/language017.phpt new file mode 100644 index 000000000..56f9e2409 --- /dev/null +++ b/Zend/tests/traits/language017.phpt @@ -0,0 +1,17 @@ +--TEST-- +Invalid conflict resolution (unused trait as lhs of "as") +--FILE-- +<?php +trait T1 { + function foo() {echo "T1\n";} +} +trait T2 { + function foo() {echo "T2\n";} +} +class C { + use T1 { + T2::foo as private; + } +} +--EXPECTF-- +Fatal error: Trait T2 is not used in %s on line %d diff --git a/Zend/tests/traits/language018.phpt b/Zend/tests/traits/language018.phpt new file mode 100644 index 000000000..169cb50c6 --- /dev/null +++ b/Zend/tests/traits/language018.phpt @@ -0,0 +1,15 @@ +--TEST-- +abstract alias +--FILE-- +<?php +trait T1 { + function foo() {} +} +class C1 { + use T1 { + T1::foo as abstract; + } +} +?> +--EXPECTF-- +Fatal error: Cannot use 'abstract' as method modifier in %s on line %d diff --git a/Zend/tests/traits/language019.phpt b/Zend/tests/traits/language019.phpt new file mode 100644 index 000000000..83318c58a --- /dev/null +++ b/Zend/tests/traits/language019.phpt @@ -0,0 +1,15 @@ +--TEST-- +final alias +--FILE-- +<?php +trait T1 { + function foo() {} +} +class C1 { + use T1 { + T1::foo as final; + } +} +?> +--EXPECTF-- +Fatal error: Cannot use 'final' as method modifier in %s on line %d diff --git a/Zend/tests/try_catch_finally_003.phpt b/Zend/tests/try_catch_finally_003.phpt index 784063b74..7ec8ec82d 100644 --- a/Zend/tests/try_catch_finally_003.phpt +++ b/Zend/tests/try_catch_finally_003.phpt @@ -15,11 +15,9 @@ function foo () { die("error"); } finally { echo "1"; - return 1; } } finally { echo "2"; - return 2; } } catch (BE $e) { die("error"); diff --git a/Zend/tests/try_finally_010.phpt b/Zend/tests/try_finally_010.phpt new file mode 100644 index 000000000..bbac8dd1e --- /dev/null +++ b/Zend/tests/try_finally_010.phpt @@ -0,0 +1,30 @@ +--TEST-- +Try finally (function call in the finaly block after exception) +--FILE-- +<?php +function foo() { + echo "4"; +} +function bar() { + try { + echo "2"; + throw new Exception(); + echo "x"; + } catch (MyEx $ex) { + echo "x"; + } finally { + echo "3"; + foo(); + echo "5"; + } +} +try { + echo "1"; + bar(); + echo "x"; +} catch (Exception $ex) { + echo "6"; +} +echo "\n"; +--EXPECT-- +123456 diff --git a/Zend/zend.c b/Zend/zend.c index 9ab879a2a..d71d7cb5c 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -131,7 +131,7 @@ ZEND_API zval zval_used_for_init; /* True global variable */ /* version information */ static char *zend_version_info; static uint zend_version_info_length; -#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998-2012 Zend Technologies\n" +#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998-2013 Zend Technologies\n" #define PRINT_ZVAL_INDENT 4 static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent, zend_bool is_object TSRMLS_DC) /* {{{ */ @@ -683,11 +683,11 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions TS #if HAVE_DTRACE /* build with dtrace support */ zend_compile_file = dtrace_compile_file; - zend_execute = dtrace_execute; + zend_execute_ex = dtrace_execute_ex; zend_execute_internal = dtrace_execute_internal; #else zend_compile_file = compile_file; - zend_execute = execute; + zend_execute_ex = execute_ex; zend_execute_internal = NULL; #endif /* HAVE_SYS_SDT_H */ zend_compile_string = compile_string; @@ -1238,7 +1238,13 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */ va_end(args); if (type == E_PARSE) { - EG(exit_status) = 255; + /* eval() errors do not affect exit_status */ + if (!(EG(current_execute_data) && + EG(current_execute_data)->opline && + EG(current_execute_data)->opline->opcode == ZEND_INCLUDE_OR_EVAL && + EG(current_execute_data)->opline->extended_value == ZEND_EVAL)) { + EG(exit_status) = 255; + } zend_init_compiler_data_structures(TSRMLS_C); } } diff --git a/Zend/zend.h b/Zend/zend.h index d2a4ef695..aed03d871 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -225,6 +225,7 @@ char *alloca (); #define ZEND_FILE_LINE_EMPTY_CC , ZEND_FILE_LINE_EMPTY_C #define ZEND_FILE_LINE_ORIG_RELAY_C __zend_orig_filename, __zend_orig_lineno #define ZEND_FILE_LINE_ORIG_RELAY_CC , ZEND_FILE_LINE_ORIG_RELAY_C +#define ZEND_ASSERT(c) assert(c) #else #define ZEND_FILE_LINE_D #define ZEND_FILE_LINE_DC @@ -238,6 +239,7 @@ char *alloca (); #define ZEND_FILE_LINE_EMPTY_CC #define ZEND_FILE_LINE_ORIG_RELAY_C #define ZEND_FILE_LINE_ORIG_RELAY_CC +#define ZEND_ASSERT(c) #endif /* ZEND_DEBUG */ #ifdef ZTS @@ -449,8 +451,6 @@ struct _zend_trait_precedence { zend_trait_method_reference *trait_method; zend_class_entry** exclude_from_classes; - - union _zend_function* function; }; typedef struct _zend_trait_precedence zend_trait_precedence; @@ -467,8 +467,6 @@ struct _zend_trait_alias { * modifiers to be set on trait method */ zend_uint modifiers; - - union _zend_function* function; }; typedef struct _zend_trait_alias zend_trait_alias; diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 45abcf61e..eec4ab0bb 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -2732,7 +2732,7 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca } else if (zend_hash_find(ftable, lmname, mlen+1, (void**)&fcc->function_handler) == SUCCESS) { retval = 1; if ((fcc->function_handler->op_array.fn_flags & ZEND_ACC_CHANGED) && - EG(scope) && + !strict_class && EG(scope) && instanceof_function(fcc->function_handler->common.scope, EG(scope) TSRMLS_CC)) { zend_function *priv_fbc; @@ -3708,6 +3708,8 @@ ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *na (*property)->value = value->value; if (Z_REFCOUNT_P(value) > 0) { zval_copy_ctor(*property); + } else { + efree(value); } } else { zval *garbage = *property; diff --git a/Zend/zend_API.h b/Zend/zend_API.h index d7fbc3c3a..4a3985e0f 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index 155ae88b6..1cc2c6783 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_alloc.h b/Zend/zend_alloc.h index 6b071c289..0b4e74d89 100644 --- a/Zend/zend_alloc.h +++ b/Zend/zend_alloc.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_build.h b/Zend/zend_build.h index 042f50e80..152e1bd44 100644 --- a/Zend/zend_build.h +++ b/Zend/zend_build.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 698ef72e5..7bbb04785 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_builtin_functions.h b/Zend/zend_builtin_functions.h index a53bfb65a..e1af53637 100644 --- a/Zend/zend_builtin_functions.h +++ b/Zend/zend_builtin_functions.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index c7527b4ff..a37397543 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_closures.h b/Zend/zend_closures.h index c540b554c..c41cf4756 100644 --- a/Zend/zend_closures.h +++ b/Zend/zend_closures.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 2d2c284b7..101662cfe 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -179,6 +179,9 @@ void zend_init_compiler_context(TSRMLS_D) /* {{{ */ CG(context).literals_size = 0; CG(context).current_brk_cont = -1; CG(context).backpatch_count = 0; + CG(context).nested_calls = 0; + CG(context).used_stack = 0; + CG(context).in_finally = 0; CG(context).labels = NULL; } /* }}} */ @@ -219,6 +222,7 @@ ZEND_API void file_handle_dtor(zend_file_handle *fh) /* {{{ */ void init_compiler(TSRMLS_D) /* {{{ */ { CG(active_op_array) = NULL; + memset(&CG(context), 0, sizeof(CG(context))); zend_init_compiler_data_structures(TSRMLS_C); zend_init_rsrc_list(TSRMLS_C); zend_hash_init(&CG(filenames_table), 5, NULL, (dtor_func_t) free_estring, 0); @@ -284,7 +288,7 @@ ZEND_API zend_bool zend_is_compiling(TSRMLS_D) /* {{{ */ static zend_uint get_temporary_variable(zend_op_array *op_array) /* {{{ */ { - return (op_array->T)++ * ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)); + return (zend_uint)EX_TMP_VAR_NUM(0, (op_array->T)++); } /* }}} */ @@ -1949,6 +1953,9 @@ int zend_do_begin_function_call(znode *function_name, zend_bool check_namespace function_name->u.constant.value.str.val = 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) { + CG(active_op_array)->nested_calls = CG(context).nested_calls + 1; + } zend_do_extended_fcall_begin(TSRMLS_C); return 0; } @@ -1987,11 +1994,13 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC) /* {{{ */ GET_POLYMORPHIC_CACHE_SLOT(last_op->op2.constant); } last_op->opcode = ZEND_INIT_METHOD_CALL; - SET_UNUSED(last_op->result); + last_op->result_type = IS_UNUSED; + last_op->result.num = CG(context).nested_calls; Z_LVAL(left_bracket->u.constant) = ZEND_INIT_FCALL_BY_NAME; } else { zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); opline->opcode = ZEND_INIT_FCALL_BY_NAME; + opline->result.num = CG(context).nested_calls; SET_UNUSED(opline->op1); if (left_bracket->op_type == IS_CONST) { opline->op2_type = IS_CONST; @@ -2003,6 +2012,9 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC) /* {{{ */ } zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *)); + if (++CG(context).nested_calls > CG(active_op_array)->nested_calls) { + CG(active_op_array)->nested_calls = CG(context).nested_calls; + } zend_do_extended_fcall_begin(TSRMLS_C); } /* }}} */ @@ -2030,12 +2042,14 @@ void zend_do_begin_dynamic_function_call(znode *function_name, int ns_call TSRML /* In run-time PHP will check for function with full name and internal function with short name */ opline->opcode = ZEND_INIT_NS_FCALL_BY_NAME; + opline->result.num = CG(context).nested_calls; SET_UNUSED(opline->op1); opline->op2_type = IS_CONST; opline->op2.constant = zend_add_ns_func_name_literal(CG(active_op_array), &function_name->u.constant TSRMLS_CC); GET_CACHE_SLOT(opline->op2.constant); } else { opline->opcode = ZEND_INIT_FCALL_BY_NAME; + opline->result.num = CG(context).nested_calls; SET_UNUSED(opline->op1); if (function_name->op_type == IS_CONST) { opline->op2_type = IS_CONST; @@ -2047,6 +2061,9 @@ void zend_do_begin_dynamic_function_call(znode *function_name, int ns_call TSRML } zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *)); + if (++CG(context).nested_calls > CG(active_op_array)->nested_calls) { + CG(active_op_array)->nested_calls = CG(context).nested_calls; + } zend_do_extended_fcall_begin(TSRMLS_C); } /* }}} */ @@ -2394,6 +2411,7 @@ int zend_do_begin_class_member_function_call(znode *class_name, znode *method_na opline->extended_value = class_node.EA ; } opline->opcode = ZEND_INIT_STATIC_METHOD_CALL; + opline->result.num = CG(context).nested_calls; if (class_node.op_type == IS_CONST) { opline->op1_type = IS_CONST; opline->op1.constant = @@ -2415,6 +2433,9 @@ int zend_do_begin_class_member_function_call(znode *class_name, znode *method_na } zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *)); + if (++CG(context).nested_calls > CG(active_op_array)->nested_calls) { + CG(active_op_array)->nested_calls = CG(context).nested_calls; + } zend_do_extended_fcall_begin(TSRMLS_C); return 1; /* Dynamic */ } @@ -2435,21 +2456,29 @@ void zend_do_end_function_call(znode *function_name, znode *result, const znode if (!is_method && !is_dynamic_fcall && function_name->op_type==IS_CONST) { opline->opcode = ZEND_DO_FCALL; SET_NODE(opline->op1, function_name); + SET_UNUSED(opline->op2); + opline->op2.num = CG(context).nested_calls; CALCULATE_LITERAL_HASH(opline->op1.constant); GET_CACHE_SLOT(opline->op1.constant); } else { opline->opcode = ZEND_DO_FCALL_BY_NAME; SET_UNUSED(opline->op1); + SET_UNUSED(opline->op2); + opline->op2.num = --CG(context).nested_calls; } } opline->result.var = get_temporary_variable(CG(active_op_array)); opline->result_type = IS_VAR; - GET_NODE(result, opline->result) ; - SET_UNUSED(opline->op2); + GET_NODE(result, opline->result); zend_stack_del_top(&CG(function_call_stack)); opline->extended_value = Z_LVAL(argument_list->u.constant); + + if (CG(context).used_stack + 1 > CG(active_op_array)->used_stack) { + CG(active_op_array)->used_stack = CG(context).used_stack + 1; + } + CG(context).used_stack -= Z_LVAL(argument_list->u.constant); } /* }}} */ @@ -2557,6 +2586,10 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC) /* {{ SET_NODE(opline->op1, param); opline->op2.opline_num = offset; SET_UNUSED(opline->op2); + + if (++CG(context).used_stack > CG(active_op_array)->used_stack) { + CG(active_op_array)->used_stack = CG(context).used_stack; + } } /* }}} */ @@ -2639,6 +2672,13 @@ void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC) /* {{{ */ start_op_number++; } + if (CG(context).in_finally) { + opline = get_next_op(CG(active_op_array) TSRMLS_CC); + opline->opcode = ZEND_DISCARD_EXCEPTION; + SET_UNUSED(opline->op1); + SET_UNUSED(opline->op2); + } + opline = get_next_op(CG(active_op_array) TSRMLS_CC); opline->opcode = returns_reference ? ZEND_RETURN_BY_REF : ZEND_RETURN; @@ -2696,7 +2736,7 @@ void zend_do_yield(znode *result, znode *value, const znode *key, zend_bool is_v SET_UNUSED(opline->op2); } - opline->result_type = IS_VAR; + opline->result_type = IS_TMP_VAR; opline->result.var = get_temporary_variable(CG(active_op_array)); GET_NODE(result, opline->result); } @@ -2708,6 +2748,7 @@ static int zend_add_try_element(zend_uint try_op TSRMLS_DC) /* {{{ */ CG(active_op_array)->try_catch_array = erealloc(CG(active_op_array)->try_catch_array, sizeof(zend_try_catch_element)*CG(active_op_array)->last_try_catch); CG(active_op_array)->try_catch_array[try_catch_offset].try_op = try_op; + CG(active_op_array)->try_catch_array[try_catch_offset].catch_op = 0; CG(active_op_array)->try_catch_array[try_catch_offset].finally_op = 0; CG(active_op_array)->try_catch_array[try_catch_offset].finally_end = 0; return try_catch_offset; @@ -2769,9 +2810,27 @@ void zend_do_try(znode *try_token TSRMLS_DC) /* {{{ */ } /* }}} */ -void zend_do_finally(znode *finally_token TSRMLS_DC) /* {{{ */ { +void zend_do_finally(znode *finally_token TSRMLS_DC) /* {{{ */ +{ + zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); + finally_token->u.op.opline_num = get_next_op_number(CG(active_op_array)); -} /* }}} */ + /* call the the "finally" block */ + opline->opcode = ZEND_FAST_CALL; + SET_UNUSED(opline->op1); + opline->op1.opline_num = finally_token->u.op.opline_num + 1; + SET_UNUSED(opline->op2); + /* jump to code after the "finally" block, + * the actual jump address is going to be set in zend_do_end_finally() + */ + opline = get_next_op(CG(active_op_array) TSRMLS_CC); + opline->opcode = ZEND_JMP; + SET_UNUSED(opline->op1); + SET_UNUSED(opline->op2); + + CG(context).in_finally++; +} +/* }}} */ void zend_do_begin_catch(znode *catch_token, znode *class_name, znode *catch_var, znode *first_catch TSRMLS_DC) /* {{{ */ { @@ -2836,18 +2895,21 @@ void zend_do_end_finally(znode *try_token, znode* catch_token, znode *finally_to zend_error(E_COMPILE_ERROR, "Cannot use try without catch or finally"); } if (finally_token->op_type != IS_UNUSED) { - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - CG(active_op_array)->try_catch_array[try_token->u.op.opline_num].finally_op = finally_token->u.op.opline_num; + zend_op *opline; + + CG(active_op_array)->try_catch_array[try_token->u.op.opline_num].finally_op = finally_token->u.op.opline_num + 1; CG(active_op_array)->try_catch_array[try_token->u.op.opline_num].finally_end = get_next_op_number(CG(active_op_array)); CG(active_op_array)->has_finally_block = 1; - opline->opcode = ZEND_LEAVE; + opline = get_next_op(CG(active_op_array) TSRMLS_CC); + opline->opcode = ZEND_FAST_RET; SET_UNUSED(opline->op1); SET_UNUSED(opline->op2); + + CG(active_op_array)->opcodes[finally_token->u.op.opline_num].op1.opline_num = get_next_op_number(CG(active_op_array)); + + CG(context).in_finally--; } - if (catch_token->op_type == IS_UNUSED) { - CG(active_op_array)->try_catch_array[try_token->u.op.opline_num].catch_op = 0; - } } /* }}} */ @@ -3413,7 +3475,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"); } else if ((child_info->flags & ZEND_ACC_STATIC) == 0) { - Z_DELREF_P(ce->default_properties_table[parent_info->offset]); + zval_ptr_dtor(&(ce->default_properties_table[parent_info->offset])); ce->default_properties_table[parent_info->offset] = ce->default_properties_table[child_info->offset]; ce->default_properties_table[child_info->offset] = NULL; child_info->offset = parent_info->offset; @@ -3607,8 +3669,7 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent if (ce->ce_flags & ZEND_ACC_IMPLICIT_ABSTRACT_CLASS && ce->type == ZEND_INTERNAL_CLASS) { ce->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS; - } else if (!(ce->ce_flags & ZEND_ACC_IMPLEMENT_INTERFACES) - && !(ce->ce_flags & ZEND_ACC_IMPLEMENT_TRAITS)) { + } else if (!(ce->ce_flags & (ZEND_ACC_IMPLEMENT_INTERFACES|ZEND_ACC_IMPLEMENT_TRAITS))) { /* The verification will be done in runtime by ZEND_VERIFY_ABSTRACT_CLASS */ zend_verify_abstract_class(ce TSRMLS_CC); } @@ -3705,7 +3766,6 @@ ZEND_API void zend_do_implement_trait(zend_class_entry *ce, zend_class_entry *tr } } ce->traits[ce->num_traits++] = trait; - trait->refcount++; } } /* }}} */ @@ -3717,92 +3777,8 @@ static zend_bool zend_traits_method_compatibility_check(zend_function *fn, zend_ return zend_do_perform_implementation_check(fn, other_fn TSRMLS_CC) && zend_do_perform_implementation_check(other_fn, fn TSRMLS_CC) - && ((fn_flags & ZEND_ACC_FINAL) == (other_flags & ZEND_ACC_FINAL)) /* equal final qualifier */ - && ((fn_flags & ZEND_ACC_STATIC)== (other_flags & ZEND_ACC_STATIC)); /* equal static qualifier */ -} -/* }}} */ - -static int zend_traits_merge_functions(zend_function *fn TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ -{ - size_t current; - size_t i; - size_t count; - HashTable* resulting_table; - HashTable** function_tables; - zend_class_entry *ce; - size_t collision = 0; - size_t abstract_solved = 0; - zend_function* other_trait_fn; - - current = va_arg(args, size_t); /* index of current trait */ - count = va_arg(args, size_t); - resulting_table = va_arg(args, HashTable*); - function_tables = va_arg(args, HashTable**); - ce = va_arg(args, zend_class_entry*); - - for (i = 0; i < count; i++) { - if (i == current) { - continue; /* just skip this, cause its the table this function is applied on */ - } - - if (zend_hash_quick_find(function_tables[i], hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void **)&other_trait_fn) == SUCCESS) { - /* if it is an abstract method, there is no collision */ - if (other_trait_fn->common.fn_flags & ZEND_ACC_ABSTRACT) { - /* Make sure they are compatible */ - /* In case both are abstract, just check prototype, but need to do that in both directions */ - if (!zend_traits_method_compatibility_check(fn, other_trait_fn TSRMLS_CC)) { - zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", - zend_get_function_declaration(fn TSRMLS_CC), - zend_get_function_declaration(other_trait_fn TSRMLS_CC)); - } - - /* we can savely free and remove it from other table */ - zend_function_dtor(other_trait_fn); - zend_hash_quick_del(function_tables[i], hash_key->arKey, hash_key->nKeyLength, hash_key->h); - } else { - /* if it is not an abstract method, there is still no collision */ - /* if fn is an abstract method */ - if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) { - /* Make sure they are compatible. - Here, we already know other_trait_fn cannot be abstract, full check ok. */ - if (!zend_traits_method_compatibility_check(fn, other_trait_fn TSRMLS_CC)) { - zend_error(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", - zend_get_function_declaration(fn TSRMLS_CC), - zend_get_function_declaration(other_trait_fn TSRMLS_CC)); - } - - /* just mark as solved, will be added if its own trait is processed */ - abstract_solved = 1; - } else { - /* but else, we have a collision of non-abstract methods */ - collision++; - zend_function_dtor(other_trait_fn); - zend_hash_quick_del(function_tables[i], hash_key->arKey, hash_key->nKeyLength, hash_key->h); - } - } - } - } - - if (collision) { - zend_function* class_fn; - - /* make sure method is not already overridden in class */ - if (zend_hash_quick_find(&ce->function_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void **)&class_fn) == FAILURE - || class_fn->common.scope != ce) { - zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because there are collisions with other trait methods on %s", fn->common.function_name, ce->name); - } - - zend_function_dtor(fn); - } else if (abstract_solved) { - zend_function_dtor(fn); - } else { - /* Add it to result function table */ - if (zend_hash_quick_add(resulting_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, fn, sizeof(zend_function), NULL)==FAILURE) { - zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occurred during updating resulting trait method table", fn->common.function_name); - } - } - - return ZEND_HASH_APPLY_REMOVE; + && ((fn_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC)) == + (other_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC))); /* equal final and static qualifier */ } /* }}} */ @@ -3847,66 +3823,84 @@ static void zend_add_magic_methods(zend_class_entry* ce, const char* mname, uint } /* }}} */ -static int zend_traits_merge_functions_to_class(zend_function *fn TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ +static void zend_add_trait_method(zend_class_entry *ce, const char *name, const char *arKey, uint nKeyLength, zend_function *fn, HashTable **overriden TSRMLS_DC) /* {{{ */ { - zend_class_entry *ce = va_arg(args, zend_class_entry*); - zend_function* existing_fn = NULL; - zend_function fn_copy, *fn_copy_p; - zend_function* prototype = NULL; /* is used to determine the prototype according to the inheritance chain */ + zend_function *existing_fn = NULL; + ulong h = zend_hash_func(arKey, nKeyLength); - if (zend_hash_quick_find(&ce->function_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void**) &existing_fn) == FAILURE || - existing_fn->common.scope != ce) { - /* not found or inherited from other class or interface */ - zend_function* parent_function; - - if (ce->parent && zend_hash_quick_find(&ce->parent->function_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void**) &parent_function) != FAILURE) { - prototype = parent_function; /* ->common.fn_flags |= ZEND_ACC_ABSTRACT; */ - - /* we got that method in the parent class, and are going to override it, - except, if the trait is just asking to have an abstract method implemented. */ - if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) { - /* then we clean up an skip this method */ - zend_function_dtor(fn); - return ZEND_HASH_APPLY_REMOVE; + if (zend_hash_quick_find(&ce->function_table, arKey, nKeyLength, h, (void**) &existing_fn) == SUCCESS) { + if (existing_fn->common.scope == ce) { + /* members from the current class override trait methods */ + /* use temporary *overriden HashTable to detect hidden conflict */ + if (*overriden) { + if (zend_hash_quick_find(*overriden, arKey, nKeyLength, h, (void**) &existing_fn) == SUCCESS) { + 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_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_get_function_declaration(fn TSRMLS_CC), + zend_get_function_declaration(existing_fn TSRMLS_CC)); + } + return; + } + } + } else { + ALLOC_HASHTABLE(*overriden); + zend_hash_init_ex(*overriden, 2, NULL, NULL, 0, 0); } - } - - fn->common.scope = ce; - fn->common.prototype = prototype; - - if (prototype - && (prototype->common.fn_flags & ZEND_ACC_IMPLEMENTED_ABSTRACT - || prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) { - fn->common.fn_flags |= ZEND_ACC_IMPLEMENTED_ABSTRACT; - } else if (fn->common.fn_flags & ZEND_ACC_IMPLEMENTED_ABSTRACT) { - /* remove ZEND_ACC_IMPLEMENTED_ABSTRACT flag, think it shouldn't be copied to class */ - fn->common.fn_flags = fn->common.fn_flags - ZEND_ACC_IMPLEMENTED_ABSTRACT; - } - - /* check whether the trait method fullfills the inheritance requirements */ - if (prototype) { - do_inheritance_check_on_method(fn, prototype TSRMLS_CC); - } - - /* one more thing: make sure we properly implement an abstract method */ - if (existing_fn && existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) { - prototype = fn->common.prototype; + zend_hash_quick_update(*overriden, arKey, nKeyLength, h, fn, sizeof(zend_function), (void**)&fn); + return; + } 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_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_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 */ +#if 1 + zend_error(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", + fn->common.scope->name, fn->common.function_name, + ce->name, name, + existing_fn->common.scope->name, existing_fn->common.function_name); +#endif + } else { + /* inherited members are overridden by members inserted by traits */ + /* check whether the trait method fullfills the inheritance requirements */ do_inheritance_check_on_method(fn, existing_fn TSRMLS_CC); - fn->common.prototype = prototype; } + } - /* delete inherited fn if the function to be added is not abstract */ - if (existing_fn - && existing_fn->common.scope != ce - && (fn->common.fn_flags & ZEND_ACC_ABSTRACT) == 0) { - /* it is just a reference which was added to the subclass while doing - the inheritance, so we can deleted now, and will add the overriding - method afterwards. - Except, if we try to add an abstract function, then we should not - delete the inherited one */ - zend_hash_quick_del(&ce->function_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h); - } + function_add_ref(fn); + zend_hash_quick_update(&ce->function_table, arKey, nKeyLength, h, fn, sizeof(zend_function), (void**)&fn); + zend_add_magic_methods(ce, arKey, nKeyLength, fn TSRMLS_CC); +} +/* }}} */ +static int zend_fixup_trait_method(zend_function *fn, zend_class_entry *ce TSRMLS_DC) /* {{{ */ +{ + if ((fn->common.scope->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) { + + fn->common.scope = ce; if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) { ce->ce_flags |= ZEND_ACC_IMPLICIT_ABSTRACT_CLASS; @@ -3914,78 +3908,56 @@ static int zend_traits_merge_functions_to_class(zend_function *fn TSRMLS_DC, int if (fn->op_array.static_variables) { ce->ce_flags |= ZEND_HAS_STATIC_IN_METHODS; } - fn_copy = *fn; - function_add_ref(&fn_copy); - - if (zend_hash_quick_update(&ce->function_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, &fn_copy, sizeof(zend_function), (void**)&fn_copy_p)==FAILURE) { - zend_error(E_COMPILE_ERROR, "Trait method %s has not been applied, because failure occurred during updating class method table", hash_key->arKey); - } - - zend_add_magic_methods(ce, hash_key->arKey, hash_key->nKeyLength, fn_copy_p TSRMLS_CC); - - zend_function_dtor(fn); - } else { - zend_function_dtor(fn); } - - return ZEND_HASH_APPLY_REMOVE; + return ZEND_HASH_APPLY_KEEP; } /* }}} */ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ { - HashTable* target; - zend_trait_alias** aliases; - HashTable* exclude_table; - char* lcname; - unsigned int fnname_len; - zend_function fn_copy; - void* dummy; - size_t i = 0; - - target = va_arg(args, HashTable*); - aliases = va_arg(args, zend_trait_alias**); + zend_class_entry *ce; + HashTable **overriden; + zend_trait_alias *alias, **alias_ptr; + HashTable *exclude_table; + char *lcname; + unsigned int fnname_len; + zend_function fn_copy; + void *dummy; + + ce = va_arg(args, zend_class_entry*); + overriden = va_arg(args, HashTable**); exclude_table = va_arg(args, HashTable*); - + fnname_len = strlen(fn->common.function_name); /* apply aliases which are qualified with a class name, there should not be any ambiguity */ - if (aliases) { - while (aliases[i]) { + if (ce->trait_aliases) { + alias_ptr = ce->trait_aliases; + alias = *alias_ptr; + while (alias) { /* Scope unset or equal to the function we compare to, and the alias applies to fn */ - if (aliases[i]->alias != NULL - && (!aliases[i]->trait_method->ce || fn->common.scope == aliases[i]->trait_method->ce) - && aliases[i]->trait_method->mname_len == fnname_len - && (zend_binary_strcasecmp(aliases[i]->trait_method->method_name, aliases[i]->trait_method->mname_len, fn->common.function_name, fnname_len) == 0)) { + if (alias->alias != NULL + && (!alias->trait_method->ce || fn->common.scope == alias->trait_method->ce) + && alias->trait_method->mname_len == fnname_len + && (zend_binary_strcasecmp(alias->trait_method->method_name, alias->trait_method->mname_len, fn->common.function_name, fnname_len) == 0)) { fn_copy = *fn; - function_add_ref(&fn_copy); - /* this function_name is never destroyed, because ZEND_ACC_ALIAS - flag is set */ - fn_copy.common.function_name = aliases[i]->alias; - fn_copy.common.fn_flags |= ZEND_ACC_ALIAS; /* if it is 0, no modifieres has been changed */ - if (aliases[i]->modifiers) { - fn_copy.common.fn_flags = aliases[i]->modifiers | ZEND_ACC_ALIAS; - if (!(aliases[i]->modifiers & ZEND_ACC_PPP_MASK)) { - fn_copy.common.fn_flags |= ZEND_ACC_PUBLIC; - } - fn_copy.common.fn_flags |= fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK); + if (alias->modifiers) { + fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK)); } - lcname = zend_str_tolower_dup(aliases[i]->alias, aliases[i]->alias_len); - - if (zend_hash_add(target, lcname, aliases[i]->alias_len+1, &fn_copy, sizeof(zend_function), NULL)==FAILURE) { - zend_error(E_COMPILE_ERROR, "Failed to add aliased trait method (%s) to the trait table. There is probably already a trait method with the same name", fn_copy.common.function_name); - } + lcname = zend_str_tolower_dup(alias->alias, alias->alias_len); + zend_add_trait_method(ce, alias->alias, lcname, alias->alias_len+1, &fn_copy, overriden TSRMLS_CC); efree(lcname); - /** Record the trait from which this alias was resolved. */ - if (!aliases[i]->trait_method->ce) { - aliases[i]->trait_method->ce = fn->common.scope; + /* Record the trait from which this alias was resolved. */ + if (!alias->trait_method->ce) { + alias->trait_method->ce = fn->common.scope; } } - i++; + alias_ptr++; + alias = *alias_ptr; } } @@ -3994,38 +3966,31 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args, 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 */ fn_copy = *fn; - function_add_ref(&fn_copy); - fn_copy.common.fn_flags |= ZEND_ACC_ALIAS; - - /* apply aliases which are not qualified by a class name, or which have not - * alias name, just setting visibility */ - if (aliases) { - i = 0; - while (aliases[i]) { + + /* apply aliases which have not alias name, just setting visibility */ + if (ce->trait_aliases) { + alias_ptr = ce->trait_aliases; + alias = *alias_ptr; + while (alias) { /* Scope unset or equal to the function we compare to, and the alias applies to fn */ - if (aliases[i]->alias == NULL && aliases[i]->modifiers != 0 - && (!aliases[i]->trait_method->ce || fn->common.scope == aliases[i]->trait_method->ce) - && (aliases[i]->trait_method->mname_len == fnname_len) - && (zend_binary_strcasecmp(aliases[i]->trait_method->method_name, aliases[i]->trait_method->mname_len, fn->common.function_name, fnname_len) == 0)) { - fn_copy.common.fn_flags = aliases[i]->modifiers | ZEND_ACC_ALIAS; - - if (!(aliases[i]->modifiers & ZEND_ACC_PPP_MASK)) { - fn_copy.common.fn_flags |= ZEND_ACC_PUBLIC; - } - fn_copy.common.fn_flags |= fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK); + if (alias->alias == NULL && alias->modifiers != 0 + && (!alias->trait_method->ce || fn->common.scope == alias->trait_method->ce) + && (alias->trait_method->mname_len == fnname_len) + && (zend_binary_strcasecmp(alias->trait_method->method_name, alias->trait_method->mname_len, fn->common.function_name, fnname_len) == 0)) { + + fn_copy.common.fn_flags = alias->modifiers | (fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK)); /** Record the trait from which this alias was resolved. */ - if (!aliases[i]->trait_method->ce) { - aliases[i]->trait_method->ce = fn->common.scope; + if (!alias->trait_method->ce) { + alias->trait_method->ce = fn->common.scope; } } - i++; + alias_ptr++; + alias = *alias_ptr; } } - if (zend_hash_add(target, lcname, fnname_len+1, &fn_copy, sizeof(zend_function), NULL)==FAILURE) { - zend_error(E_COMPILE_ERROR, "Failed to add trait method (%s) to the trait table. There is probably already a trait method with the same name", fn_copy.common.function_name); - } + zend_add_trait_method(ce, fn->common.function_name, lcname, fnname_len+1, &fn_copy, overriden TSRMLS_CC); } efree(lcname); @@ -4034,10 +3999,16 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args, } /* }}} */ -/* Copies function table entries to target function table with applied aliasing */ -static void zend_traits_copy_trait_function_table(HashTable *target, HashTable *source, zend_trait_alias** aliases, HashTable* exclude_table TSRMLS_DC) /* {{{ */ +static void zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *trait TSRMLS_DC) /* {{{ */ { - zend_hash_apply_with_arguments(source TSRMLS_CC, (apply_func_args_t)zend_traits_copy_functions, 3, target, aliases, exclude_table); + zend_uint i; + + for (i = 0; i < ce->num_traits; i++) { + if (ce->traits[i] == trait) { + return; + } + } + zend_error(E_COMPILE_ERROR, "Trait %s is not used", trait->name); } /* }}} */ @@ -4060,6 +4031,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* 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_check_trait_usage(ce, cur_precedence->trait_method->ce TSRMLS_CC); /** Ensure that the prefered method is actually available. */ lcname = zend_str_tolower_dup(cur_method_ref->method_name, @@ -4088,8 +4060,9 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* 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_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]) { @@ -4118,6 +4091,7 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /* 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_check_trait_usage(ce, cur_method_ref->ce TSRMLS_CC); /** And, ensure that the referenced method is resolvable, too. */ lcname = zend_str_tolower_dup(cur_method_ref->method_name, @@ -4167,122 +4141,49 @@ static void zend_traits_compile_exclude_table(HashTable* exclude_table, zend_tra static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{ */ { - HashTable** function_tables; - HashTable* resulting_table; - HashTable exclude_table; - size_t i; + zend_uint i; + HashTable *overriden = NULL; - /* prepare copies of trait function tables for combination */ - function_tables = emalloc(sizeof(HashTable*) * ce->num_traits); - resulting_table = (HashTable *)emalloc(sizeof(HashTable)); - - /* TODO: revisit this start size, may be its not optimal */ - zend_hash_init_ex(resulting_table, 10, NULL, NULL, 0, 0); - for (i = 0; i < ce->num_traits; i++) { - function_tables[i] = (HashTable *)emalloc(sizeof(HashTable)); - zend_hash_init_ex(function_tables[i], ce->traits[i]->function_table.nNumOfElements, NULL, NULL, 1, 0); - if (ce->trait_precedences) { + HashTable exclude_table; + /* TODO: revisit this start size, may be its not optimal */ zend_hash_init_ex(&exclude_table, 2, NULL, NULL, 0, 0); zend_traits_compile_exclude_table(&exclude_table, ce->trait_precedences, ce->traits[i]); /* copies functions, applies defined aliasing, and excludes unused trait methods */ - zend_traits_copy_trait_function_table(function_tables[i], &ce->traits[i]->function_table, ce->trait_aliases, &exclude_table TSRMLS_CC); + zend_hash_apply_with_arguments(&ce->traits[i]->function_table TSRMLS_CC, (apply_func_args_t)zend_traits_copy_functions, 3, ce, &overriden, &exclude_table); + zend_hash_destroy(&exclude_table); } else { - zend_traits_copy_trait_function_table(function_tables[i], &ce->traits[i]->function_table, ce->trait_aliases, NULL TSRMLS_CC); + zend_hash_apply_with_arguments(&ce->traits[i]->function_table TSRMLS_CC, (apply_func_args_t)zend_traits_copy_functions, 3, ce, &overriden, NULL); } } - /* now merge trait methods */ - for (i = 0; i < ce->num_traits; i++) { - zend_hash_apply_with_arguments(function_tables[i] TSRMLS_CC, (apply_func_args_t)zend_traits_merge_functions, 5, i, ce->num_traits, resulting_table, function_tables, ce); - } - - /* Now the resulting_table contains all trait methods we would have to - * add to the class in the following step the methods are inserted into the method table - * if there is already a method with the same name it is replaced iff ce != fn.scope - * --> all inherited methods are overridden, methods defined in the class are left untouched - */ - zend_hash_apply_with_arguments(resulting_table TSRMLS_CC, (apply_func_args_t)zend_traits_merge_functions_to_class, 1, ce); - - /* free temporary function tables */ - for (i = 0; i < ce->num_traits; i++) { - /* zend_hash_destroy(function_tables[i]); */ - zend_hash_graceful_destroy(function_tables[i]); - efree(function_tables[i]); - } - efree(function_tables); + zend_hash_apply_with_argument(&ce->function_table, (apply_func_arg_t)zend_fixup_trait_method, ce TSRMLS_CC); - /* free temporary resulting table */ - /* zend_hash_destroy(resulting_table); */ - zend_hash_graceful_destroy(resulting_table); - efree(resulting_table); + if (overriden) { + zend_hash_destroy(overriden); + FREE_HASHTABLE(overriden); + } } /* }}} */ static zend_class_entry* find_first_definition(zend_class_entry *ce, size_t current_trait, const char* prop_name, int prop_name_length, ulong prop_hash, zend_class_entry *coliding_ce) /* {{{ */ { size_t i; - zend_property_info *coliding_prop; - for (i = 0; (i < current_trait) && (i < ce->num_traits); i++) { - if (zend_hash_quick_find(&ce->traits[i]->properties_info, prop_name, prop_name_length+1, prop_hash, (void **) &coliding_prop) == SUCCESS) { - return ce->traits[i]; - } - } - return coliding_ce; -} -/* }}} */ - -static void zend_traits_register_private_property(zend_class_entry *ce, const char *name, int name_len, zend_property_info *old_info, zval *property TSRMLS_DC) /* {{{ */ -{ - char *priv_name; - int priv_name_length; - const char *interned_name; - zend_property_info property_info; - ulong h = zend_get_hash_value(name, name_len+1); - property_info = *old_info; - - if (old_info->flags & ZEND_ACC_STATIC) { - property_info.offset = ce->default_static_members_count++; - ce->default_static_members_table = perealloc(ce->default_static_members_table, sizeof(zval*) * ce->default_static_members_count, ce->type == ZEND_INTERNAL_CLASS); - ce->default_static_members_table[property_info.offset] = property; - if (ce->type == ZEND_USER_CLASS) { - ce->static_members_table = ce->default_static_members_table; - } - } else { - property_info.offset = ce->default_properties_count++; - ce->default_properties_table = perealloc(ce->default_properties_table, sizeof(zval*) * ce->default_properties_count, ce->type == ZEND_INTERNAL_CLASS); - ce->default_properties_table[property_info.offset] = property; - } - - zend_mangle_property_name(&priv_name, &priv_name_length, ce->name, ce->name_length, name, name_len, ce->type & ZEND_INTERNAL_CLASS); - property_info.name = priv_name; - property_info.name_length = priv_name_length; - - interned_name = zend_new_interned_string(property_info.name, property_info.name_length+1, 0 TSRMLS_CC); - if (interned_name != property_info.name) { - if (ce->type == ZEND_USER_CLASS) { - efree((char*)property_info.name); - } else { - free((char*)property_info.name); + if (coliding_ce == ce) { + for (i = 0; i < current_trait; i++) { + if (zend_hash_quick_exists(&ce->traits[i]->properties_info, prop_name, prop_name_length+1, prop_hash)) { + return ce->traits[i]; + } } - property_info.name = interned_name; } - property_info.h = zend_get_hash_value(property_info.name, property_info.name_length+1); - - property_info.ce = ce; - - if (property_info.doc_comment) { - property_info.doc_comment = estrndup(property_info.doc_comment, property_info.doc_comment_len); - } - - zend_hash_quick_update(&ce->properties_info, name, name_len+1, h, &property_info, sizeof(zend_property_info), NULL); + return coliding_ce; } /* }}} */ @@ -4299,7 +4200,8 @@ static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* { zend_bool not_compatible; zval* prop_value; char* doc_comment; - + zend_uint flags; + /* In the following steps the properties are inserted into the property table * for that, a very strict approach is applied: * - check for compatibility, if not compatible with any property in class -> fatal @@ -4312,7 +4214,8 @@ static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* { /* first get the unmangeld name if necessary, * then check whether the property is already there */ - if ((property_info->flags & ZEND_ACC_PPP_MASK) == ZEND_ACC_PUBLIC) { + flags = property_info->flags; + if ((flags & ZEND_ACC_PPP_MASK) == ZEND_ACC_PUBLIC) { prop_hash = property_info->h; prop_name = property_info->name; prop_name_length = property_info->name_length; @@ -4326,61 +4229,50 @@ static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* { /* next: check for conflicts with current class */ if (zend_hash_quick_find(&ce->properties_info, prop_name, prop_name_length+1, prop_hash, (void **) &coliding_prop) == SUCCESS) { - if (coliding_prop->flags & ZEND_ACC_SHADOW) { - /* this one is inherited, lets look it up in its own class */ - zend_hash_quick_find(&coliding_prop->ce->properties_info, prop_name, prop_name_length+1, prop_hash, (void **) &coliding_prop); - if (coliding_prop->flags & ZEND_ACC_PRIVATE) { - /* private property, make the property_info.offset indenpended */ - if (property_info->flags & ZEND_ACC_STATIC) { - prop_value = ce->traits[i]->default_static_members_table[property_info->offset]; + if (coliding_prop->flags & ZEND_ACC_SHADOW) { + zend_hash_quick_del(&ce->properties_info, prop_name, prop_name_length+1, prop_hash); + flags |= ZEND_ACC_CHANGED; + } else { + if ((coliding_prop->flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC)) + == (flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC))) { + /* flags are identical, now the value needs to be checked */ + if (flags & ZEND_ACC_STATIC) { + not_compatible = (FAILURE == compare_function(&compare_result, + ce->default_static_members_table[coliding_prop->offset], + ce->traits[i]->default_static_members_table[property_info->offset] TSRMLS_CC)) + || (Z_LVAL(compare_result) != 0); } else { - prop_value = ce->traits[i]->default_properties_table[property_info->offset]; + not_compatible = (FAILURE == compare_function(&compare_result, + ce->default_properties_table[coliding_prop->offset], + ce->traits[i]->default_properties_table[property_info->offset] TSRMLS_CC)) + || (Z_LVAL(compare_result) != 0); } - Z_ADDREF_P(prop_value); - - zend_traits_register_private_property(ce, prop_name, prop_name_length, property_info, prop_value TSRMLS_CC); - continue; - } - } - - if ((coliding_prop->flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC)) - == (property_info->flags & (ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC))) { - /* flags are identical, now the value needs to be checked */ - if (property_info->flags & ZEND_ACC_STATIC) { - not_compatible = (FAILURE == compare_function(&compare_result, - ce->default_static_members_table[coliding_prop->offset], - ce->traits[i]->default_static_members_table[property_info->offset] TSRMLS_CC)) - || (Z_LVAL(compare_result) != 0); } else { - not_compatible = (FAILURE == compare_function(&compare_result, - ce->default_properties_table[coliding_prop->offset], - ce->traits[i]->default_properties_table[property_info->offset] TSRMLS_CC)) - || (Z_LVAL(compare_result) != 0); + /* the flags are not identical, thus, we assume properties are not compatible */ + not_compatible = 1; } - } else { - /* the flags are not identical, thus, we assume properties are not compatible */ - not_compatible = 1; - } - if (not_compatible) { - zend_error(E_COMPILE_ERROR, + if (not_compatible) { + zend_error(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, prop_name, ce->name); - } else { - zend_error(E_STRICT, + } else { + zend_error(E_STRICT, "%s and %s define the same property ($%s) in the composition of %s. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed", find_first_definition(ce, i, prop_name, prop_name_length, prop_hash, coliding_prop->ce)->name, property_info->ce->name, prop_name, ce->name); + continue; + } } } /* property not found, so lets add it */ - if (property_info->flags & ZEND_ACC_STATIC) { + if (flags & ZEND_ACC_STATIC) { prop_value = ce->traits[i]->default_static_members_table[property_info->offset]; } else { prop_value = ce->traits[i]->default_properties_table[property_info->offset]; @@ -4389,7 +4281,7 @@ static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* { doc_comment = property_info->doc_comment ? estrndup(property_info->doc_comment, property_info->doc_comment_len) : NULL; zend_declare_property_ex(ce, prop_name, prop_name_length, - prop_value, property_info->flags, + prop_value, flags, doc_comment, property_info->doc_comment_len TSRMLS_CC); } } @@ -4513,20 +4405,6 @@ ZEND_API int do_bind_function(const zend_op_array *op_array, zend_op *opline, Ha } /* }}} */ -void zend_add_trait_precedence(znode *precedence_znode TSRMLS_DC) /* {{{ */ -{ - zend_class_entry *ce = CG(active_class_entry); - zend_add_to_list(&ce->trait_precedences, precedence_znode->u.op.ptr TSRMLS_CC); -} -/* }}} */ - -void zend_add_trait_alias(znode *alias_znode TSRMLS_DC) /* {{{ */ -{ - zend_class_entry *ce = CG(active_class_entry); - zend_add_to_list(&ce->trait_aliases, alias_znode->u.op.ptr TSRMLS_CC); -} -/* }}} */ - void zend_prepare_reference(znode *result, znode *class_name, znode *method_name TSRMLS_DC) /* {{{ */ { zend_trait_method_reference *method_ref = emalloc(sizeof(zend_trait_method_reference)); @@ -4551,40 +4429,44 @@ void zend_prepare_reference(znode *result, znode *class_name, znode *method_name } /* }}} */ -void zend_prepare_trait_alias(znode *result, znode *method_reference, znode *modifiers, znode *alias TSRMLS_DC) /* {{{ */ +void zend_add_trait_alias(znode *method_reference, znode *modifiers, znode *alias TSRMLS_DC) /* {{{ */ { - zend_trait_alias *trait_alias = emalloc(sizeof(zend_trait_alias)); + zend_class_entry *ce = CG(active_class_entry); + zend_trait_alias *trait_alias; - trait_alias->trait_method = (zend_trait_method_reference*)method_reference->u.op.ptr; - trait_alias->modifiers = Z_LVAL(modifiers->u.constant); - if (Z_LVAL(modifiers->u.constant) == ZEND_ACC_STATIC) { zend_error(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"); + return; + } else if (Z_LVAL(modifiers->u.constant) == ZEND_ACC_FINAL) { + zend_error(E_COMPILE_ERROR, "Cannot use 'final' as method modifier"); + return; } + trait_alias = emalloc(sizeof(zend_trait_alias)); + trait_alias->trait_method = (zend_trait_method_reference*)method_reference->u.op.ptr; + trait_alias->modifiers = Z_LVAL(modifiers->u.constant); if (alias) { trait_alias->alias = Z_STRVAL(alias->u.constant); trait_alias->alias_len = Z_STRLEN(alias->u.constant); } else { trait_alias->alias = NULL; } - trait_alias->function = NULL; - - result->u.op.ptr = trait_alias; + zend_add_to_list(&ce->trait_aliases, trait_alias TSRMLS_CC); } /* }}} */ -void zend_prepare_trait_precedence(znode *result, znode *method_reference, znode *trait_list TSRMLS_DC) /* {{{ */ +void zend_add_trait_precedence(znode *method_reference, znode *trait_list TSRMLS_DC) /* {{{ */ { + zend_class_entry *ce = CG(active_class_entry); zend_trait_precedence *trait_precedence = emalloc(sizeof(zend_trait_precedence)); trait_precedence->trait_method = (zend_trait_method_reference*)method_reference->u.op.ptr; trait_precedence->exclude_from_classes = (zend_class_entry**) trait_list->u.op.ptr; - trait_precedence->function = NULL; - - result->u.op.ptr = trait_precedence; + zend_add_to_list(&ce->trait_precedences, trait_precedence TSRMLS_CC); } /* }}} */ @@ -4619,7 +4501,7 @@ ZEND_API zend_class_entry *do_bind_class(const zend_op_array* op_array, const ze } return NULL; } else { - if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_IMPLEMENT_INTERFACES))) { + if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_IMPLEMENT_INTERFACES|ZEND_ACC_IMPLEMENT_TRAITS))) { zend_verify_abstract_class(ce TSRMLS_CC); } return ce; @@ -5051,10 +4933,11 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name /* Prefix class name with name of current namespace */ znode tmp; + tmp.op_type = IS_CONST; tmp.u.constant = *CG(current_namespace); zval_copy_ctor(&tmp.u.constant); zend_do_build_namespace_name(&tmp, &tmp, class_name TSRMLS_CC); - class_name = &tmp; + *class_name = tmp; efree(lcname); lcname = zend_str_tolower_dup(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant)); } @@ -5187,9 +5070,9 @@ void zend_do_end_class_declaration(const znode *class_token, const znode *parent } if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) - && ((parent_token->op_type != IS_UNUSED) || (ce->num_interfaces > 0))) { + && (parent_token || (ce->num_interfaces > 0))) { zend_verify_abstract_class(ce TSRMLS_CC); - if (ce->num_interfaces) { + if (ce->num_interfaces && !(ce->ce_flags & ZEND_ACC_IMPLEMENT_TRAITS)) { do_verify_abstract_class(TSRMLS_C); } } @@ -5239,9 +5122,10 @@ void zend_do_implements_interface(znode *interface_name TSRMLS_DC) /* {{{ */ } /* }}} */ -void zend_do_implements_trait(znode *trait_name TSRMLS_DC) /* {{{ */ +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, "Cannot use traits inside of interfaces. %s is used in %s", @@ -5528,12 +5412,16 @@ void zend_do_begin_new_object(znode *new_token, znode *class_type TSRMLS_DC) /* new_token->u.op.opline_num = get_next_op_number(CG(active_op_array)); opline = get_next_op(CG(active_op_array) TSRMLS_CC); opline->opcode = ZEND_NEW; + opline->extended_value = CG(context).nested_calls; opline->result_type = IS_VAR; opline->result.var = get_temporary_variable(CG(active_op_array)); SET_NODE(opline->op1, class_type); SET_UNUSED(opline->op2); zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(unsigned char *)); + if (++CG(context).nested_calls > CG(active_op_array)->nested_calls) { + CG(active_op_array)->nested_calls = CG(context).nested_calls; + } } /* }}} */ @@ -5746,6 +5634,13 @@ void zend_do_shell_exec(znode *result, const znode *cmd TSRMLS_DC) /* {{{ */ opline->extended_value = 1; SET_UNUSED(opline->op2); GET_NODE(result, opline->result); + + if (CG(context).nested_calls + 1 > CG(active_op_array)->nested_calls) { + CG(active_op_array)->nested_calls = CG(context).nested_calls + 1; + } + if (CG(context).used_stack + 2 > CG(active_op_array)->used_stack) { + CG(active_op_array)->used_stack = CG(context).used_stack + 2; + } } /* }}} */ @@ -5971,7 +5866,11 @@ void zend_add_to_list(void *result, void *item TSRMLS_DC) /* {{{ */ void** list = *(void**)result; size_t n = 0; - while (list && list[n]) { n++; } + if (list) { + while (list[n]) { + n++; + } + } list = erealloc(list, sizeof(void*) * (n+2)); diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 77809dae5..d2ab0607b 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -59,6 +59,9 @@ typedef struct _zend_compiler_context { int literals_size; int current_brk_cont; int backpatch_count; + int nested_calls; + int used_stack; + int in_finally; HashTable *labels; } zend_compiler_context; @@ -210,8 +213,6 @@ typedef struct _zend_try_catch_element { #define ZEND_ACC_RETURN_REFERENCE 0x4000000 #define ZEND_ACC_DONE_PASS_TWO 0x8000000 -#define ZEND_ACC_ALIAS 0x10000000 - char *zend_visibility_string(zend_uint fn_flags); @@ -279,6 +280,9 @@ struct _zend_op_array { zend_uint T; + zend_uint nested_calls; + zend_uint used_stack; + zend_brk_cont_element *brk_cont_array; int last_brk_cont; @@ -369,15 +373,19 @@ typedef struct _list_llist_element { union _temp_variable; +typedef struct _call_slot { + zend_function *fbc; + zval *object; + zend_class_entry *called_scope; + zend_bool is_ctor_call; + zend_bool is_ctor_result_used; +} call_slot; + struct _zend_execute_data { struct _zend_op *opline; zend_function_state function_state; - zend_function *fbc; /* Function Being Called */ - zend_class_entry *called_scope; zend_op_array *op_array; zval *object; - union _temp_variable *Ts; - zval ***CVs; HashTable *symbol_table; struct _zend_execute_data *prev_execute_data; zval *old_error_reporting; @@ -386,13 +394,18 @@ struct _zend_execute_data { zend_class_entry *current_scope; zend_class_entry *current_called_scope; zval *current_this; - zval *current_object; - zend_uint leaving; - zend_uint leaving_dest; + struct _zend_op *fast_ret; /* used by FAST_CALL/FAST_RET (finally keyword) */ + call_slot *call_slots; + call_slot *call; }; #define EX(element) execute_data.element +#define EX_TMP_VAR(ex, n) ((temp_variable*)(((char*)(ex)) + ((int)(n)))) +#define EX_TMP_VAR_NUM(ex, n) (EX_TMP_VAR(ex, 0) - (1 + (n))) + +#define EX_CV_NUM(ex, n) (((zval***)(((char*)(ex))+ZEND_MM_ALIGNED_SIZE(sizeof(zend_execute_data))))+(n)) + #define IS_CONST (1<<0) #define IS_TMP_VAR (1<<1) @@ -519,16 +532,13 @@ ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry void zend_do_implements_interface(znode *interface_znode TSRMLS_DC); /* Trait related functions */ -void zend_add_trait_precedence(znode *precedence_znode TSRMLS_DC); -void zend_add_trait_alias(znode *alias_znode TSRMLS_DC); - +void zend_do_use_trait(znode *trait_znode TSRMLS_DC); +void zend_prepare_reference(znode *result, znode *class_name, znode *method_name TSRMLS_DC); +void zend_add_trait_precedence(znode *method_reference, znode *trait_list TSRMLS_DC); +void zend_add_trait_alias(znode *method_reference, znode *modifiers, znode *alias TSRMLS_DC); -void zend_do_implements_trait(znode *interface_znode /*, znode* aliases */ TSRMLS_DC); ZEND_API void zend_do_implement_trait(zend_class_entry *ce, zend_class_entry *trait TSRMLS_DC); ZEND_API void zend_do_bind_traits(zend_class_entry *ce TSRMLS_DC); -void zend_prepare_trait_precedence(znode *result, znode *method_reference, znode *trait_list TSRMLS_DC); -void zend_prepare_reference(znode *result, znode *class_name, znode *method_name TSRMLS_DC); -void zend_prepare_trait_alias(znode *result, znode *method_reference, znode *modifiers, znode *alias TSRMLS_DC); ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce TSRMLS_DC); void zend_do_early_binding(TSRMLS_D); @@ -826,6 +836,9 @@ 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_FAST_RET_TO_CATCH 1 +#define ZEND_FAST_RET_TO_FINALLY 2 + END_EXTERN_C() #define ZEND_CLONE_FUNC_NAME "__clone" diff --git a/Zend/zend_config.nw.h b/Zend/zend_config.nw.h index a6490a6cd..04f80bfe7 100644 --- a/Zend/zend_config.nw.h +++ b/Zend/zend_config.nw.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_config.w32.h b/Zend/zend_config.w32.h index 2c41e0da8..73bd0525b 100644 --- a/Zend/zend_config.w32.h +++ b/Zend/zend_config.w32.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c index 03b6309cc..21580d3d5 100644 --- a/Zend/zend_constants.c +++ b/Zend/zend_constants.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_constants.h b/Zend/zend_constants.h index af8ec56e8..c7261946c 100644 --- a/Zend/zend_constants.h +++ b/Zend/zend_constants.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_default_classes.c b/Zend/zend_default_classes.c index bcc43ea7d..46b00eac4 100644 --- a/Zend/zend_default_classes.c +++ b/Zend/zend_default_classes.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_dtrace.c b/Zend/zend_dtrace.c index 3d109deab..165172ad1 100644 --- a/Zend/zend_dtrace.c +++ b/Zend/zend_dtrace.c @@ -44,7 +44,7 @@ ZEND_API zend_op_array *dtrace_compile_file(zend_file_handle *file_handle, int t } /* We wrap the execute function to have fire the execute-entry/return and function-entry/return probes */ -ZEND_API void dtrace_execute(zend_op_array *op_array TSRMLS_DC) +ZEND_API void dtrace_execute_ex(zend_execute_data *execute_data TSRMLS_DC) { int lineno; char *scope, *filename, *funcname, *classname; @@ -72,7 +72,7 @@ ZEND_API void dtrace_execute(zend_op_array *op_array TSRMLS_DC) DTRACE_FUNCTION_ENTRY(funcname, filename, lineno, classname, scope); } - execute(op_array TSRMLS_CC); + execute_ex(execute_data TSRMLS_CC); if (DTRACE_FUNCTION_RETURN_ENABLED() && funcname != NULL) { DTRACE_FUNCTION_RETURN(funcname, filename, lineno, classname, scope); diff --git a/Zend/zend_dtrace.h b/Zend/zend_dtrace.h index 49388e562..26008afb6 100644 --- a/Zend/zend_dtrace.h +++ b/Zend/zend_dtrace.h @@ -35,7 +35,7 @@ ZEND_API void (*zend_dtrace_execute)(zend_op_array *op_array TSRMLS_DC); ZEND_API void (*zend_dtrace_execute_internal)(zend_execute_data *execute_data_ptr, zend_fcall_info *fci, int return_value_used TSRMLS_DC); ZEND_API zend_op_array *dtrace_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC); -ZEND_API void dtrace_execute(zend_op_array *op_array TSRMLS_DC); +ZEND_API void dtrace_execute_ex(zend_execute_data *execute_data TSRMLS_DC); ZEND_API void dtrace_execute_internal(zend_execute_data *execute_data_ptr, zend_fcall_info *fci, int return_value_used TSRMLS_DC); #include <zend_dtrace_gen.h> diff --git a/Zend/zend_dynamic_array.c b/Zend/zend_dynamic_array.c index 59511dddf..543479c43 100644 --- a/Zend/zend_dynamic_array.c +++ b/Zend/zend_dynamic_array.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_dynamic_array.h b/Zend/zend_dynamic_array.h index 1fcf50982..2c96f8543 100644 --- a/Zend/zend_dynamic_array.h +++ b/Zend/zend_dynamic_array.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_errors.h b/Zend/zend_errors.h index 1774a353b..a2cdc20a6 100644 --- a/Zend/zend_errors.h +++ b/Zend/zend_errors.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index 787e66bfe..f457b2846 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -350,9 +350,14 @@ ZEND_METHOD(error_exception, getSeverity) #define TRACE_APPEND_STR(val) \ TRACE_APPEND_STRL(val, sizeof(val)-1) -#define TRACE_APPEND_KEY(key) \ - if (zend_hash_find(ht, key, sizeof(key), (void**)&tmp) == SUCCESS) { \ - TRACE_APPEND_STRL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); \ +#define TRACE_APPEND_KEY(key) \ + if (zend_hash_find(ht, key, sizeof(key), (void**)&tmp) == SUCCESS) { \ + if (Z_TYPE_PP(tmp) != IS_STRING) { \ + zend_error(E_WARNING, "Value for %s is no string", key); \ + TRACE_APPEND_STR("[unknown]"); \ + } else { \ + TRACE_APPEND_STRL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); \ + } \ } /* }}} */ @@ -461,6 +466,11 @@ static int _build_trace_string(zval **frame TSRMLS_DC, int num_args, va_list arg HashTable *ht = Z_ARRVAL_PP(frame); zval **file, **tmp; + if (Z_TYPE_PP(frame) != IS_ARRAY) { + zend_error(E_WARNING, "Expected array for frame %lu", hash_key->h); + return ZEND_HASH_APPLY_KEEP; + } + str = va_arg(args, char**); len = va_arg(args, int*); num = va_arg(args, int*); @@ -470,15 +480,25 @@ static int _build_trace_string(zval **frame TSRMLS_DC, int num_args, va_list arg TRACE_APPEND_STRL(s_tmp, strlen(s_tmp)); efree(s_tmp); if (zend_hash_find(ht, "file", sizeof("file"), (void**)&file) == SUCCESS) { - if (zend_hash_find(ht, "line", sizeof("line"), (void**)&tmp) == SUCCESS) { - line = Z_LVAL_PP(tmp); - } else { - line = 0; + if (Z_TYPE_PP(file) != IS_STRING) { + zend_error(E_WARNING, "Function name is no string"); + TRACE_APPEND_STR("[unknown function]"); + } else{ + if (zend_hash_find(ht, "line", sizeof("line"), (void**)&tmp) == SUCCESS) { + if (Z_TYPE_PP(tmp) == IS_LONG) { + line = Z_LVAL_PP(tmp); + } else { + zend_error(E_WARNING, "Line is no long"); + line = 0; + } + } else { + line = 0; + } + s_tmp = emalloc(Z_STRLEN_PP(file) + MAX_LENGTH_OF_LONG + 4 + 1); + sprintf(s_tmp, "%s(%ld): ", Z_STRVAL_PP(file), line); + TRACE_APPEND_STRL(s_tmp, strlen(s_tmp)); + efree(s_tmp); } - s_tmp = emalloc(Z_STRLEN_PP(file) + MAX_LENGTH_OF_LONG + 4 + 1); - sprintf(s_tmp, "%s(%ld): ", Z_STRVAL_PP(file), line); - TRACE_APPEND_STRL(s_tmp, strlen(s_tmp)); - efree(s_tmp); } else { TRACE_APPEND_STR("[internal function]: "); } @@ -487,10 +507,14 @@ static int _build_trace_string(zval **frame TSRMLS_DC, int num_args, va_list arg TRACE_APPEND_KEY("function"); TRACE_APPEND_CHR('('); if (zend_hash_find(ht, "args", sizeof("args"), (void**)&tmp) == SUCCESS) { - int last_len = *len; - zend_hash_apply_with_arguments(Z_ARRVAL_PP(tmp) TSRMLS_CC, (apply_func_args_t)_build_trace_args, 2, str, len); - if (last_len != *len) { - *len -= 2; /* remove last ', ' */ + if (Z_TYPE_PP(tmp) == IS_ARRAY) { + int last_len = *len; + zend_hash_apply_with_arguments(Z_ARRVAL_PP(tmp) TSRMLS_CC, (apply_func_args_t)_build_trace_args, 2, str, len); + if (last_len != *len) { + *len -= 2; /* remove last ', ' */ + } + } else { + zend_error(E_WARNING, "args element is no array"); } } TRACE_APPEND_STR(")\n"); diff --git a/Zend/zend_exceptions.h b/Zend/zend_exceptions.h index a1a228868..82633530d 100644 --- a/Zend/zend_exceptions.h +++ b/Zend/zend_exceptions.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 361afc6f1..49a241d9a 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -50,10 +50,10 @@ typedef int (*incdec_t)(zval *); -#define get_zval_ptr(op_type, node, Ts, should_free, type) _get_zval_ptr(op_type, node, Ts, should_free, type TSRMLS_CC) -#define get_zval_ptr_ptr(op_type, node, Ts, should_free, type) _get_zval_ptr_ptr(op_type, node, Ts, should_free, type TSRMLS_CC) -#define get_obj_zval_ptr(op_type, node, Ts, should_free, type) _get_obj_zval_ptr(op_type, node, Ts, should_free, type TSRMLS_CC) -#define get_obj_zval_ptr_ptr(op_type, node, Ts, should_free, type) _get_obj_zval_ptr_ptr(op_type, node, Ts, should_free, type TSRMLS_CC) +#define get_zval_ptr(op_type, node, ex, should_free, type) _get_zval_ptr(op_type, node, ex, should_free, type TSRMLS_CC) +#define get_zval_ptr_ptr(op_type, node, ex, should_free, type) _get_zval_ptr_ptr(op_type, node, ex, should_free, type TSRMLS_CC) +#define get_obj_zval_ptr(op_type, node, ex, should_free, type) _get_obj_zval_ptr(op_type, node, ex, should_free, type TSRMLS_CC) +#define get_obj_zval_ptr_ptr(op_type, node, ex, should_free, type) _get_obj_zval_ptr_ptr(op_type, node, ex, should_free, type TSRMLS_CC) /* Prototypes */ static void zend_extension_statement_handler(const zend_extension *extension, zend_op_array *op_array TSRMLS_DC); @@ -62,8 +62,8 @@ static void zend_extension_fcall_end_handler(const zend_extension *extension, ze #define RETURN_VALUE_USED(opline) (!((opline)->result_type & EXT_TYPE_UNUSED)) -#define T(offset) (*(temp_variable *)((char *) Ts + offset)) -#define CV(var) CVs[var] +#define EX_T(offset) (*EX_TMP_VAR(execute_data, offset)) +#define EX_CV(var) (*EX_CV_NUM(execute_data, var)) #define TEMP_VAR_STACK_LIMIT 2000 @@ -86,11 +86,10 @@ static zend_always_inline void zend_pzval_unlock_func(zval *z, zend_free_op *sho static zend_always_inline void zend_pzval_unlock_free_func(zval *z TSRMLS_DC) { if (!Z_DELREF_P(z)) { - if (z != &EG(uninitialized_zval)) { - GC_REMOVE_ZVAL_FROM_BUFFER(z); - zval_dtor(z); - efree(z); - } + ZEND_ASSERT(z != &EG(uninitialized_zval)); + GC_REMOVE_ZVAL_FROM_BUFFER(z); + zval_dtor(z); + efree(z); } } @@ -154,7 +153,6 @@ static zend_always_inline void zend_pzval_unlock_free_func(zval *z TSRMLS_DC) /* End of zend_execute_locks.h */ -#define CV_OF(i) (EG(current_execute_data)->CVs[i]) #define CV_DEF_OF(i) (EG(active_op_array)->vars[i]) #define CTOR_CALL_BIT 0x1 @@ -168,19 +166,22 @@ static zend_always_inline void zend_pzval_unlock_free_func(zval *z TSRMLS_DC) #define DECODE_CTOR(ce) \ ((zend_class_entry*)(((zend_uintptr_t)(ce)) & ~(CTOR_CALL_BIT|CTOR_USED_BIT))) -ZEND_API zval** zend_get_compiled_variable_value(const zend_execute_data *execute_data_ptr, zend_uint var) +#undef EX +#define EX(element) execute_data->element + +ZEND_API zval** zend_get_compiled_variable_value(const zend_execute_data *execute_data, zend_uint var) { - return execute_data_ptr->CVs[var]; + return EX_CV(var); } -static zend_always_inline zval *_get_zval_ptr_tmp(zend_uint var, const temp_variable *Ts, zend_free_op *should_free TSRMLS_DC) +static zend_always_inline zval *_get_zval_ptr_tmp(zend_uint var, const zend_execute_data *execute_data, zend_free_op *should_free TSRMLS_DC) { - return should_free->var = &T(var).tmp_var; + return should_free->var = &EX_T(var).tmp_var; } -static zend_always_inline zval *_get_zval_ptr_var(zend_uint var, const temp_variable *Ts, zend_free_op *should_free TSRMLS_DC) +static zend_always_inline zval *_get_zval_ptr_var(zend_uint var, const zend_execute_data *execute_data, zend_free_op *should_free TSRMLS_DC) { - zval *ptr = T(var).var.ptr; + zval *ptr = EX_T(var).var.ptr; PZVAL_UNLOCK(ptr, should_free); return ptr; @@ -206,7 +207,7 @@ static zend_never_inline zval **_get_zval_cv_lookup(zval ***ptr, zend_uint var, case BP_VAR_W: Z_ADDREF(EG(uninitialized_zval)); if (!EG(active_symbol_table)) { - *ptr = (zval**)EG(current_execute_data)->CVs + (EG(active_op_array)->last_var + var); + *ptr = (zval**)EX_CV_NUM(EG(current_execute_data), EG(active_op_array)->last_var + var); **ptr = &EG(uninitialized_zval); } else { zend_hash_quick_update(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, &EG(uninitialized_zval_ptr), sizeof(zval *), (void **)ptr); @@ -258,7 +259,7 @@ static zend_never_inline zval **_get_zval_cv_lookup_BP_VAR_RW(zval ***ptr, zend_ if (!EG(active_symbol_table)) { Z_ADDREF(EG(uninitialized_zval)); - *ptr = (zval**)EG(current_execute_data)->CVs + (EG(active_op_array)->last_var + var); + *ptr = (zval**)EX_CV_NUM(EG(current_execute_data), EG(active_op_array)->last_var + var); **ptr = &EG(uninitialized_zval); zend_error(E_NOTICE, "Undefined variable: %s", cv->name); } else if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **)ptr)==FAILURE) { @@ -275,7 +276,7 @@ static zend_never_inline zval **_get_zval_cv_lookup_BP_VAR_W(zval ***ptr, zend_u if (!EG(active_symbol_table)) { Z_ADDREF(EG(uninitialized_zval)); - *ptr = (zval**)EG(current_execute_data)->CVs + (EG(active_op_array)->last_var + var); + *ptr = (zval**)EX_CV_NUM(EG(current_execute_data), EG(active_op_array)->last_var + var); **ptr = &EG(uninitialized_zval); } else if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **)ptr)==FAILURE) { Z_ADDREF(EG(uninitialized_zval)); @@ -286,7 +287,7 @@ static zend_never_inline zval **_get_zval_cv_lookup_BP_VAR_W(zval ***ptr, zend_u static zend_always_inline zval *_get_zval_ptr_cv(zend_uint var, int type TSRMLS_DC) { - zval ***ptr = &CV_OF(var); + zval ***ptr = EX_CV_NUM(EG(current_execute_data), var); if (UNEXPECTED(*ptr == NULL)) { return *_get_zval_cv_lookup(ptr, var, type TSRMLS_CC); @@ -294,9 +295,9 @@ static zend_always_inline zval *_get_zval_ptr_cv(zend_uint var, int type TSRMLS_ return **ptr; } -static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_R(zval ***CVs, zend_uint var TSRMLS_DC) +static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_R(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC) { - zval ***ptr = &CV(var); + zval ***ptr = EX_CV_NUM(execute_data, var); if (UNEXPECTED(*ptr == NULL)) { return *_get_zval_cv_lookup_BP_VAR_R(ptr, var TSRMLS_CC); @@ -304,9 +305,9 @@ static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_R(zval ***CVs, zend_uint return **ptr; } -static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_UNSET(zval ***CVs, zend_uint var TSRMLS_DC) +static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_UNSET(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC) { - zval ***ptr = &CV(var); + zval ***ptr = EX_CV_NUM(execute_data, var); if (UNEXPECTED(*ptr == NULL)) { return *_get_zval_cv_lookup_BP_VAR_UNSET(ptr, var TSRMLS_CC); @@ -314,9 +315,9 @@ static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_UNSET(zval ***CVs, zend_ return **ptr; } -static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_IS(zval ***CVs, zend_uint var TSRMLS_DC) +static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_IS(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC) { - zval ***ptr = &CV(var); + zval ***ptr = EX_CV_NUM(execute_data, var); if (UNEXPECTED(*ptr == NULL)) { return *_get_zval_cv_lookup_BP_VAR_IS(ptr, var TSRMLS_CC); @@ -324,9 +325,9 @@ static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_IS(zval ***CVs, zend_uin return **ptr; } -static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_RW(zval ***CVs, zend_uint var TSRMLS_DC) +static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_RW(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC) { - zval ***ptr = &CV(var); + zval ***ptr = EX_CV_NUM(execute_data, var); if (UNEXPECTED(*ptr == NULL)) { return *_get_zval_cv_lookup_BP_VAR_RW(ptr, var TSRMLS_CC); @@ -334,9 +335,9 @@ static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_RW(zval ***CVs, zend_uin return **ptr; } -static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_W(zval ***CVs, zend_uint var TSRMLS_DC) +static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_W(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC) { - zval ***ptr = &CV(var); + zval ***ptr = EX_CV_NUM(execute_data, var); if (UNEXPECTED(*ptr == NULL)) { return *_get_zval_cv_lookup_BP_VAR_W(ptr, var TSRMLS_CC); @@ -344,7 +345,7 @@ static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_W(zval ***CVs, zend_uint return **ptr; } -static inline zval *_get_zval_ptr(int op_type, const znode_op *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC) +static inline zval *_get_zval_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC) { /* should_free->is_var = 0; */ switch (op_type) { @@ -353,11 +354,11 @@ static inline zval *_get_zval_ptr(int op_type, const znode_op *node, const temp_ return node->zv; break; case IS_TMP_VAR: - should_free->var = TMP_FREE(&T(node->var).tmp_var); - return &T(node->var).tmp_var; + should_free->var = TMP_FREE(&EX_T(node->var).tmp_var); + return &EX_T(node->var).tmp_var; break; case IS_VAR: - return _get_zval_ptr_var(node->var, Ts, should_free TSRMLS_CC); + return _get_zval_ptr_var(node->var, execute_data, should_free TSRMLS_CC); break; case IS_UNUSED: should_free->var = 0; @@ -372,22 +373,22 @@ static inline zval *_get_zval_ptr(int op_type, const znode_op *node, const temp_ return NULL; } -static zend_always_inline zval **_get_zval_ptr_ptr_var(zend_uint var, const temp_variable *Ts, zend_free_op *should_free TSRMLS_DC) +static zend_always_inline zval **_get_zval_ptr_ptr_var(zend_uint var, const zend_execute_data *execute_data, zend_free_op *should_free TSRMLS_DC) { - zval** ptr_ptr = T(var).var.ptr_ptr; + zval** ptr_ptr = EX_T(var).var.ptr_ptr; if (EXPECTED(ptr_ptr != NULL)) { PZVAL_UNLOCK(*ptr_ptr, should_free); } else { /* string offset */ - PZVAL_UNLOCK(T(var).str_offset.str, should_free); + PZVAL_UNLOCK(EX_T(var).str_offset.str, should_free); } return ptr_ptr; } static zend_always_inline zval **_get_zval_ptr_ptr_cv(zend_uint var, int type TSRMLS_DC) { - zval ***ptr = &CV_OF(var); + zval ***ptr = EX_CV_NUM(EG(current_execute_data), var); if (UNEXPECTED(*ptr == NULL)) { return _get_zval_cv_lookup(ptr, var, type TSRMLS_CC); @@ -395,9 +396,9 @@ static zend_always_inline zval **_get_zval_ptr_ptr_cv(zend_uint var, int type TS return *ptr; } -static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_R(zval ***CVs, zend_uint var TSRMLS_DC) +static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_R(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC) { - zval ***ptr = &CV(var); + zval ***ptr = EX_CV_NUM(execute_data, var); if (UNEXPECTED(*ptr == NULL)) { return _get_zval_cv_lookup_BP_VAR_R(ptr, var TSRMLS_CC); @@ -405,9 +406,9 @@ static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_R(zval ***CVs, zend return *ptr; } -static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_UNSET(zval ***CVs, zend_uint var TSRMLS_DC) +static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_UNSET(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC) { - zval ***ptr = &CV(var); + zval ***ptr = EX_CV_NUM(execute_data, var); if (UNEXPECTED(*ptr == NULL)) { return _get_zval_cv_lookup_BP_VAR_UNSET(ptr, var TSRMLS_CC); @@ -415,9 +416,9 @@ static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_UNSET(zval ***CVs, return *ptr; } -static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_IS(zval ***CVs, zend_uint var TSRMLS_DC) +static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_IS(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC) { - zval ***ptr = &CV(var); + zval ***ptr = EX_CV_NUM(execute_data, var); if (UNEXPECTED(*ptr == NULL)) { return _get_zval_cv_lookup_BP_VAR_IS(ptr, var TSRMLS_CC); @@ -425,9 +426,9 @@ static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_IS(zval ***CVs, zen return *ptr; } -static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_RW(zval ***CVs, zend_uint var TSRMLS_DC) +static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_RW(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC) { - zval ***ptr = &CV(var); + zval ***ptr = EX_CV_NUM(execute_data, var); if (UNEXPECTED(*ptr == NULL)) { return _get_zval_cv_lookup_BP_VAR_RW(ptr, var TSRMLS_CC); @@ -435,9 +436,9 @@ static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_RW(zval ***CVs, zen return *ptr; } -static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_W(zval ***CVs, zend_uint var TSRMLS_DC) +static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_W(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC) { - zval ***ptr = &CV(var); + zval ***ptr = EX_CV_NUM(execute_data, var); if (UNEXPECTED(*ptr == NULL)) { return _get_zval_cv_lookup_BP_VAR_W(ptr, var TSRMLS_CC); @@ -445,13 +446,13 @@ static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_W(zval ***CVs, zend return *ptr; } -static inline zval **_get_zval_ptr_ptr(int op_type, const znode_op *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC) +static inline zval **_get_zval_ptr_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC) { if (op_type == IS_CV) { should_free->var = 0; return _get_zval_ptr_ptr_cv(node->var, type TSRMLS_CC); } else if (op_type == IS_VAR) { - return _get_zval_ptr_ptr_var(node->var, Ts, should_free TSRMLS_CC); + return _get_zval_ptr_ptr_var(node->var, execute_data, should_free TSRMLS_CC); } else { should_free->var = 0; return NULL; @@ -468,7 +469,7 @@ static zend_always_inline zval *_get_obj_zval_ptr_unused(TSRMLS_D) } } -static inline zval **_get_obj_zval_ptr_ptr(int op_type, const znode_op *op, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC) +static inline zval **_get_obj_zval_ptr_ptr(int op_type, const znode_op *op, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC) { if (op_type == IS_UNUSED) { if (EXPECTED(EG(This) != NULL)) { @@ -480,7 +481,7 @@ static inline zval **_get_obj_zval_ptr_ptr(int op_type, const znode_op *op, cons zend_error_noreturn(E_ERROR, "Using $this when not in object context"); } } - return get_zval_ptr_ptr(op_type, op, Ts, should_free, type); + return get_zval_ptr_ptr(op_type, op, execute_data, should_free, type); } static zend_always_inline zval **_get_obj_zval_ptr_ptr_unused(TSRMLS_D) @@ -493,7 +494,7 @@ static zend_always_inline zval **_get_obj_zval_ptr_ptr_unused(TSRMLS_D) } } -static inline zval *_get_obj_zval_ptr(int op_type, znode_op *op, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC) +static inline zval *_get_obj_zval_ptr(int op_type, znode_op *op, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC) { if (op_type == IS_UNUSED) { if (EXPECTED(EG(This) != NULL)) { @@ -503,7 +504,7 @@ static inline zval *_get_obj_zval_ptr(int op_type, znode_op *op, const temp_vari zend_error_noreturn(E_ERROR, "Using $this when not in object context"); } } - return get_zval_ptr(op_type, op, Ts, should_free, type); + return get_zval_ptr(op_type, op, execute_data, should_free, type); } static void zend_assign_to_variable_reference(zval **variable_ptr_ptr, zval **value_ptr_ptr TSRMLS_DC) @@ -654,11 +655,11 @@ static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zva return 1; } -static inline void zend_assign_to_object(zval **retval, zval **object_ptr, zval *property_name, int value_type, znode_op *value_op, const temp_variable *Ts, int opcode, const zend_literal *key TSRMLS_DC) +static inline void zend_assign_to_object(zval **retval, zval **object_ptr, zval *property_name, int value_type, znode_op *value_op, const zend_execute_data *execute_data, int opcode, const zend_literal *key TSRMLS_DC) { zval *object = *object_ptr; zend_free_op free_value; - zval *value = get_zval_ptr(value_type, value_op, Ts, &free_value, BP_VAR_R); + zval *value = get_zval_ptr(value_type, value_op, execute_data, &free_value, BP_VAR_R); if (Z_TYPE_P(object) != IS_OBJECT) { if (object == &EG(error_zval)) { @@ -1410,7 +1411,7 @@ static void zend_fetch_property_address(temp_variable *result, zval **container_ } } -static inline zend_brk_cont_element* zend_brk_cont(int nest_levels, int array_offset, const zend_op_array *op_array, const temp_variable *Ts TSRMLS_DC) +static inline zend_brk_cont_element* zend_brk_cont(int nest_levels, int array_offset, const zend_op_array *op_array, const zend_execute_data *execute_data TSRMLS_DC) { int original_nest_levels = nest_levels; zend_brk_cont_element *jmp_to; @@ -1426,12 +1427,12 @@ static inline zend_brk_cont_element* zend_brk_cont(int nest_levels, int array_of switch (brk_opline->opcode) { case ZEND_SWITCH_FREE: if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) { - zval_ptr_dtor(&T(brk_opline->op1.var).var.ptr); + zval_ptr_dtor(&EX_T(brk_opline->op1.var).var.ptr); } break; case ZEND_FREE: if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) { - zendi_zval_dtor(T(brk_opline->op1.var).tmp_var); + zendi_zval_dtor(EX_T(brk_opline->op1.var).tmp_var); } break; } @@ -1482,13 +1483,206 @@ ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, zend_fcall_i *fci->retval_ptr_ptr, fci->retval_ptr_ptr, fci->object_ptr, 1 TSRMLS_CC); } else { - zval **return_value_ptr = &(*(temp_variable *)((char *) execute_data_ptr->Ts + execute_data_ptr->opline->result.var)).var.ptr; + 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); } } +void zend_clean_and_cache_symbol_table(HashTable *symbol_table TSRMLS_DC) /* {{{ */ +{ + if (EG(symtable_cache_ptr) >= EG(symtable_cache_limit)) { + zend_hash_destroy(symbol_table); + FREE_HASHTABLE(symbol_table); + } else { + /* clean before putting into the cache, since clean + could call dtors, which could use cached hash */ + zend_hash_clean(symbol_table); + *(++EG(symtable_cache_ptr)) = symbol_table; + } +} +/* }}} */ + +static zend_always_inline void i_free_compiled_variables(zend_execute_data *execute_data) /* {{{ */ +{ + zval ***cv = EX_CV_NUM(execute_data, 0); + zval ***end = cv + EX(op_array)->last_var; + while (cv != end) { + if (*cv) { + zval_ptr_dtor(*cv); + } + cv++; + } +} +/* }}} */ + +void zend_free_compiled_variables(zend_execute_data *execute_data) /* {{{ */ +{ + i_free_compiled_variables(execute_data); +} +/* }}} */ + +/* + * Stack Frame Layout (the whole stack frame is allocated at once) + * ================== + * + * +========================================+ + * | zend_execute_data |<---+ + * | EX(function_state).arguments |--+ | + * | ... | | | + * | ARGUMENT [1] | | | + * | ... | | | + * | ARGUMENT [ARGS_NUMBER] | | | + * | ARGS_NUMBER |<-+ | + * +========================================+ | + * | + * +========================================+ | + * | TMP_VAR[op_arrat->T-1] | | + * | ... | | + * EX_TMP_VAR_NUM(0) ----> | TMP_VAR[0] | | + * +----------------------------------------+ | + * EG(current_execute_data) -> | zend_execute_data | | + * | EX(prev_execute_data) |----+ + * +----------------------------------------+ + * EX_CV_NUM(0) ---------> | CV[0] |--+ + * | ... | | + * | CV[op_array->last_var-1] | | + * +----------------------------------------+ | + * | Optional slot for CV[0] zval* |<-+ + * | ... | + * | ...for CV [op_array->last_var-1] zval* | + * +----------------------------------------+ + * EX(call_slots) -> | CALL_SLOT[0] | + * | ... | + * | CALL_SLOT[op_array->nested_calls-1] | + * +----------------------------------------+ + * zend_vm_stack_frame_base -> | ARGUMENTS STACK [0] | + * | ... | + * zend_vm_stack_top --------> | ... | + * | ... | + * | ARGUMENTS STACK [op_array->used_stack] | + * +----------------------------------------+ + */ + +static zend_always_inline zend_execute_data *i_create_execute_data_from_op_array(zend_op_array *op_array, zend_bool nested TSRMLS_DC) /* {{{ */ +{ + zend_execute_data *execute_data; + + /* + * When allocating the execute_data, memory for compiled variables and + * temporary variables is also allocated before and after the actual + * zend_execute_data struct. In addition we also allocate space to store + * information about syntactically nested called functions and actual + * parameters. op_array->last_var specifies the number of compiled + * variables and op_array->T is the number of temporary variables. If there + * is no symbol table, then twice as much memory is allocated for compiled + * variables. In that case the first half contains zval**s and the second + * half the actual zval*s (which would otherwise be in the symbol table). + */ + size_t execute_data_size = ZEND_MM_ALIGNED_SIZE(sizeof(zend_execute_data)); + size_t CVs_size = ZEND_MM_ALIGNED_SIZE(sizeof(zval **) * op_array->last_var * (EG(active_symbol_table) ? 1 : 2)); + size_t Ts_size = ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * op_array->T; + size_t call_slots_size = ZEND_MM_ALIGNED_SIZE(sizeof(call_slot)) * op_array->nested_calls; + size_t stack_size = ZEND_MM_ALIGNED_SIZE(sizeof(zval*)) * op_array->used_stack; + size_t total_size = execute_data_size + Ts_size + CVs_size + call_slots_size + stack_size; + + /* + * Normally the execute_data is allocated on the VM stack (because it does + * not actually do any allocation and thus is faster). For generators + * though this behavior would be suboptimal, because the (rather large) + * structure would have to be copied back and forth every time execution is + * suspended or resumed. That's why for generators the execution context + * is allocated using a separate VM stack, thus allowing to save and + * restore it simply by replacing a pointer. The same segment also keeps + * a copy of previous execute_data and passed parameters. + */ + if (UNEXPECTED((op_array->fn_flags & ZEND_ACC_GENERATOR) != 0)) { + /* Prepend the regular stack frame with a copy of prev_execute_data + * and the passed arguments + */ + int args_count = zend_vm_stack_get_args_count_ex(EG(current_execute_data)); + size_t args_size = ZEND_MM_ALIGNED_SIZE(sizeof(zval*)) * (args_count + 1); + + total_size += args_size + execute_data_size; + + EG(argument_stack) = zend_vm_stack_new_page((total_size + (sizeof(void*) - 1)) / sizeof(void*)); + EG(argument_stack)->prev = NULL; + execute_data = (zend_execute_data*)((char*)ZEND_VM_STACK_ELEMETS(EG(argument_stack)) + args_size + execute_data_size + Ts_size); + + /* copy prev_execute_data */ + EX(prev_execute_data) = (zend_execute_data*)((char*)ZEND_VM_STACK_ELEMETS(EG(argument_stack)) + args_size); + memset(EX(prev_execute_data), 0, sizeof(zend_execute_data)); + EX(prev_execute_data)->function_state.function = (zend_function*)op_array; + EX(prev_execute_data)->function_state.arguments = (void**)((char*)ZEND_VM_STACK_ELEMETS(EG(argument_stack)) + ZEND_MM_ALIGNED_SIZE(sizeof(zval*)) * args_count); + + /* copy arguments */ + *EX(prev_execute_data)->function_state.arguments = (void*)(zend_uintptr_t)args_count; + if (args_count > 0) { + zval **arg_src = (zval**)zend_vm_stack_get_arg_ex(EG(current_execute_data), 1); + zval **arg_dst = (zval**)zend_vm_stack_get_arg_ex(EX(prev_execute_data), 1); + int i; + + for (i = 0; i < args_count; i++) { + arg_dst[i] = arg_src[i]; + Z_ADDREF_P(arg_dst[i]); + } + } + } else { + execute_data = zend_vm_stack_alloc(total_size TSRMLS_CC); + execute_data = (zend_execute_data*)((char*)execute_data + Ts_size); + EX(prev_execute_data) = EG(current_execute_data); + } + + memset(EX_CV_NUM(execute_data, 0), 0, sizeof(zval **) * op_array->last_var); + + EX(call_slots) = (call_slot*)((char *)execute_data + execute_data_size + CVs_size); + + + EX(op_array) = op_array; + + EG(argument_stack)->top = zend_vm_stack_frame_base(execute_data); + + EX(object) = NULL; + EX(current_this) = NULL; + EX(old_error_reporting) = NULL; + EX(symbol_table) = EG(active_symbol_table); + EX(call) = NULL; + EG(current_execute_data) = execute_data; + EX(nested) = nested; + + if (!op_array->run_time_cache && op_array->last_cache_slot) { + op_array->run_time_cache = ecalloc(op_array->last_cache_slot, sizeof(void*)); + } + + if (op_array->this_var != -1 && EG(This)) { + Z_ADDREF_P(EG(This)); /* For $this pointer */ + if (!EG(active_symbol_table)) { + EX_CV(op_array->this_var) = (zval **) EX_CV_NUM(execute_data, op_array->last_var + op_array->this_var); + *EX_CV(op_array->this_var) = EG(This); + } else { + if (zend_hash_add(EG(active_symbol_table), "this", sizeof("this"), &EG(This), sizeof(zval *), (void **) EX_CV_NUM(execute_data, op_array->this_var))==FAILURE) { + Z_DELREF_P(EG(This)); + } + } + } + + EX(opline) = UNEXPECTED((op_array->fn_flags & ZEND_ACC_INTERACTIVE) != 0) && EG(start_op) ? EG(start_op) : op_array->opcodes; + EG(opline_ptr) = &EX(opline); + + EX(function_state).function = (zend_function *) op_array; + EX(function_state).arguments = NULL; + + return execute_data; +} +/* }}} */ + +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); +} +/* }}} */ + #define ZEND_VM_NEXT_OPCODE() \ CHECK_SYMBOL_TABLES() \ ZEND_VM_INC_OPCODE(); \ @@ -1537,58 +1731,14 @@ ZEND_API user_opcode_handler_t zend_get_user_opcode_handler(zend_uchar opcode) return zend_user_opcode_handlers[opcode]; } -ZEND_API zval *zend_get_zval_ptr(int op_type, const znode_op *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC) { - return get_zval_ptr(op_type, node, Ts, should_free, type); +ZEND_API zval *zend_get_zval_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC) { + return get_zval_ptr(op_type, node, execute_data, should_free, type); } -ZEND_API zval **zend_get_zval_ptr_ptr(int op_type, const znode_op *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC) { - return get_zval_ptr_ptr(op_type, node, Ts, should_free, type); +ZEND_API zval **zend_get_zval_ptr_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC) { + return get_zval_ptr_ptr(op_type, node, execute_data, should_free, type); } -void zend_clean_and_cache_symbol_table(HashTable *symbol_table TSRMLS_DC) /* {{{ */ -{ - if (EG(symtable_cache_ptr) >= EG(symtable_cache_limit)) { - zend_hash_destroy(symbol_table); - FREE_HASHTABLE(symbol_table); - } else { - /* clean before putting into the cache, since clean - could call dtors, which could use cached hash */ - zend_hash_clean(symbol_table); - *(++EG(symtable_cache_ptr)) = symbol_table; - } -} -/* }}} */ - -void zend_free_compiled_variables(zval ***CVs, int num) /* {{{ */ -{ - int i; - for (i = 0; i < num; ++i) { - if (CVs[i]) { - zval_ptr_dtor(CVs[i]); - } - } -} -/* }}} */ - -void** zend_copy_arguments(void **arguments_end) /* {{{ */ -{ - int arguments_count = (int) (zend_uintptr_t) *arguments_end; - size_t arguments_size = (arguments_count + 1) * sizeof(void **); - void **arguments_start = arguments_end - arguments_count; - void **copied_arguments_start = emalloc(arguments_size); - void **copied_arguments_end = copied_arguments_start + arguments_count; - int i; - - memcpy(copied_arguments_start, arguments_start, arguments_size); - - for (i = 0; i < arguments_count; i++) { - Z_ADDREF_P((zval *) arguments_start[i]); - } - - return copied_arguments_end; -} -/* }}} */ - /* * Local variables: * tab-width: 4 diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index 4594eba9e..a17f10b31 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -50,26 +50,17 @@ typedef union _temp_variable { BEGIN_EXTERN_C() struct _zend_fcall_info; -ZEND_API extern void (*zend_execute)(zend_op_array *op_array TSRMLS_DC); +ZEND_API extern void (*zend_execute_ex)(zend_execute_data *execute_data TSRMLS_DC); ZEND_API extern void (*zend_execute_internal)(zend_execute_data *execute_data_ptr, struct _zend_fcall_info *fci, int return_value_used TSRMLS_DC); 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 void execute(zend_op_array *op_array 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); ZEND_API int zend_is_true(zval *op); -#define safe_free_zval_ptr(p) safe_free_zval_ptr_rel(p ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC) -static zend_always_inline void safe_free_zval_ptr_rel(zval *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) -{ - TSRMLS_FETCH(); - - if (p!=EG(uninitialized_zval_ptr)) { - FREE_ZVAL_REL(p); - } -} ZEND_API int zend_lookup_class(const char *name, int name_length, zend_class_entry ***ce TSRMLS_DC); ZEND_API int zend_lookup_class_ex(const char *name, int name_length, const zend_literal *key, int use_autoload, zend_class_entry ***ce TSRMLS_DC); ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name TSRMLS_DC); @@ -85,11 +76,10 @@ static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC) if (!Z_DELREF_P(zval_ptr)) { TSRMLS_FETCH(); - if (zval_ptr != &EG(uninitialized_zval)) { - GC_REMOVE_ZVAL_FROM_BUFFER(zval_ptr); - zval_dtor(zval_ptr); - efree_rel(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 { TSRMLS_FETCH(); @@ -222,12 +212,6 @@ static zend_always_inline void **zend_vm_stack_top(TSRMLS_D) static zend_always_inline void zend_vm_stack_push(void *ptr TSRMLS_DC) { - ZEND_VM_STACK_GROW_IF_NEEDED(1); - *(EG(argument_stack)->top++) = ptr; -} - -static zend_always_inline void zend_vm_stack_push_nocheck(void *ptr TSRMLS_DC) -{ *(EG(argument_stack)->top++) = ptr; } @@ -235,11 +219,6 @@ static zend_always_inline void *zend_vm_stack_pop(TSRMLS_D) { void *el = *(--EG(argument_stack)->top); - if (UNEXPECTED(EG(argument_stack)->top == ZEND_VM_STACK_ELEMETS(EG(argument_stack)))) { - zend_vm_stack p = EG(argument_stack); - EG(argument_stack) = p->prev; - efree(p); - } return el; } @@ -272,6 +251,12 @@ static zend_always_inline void *zend_vm_stack_alloc(size_t size TSRMLS_DC) return ret; } +static zend_always_inline void** zend_vm_stack_frame_base(zend_execute_data *ex) +{ + return (void**)((char*)ex->call_slots + + ZEND_MM_ALIGNED_SIZE(sizeof(call_slot)) * ex->op_array->nested_calls); +} + static zend_always_inline void zend_vm_stack_free_int(void *ptr TSRMLS_DC) { if (UNEXPECTED(ZEND_VM_STACK_ELEMETS(EG(argument_stack)) == (void**)ptr)) { @@ -302,51 +287,36 @@ static zend_always_inline void zend_vm_stack_free(void *ptr TSRMLS_DC) } } -static zend_always_inline void** zend_vm_stack_push_args(int count TSRMLS_DC) -{ - - if (UNEXPECTED(EG(argument_stack)->top - ZEND_VM_STACK_ELEMETS(EG(argument_stack)) < count) || - UNEXPECTED(EG(argument_stack)->top == EG(argument_stack)->end)) { - zend_vm_stack p = EG(argument_stack); - - zend_vm_stack_extend(count + 1 TSRMLS_CC); - - EG(argument_stack)->top += count; - *(EG(argument_stack)->top) = (void*)(zend_uintptr_t)count; - while (count-- > 0) { - void *data = *(--p->top); - - if (UNEXPECTED(p->top == ZEND_VM_STACK_ELEMETS(p))) { - zend_vm_stack r = p; - - EG(argument_stack)->prev = p->prev; - p = p->prev; - efree(r); - } - *(ZEND_VM_STACK_ELEMETS(EG(argument_stack)) + count) = data; - } - return EG(argument_stack)->top++; - } - *(EG(argument_stack)->top) = (void*)(zend_uintptr_t)count; - return EG(argument_stack)->top++; -} - -static zend_always_inline void zend_vm_stack_clear_multiple(TSRMLS_D) +static zend_always_inline void zend_vm_stack_clear_multiple(int nested TSRMLS_DC) { void **p = EG(argument_stack)->top - 1; - int delete_count = (int)(zend_uintptr_t) *p; + void **end = p - (int)(zend_uintptr_t)*p; - while (--delete_count>=0) { + while (p != end) { zval *q = *(zval **)(--p); *p = NULL; i_zval_ptr_dtor(q ZEND_FILE_LINE_CC); } - zend_vm_stack_free_int(p TSRMLS_CC); + if (nested) { + EG(argument_stack)->top = p; + } else { + zend_vm_stack_free_int(p TSRMLS_CC); + } } -static zend_always_inline zval** zend_vm_stack_get_arg(int requested_arg TSRMLS_DC) +static zend_always_inline int zend_vm_stack_get_args_count_ex(zend_execute_data *ex) { - void **p = EG(current_execute_data)->prev_execute_data->function_state.arguments; + if (ex) { + void **p = ex->function_state.arguments; + return (int)(zend_uintptr_t) *p; + } else { + return 0; + } +} + +static zend_always_inline zval** zend_vm_stack_get_arg_ex(zend_execute_data *ex, int requested_arg) +{ + void **p = ex->function_state.arguments; int arg_count = (int)(zend_uintptr_t) *p; if (UNEXPECTED(requested_arg > arg_count)) { @@ -355,25 +325,14 @@ static zend_always_inline zval** zend_vm_stack_get_arg(int requested_arg TSRMLS_ return (zval**)p - arg_count + requested_arg - 1; } -static zend_always_inline void zend_arg_types_stack_2_pop(zend_ptr_stack *stack, zval **object, zend_function **fbc) +static zend_always_inline int zend_vm_stack_get_args_count(TSRMLS_D) { - void *a, *b; - - zend_ptr_stack_2_pop(stack, &a, &b); - - *object = (zval *) a; - *fbc = (zend_function *) b; + return zend_vm_stack_get_args_count_ex(EG(current_execute_data)->prev_execute_data); } -static zend_always_inline void zend_arg_types_stack_3_pop(zend_ptr_stack *stack, zend_class_entry **called_scope, zval **object, zend_function **fbc) +static zend_always_inline zval** zend_vm_stack_get_arg(int requested_arg TSRMLS_DC) { - void *a, *b, *c; - - zend_ptr_stack_3_pop(stack, &a, &b, &c); - - *called_scope = (zend_class_entry *) a; - *object = (zval *) b; - *fbc = (zend_function *) c; + return zend_vm_stack_get_arg_ex(EG(current_execute_data)->prev_execute_data, requested_arg); } void execute_new_code(TSRMLS_D); @@ -429,14 +388,13 @@ typedef struct _zend_free_op { /* int is_var; */ } zend_free_op; -ZEND_API zval *zend_get_zval_ptr(int op_type, const znode_op *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC); -ZEND_API zval **zend_get_zval_ptr_ptr(int op_type, const znode_op *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC); +ZEND_API zval *zend_get_zval_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC); +ZEND_API zval **zend_get_zval_ptr_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC); 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(zval ***CVs, int num); -void **zend_copy_arguments(void **arguments_end); +void zend_free_compiled_variables(zend_execute_data *execute_data); #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 9787966f2..f099784a4 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -38,7 +38,7 @@ #include <sys/time.h> #endif -ZEND_API void (*zend_execute)(zend_op_array *op_array TSRMLS_DC); +ZEND_API void (*zend_execute_ex)(zend_execute_data *execute_data TSRMLS_DC); ZEND_API void (*zend_execute_internal)(zend_execute_data *execute_data_ptr, zend_fcall_info *fci, int return_value_used TSRMLS_DC); /* true globals */ @@ -137,7 +137,6 @@ void init_executor(TSRMLS_D) /* {{{ */ INIT_ZVAL(EG(error_zval)); EG(uninitialized_zval_ptr)=&EG(uninitialized_zval); EG(error_zval_ptr)=&EG(error_zval); - zend_ptr_stack_init(&EG(arg_types_stack)); /* destroys stack frame, therefore makes core dumps worthless */ #if 0&&ZEND_DEBUG original_sigsegv_handler = signal(SIGSEGV, zend_handle_sigsegv); @@ -293,10 +292,10 @@ void shutdown_executor(TSRMLS_D) /* {{{ */ } zend_end_try(); zend_try { - zend_vm_stack_destroy(TSRMLS_C); - zend_objects_store_free_object_storage(&EG(objects_store) TSRMLS_CC); + zend_vm_stack_destroy(TSRMLS_C); + /* Destroy all op arrays */ if (EG(full_tables_cleanup)) { zend_hash_reverse_apply(EG(function_table), (apply_func_t) clean_non_persistent_function_full TSRMLS_CC); @@ -324,7 +323,6 @@ void shutdown_executor(TSRMLS_D) /* {{{ */ zend_hash_destroy(&EG(included_files)); - zend_ptr_stack_destroy(&EG(arg_types_stack)); zend_stack_destroy(&EG(user_error_handlers_error_reporting)); zend_ptr_stack_destroy(&EG(user_error_handlers)); zend_ptr_stack_destroy(&EG(user_exception_handlers)); @@ -427,27 +425,7 @@ ZEND_API zend_bool zend_is_executing(TSRMLS_D) /* {{{ */ ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC) /* {{{ */ { -#if DEBUG_ZEND>=2 - printf("Reducing refcount for %x (%x): %d->%d\n", *zval_ptr, zval_ptr, Z_REFCOUNT_PP(zval_ptr), Z_REFCOUNT_PP(zval_ptr) - 1); -#endif - Z_DELREF_PP(zval_ptr); - if (Z_REFCOUNT_PP(zval_ptr) == 0) { - TSRMLS_FETCH(); - - if (*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_PP(zval_ptr) == 1) { - Z_UNSET_ISREF_PP(zval_ptr); - } - - GC_ZVAL_CHECK_POSSIBLE_ROOT(*zval_ptr); - } + i_zval_ptr_dtor(*zval_ptr ZEND_FILE_LINE_RELAY_CC); } /* }}} */ @@ -862,8 +840,8 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS !ARG_MAY_BE_SENT_BY_REF(EX(function_state).function, i + 1)) { if (i || UNEXPECTED(ZEND_VM_STACK_ELEMETS(EG(argument_stack)) == (EG(argument_stack)->top))) { /* hack to clean up the stack */ - zend_vm_stack_push_nocheck((void *) (zend_uintptr_t)i TSRMLS_CC); - zend_vm_stack_clear_multiple(TSRMLS_C); + zend_vm_stack_push((void *) (zend_uintptr_t)i TSRMLS_CC); + zend_vm_stack_clear_multiple(0 TSRMLS_CC); } zend_error(E_WARNING, "Parameter %d to %s%s%s() expected to be a reference, value given", @@ -899,11 +877,11 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS *param = **(fci->params[i]); INIT_PZVAL(param); } - zend_vm_stack_push_nocheck(param TSRMLS_CC); + zend_vm_stack_push(param TSRMLS_CC); } EX(function_state).arguments = zend_vm_stack_top(TSRMLS_C); - zend_vm_stack_push_nocheck((void*)(zend_uintptr_t)fci->param_count TSRMLS_CC); + zend_vm_stack_push((void*)(zend_uintptr_t)fci->param_count TSRMLS_CC); current_scope = EG(scope); EG(scope) = calling_scope; @@ -1017,7 +995,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS *fci->retval_ptr_ptr = NULL; } } - zend_vm_stack_clear_multiple(TSRMLS_C); + zend_vm_stack_clear_multiple(0 TSRMLS_CC); if (EG(This)) { zval_ptr_dtor(&EG(This)); @@ -1691,7 +1669,7 @@ ZEND_API void zend_reset_all_cv(HashTable *symbol_table TSRMLS_DC) /* {{{ */ for (ex = EG(current_execute_data); ex; ex = ex->prev_execute_data) { if (ex->op_array && ex->symbol_table == symbol_table) { for (i = 0; i < ex->op_array->last_var; i++) { - ex->CVs[i] = NULL; + *EX_CV_NUM(ex, i) = NULL; } } } @@ -1710,7 +1688,7 @@ ZEND_API void zend_delete_variable(zend_execute_data *ex, HashTable *ht, const c if (ex->op_array->vars[i].hash_value == hash_value && ex->op_array->vars[i].name_len == name_len && !memcmp(ex->op_array->vars[i].name, name, name_len)) { - ex->CVs[i] = NULL; + *EX_CV_NUM(ex, i) = NULL; break; } } @@ -1734,7 +1712,7 @@ ZEND_API int zend_delete_global_variable_ex(const char *name, int name_len, ulon ex->op_array->vars[i].name_len == name_len && !memcmp(ex->op_array->vars[i].name, name, name_len) ) { - ex->CVs[i] = NULL; + *EX_CV_NUM(ex, i) = NULL; break; } } @@ -1781,20 +1759,20 @@ ZEND_API void zend_rebuild_symbol_table(TSRMLS_D) /* {{{ */ ex->symbol_table = EG(active_symbol_table); if (ex->op_array->this_var != -1 && - !ex->CVs[ex->op_array->this_var] && + !*EX_CV_NUM(ex, ex->op_array->this_var) && EG(This)) { - ex->CVs[ex->op_array->this_var] = (zval**)ex->CVs + ex->op_array->last_var + ex->op_array->this_var; - *ex->CVs[ex->op_array->this_var] = EG(This); + *EX_CV_NUM(ex, ex->op_array->this_var) = (zval**)EX_CV_NUM(ex, ex->op_array->last_var + ex->op_array->this_var); + **EX_CV_NUM(ex, ex->op_array->this_var) = EG(This); } for (i = 0; i < ex->op_array->last_var; i++) { - if (ex->CVs[i]) { + if (*EX_CV_NUM(ex, i)) { zend_hash_quick_update(EG(active_symbol_table), ex->op_array->vars[i].name, ex->op_array->vars[i].name_len + 1, ex->op_array->vars[i].hash_value, - (void**)ex->CVs[i], + (void**)*EX_CV_NUM(ex, i), sizeof(zval*), - (void**)&ex->CVs[i]); + (void**)EX_CV_NUM(ex, i)); } } } diff --git a/Zend/zend_extensions.c b/Zend/zend_extensions.c index 5c66b4a30..2dd7cd4c5 100644 --- a/Zend/zend_extensions.c +++ b/Zend/zend_extensions.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_extensions.h b/Zend/zend_extensions.h index 703e03c3f..83cad7f38 100644 --- a/Zend/zend_extensions.h +++ b/Zend/zend_extensions.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -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 220121113 +#define ZEND_EXTENSION_API_NO 220121212 typedef struct _zend_extension_version_info { int zend_extension_api_no; diff --git a/Zend/zend_float.c b/Zend/zend_float.c index 75e42efd6..cd6fcf2a1 100644 --- a/Zend/zend_float.c +++ b/Zend/zend_float.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_float.h b/Zend/zend_float.h index bcde0bb0e..a17ad5658 100644 --- a/Zend/zend_float.h +++ b/Zend/zend_float.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_gc.c b/Zend/zend_gc.c index 84a99c169..7b83ddb54 100644 --- a/Zend/zend_gc.c +++ b/Zend/zend_gc.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -644,7 +644,8 @@ tail_call: struct _store_object *obj = &EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(pz)].bucket.obj; if (obj->buffered == (gc_root_buffer*)GC_WHITE) { - GC_SET_BLACK(obj->buffered); + /* PURPLE instead of BLACK to prevent buffering in nested gc calls */ + GC_SET_PURPLE(obj->buffered); if (EXPECTED(EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(pz)].valid && (get_gc = Z_OBJ_HANDLER_P(pz, get_gc)) != NULL)) { @@ -715,7 +716,8 @@ static void zobj_collect_white(zval *pz TSRMLS_DC) struct _store_object *obj = &EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(pz)].bucket.obj; if (obj->buffered == (gc_root_buffer*)GC_WHITE) { - GC_SET_BLACK(obj->buffered); + /* PURPLE instead of BLACK to prevent buffering in nested gc calls */ + GC_SET_PURPLE(obj->buffered); if (EXPECTED(EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(pz)].valid && (get_gc = Z_OBJ_HANDLER_P(pz, get_gc)) != NULL)) { diff --git a/Zend/zend_gc.h b/Zend/zend_gc.h index ba30b3aa3..a44303268 100644 --- a/Zend/zend_gc.h +++ b/Zend/zend_gc.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c index 87f0644e8..c6c18a707 100644 --- a/Zend/zend_generators.c +++ b/Zend/zend_generators.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -27,8 +27,18 @@ ZEND_API zend_class_entry *zend_ce_generator; static zend_object_handlers zend_generator_handlers; -void zend_generator_close(zend_generator *generator, zend_bool finished_execution TSRMLS_DC) /* {{{ */ +ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished_execution TSRMLS_DC) /* {{{ */ { + if (generator->value) { + zval_ptr_dtor(&generator->value); + generator->value = NULL; + } + + if (generator->key) { + zval_ptr_dtor(&generator->key); + generator->key = NULL; + } + if (generator->execute_data) { zend_execute_data *execute_data = generator->execute_data; zend_op_array *op_array = execute_data->op_array; @@ -36,7 +46,7 @@ void zend_generator_close(zend_generator *generator, zend_bool finished_executio if (!finished_execution) { if (op_array->has_finally_block) { /* -1 required because we want the last run opcode, not the - * next to-be-run one. */ + * next to-be-run one. */ zend_uint op_num = execute_data->opline - op_array->opcodes - 1; zend_uint finally_op_num = 0; @@ -60,7 +70,7 @@ void zend_generator_close(zend_generator *generator, zend_bool finished_executio * the resume. */ if (finally_op_num) { execute_data->opline = &op_array->opcodes[finally_op_num]; - execute_data->leaving = ZEND_RETURN; + execute_data->fast_ret = NULL; generator->flags |= ZEND_GENERATOR_FORCED_CLOSE; zend_generator_resume(generator TSRMLS_CC); return; @@ -69,7 +79,7 @@ void zend_generator_close(zend_generator *generator, zend_bool finished_executio } if (!execute_data->symbol_table) { - zend_free_compiled_variables(execute_data->CVs, op_array->last_var); + zend_free_compiled_variables(execute_data); } else { zend_clean_and_cache_symbol_table(execute_data->symbol_table TSRMLS_CC); } @@ -78,10 +88,6 @@ void zend_generator_close(zend_generator *generator, zend_bool finished_executio zval_ptr_dtor(&execute_data->current_this); } - if (execute_data->object) { - zval_ptr_dtor(&execute_data->object); - } - /* If the generator is closed before it can finish execution (reach * a return statement) we have to free loop variables manually, as * we don't know whether the SWITCH_FREE / FREE opcodes have run */ @@ -104,13 +110,13 @@ void zend_generator_close(zend_generator *generator, zend_bool finished_executio switch (brk_opline->opcode) { case ZEND_SWITCH_FREE: { - temp_variable *var = (temp_variable *) ((char *) execute_data->Ts + brk_opline->op1.var); + temp_variable *var = EX_TMP_VAR(execute_data, brk_opline->op1.var); zval_ptr_dtor(&var->var.ptr); } break; case ZEND_FREE: { - temp_variable *var = (temp_variable *) ((char *) execute_data->Ts + brk_opline->op1.var); + temp_variable *var = EX_TMP_VAR(execute_data, brk_opline->op1.var); zval_dtor(&var->tmp_var); } break; @@ -120,32 +126,20 @@ void zend_generator_close(zend_generator *generator, zend_bool finished_executio } /* Clear any backed up stack arguments */ - if (generator->backed_up_stack) { - zval **zvals = (zval **) generator->backed_up_stack; - size_t zval_num = generator->backed_up_stack_size / sizeof(zval *); - int i; - - for (i = 0; i < zval_num; i++) { - zval_ptr_dtor(&zvals[i]); + if (generator->stack != EG(argument_stack)) { + void **stack_frame = zend_vm_stack_frame_base(execute_data); + while (generator->stack->top != stack_frame) { + zval_ptr_dtor((zval**)stack_frame); + stack_frame++; } - - efree(generator->backed_up_stack); } - if (generator->backed_up_arg_types_stack) { - /* The arg types stack contains three elements per call: fbc, object - * and called_scope. Here we traverse the stack from top to bottom - * and dtor the object. */ - int i = generator->backed_up_arg_types_stack_count / 3; - while (i--) { - zval *object = (zval *) generator->backed_up_arg_types_stack[3*i + 1]; - if (object) { - zval_ptr_dtor(&object); - } + while (execute_data->call >= execute_data->call_slots) { + if (execute_data->call->object) { + zval_ptr_dtor(&execute_data->call->object); } - - efree(generator->backed_up_arg_types_stack); - } + execute_data->call--; + } /* We have added an additional stack frame in prev_execute_data, so we * have to free it. It also contains the arguments passed to the @@ -162,11 +156,7 @@ void zend_generator_close(zend_generator *generator, zend_bool finished_executio for (i = 0; i < arguments_count; ++i) { zval_ptr_dtor(arguments_start + i); } - - efree(arguments_start); } - - efree(prev_execute_data); } /* Free a clone of closure */ @@ -175,19 +165,13 @@ void zend_generator_close(zend_generator *generator, zend_bool finished_executio efree(op_array); } - efree(execute_data); + efree(generator->stack); + if (generator->stack == EG(argument_stack)) { + /* abnormal exit for running generator */ + EG(argument_stack) = NULL; + } generator->execute_data = NULL; } - - if (generator->value) { - zval_ptr_dtor(&generator->value); - generator->value = NULL; - } - - if (generator->key) { - zval_ptr_dtor(&generator->key); - generator->key = NULL; - } } /* }}} */ @@ -200,7 +184,7 @@ static void zend_generator_free_storage(zend_generator *generator TSRMLS_DC) /* } /* }}} */ -static void zend_generator_clone_storage(zend_generator *orig, zend_generator **clone_ptr) /* {{{ */ +static void zend_generator_clone_storage(zend_generator *orig, zend_generator **clone_ptr TSRMLS_DC) /* {{{ */ { zend_generator *clone = emalloc(sizeof(zend_generator)); memcpy(clone, orig, sizeof(zend_generator)); @@ -210,36 +194,49 @@ static void zend_generator_clone_storage(zend_generator *orig, zend_generator ** zend_execute_data *execute_data = orig->execute_data; zend_op_array *op_array = execute_data->op_array; HashTable *symbol_table = execute_data->symbol_table; - - /* Alloc separate execution context, as well as separate sections for - * compiled variables and temporary variables */ - size_t execute_data_size = ZEND_MM_ALIGNED_SIZE(sizeof(zend_execute_data)); - size_t CVs_size = ZEND_MM_ALIGNED_SIZE(sizeof(zval **) * op_array->last_var * (symbol_table ? 1 : 2)); - size_t Ts_size = ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * op_array->T; - size_t total_size = execute_data_size + CVs_size + Ts_size; - - clone->execute_data = emalloc(total_size); - - /* Copy the zend_execute_data struct */ - memcpy(clone->execute_data, execute_data, execute_data_size); - - /* Set the pointers to the memory segments for the compiled and - * temporary variables (which are located after the execute_data) */ - clone->execute_data->CVs = (zval ***) ((char *) clone->execute_data + execute_data_size); - clone->execute_data->Ts = (temp_variable *) ((char *) clone->execute_data->CVs + CVs_size); - - /* Zero out the compiled variables section */ - memset(clone->execute_data->CVs, 0, sizeof(zval **) * op_array->last_var); - + zend_execute_data *current_execute_data; + zend_op **opline_ptr; + HashTable *current_symbol_table; + zend_vm_stack current_stack; + zval *current_this; + void **stack_frame, **orig_stack_frame; + + /* Create new execution context. We have to back up and restore + * EG(current_execute_data), EG(opline_ptr), EG(active_symbol_table) + * and EG(This) here because the function modifies or uses them */ + current_execute_data = EG(current_execute_data); + EG(current_execute_data) = execute_data->prev_execute_data; + opline_ptr = EG(opline_ptr); + current_symbol_table = EG(active_symbol_table); + EG(active_symbol_table) = execute_data->symbol_table; + current_this = EG(This); + EG(This) = NULL; + current_stack = EG(argument_stack); + clone->execute_data = zend_create_execute_data_from_op_array(op_array, 0 TSRMLS_CC); + clone->stack = EG(argument_stack); + EG(argument_stack) = current_stack; + EG(This) = current_this; + EG(active_symbol_table) = current_symbol_table; + EG(current_execute_data) = current_execute_data; + EG(opline_ptr) = opline_ptr; + + /* copy */ + clone->execute_data->opline = execute_data->opline; + clone->execute_data->function_state = execute_data->function_state; + clone->execute_data->object = execute_data->object; + clone->execute_data->current_scope = execute_data->current_scope; + clone->execute_data->current_called_scope = execute_data->current_called_scope; + clone->execute_data->fast_ret = execute_data->fast_ret; + if (!symbol_table) { int i; /* Copy compiled variables */ for (i = 0; i < op_array->last_var; i++) { - if (execute_data->CVs[i]) { - clone->execute_data->CVs[i] = (zval **) clone->execute_data->CVs + op_array->last_var + i; - *clone->execute_data->CVs[i] = (zval *) orig->execute_data->CVs[op_array->last_var + i]; - Z_ADDREF_PP(clone->execute_data->CVs[i]); + if (*EX_CV_NUM(execute_data, i)) { + *EX_CV_NUM(clone->execute_data, i) = (zval **) EX_CV_NUM(clone->execute_data, op_array->last_var + i); + **EX_CV_NUM(clone->execute_data, i) = *(zval **) EX_CV_NUM(execute_data, op_array->last_var + i); + Z_ADDREF_PP(*EX_CV_NUM(clone->execute_data, i)); } } } else { @@ -252,15 +249,46 @@ static void zend_generator_clone_storage(zend_generator *orig, zend_generator ** { int i; for (i = 0; i < op_array->last_var; i++) { - if (zend_hash_quick_find(clone->execute_data->symbol_table, op_array->vars[i].name, op_array->vars[i].name_len + 1, op_array->vars[i].hash_value, (void **) &clone->execute_data->CVs[i]) == FAILURE) { - clone->execute_data->CVs[i] = NULL; + if (zend_hash_quick_find(clone->execute_data->symbol_table, op_array->vars[i].name, op_array->vars[i].name_len + 1, op_array->vars[i].hash_value, (void **) EX_CV_NUM(clone->execute_data, i)) == FAILURE) { + *EX_CV_NUM(clone->execute_data, i) = NULL; } } } } + /* Copy nested-calls stack */ + if (execute_data->call) { + clone->execute_data->call = clone->execute_data->call_slots + + (execute_data->call - execute_data->call_slots); + } else { + clone->execute_data->call = NULL; + } + memcpy(clone->execute_data->call_slots, execute_data->call_slots, ZEND_MM_ALIGNED_SIZE(sizeof(call_slot)) * op_array->nested_calls); + if (clone->execute_data->call >= clone->execute_data->call_slots) { + call_slot *call = clone->execute_data->call; + + while (call >= clone->execute_data->call_slots) { + if (call->object) { + Z_ADDREF_P(call->object); + } + call--; + } + } + /* Copy the temporary variables */ - memcpy(clone->execute_data->Ts, orig->execute_data->Ts, Ts_size); + memcpy(EX_TMP_VAR_NUM(clone->execute_data, op_array->T-1), EX_TMP_VAR_NUM(execute_data, op_array->T-1), ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * op_array->T); + + /* Copy arguments passed on stack */ + stack_frame = zend_vm_stack_frame_base(clone->execute_data); + orig_stack_frame = zend_vm_stack_frame_base(execute_data); + clone->stack->top = stack_frame + (orig->stack->top - orig_stack_frame); + if (clone->stack->top != stack_frame) { + memcpy(stack_frame, orig_stack_frame, ZEND_MM_ALIGNED_SIZE(sizeof(zval*)) * (orig->stack->top - orig_stack_frame)); + while (clone->stack->top != stack_frame) { + Z_ADDREF_PP((zval**)stack_frame); + stack_frame++; + } + } /* Add references to loop variables */ { @@ -278,7 +306,7 @@ static void zend_generator_clone_storage(zend_generator *orig, zend_generator ** zend_op *brk_opline = op_array->opcodes + brk_cont->brk; if (brk_opline->opcode == ZEND_SWITCH_FREE) { - temp_variable *var = (temp_variable *) ((char *) execute_data->Ts + brk_opline->op1.var); + temp_variable *var = EX_TMP_VAR(execute_data, brk_opline->op1.var); Z_ADDREF_P(var->var.ptr); } @@ -286,72 +314,19 @@ static void zend_generator_clone_storage(zend_generator *orig, zend_generator ** } } - if (orig->backed_up_stack) { - /* Copy backed up stack */ - clone->backed_up_stack = emalloc(orig->backed_up_stack_size); - memcpy(clone->backed_up_stack, orig->backed_up_stack, orig->backed_up_stack_size); - - /* Add refs to stack variables */ - { - zval **zvals = (zval **) orig->backed_up_stack; - size_t zval_num = orig->backed_up_stack_size / sizeof(zval *); - int i; - - for (i = 0; i < zval_num; i++) { - Z_ADDREF_P(zvals[i]); - } - } - } - - if (orig->backed_up_arg_types_stack) { - size_t stack_size = orig->backed_up_arg_types_stack_count * sizeof(void *); - - clone->backed_up_arg_types_stack = emalloc(stack_size); - memcpy(clone->backed_up_arg_types_stack, orig->backed_up_arg_types_stack, stack_size); - - /* We have to add refs to the objects in the arg types stack (the - * object is always the second element of a three-pack. */ - { - int i, stack_frames = clone->backed_up_arg_types_stack_count / 3; - for (i = 0; i < stack_frames; i++) { - zval *object = (zval *) clone->backed_up_arg_types_stack[3*i + 1]; - if (object) { - Z_ADDREF_P(object); - } - } - } - } - /* Update the send_target to use the temporary variable with the same * offset as the original generator, but in our temporary variable * memory segment. */ if (orig->send_target) { - size_t offset = (char *) orig->send_target - (char *) execute_data->Ts; - clone->send_target = (temp_variable *) ( - (char *) clone->execute_data->Ts + offset - ); - Z_ADDREF_P(clone->send_target->var.ptr); + size_t offset = (char *) orig->send_target - (char *)execute_data; + clone->send_target = EX_TMP_VAR(clone->execute_data, offset); + zval_copy_ctor(&clone->send_target->tmp_var); } if (execute_data->current_this) { + clone->execute_data->current_this = execute_data->current_this; Z_ADDREF_P(execute_data->current_this); } - - if (execute_data->object) { - Z_ADDREF_P(execute_data->object); - } - - /* Prev execute data contains an additional stack frame (for proper - * backtraces) which has to be copied. */ - clone->execute_data->prev_execute_data = emalloc(sizeof(zend_execute_data)); - memcpy(clone->execute_data->prev_execute_data, execute_data->prev_execute_data, sizeof(zend_execute_data)); - - /* It also contains the arguments passed to the generator, which also - * have to be copied */ - if (execute_data->prev_execute_data->function_state.arguments) { - clone->execute_data->prev_execute_data->function_state.arguments - = zend_copy_arguments(execute_data->prev_execute_data->function_state.arguments); - } } /* The value and key are known not to be references, so simply add refs */ @@ -393,13 +368,15 @@ static zend_object_value zend_generator_create(zend_class_entry *class_type TSRM /* Requires globals EG(scope), EG(current_scope), EG(This), * EG(active_symbol_table) and EG(current_execute_data). */ -zval *zend_generator_create_zval(zend_op_array *op_array TSRMLS_DC) /* {{{ */ +ZEND_API zval *zend_generator_create_zval(zend_op_array *op_array TSRMLS_DC) /* {{{ */ { zval *return_value; zend_generator *generator; zend_execute_data *current_execute_data; zend_op **opline_ptr; + HashTable *current_symbol_table; zend_execute_data *execute_data; + zend_vm_stack current_stack = EG(argument_stack); /* Create a clone of closure, because it may be destroyed */ if (op_array->fn_flags & ZEND_ACC_CLOSURE) { @@ -410,11 +387,14 @@ zval *zend_generator_create_zval(zend_op_array *op_array TSRMLS_DC) /* {{{ */ } /* Create new execution context. We have to back up and restore - * EG(current_execute_data) and EG(opline_ptr) here because the function - * modifies it. */ + * EG(current_execute_data), EG(opline_ptr) and EG(active_symbol_table) + * here because the function modifies or uses them */ current_execute_data = EG(current_execute_data); opline_ptr = EG(opline_ptr); + current_symbol_table = EG(active_symbol_table); + EG(active_symbol_table) = NULL; execute_data = zend_create_execute_data_from_op_array(op_array, 0 TSRMLS_CC); + EG(active_symbol_table) = current_symbol_table; EG(current_execute_data) = current_execute_data; EG(opline_ptr) = opline_ptr; @@ -434,18 +414,8 @@ zval *zend_generator_create_zval(zend_op_array *op_array TSRMLS_DC) /* {{{ */ /* Save execution context in generator object. */ generator = (zend_generator *) zend_object_store_get_object(return_value TSRMLS_CC); generator->execute_data = execute_data; - - /* We have to add another stack frame so the generator function shows - * up in backtraces and func_get_all() can access the function - * arguments. */ - execute_data->prev_execute_data = emalloc(sizeof(zend_execute_data)); - memset(execute_data->prev_execute_data, 0, sizeof(zend_execute_data)); - execute_data->prev_execute_data->function_state.function = (zend_function *) op_array; - if (EG(current_execute_data)) { - execute_data->prev_execute_data->function_state.arguments = zend_copy_arguments(EG(current_execute_data)->function_state.arguments); - } else { - execute_data->prev_execute_data->function_state.arguments = NULL; - } + generator->stack = EG(argument_stack); + EG(argument_stack) = current_stack; return return_value; } @@ -459,12 +429,8 @@ static zend_function *zend_generator_get_constructor(zval *object TSRMLS_DC) /* } /* }}} */ -void zend_generator_resume(zend_generator *generator TSRMLS_DC) /* {{{ */ +ZEND_API void zend_generator_resume(zend_generator *generator TSRMLS_DC) /* {{{ */ { - if (EG(exception)) { - return; - } - /* The generator is already closed, thus can't resume */ if (!generator->execute_data) { return; @@ -487,28 +453,7 @@ void zend_generator_resume(zend_generator *generator TSRMLS_DC) /* {{{ */ zval *original_This = EG(This); zend_class_entry *original_scope = EG(scope); zend_class_entry *original_called_scope = EG(called_scope); - int original_arg_types_stack_count = EG(arg_types_stack).top; - - /* Remember the current stack position so we can back up pushed args */ - generator->original_stack_top = zend_vm_stack_top(TSRMLS_C); - - /* If there is a backed up stack copy it to the VM stack */ - if (generator->backed_up_stack) { - void *stack = zend_vm_stack_alloc(generator->backed_up_stack_size TSRMLS_CC); - memcpy(stack, generator->backed_up_stack, generator->backed_up_stack_size); - efree(generator->backed_up_stack); - generator->backed_up_stack = NULL; - } - - if (generator->backed_up_arg_types_stack) { - zend_ptr_stack_push_from_memory( - &EG(arg_types_stack), - generator->backed_up_arg_types_stack_count, - generator->backed_up_arg_types_stack - ); - efree(generator->backed_up_arg_types_stack); - generator->backed_up_arg_types_stack = NULL; - } + zend_vm_stack original_stack = EG(argument_stack); /* We (mis)use the return_value_ptr_ptr to provide the generator object * to the executor, so YIELD will be able to set the yielded value */ @@ -522,6 +467,7 @@ void zend_generator_resume(zend_generator *generator TSRMLS_DC) /* {{{ */ EG(This) = generator->execute_data->current_this; EG(scope) = generator->execute_data->current_scope; EG(called_scope) = generator->execute_data->current_called_scope; + EG(argument_stack) = generator->stack; /* We want the backtrace to look as if the generator function was * called from whatever method we are current running (e.g. next()). @@ -533,7 +479,7 @@ void zend_generator_resume(zend_generator *generator TSRMLS_DC) /* {{{ */ /* Resume execution */ generator->flags |= ZEND_GENERATOR_CURRENTLY_RUNNING; - execute_ex(generator->execute_data TSRMLS_CC); + zend_execute_ex(generator->execute_data TSRMLS_CC); generator->flags &= ~ZEND_GENERATOR_CURRENTLY_RUNNING; /* Restore executor globals */ @@ -545,27 +491,7 @@ void zend_generator_resume(zend_generator *generator TSRMLS_DC) /* {{{ */ EG(This) = original_This; EG(scope) = original_scope; EG(called_scope) = original_called_scope; - - /* The stack top before and after the execution differ, i.e. there are - * arguments pushed to the stack. */ - if (generator->original_stack_top != zend_vm_stack_top(TSRMLS_C)) { - generator->backed_up_stack_size = (zend_vm_stack_top(TSRMLS_C) - generator->original_stack_top) * sizeof(void *); - generator->backed_up_stack = emalloc(generator->backed_up_stack_size); - memcpy(generator->backed_up_stack, generator->original_stack_top, generator->backed_up_stack_size); - zend_vm_stack_free(generator->original_stack_top TSRMLS_CC); - } - - if (original_arg_types_stack_count != EG(arg_types_stack).top) { - generator->backed_up_arg_types_stack_count = - EG(arg_types_stack).top - original_arg_types_stack_count; - - generator->backed_up_arg_types_stack = emalloc(generator->backed_up_arg_types_stack_count * sizeof(void *)); - zend_ptr_stack_pop_into_memory( - &EG(arg_types_stack), - generator->backed_up_arg_types_stack_count, - generator->backed_up_arg_types_stack - ); - } + EG(argument_stack) = original_stack; /* If an exception was thrown in the generator we have to internally * rethrow it in the parent scope. */ @@ -687,7 +613,7 @@ ZEND_METHOD(Generator, next) } /* }}} */ -/* {{{ proto mixed Generator::send() +/* {{{ proto mixed Generator::send(mixed $value) * Sends a value to the generator */ ZEND_METHOD(Generator, send) { @@ -707,13 +633,8 @@ ZEND_METHOD(Generator, send) return; } - /* The sent value was initialized to NULL, so dtor that */ - zval_ptr_dtor(&generator->send_target->var.ptr); - - /* Set new sent value */ - Z_ADDREF_P(value); - generator->send_target->var.ptr = value; - generator->send_target->var.ptr_ptr = &value; + /* Put sent value into the TMP_VAR slot */ + MAKE_COPY_ZVAL(&value, &generator->send_target->tmp_var); zend_generator_resume(generator TSRMLS_CC); @@ -723,6 +644,44 @@ ZEND_METHOD(Generator, send) } /* }}} */ +/* {{{ proto mixed Generator::throw(Exception $exception) + * Throws an exception into the generator */ +ZEND_METHOD(Generator, throw) +{ + zval *exception, *exception_copy; + zend_generator *generator; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &exception) == FAILURE) { + return; + } + + ALLOC_ZVAL(exception_copy); + MAKE_COPY_ZVAL(&exception, exception_copy); + + generator = (zend_generator *) zend_object_store_get_object(getThis() TSRMLS_CC); + + if (generator->execute_data) { + /* Throw the exception in the context of the generator */ + zend_execute_data *current_execute_data = EG(current_execute_data); + EG(current_execute_data) = generator->execute_data; + + zend_throw_exception_object(exception_copy TSRMLS_CC); + + EG(current_execute_data) = current_execute_data; + + zend_generator_resume(generator TSRMLS_CC); + + if (generator->value) { + RETURN_ZVAL(generator->value, 1, 0); + } + } else { + /* If the generator is already closed throw the exception in the + * current context */ + zend_throw_exception_object(exception_copy TSRMLS_CC); + } +} +/* }}} */ + /* {{{ proto void Generator::__wakeup() * Throws an Exception as generators can't be serialized */ ZEND_METHOD(Generator, __wakeup) @@ -741,21 +700,11 @@ ZEND_METHOD(Generator, __wakeup) /* get_iterator implementation */ -typedef struct _zend_generator_iterator { - zend_object_iterator intern; - - /* The generator object zval has to be stored, because the iterator is - * holding a ref to it, which has to be dtored. */ - zval *object; -} zend_generator_iterator; - static void zend_generator_iterator_dtor(zend_object_iterator *iterator TSRMLS_DC) /* {{{ */ { zval *object = ((zend_generator_iterator *) iterator)->object; zval_ptr_dtor(&object); - - efree(iterator); } /* }}} */ @@ -807,6 +756,7 @@ static int zend_generator_iterator_get_key(zend_object_iterator *iterator, char /* Waiting for Etienne's patch to allow arbitrary zval keys. Until then * error out on non-int and non-string keys. */ zend_error_noreturn(E_ERROR, "Currently only int and string keys can be yielded"); + return HASH_KEY_NON_EXISTANT; /* Nerver reached */ } /* }}} */ @@ -854,7 +804,7 @@ zend_object_iterator *zend_generator_get_iterator(zend_class_entry *ce, zval *ob return NULL; } - iterator = emalloc(sizeof(zend_generator_iterator)); + iterator = &generator->iterator; iterator->intern.funcs = &zend_generator_iterator_functions; iterator->intern.data = (void *) generator; @@ -874,6 +824,10 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_generator_send, 0, 0, 1) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_generator_throw, 0, 0, 1) + ZEND_ARG_INFO(0, exception) +ZEND_END_ARG_INFO() + static const zend_function_entry generator_functions[] = { ZEND_ME(Generator, rewind, arginfo_generator_void, ZEND_ACC_PUBLIC) ZEND_ME(Generator, valid, arginfo_generator_void, ZEND_ACC_PUBLIC) @@ -881,6 +835,7 @@ static const zend_function_entry generator_functions[] = { ZEND_ME(Generator, key, arginfo_generator_void, ZEND_ACC_PUBLIC) ZEND_ME(Generator, next, arginfo_generator_void, ZEND_ACC_PUBLIC) ZEND_ME(Generator, send, arginfo_generator_send, ZEND_ACC_PUBLIC) + ZEND_ME(Generator, throw, arginfo_generator_throw, ZEND_ACC_PUBLIC) ZEND_ME(Generator, __wakeup, arginfo_generator_void, ZEND_ACC_PUBLIC) ZEND_FE_END }; diff --git a/Zend/zend_generators.h b/Zend/zend_generators.h index 3dc3e6fec..9f37b93c4 100644 --- a/Zend/zend_generators.h +++ b/Zend/zend_generators.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -25,25 +25,24 @@ BEGIN_EXTERN_C() extern ZEND_API zend_class_entry *zend_ce_generator; END_EXTERN_C() +typedef struct _zend_generator_iterator { + zend_object_iterator intern; + + /* The generator object zval has to be stored, because the iterator is + * holding a ref to it, which has to be dtored. */ + zval *object; +} zend_generator_iterator; + typedef struct _zend_generator { zend_object std; + zend_generator_iterator iterator; + /* The suspended execution context. */ zend_execute_data *execute_data; - /* If the execution is suspended during a function call there may be - * arguments pushed to the stack, so it has to be backed up. */ - void *backed_up_stack; - size_t backed_up_stack_size; - - /* For method calls PHP also pushes various type information on a second - * stack, which also needs to be backed up. */ - void **backed_up_arg_types_stack; - int backed_up_arg_types_stack_count; - - /* The original stack top before resuming the generator. This is required - * for proper cleanup during exception handling. */ - void **original_stack_top; + /* The separate stack used by generator */ + zend_vm_stack stack; /* Current value */ zval *value; @@ -63,9 +62,9 @@ static const zend_uchar ZEND_GENERATOR_FORCED_CLOSE = 0x2; static const zend_uchar ZEND_GENERATOR_AT_FIRST_YIELD = 0x4; void zend_register_generator_ce(TSRMLS_D); -zval *zend_generator_create_zval(zend_op_array *op_array TSRMLS_DC); -void zend_generator_close(zend_generator *generator, zend_bool finished_execution TSRMLS_DC); -void zend_generator_resume(zend_generator *generator TSRMLS_DC); +ZEND_API zval *zend_generator_create_zval(zend_op_array *op_array TSRMLS_DC); +ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished_execution TSRMLS_DC); +ZEND_API void zend_generator_resume(zend_generator *generator TSRMLS_DC); #endif diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h index e5aba0df6..800bdc7f6 100644 --- a/Zend/zend_globals.h +++ b/Zend/zend_globals.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -167,8 +167,6 @@ struct _zend_executor_globals { zval error_zval; zval *error_zval_ptr; - zend_ptr_stack arg_types_stack; - /* symbol table cache */ HashTable *symtable_cache[SYMTABLE_CACHE_SIZE]; HashTable **symtable_cache_limit; diff --git a/Zend/zend_globals_macros.h b/Zend/zend_globals_macros.h index 7826e9548..9bb1b8026 100644 --- a/Zend/zend_globals_macros.h +++ b/Zend/zend_globals_macros.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c index 2087d5729..0609d707f 100644 --- a/Zend/zend_hash.c +++ b/Zend/zend_hash.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h index 1bd64394a..88c3bfb42 100644 --- a/Zend/zend_hash.h +++ b/Zend/zend_hash.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_highlight.c b/Zend/zend_highlight.c index 938e1c612..c789cb719 100644 --- a/Zend/zend_highlight.c +++ b/Zend/zend_highlight.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -186,7 +186,6 @@ ZEND_API void zend_strip(TSRMLS_D) case T_END_HEREDOC: zend_write((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng)); - efree(token.value.str.val); /* read the following character, either newline or ; */ if (lex_scan(&token TSRMLS_CC) != T_WHITESPACE) { zend_write((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng)); diff --git a/Zend/zend_highlight.h b/Zend/zend_highlight.h index 7923d35be..20adf349a 100644 --- a/Zend/zend_highlight.h +++ b/Zend/zend_highlight.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_indent.c b/Zend/zend_indent.c index f2cf6d913..fea78d9c5 100644 --- a/Zend/zend_indent.c +++ b/Zend/zend_indent.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_indent.h b/Zend/zend_indent.h index 066bb984d..bba02a738 100644 --- a/Zend/zend_indent.h +++ b/Zend/zend_indent.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c index b8f65b7cf..2c74f20f6 100644 --- a/Zend/zend_ini.c +++ b/Zend/zend_ini.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_ini.h b/Zend/zend_ini.h index 0f3eeb524..2773ebb6c 100644 --- a/Zend/zend_ini.h +++ b/Zend/zend_ini.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_ini_parser.c b/Zend/zend_ini_parser.c index e0198e37b..55a358fec 100644 --- a/Zend/zend_ini_parser.c +++ b/Zend/zend_ini_parser.c @@ -78,7 +78,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y index 780dce3c8..2d428c3fe 100644 --- a/Zend/zend_ini_parser.y +++ b/Zend/zend_ini_parser.y @@ -3,7 +3,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_ini_scanner.c b/Zend/zend_ini_scanner.c index 470f52360..35d9763bd 100644 --- a/Zend/zend_ini_scanner.c +++ b/Zend/zend_ini_scanner.c @@ -1,10 +1,10 @@ -/* Generated by re2c 0.13.5 on Thu Jun 7 17:55:40 2012 */ +/* Generated by re2c 0.13.5 */ #line 1 "Zend/zend_ini_scanner.l" /* +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -481,7 +481,7 @@ yy4: yy5: YYDEBUG(5, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 568 "Zend/zend_ini_scanner.l" +#line 575 "Zend/zend_ini_scanner.l" { /* eat whitespace */ goto restart; @@ -493,7 +493,7 @@ yy6: yy7: YYDEBUG(7, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 573 "Zend/zend_ini_scanner.l" +#line 580 "Zend/zend_ini_scanner.l" { SCNG(lineno)++; return END_OF_LINE; @@ -533,7 +533,7 @@ yy10: ++YYCURSOR; YYDEBUG(11, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 496 "Zend/zend_ini_scanner.l" +#line 503 "Zend/zend_ini_scanner.l" { /* Disallow these chars outside option values */ return yytext[0]; } @@ -554,7 +554,7 @@ yy14: goto yy54; YYDEBUG(15, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 596 "Zend/zend_ini_scanner.l" +#line 603 "Zend/zend_ini_scanner.l" { return 0; } @@ -926,7 +926,7 @@ yy55: yy56: YYDEBUG(56, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 578 "Zend/zend_ini_scanner.l" +#line 585 "Zend/zend_ini_scanner.l" { /* Comment */ BEGIN(INITIAL); SCNG(lineno)++; @@ -1012,7 +1012,7 @@ yy64: yy65: YYDEBUG(65, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 584 "Zend/zend_ini_scanner.l" +#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); @@ -1159,7 +1159,7 @@ yyc_ST_DOUBLE_QUOTES: yy76: YYDEBUG(76, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 528 "Zend/zend_ini_scanner.l" +#line 535 "Zend/zend_ini_scanner.l" { /* Escape double quoted string contents */ if (YYCURSOR > YYLIMIT) { return 0; @@ -1204,7 +1204,7 @@ yy77: yy78: YYDEBUG(78, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 523 "Zend/zend_ini_scanner.l" +#line 530 "Zend/zend_ini_scanner.l" { /* Double quoted '"' string ends */ yy_pop_state(TSRMLS_C); return '"'; @@ -1323,7 +1323,7 @@ yy86: yy87: YYDEBUG(87, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 514 "Zend/zend_ini_scanner.l" +#line 521 "Zend/zend_ini_scanner.l" { /* Get rest as section/offset value */ RETURN_TOKEN(TC_STRING, yytext, yyleng); } @@ -1344,7 +1344,7 @@ yy89: yy90: YYDEBUG(90, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 596 "Zend/zend_ini_scanner.l" +#line 603 "Zend/zend_ini_scanner.l" { return 0; } @@ -1355,7 +1355,7 @@ yy91: yy92: YYDEBUG(92, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 518 "Zend/zend_ini_scanner.l" +#line 525 "Zend/zend_ini_scanner.l" { /* Double quoted '"' string start */ yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC); return '"'; @@ -1422,7 +1422,7 @@ yy97: yy98: YYDEBUG(98, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 492 "Zend/zend_ini_scanner.l" +#line 499 "Zend/zend_ini_scanner.l" { /* Get number option value as string */ RETURN_TOKEN(TC_NUMBER, yytext, yyleng); } @@ -1452,7 +1452,7 @@ yy99: yy100: YYDEBUG(100, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 488 "Zend/zend_ini_scanner.l" +#line 495 "Zend/zend_ini_scanner.l" { /* Get constant option value */ RETURN_TOKEN(TC_CONSTANT, yytext, yyleng); } @@ -1829,100 +1829,131 @@ yy134: yyc_ST_RAW: { static const unsigned char yybm[] = { - 32, 160, 160, 160, 160, 160, 160, 160, - 160, 224, 0, 160, 160, 0, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 224, 160, 32, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 32, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, + 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 <= '\r') { - if (yych <= '\t') { - if (yych <= 0x00) goto yy137; - if (yych <= 0x08) goto yy139; - goto yy141; + if (yych <= '\f') { + if (yych <= 0x08) { + if (yych >= 0x01) goto yy139; } else { + if (yych <= '\t') goto yy141; if (yych <= '\n') goto yy142; - if (yych <= '\f') goto yy139; - goto yy144; + goto yy139; } } else { - if (yych <= '!') { - if (yych == ' ') goto yy141; - goto yy139; + if (yych <= ' ') { + if (yych <= '\r') goto yy144; + if (yych <= 0x1F) goto yy139; + goto yy141; } else { - if (yych <= '"') goto yy145; - if (yych == ';') goto yy147; + if (yych == ';') goto yy145; goto yy139; } } -yy137: YYDEBUG(137, *YYCURSOR); ++YYCURSOR; YYDEBUG(138, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 591 "Zend/zend_ini_scanner.l" +#line 598 "Zend/zend_ini_scanner.l" { /* End of option value (if EOF is reached before EOL */ BEGIN(INITIAL); return END_OF_LINE; } -#line 1899 "Zend/zend_ini_scanner.c" +#line 1896 "Zend/zend_ini_scanner.c" yy139: YYDEBUG(139, *YYCURSOR); ++YYCURSOR; - yych = *YYCURSOR; - goto yy158; yy140: YYDEBUG(140, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 474 "Zend/zend_ini_scanner.l" +#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 1912 "Zend/zend_ini_scanner.c" +#line 1940 "Zend/zend_ini_scanner.c" yy141: YYDEBUG(141, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yybm[0+yych] & 64) { - goto yy154; - } - if (yych <= '\f') { - if (yych == '\n') goto yy153; - goto yy158; + if (yych <= '\r') { + if (yych <= 0x08) goto yy140; + if (yych <= '\n') goto yy153; + if (yych <= '\f') goto yy140; + goto yy153; } else { - if (yych <= '\r') goto yy156; - if (yych == ';') goto yy148; - goto yy158; + if (yych <= ' ') { + if (yych <= 0x1F) goto yy140; + goto yy153; + } else { + if (yych == ';') goto yy153; + goto yy140; + } } yy142: YYDEBUG(142, *YYCURSOR); @@ -1930,131 +1961,86 @@ yy142: yy143: YYDEBUG(143, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 482 "Zend/zend_ini_scanner.l" +#line 489 "Zend/zend_ini_scanner.l" { /* End of option value */ BEGIN(INITIAL); SCNG(lineno)++; return END_OF_LINE; } -#line 1940 "Zend/zend_ini_scanner.c" +#line 1971 "Zend/zend_ini_scanner.c" yy144: YYDEBUG(144, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '\n') goto yy153; + if (yych == '\n') goto yy151; goto yy143; yy145: YYDEBUG(145, *YYCURSOR); - ++YYCURSOR; + yyaccept = 1; + yych = *(YYMARKER = ++YYCURSOR); + goto yy147; +yy146: YYDEBUG(146, *YYCURSOR); - yyleng = YYCURSOR - SCNG(yy_text); -#line 448 "Zend/zend_ini_scanner.l" - { - while (YYCURSOR < YYLIMIT) { - switch (*YYCURSOR++) { - case '\n': - SCNG(lineno)++; - break; - case '\r': - if (*YYCURSOR != '\n') { - SCNG(lineno)++; - } - break; - case '"': - yyleng = YYCURSOR - SCNG(yy_text) - 2; - SCNG(yy_text)++; - RETURN_TOKEN(TC_RAW, yytext, yyleng); - case '\\': - if (YYCURSOR < YYLIMIT) { - YYCURSOR++; - } - break; - } - } - yyleng = YYCURSOR - SCNG(yy_text); - RETURN_TOKEN(TC_RAW, yytext, yyleng); -} -#line 1977 "Zend/zend_ini_scanner.c" + ++YYCURSOR; + YYFILL(2); + yych = *YYCURSOR; yy147: YYDEBUG(147, *YYCURSOR); - yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - goto yy149; + if (yybm[0+yych] & 64) { + goto yy146; + } + if (yych >= '\r') goto yy150; yy148: YYDEBUG(148, *YYCURSOR); ++YYCURSOR; - YYFILL(2); - yych = *YYCURSOR; yy149: YYDEBUG(149, *YYCURSOR); - if (yybm[0+yych] & 32) { - goto yy148; - } - if (yych >= '\r') goto yy152; -yy150: - YYDEBUG(150, *YYCURSOR); - ++YYCURSOR; -yy151: - YYDEBUG(151, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 578 "Zend/zend_ini_scanner.l" +#line 585 "Zend/zend_ini_scanner.l" { /* Comment */ BEGIN(INITIAL); SCNG(lineno)++; return END_OF_LINE; } -#line 2006 "Zend/zend_ini_scanner.c" -yy152: - YYDEBUG(152, *YYCURSOR); +#line 2005 "Zend/zend_ini_scanner.c" +yy150: + YYDEBUG(150, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '\n') goto yy150; - goto yy151; -yy153: - YYDEBUG(153, *YYCURSOR); + if (yych == '\n') goto yy148; + goto yy149; +yy151: + YYDEBUG(151, *YYCURSOR); yych = *++YYCURSOR; goto yy143; -yy154: - YYDEBUG(154, *YYCURSOR); - yyaccept = 0; +yy152: + YYDEBUG(152, *YYCURSOR); + yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; - YYDEBUG(155, *YYCURSOR); - if (yybm[0+yych] & 64) { - goto yy154; +yy153: + YYDEBUG(153, *YYCURSOR); + if (yybm[0+yych] & 128) { + goto yy152; } - if (yych <= '\r') { - if (yych <= '\t') { - if (yych <= 0x00) goto yy140; - goto yy157; - } else { - if (yych <= '\n') goto yy153; - if (yych <= '\f') goto yy157; - } + if (yych <= '\f') { + if (yych == '\n') goto yy151; } else { - if (yych <= '"') { - if (yych <= '!') goto yy157; - goto yy140; - } else { - if (yych == ';') goto yy148; - goto yy157; - } + if (yych <= '\r') goto yy155; + if (yych == ';') goto yy146; } -yy156: - YYDEBUG(156, *YYCURSOR); - yych = *++YYCURSOR; - if (yych == '\n') goto yy153; - goto yy143; -yy157: - YYDEBUG(157, *YYCURSOR); + YYDEBUG(154, *YYCURSOR); + yyleng = YYCURSOR - SCNG(yy_text); +#line 575 "Zend/zend_ini_scanner.l" + { + /* eat whitespace */ + goto restart; +} +#line 2039 "Zend/zend_ini_scanner.c" +yy155: + YYDEBUG(155, *YYCURSOR); ++YYCURSOR; - YYFILL(1); - yych = *YYCURSOR; -yy158: - YYDEBUG(158, *YYCURSOR); - if (yybm[0+yych] & 128) { - goto yy157; - } - goto yy140; + if ((yych = *YYCURSOR) == '\n') goto yy151; + goto yy143; } /* *********************************** */ yyc_ST_SECTION_RAW: @@ -2093,44 +2079,44 @@ yyc_ST_SECTION_RAW: 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, }; - YYDEBUG(159, *YYCURSOR); + YYDEBUG(156, *YYCURSOR); YYFILL(3); yych = *YYCURSOR; if (yych <= '\f') { - if (yych == '\n') goto yy163; + if (yych == '\n') goto yy160; } else { - if (yych <= '\r') goto yy163; - if (yych == ']') goto yy165; + if (yych <= '\r') goto yy160; + if (yych == ']') goto yy162; } - YYDEBUG(161, *YYCURSOR); + YYDEBUG(158, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy172; -yy162: - YYDEBUG(162, *YYCURSOR); + goto yy169; +yy159: + YYDEBUG(159, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 478 "Zend/zend_ini_scanner.l" +#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 2117 "Zend/zend_ini_scanner.c" -yy163: - YYDEBUG(163, *YYCURSOR); +#line 2103 "Zend/zend_ini_scanner.c" +yy160: + YYDEBUG(160, *YYCURSOR); ++YYCURSOR; - YYDEBUG(164, *YYCURSOR); + YYDEBUG(161, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 596 "Zend/zend_ini_scanner.l" +#line 603 "Zend/zend_ini_scanner.l" { return 0; } -#line 2127 "Zend/zend_ini_scanner.c" -yy165: - YYDEBUG(165, *YYCURSOR); +#line 2113 "Zend/zend_ini_scanner.c" +yy162: + YYDEBUG(162, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy168; -yy166: - YYDEBUG(166, *YYCURSOR); + goto yy165; +yy163: + YYDEBUG(163, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 377 "Zend/zend_ini_scanner.l" { /* End of section */ @@ -2138,40 +2124,40 @@ yy166: SCNG(lineno)++; return ']'; } -#line 2142 "Zend/zend_ini_scanner.c" -yy167: - YYDEBUG(167, *YYCURSOR); +#line 2128 "Zend/zend_ini_scanner.c" +yy164: + YYDEBUG(164, *YYCURSOR); ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; -yy168: - YYDEBUG(168, *YYCURSOR); +yy165: + YYDEBUG(165, *YYCURSOR); if (yybm[0+yych] & 64) { - goto yy167; + goto yy164; } - if (yych == '\n') goto yy169; - if (yych == '\r') goto yy170; - goto yy166; -yy169: - YYDEBUG(169, *YYCURSOR); + if (yych == '\n') goto yy166; + if (yych == '\r') goto yy167; + goto yy163; +yy166: + YYDEBUG(166, *YYCURSOR); yych = *++YYCURSOR; - goto yy166; -yy170: - YYDEBUG(170, *YYCURSOR); + goto yy163; +yy167: + YYDEBUG(167, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '\n') goto yy169; - goto yy166; -yy171: - YYDEBUG(171, *YYCURSOR); + if (yych == '\n') goto yy166; + goto yy163; +yy168: + YYDEBUG(168, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy172: - YYDEBUG(172, *YYCURSOR); +yy169: + YYDEBUG(169, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy171; + goto yy168; } - goto yy162; + goto yy159; } /* *********************************** */ yyc_ST_SECTION_VALUE: @@ -2210,203 +2196,203 @@ yyc_ST_SECTION_VALUE: 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, }; - YYDEBUG(173, *YYCURSOR); + YYDEBUG(170, *YYCURSOR); YYFILL(3); yych = *YYCURSOR; if (yych <= '-') { if (yych <= ' ') { if (yych <= '\n') { - if (yych <= 0x08) goto yy175; - if (yych <= '\t') goto yy177; - goto yy178; + if (yych <= 0x08) goto yy172; + if (yych <= '\t') goto yy174; + goto yy175; } else { - if (yych == '\r') goto yy178; - if (yych >= ' ') goto yy177; + if (yych == '\r') goto yy175; + if (yych >= ' ') goto yy174; } } else { if (yych <= '$') { - if (yych == '"') goto yy180; - if (yych >= '$') goto yy182; + if (yych == '"') goto yy177; + if (yych >= '$') goto yy179; } else { - if (yych == '\'') goto yy183; - if (yych >= '-') goto yy184; + if (yych == '\'') goto yy180; + if (yych >= '-') goto yy181; } } } else { if (yych <= 'Z') { if (yych <= '9') { - if (yych <= '.') goto yy185; - if (yych >= '0') goto yy186; + if (yych <= '.') goto yy182; + if (yych >= '0') goto yy183; } else { - if (yych == ';') goto yy178; - if (yych >= 'A') goto yy188; + if (yych == ';') goto yy175; + if (yych >= 'A') goto yy185; } } else { if (yych <= '^') { - if (yych <= '[') goto yy175; - if (yych <= '\\') goto yy190; - if (yych <= ']') goto yy191; + if (yych <= '[') goto yy172; + if (yych <= '\\') goto yy187; + if (yych <= ']') goto yy188; } else { - if (yych == '`') goto yy175; - if (yych <= 'z') goto yy188; + if (yych == '`') goto yy172; + if (yych <= 'z') goto yy185; } } } -yy175: - YYDEBUG(175, *YYCURSOR); +yy172: + YYDEBUG(172, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - goto yy198; -yy176: - YYDEBUG(176, *YYCURSOR); + goto yy195; +yy173: + YYDEBUG(173, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 514 "Zend/zend_ini_scanner.l" +#line 521 "Zend/zend_ini_scanner.l" { /* Get rest as section/offset value */ RETURN_TOKEN(TC_STRING, yytext, yyleng); } -#line 2268 "Zend/zend_ini_scanner.c" -yy177: - YYDEBUG(177, *YYCURSOR); +#line 2254 "Zend/zend_ini_scanner.c" +yy174: + YYDEBUG(174, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy224; - goto yy198; + if (yych == '\t') goto yy221; + goto yy195; } else { - if (yych <= ' ') goto yy224; - if (yych == '"') goto yy226; - goto yy198; + if (yych <= ' ') goto yy221; + if (yych == '"') goto yy223; + goto yy195; } -yy178: - YYDEBUG(178, *YYCURSOR); +yy175: + YYDEBUG(175, *YYCURSOR); ++YYCURSOR; -yy179: - YYDEBUG(179, *YYCURSOR); +yy176: + YYDEBUG(176, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 596 "Zend/zend_ini_scanner.l" +#line 603 "Zend/zend_ini_scanner.l" { return 0; } -#line 2291 "Zend/zend_ini_scanner.c" -yy180: - YYDEBUG(180, *YYCURSOR); +#line 2277 "Zend/zend_ini_scanner.c" +yy177: + YYDEBUG(177, *YYCURSOR); ++YYCURSOR; -yy181: - YYDEBUG(181, *YYCURSOR); +yy178: + YYDEBUG(178, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 518 "Zend/zend_ini_scanner.l" +#line 525 "Zend/zend_ini_scanner.l" { /* Double quoted '"' string start */ yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC); return '"'; } -#line 2303 "Zend/zend_ini_scanner.c" -yy182: - YYDEBUG(182, *YYCURSOR); +#line 2289 "Zend/zend_ini_scanner.c" +yy179: + YYDEBUG(179, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '\\') { - if (yych <= 0x00) goto yy179; - if (yych <= '[') goto yy197; - goto yy202; + if (yych <= 0x00) goto yy176; + if (yych <= '[') goto yy194; + goto yy199; } else { - if (yych == '{') goto yy222; - goto yy197; + if (yych == '{') goto yy219; + goto yy194; } -yy183: - YYDEBUG(183, *YYCURSOR); +yy180: + YYDEBUG(180, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 128) { - goto yy218; + goto yy215; } - goto yy179; -yy184: - YYDEBUG(184, *YYCURSOR); + goto yy176; +yy181: + YYDEBUG(181, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy198; - if (yych <= '9') goto yy216; - goto yy198; -yy185: - YYDEBUG(185, *YYCURSOR); + if (yych <= '/') goto yy195; + if (yych <= '9') goto yy213; + goto yy195; +yy182: + YYDEBUG(182, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy198; - if (yych <= '9') goto yy214; - goto yy198; -yy186: - YYDEBUG(186, *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 yy187; - if (yych <= '\f') goto yy198; + if (yych == '\n') goto yy184; + if (yych <= '\f') goto yy195; } else { - if (yych == '"') goto yy187; - if (yych <= '&') goto yy198; + if (yych == '"') goto yy184; + if (yych <= '&') goto yy195; } } else { if (yych <= '9') { - if (yych == '.') goto yy210; - if (yych <= '/') goto yy198; - goto yy212; + if (yych == '.') goto yy207; + if (yych <= '/') goto yy195; + goto yy209; } else { if (yych <= ';') { - if (yych <= ':') goto yy198; + if (yych <= ':') goto yy195; } else { - if (yych != ']') goto yy198; + if (yych != ']') goto yy195; } } } -yy187: - YYDEBUG(187, *YYCURSOR); +yy184: + YYDEBUG(184, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 492 "Zend/zend_ini_scanner.l" +#line 499 "Zend/zend_ini_scanner.l" { /* Get number option value as string */ RETURN_TOKEN(TC_NUMBER, yytext, yyleng); } -#line 2369 "Zend/zend_ini_scanner.c" -yy188: - YYDEBUG(188, *YYCURSOR); +#line 2355 "Zend/zend_ini_scanner.c" +yy185: + YYDEBUG(185, *YYCURSOR); yyaccept = 3; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 32) { - goto yy208; + goto yy205; } if (yych <= '"') { if (yych <= '\f') { - if (yych != '\n') goto yy198; + if (yych != '\n') goto yy195; } else { - if (yych <= '\r') goto yy189; - if (yych <= '!') goto yy198; + if (yych <= '\r') goto yy186; + if (yych <= '!') goto yy195; } } else { if (yych <= ':') { - if (yych != '\'') goto yy198; + if (yych != '\'') goto yy195; } else { - if (yych <= ';') goto yy189; - if (yych != ']') goto yy198; + if (yych <= ';') goto yy186; + if (yych != ']') goto yy195; } } -yy189: - YYDEBUG(189, *YYCURSOR); +yy186: + YYDEBUG(186, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 488 "Zend/zend_ini_scanner.l" +#line 495 "Zend/zend_ini_scanner.l" { /* Get constant option value */ RETURN_TOKEN(TC_CONSTANT, yytext, yyleng); } -#line 2399 "Zend/zend_ini_scanner.c" -yy190: - YYDEBUG(190, *YYCURSOR); +#line 2385 "Zend/zend_ini_scanner.c" +yy187: + YYDEBUG(187, *YYCURSOR); yych = *++YYCURSOR; - goto yy197; -yy191: - YYDEBUG(191, *YYCURSOR); + goto yy194; +yy188: + YYDEBUG(188, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy194; -yy192: - YYDEBUG(192, *YYCURSOR); + goto yy191; +yy189: + YYDEBUG(189, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 377 "Zend/zend_ini_scanner.l" { /* End of section */ @@ -2414,317 +2400,317 @@ yy192: SCNG(lineno)++; return ']'; } -#line 2418 "Zend/zend_ini_scanner.c" -yy193: - YYDEBUG(193, *YYCURSOR); +#line 2404 "Zend/zend_ini_scanner.c" +yy190: + YYDEBUG(190, *YYCURSOR); ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; -yy194: - YYDEBUG(194, *YYCURSOR); +yy191: + YYDEBUG(191, *YYCURSOR); if (yybm[0+yych] & 2) { - goto yy193; + goto yy190; } - if (yych == '\n') goto yy195; - if (yych == '\r') goto yy196; - goto yy192; -yy195: - YYDEBUG(195, *YYCURSOR); + if (yych == '\n') goto yy192; + if (yych == '\r') goto yy193; + goto yy189; +yy192: + YYDEBUG(192, *YYCURSOR); yych = *++YYCURSOR; - goto yy192; -yy196: - YYDEBUG(196, *YYCURSOR); + goto yy189; +yy193: + YYDEBUG(193, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '\n') goto yy195; - goto yy192; -yy197: - YYDEBUG(197, *YYCURSOR); + if (yych == '\n') goto yy192; + goto yy189; +yy194: + YYDEBUG(194, *YYCURSOR); yyaccept = 0; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy198: - YYDEBUG(198, *YYCURSOR); +yy195: + YYDEBUG(195, *YYCURSOR); if (yybm[0+yych] & 4) { - goto yy197; + goto yy194; } - if (yych == '$') goto yy200; - if (yych != '\\') goto yy176; -yy199: - YYDEBUG(199, *YYCURSOR); + if (yych == '$') goto yy197; + if (yych != '\\') goto yy173; +yy196: + YYDEBUG(196, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - goto yy197; -yy200: - YYDEBUG(200, *YYCURSOR); + goto yy194; +yy197: + YYDEBUG(197, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; if (yych <= '\\') { - if (yych <= 0x00) goto yy201; - if (yych <= '[') goto yy197; - goto yy202; + if (yych <= 0x00) goto yy198; + if (yych <= '[') goto yy194; + goto yy199; } else { - if (yych != '{') goto yy197; + if (yych != '{') goto yy194; } -yy201: - YYDEBUG(201, *YYCURSOR); +yy198: + YYDEBUG(198, *YYCURSOR); YYCURSOR = YYMARKER; if (yyaccept <= 1) { if (yyaccept <= 0) { - goto yy176; + goto yy173; } else { - goto yy179; + goto yy176; } } else { if (yyaccept <= 2) { - goto yy187; + goto yy184; } else { - goto yy189; + goto yy186; } } -yy202: - YYDEBUG(202, *YYCURSOR); +yy199: + YYDEBUG(199, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 8) { - goto yy203; + goto yy200; } - if (yych == '\\') goto yy205; - goto yy197; -yy203: - YYDEBUG(203, *YYCURSOR); + if (yych == '\\') goto yy202; + goto yy194; +yy200: + YYDEBUG(200, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(204, *YYCURSOR); + YYDEBUG(201, *YYCURSOR); if (yybm[0+yych] & 8) { - goto yy203; + goto yy200; } - if (yych == '\\') goto yy207; - goto yy197; -yy205: - YYDEBUG(205, *YYCURSOR); + if (yych == '\\') goto yy204; + goto yy194; +yy202: + YYDEBUG(202, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(206, *YYCURSOR); + YYDEBUG(203, *YYCURSOR); if (yybm[0+yych] & 8) { - goto yy203; + goto yy200; } - if (yych == '\\') goto yy205; - goto yy197; -yy207: - YYDEBUG(207, *YYCURSOR); + if (yych == '\\') goto yy202; + goto yy194; +yy204: + YYDEBUG(204, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 8) { - goto yy203; + goto yy200; } - if (yych == '\\') goto yy205; - goto yy197; -yy208: - YYDEBUG(208, *YYCURSOR); + if (yych == '\\') goto yy202; + goto yy194; +yy205: + YYDEBUG(205, *YYCURSOR); yyaccept = 3; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(209, *YYCURSOR); + YYDEBUG(206, *YYCURSOR); if (yybm[0+yych] & 32) { - goto yy208; + goto yy205; } if (yych <= '$') { if (yych <= '\r') { - if (yych == '\n') goto yy189; - if (yych <= '\f') goto yy197; - goto yy189; + if (yych == '\n') goto yy186; + if (yych <= '\f') goto yy194; + goto yy186; } else { - if (yych == '"') goto yy189; - if (yych <= '#') goto yy197; - goto yy200; + if (yych == '"') goto yy186; + if (yych <= '#') goto yy194; + goto yy197; } } else { if (yych <= ';') { - if (yych == '\'') goto yy189; - if (yych <= ':') goto yy197; - goto yy189; + if (yych == '\'') goto yy186; + if (yych <= ':') goto yy194; + goto yy186; } else { - if (yych <= '[') goto yy197; - if (yych <= '\\') goto yy199; - if (yych <= ']') goto yy189; - goto yy197; + if (yych <= '[') goto yy194; + if (yych <= '\\') goto yy196; + if (yych <= ']') goto yy186; + goto yy194; } } -yy210: - YYDEBUG(210, *YYCURSOR); +yy207: + YYDEBUG(207, *YYCURSOR); yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(211, *YYCURSOR); + YYDEBUG(208, *YYCURSOR); if (yybm[0+yych] & 64) { - goto yy210; + goto yy207; } if (yych <= '$') { if (yych <= '\r') { - if (yych == '\n') goto yy187; - if (yych <= '\f') goto yy197; - goto yy187; + if (yych == '\n') goto yy184; + if (yych <= '\f') goto yy194; + goto yy184; } else { - if (yych == '"') goto yy187; - if (yych <= '#') goto yy197; - goto yy200; + if (yych == '"') goto yy184; + if (yych <= '#') goto yy194; + goto yy197; } } else { if (yych <= ';') { - if (yych == '\'') goto yy187; - if (yych <= ':') goto yy197; - goto yy187; + if (yych == '\'') goto yy184; + if (yych <= ':') goto yy194; + goto yy184; } else { - if (yych <= '[') goto yy197; - if (yych <= '\\') goto yy199; - if (yych <= ']') goto yy187; - goto yy197; + if (yych <= '[') goto yy194; + if (yych <= '\\') goto yy196; + if (yych <= ']') goto yy184; + goto yy194; } } -yy212: - YYDEBUG(212, *YYCURSOR); +yy209: + YYDEBUG(209, *YYCURSOR); yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(213, *YYCURSOR); + YYDEBUG(210, *YYCURSOR); if (yych <= '\'') { if (yych <= '!') { if (yych <= '\n') { - if (yych <= '\t') goto yy197; - goto yy187; + if (yych <= '\t') goto yy194; + goto yy184; } else { - if (yych == '\r') goto yy187; - goto yy197; + if (yych == '\r') goto yy184; + goto yy194; } } else { if (yych <= '#') { - if (yych <= '"') goto yy187; - goto yy197; + if (yych <= '"') goto yy184; + goto yy194; } else { - if (yych <= '$') goto yy200; - if (yych <= '&') goto yy197; - goto yy187; + if (yych <= '$') goto yy197; + if (yych <= '&') goto yy194; + goto yy184; } } } else { if (yych <= ':') { if (yych <= '.') { - if (yych <= '-') goto yy197; - goto yy210; + if (yych <= '-') goto yy194; + goto yy207; } else { - if (yych <= '/') goto yy197; - if (yych <= '9') goto yy212; - goto yy197; + if (yych <= '/') goto yy194; + if (yych <= '9') goto yy209; + goto yy194; } } else { if (yych <= '[') { - if (yych <= ';') goto yy187; - goto yy197; + if (yych <= ';') goto yy184; + goto yy194; } else { - if (yych <= '\\') goto yy199; - if (yych <= ']') goto yy187; - goto yy197; + if (yych <= '\\') goto yy196; + if (yych <= ']') goto yy184; + goto yy194; } } } -yy214: - YYDEBUG(214, *YYCURSOR); +yy211: + YYDEBUG(211, *YYCURSOR); yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(215, *YYCURSOR); + YYDEBUG(212, *YYCURSOR); if (yych <= '&') { if (yych <= '\r') { - if (yych == '\n') goto yy187; - if (yych <= '\f') goto yy197; - goto yy187; + if (yych == '\n') goto yy184; + if (yych <= '\f') goto yy194; + goto yy184; } else { if (yych <= '"') { - if (yych <= '!') goto yy197; - goto yy187; + if (yych <= '!') goto yy194; + goto yy184; } else { - if (yych == '$') goto yy200; - goto yy197; + if (yych == '$') goto yy197; + goto yy194; } } } else { if (yych <= ':') { - if (yych <= '\'') goto yy187; - if (yych <= '/') goto yy197; - if (yych <= '9') goto yy214; - goto yy197; + if (yych <= '\'') goto yy184; + if (yych <= '/') goto yy194; + if (yych <= '9') goto yy211; + goto yy194; } else { if (yych <= '[') { - if (yych <= ';') goto yy187; - goto yy197; + if (yych <= ';') goto yy184; + goto yy194; } else { - if (yych <= '\\') goto yy199; - if (yych <= ']') goto yy187; - goto yy197; + if (yych <= '\\') goto yy196; + if (yych <= ']') goto yy184; + goto yy194; } } } -yy216: - YYDEBUG(216, *YYCURSOR); +yy213: + YYDEBUG(213, *YYCURSOR); yyaccept = 2; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(217, *YYCURSOR); + YYDEBUG(214, *YYCURSOR); if (yych <= '&') { if (yych <= '\r') { - if (yych == '\n') goto yy187; - if (yych <= '\f') goto yy197; - goto yy187; + if (yych == '\n') goto yy184; + if (yych <= '\f') goto yy194; + goto yy184; } else { if (yych <= '"') { - if (yych <= '!') goto yy197; - goto yy187; + if (yych <= '!') goto yy194; + goto yy184; } else { - if (yych == '$') goto yy200; - goto yy197; + if (yych == '$') goto yy197; + goto yy194; } } } else { if (yych <= ':') { - if (yych <= '\'') goto yy187; - if (yych <= '/') goto yy197; - if (yych <= '9') goto yy216; - goto yy197; + if (yych <= '\'') goto yy184; + if (yych <= '/') goto yy194; + if (yych <= '9') goto yy213; + goto yy194; } else { if (yych <= '[') { - if (yych <= ';') goto yy187; - goto yy197; + if (yych <= ';') goto yy184; + goto yy194; } else { - if (yych <= '\\') goto yy199; - if (yych <= ']') goto yy187; - goto yy197; + if (yych <= '\\') goto yy196; + if (yych <= ']') goto yy184; + goto yy194; } } } -yy218: - YYDEBUG(218, *YYCURSOR); +yy215: + YYDEBUG(215, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(219, *YYCURSOR); + YYDEBUG(216, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy218; + goto yy215; } - YYDEBUG(220, *YYCURSOR); + YYDEBUG(217, *YYCURSOR); ++YYCURSOR; - YYDEBUG(221, *YYCURSOR); + YYDEBUG(218, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 368 "Zend/zend_ini_scanner.l" { /* Raw string */ @@ -2735,65 +2721,65 @@ yy218: } RETURN_TOKEN(TC_RAW, yytext, yyleng); } -#line 2739 "Zend/zend_ini_scanner.c" -yy222: - YYDEBUG(222, *YYCURSOR); +#line 2725 "Zend/zend_ini_scanner.c" +yy219: + YYDEBUG(219, *YYCURSOR); ++YYCURSOR; - YYDEBUG(223, *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 2750 "Zend/zend_ini_scanner.c" -yy224: - YYDEBUG(224, *YYCURSOR); +#line 2736 "Zend/zend_ini_scanner.c" +yy221: + YYDEBUG(221, *YYCURSOR); yyaccept = 0; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(225, *YYCURSOR); + YYDEBUG(222, *YYCURSOR); if (yych <= '"') { if (yych <= '\f') { - if (yych <= 0x08) goto yy197; - if (yych <= '\t') goto yy224; - if (yych <= '\n') goto yy176; - goto yy197; + 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 yy176; - goto yy197; + if (yych <= '\r') goto yy173; + goto yy194; } else { - if (yych <= ' ') goto yy224; - if (yych <= '!') goto yy197; + if (yych <= ' ') goto yy221; + if (yych <= '!') goto yy194; } } } else { if (yych <= ':') { if (yych <= '$') { - if (yych <= '#') goto yy197; - goto yy200; - } else { - if (yych == '\'') goto yy176; + if (yych <= '#') goto yy194; goto yy197; + } else { + if (yych == '\'') goto yy173; + goto yy194; } } else { if (yych <= '[') { - if (yych <= ';') goto yy176; - goto yy197; + if (yych <= ';') goto yy173; + goto yy194; } else { - if (yych <= '\\') goto yy199; - if (yych <= ']') goto yy176; - goto yy197; + if (yych <= '\\') goto yy196; + if (yych <= ']') goto yy173; + goto yy194; } } } -yy226: - YYDEBUG(226, *YYCURSOR); +yy223: + YYDEBUG(223, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy181; + goto yy178; } /* *********************************** */ yyc_ST_VALUE: @@ -2832,27 +2818,27 @@ yyc_ST_VALUE: 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, }; - YYDEBUG(227, *YYCURSOR); + YYDEBUG(224, *YYCURSOR); YYFILL(6); yych = *YYCURSOR; YYDEBUG(-1, yych); switch (yych) { - case 0x00: goto yy229; + case 0x00: goto yy226; case '\t': - case ' ': goto yy233; - case '\n': goto yy235; - case '\r': goto yy237; + case ' ': goto yy230; + case '\n': goto yy232; + case '\r': goto yy234; case '!': case '&': case '(': case ')': case '|': - case '~': goto yy238; - case '"': goto yy240; - case '$': goto yy242; - case '\'': goto yy243; - case '-': goto yy244; - case '.': goto yy245; + case '~': goto yy235; + case '"': goto yy237; + case '$': goto yy239; + case '\'': goto yy240; + case '-': goto yy241; + case '.': goto yy242; case '0': case '1': case '2': @@ -2862,9 +2848,9 @@ yyc_ST_VALUE: case '6': case '7': case '8': - case '9': goto yy246; - case ';': goto yy248; - case '=': goto yy249; + case '9': goto yy243; + case ';': goto yy245; + case '=': goto yy246; case 'A': case 'B': case 'C': @@ -2907,1529 +2893,1529 @@ yyc_ST_VALUE: case 'v': case 'w': case 'x': - case 'z': goto yy251; + case 'z': goto yy248; case 'F': - case 'f': goto yy253; + case 'f': goto yy250; case 'N': - case 'n': goto yy254; + case 'n': goto yy251; case 'O': - case 'o': goto yy255; + case 'o': goto yy252; case 'T': - case 't': goto yy256; + case 't': goto yy253; case 'Y': - case 'y': goto yy257; - default: goto yy231; + case 'y': goto yy254; + default: goto yy228; } -yy229: - YYDEBUG(229, *YYCURSOR); +yy226: + YYDEBUG(226, *YYCURSOR); ++YYCURSOR; -yy230: - YYDEBUG(230, *YYCURSOR); +yy227: + YYDEBUG(227, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 591 "Zend/zend_ini_scanner.l" +#line 598 "Zend/zend_ini_scanner.l" { /* End of option value (if EOF is reached before EOL */ BEGIN(INITIAL); return END_OF_LINE; } -#line 2935 "Zend/zend_ini_scanner.c" -yy231: - YYDEBUG(231, *YYCURSOR); +#line 2921 "Zend/zend_ini_scanner.c" +yy228: + YYDEBUG(228, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - goto yy259; -yy232: - YYDEBUG(232, *YYCURSOR); + goto yy256; +yy229: + YYDEBUG(229, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 510 "Zend/zend_ini_scanner.l" +#line 517 "Zend/zend_ini_scanner.l" { /* Get everything else as option/offset value */ RETURN_TOKEN(TC_STRING, yytext, yyleng); } -#line 2948 "Zend/zend_ini_scanner.c" -yy233: - YYDEBUG(233, *YYCURSOR); +#line 2934 "Zend/zend_ini_scanner.c" +yy230: + YYDEBUG(230, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); - goto yy309; -yy234: - YYDEBUG(234, *YYCURSOR); + goto yy306; +yy231: + YYDEBUG(231, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 564 "Zend/zend_ini_scanner.l" +#line 571 "Zend/zend_ini_scanner.l" { RETURN_TOKEN(TC_WHITESPACE, yytext, yyleng); } -#line 2961 "Zend/zend_ini_scanner.c" -yy235: - YYDEBUG(235, *YYCURSOR); +#line 2947 "Zend/zend_ini_scanner.c" +yy232: + YYDEBUG(232, *YYCURSOR); ++YYCURSOR; -yy236: - YYDEBUG(236, *YYCURSOR); +yy233: + YYDEBUG(233, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 482 "Zend/zend_ini_scanner.l" +#line 489 "Zend/zend_ini_scanner.l" { /* End of option value */ BEGIN(INITIAL); SCNG(lineno)++; return END_OF_LINE; } -#line 2974 "Zend/zend_ini_scanner.c" -yy237: - YYDEBUG(237, *YYCURSOR); +#line 2960 "Zend/zend_ini_scanner.c" +yy234: + YYDEBUG(234, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '\n') goto yy307; - goto yy236; -yy238: - YYDEBUG(238, *YYCURSOR); + if (yych == '\n') goto yy304; + goto yy233; +yy235: + YYDEBUG(235, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy306; -yy239: - YYDEBUG(239, *YYCURSOR); + goto yy303; +yy236: + YYDEBUG(236, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 500 "Zend/zend_ini_scanner.l" +#line 507 "Zend/zend_ini_scanner.l" { /* Boolean operators */ return yytext[0]; } -#line 2992 "Zend/zend_ini_scanner.c" -yy240: - YYDEBUG(240, *YYCURSOR); +#line 2978 "Zend/zend_ini_scanner.c" +yy237: + YYDEBUG(237, *YYCURSOR); ++YYCURSOR; -yy241: - YYDEBUG(241, *YYCURSOR); +yy238: + YYDEBUG(238, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 518 "Zend/zend_ini_scanner.l" +#line 525 "Zend/zend_ini_scanner.l" { /* Double quoted '"' string start */ yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC); return '"'; } -#line 3004 "Zend/zend_ini_scanner.c" -yy242: - YYDEBUG(242, *YYCURSOR); +#line 2990 "Zend/zend_ini_scanner.c" +yy239: + YYDEBUG(239, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '\\') { - if (yych <= 0x00) goto yy230; - if (yych <= '[') goto yy258; - goto yy265; + if (yych <= 0x00) goto yy227; + if (yych <= '[') goto yy255; + goto yy262; } else { - if (yych == '{') goto yy303; - goto yy258; + if (yych == '{') goto yy300; + goto yy255; } -yy243: - YYDEBUG(243, *YYCURSOR); +yy240: + YYDEBUG(240, *YYCURSOR); yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 128) { - goto yy299; + goto yy296; } - goto yy230; -yy244: - YYDEBUG(244, *YYCURSOR); + goto yy227; +yy241: + YYDEBUG(241, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy259; - if (yych <= '9') goto yy297; - goto yy259; -yy245: - YYDEBUG(245, *YYCURSOR); + if (yych <= '/') goto yy256; + if (yych <= '9') goto yy294; + goto yy256; +yy242: + YYDEBUG(242, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy259; - if (yych <= '9') goto yy295; - goto yy259; -yy246: - YYDEBUG(246, *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 <= '\r') { if (yych <= 0x08) { - if (yych >= 0x01) goto yy259; + if (yych >= 0x01) goto yy256; } else { - if (yych <= '\n') goto yy247; - if (yych <= '\f') goto yy259; + if (yych <= '\n') goto yy244; + if (yych <= '\f') goto yy256; } } else { if (yych <= '%') { - if (yych <= 0x1F) goto yy259; - if (yych >= '#') goto yy259; + if (yych <= 0x1F) goto yy256; + if (yych >= '#') goto yy256; } else { - if (yych <= ')') goto yy247; - if (yych <= '-') goto yy259; - goto yy291; + if (yych <= ')') goto yy244; + if (yych <= '-') goto yy256; + goto yy288; } } } else { if (yych <= '<') { if (yych <= '9') { - if (yych <= '/') goto yy259; - goto yy293; + if (yych <= '/') goto yy256; + goto yy290; } else { - if (yych != ';') goto yy259; + if (yych != ';') goto yy256; } } else { if (yych <= '|') { - if (yych <= '=') goto yy247; - if (yych <= '{') goto yy259; + if (yych <= '=') goto yy244; + if (yych <= '{') goto yy256; } else { - if (yych != '~') goto yy259; + if (yych != '~') goto yy256; } } } -yy247: - YYDEBUG(247, *YYCURSOR); +yy244: + YYDEBUG(244, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 492 "Zend/zend_ini_scanner.l" +#line 499 "Zend/zend_ini_scanner.l" { /* Get number option value as string */ RETURN_TOKEN(TC_NUMBER, yytext, yyleng); } -#line 3084 "Zend/zend_ini_scanner.c" -yy248: - YYDEBUG(248, *YYCURSOR); +#line 3070 "Zend/zend_ini_scanner.c" +yy245: + YYDEBUG(245, *YYCURSOR); yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); - goto yy287; -yy249: - YYDEBUG(249, *YYCURSOR); + goto yy284; +yy246: + YYDEBUG(246, *YYCURSOR); ++YYCURSOR; - YYDEBUG(250, *YYCURSOR); + YYDEBUG(247, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 504 "Zend/zend_ini_scanner.l" +#line 511 "Zend/zend_ini_scanner.l" { /* Make = used in option value to trigger error */ yyless(0); BEGIN(INITIAL); return END_OF_LINE; } -#line 3101 "Zend/zend_ini_scanner.c" -yy251: - YYDEBUG(251, *YYCURSOR); +#line 3087 "Zend/zend_ini_scanner.c" +yy248: + YYDEBUG(248, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 4) { - goto yy260; + goto yy257; } if (yych <= ')') { if (yych <= '\f') { - if (yych <= 0x00) goto yy252; - if (yych <= 0x08) goto yy259; - if (yych >= '\v') goto yy259; + if (yych <= 0x00) goto yy249; + if (yych <= 0x08) goto yy256; + if (yych >= '\v') goto yy256; } else { if (yych <= 0x1F) { - if (yych >= 0x0E) goto yy259; + if (yych >= 0x0E) goto yy256; } else { - if (yych <= '"') goto yy252; - if (yych <= '%') goto yy259; + if (yych <= '"') goto yy249; + if (yych <= '%') goto yy256; } } } else { if (yych <= '=') { - if (yych == ';') goto yy252; - if (yych <= '<') goto yy259; + if (yych == ';') goto yy249; + if (yych <= '<') goto yy256; } else { if (yych <= '|') { - if (yych <= '{') goto yy259; + if (yych <= '{') goto yy256; } else { - if (yych != '~') goto yy259; + if (yych != '~') goto yy256; } } } -yy252: - YYDEBUG(252, *YYCURSOR); +yy249: + YYDEBUG(249, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 488 "Zend/zend_ini_scanner.l" +#line 495 "Zend/zend_ini_scanner.l" { /* Get constant option value */ RETURN_TOKEN(TC_CONSTANT, yytext, yyleng); } -#line 3141 "Zend/zend_ini_scanner.c" -yy253: - YYDEBUG(253, *YYCURSOR); +#line 3127 "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 yy252; - if (yych <= 0x08) goto yy259; - goto yy252; + if (yych <= 0x00) goto yy249; + if (yych <= 0x08) goto yy256; + goto yy249; } else { - if (yych == '\r') goto yy252; - if (yych <= 0x1F) goto yy259; - goto yy252; + if (yych == '\r') goto yy249; + if (yych <= 0x1F) goto yy256; + goto yy249; } } else { if (yych <= '/') { - if (yych <= '%') goto yy259; - if (yych <= ')') goto yy252; - goto yy259; + if (yych <= '%') goto yy256; + if (yych <= ')') goto yy249; + goto yy256; } else { - if (yych <= '9') goto yy260; - if (yych == ';') goto yy252; - goto yy259; + if (yych <= '9') goto yy257; + if (yych == ';') goto yy249; + goto yy256; } } } else { if (yych <= '`') { if (yych <= 'A') { - if (yych <= '=') goto yy252; - if (yych <= '@') goto yy259; - goto yy283; + if (yych <= '=') goto yy249; + if (yych <= '@') goto yy256; + goto yy280; } else { - if (yych <= 'Z') goto yy260; - if (yych == '_') goto yy260; - goto yy259; + if (yych <= 'Z') goto yy257; + if (yych == '_') goto yy257; + goto yy256; } } else { if (yych <= '{') { - if (yych <= 'a') goto yy283; - if (yych <= 'z') goto yy260; - goto yy259; + if (yych <= 'a') goto yy280; + if (yych <= 'z') goto yy257; + goto yy256; } else { - if (yych == '}') goto yy259; - if (yych <= '~') goto yy252; - goto yy259; + if (yych == '}') goto yy256; + if (yych <= '~') goto yy249; + goto yy256; } } } -yy254: - YYDEBUG(254, *YYCURSOR); +yy251: + YYDEBUG(251, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'N') { if (yych <= '%') { if (yych <= '\f') { - if (yych <= 0x00) goto yy252; - if (yych <= 0x08) goto yy259; - if (yych <= '\n') goto yy252; - goto yy259; + if (yych <= 0x00) goto yy249; + if (yych <= 0x08) goto yy256; + if (yych <= '\n') goto yy249; + goto yy256; } else { - if (yych <= '\r') goto yy252; - if (yych <= 0x1F) goto yy259; - if (yych <= '"') goto yy252; - goto yy259; + if (yych <= '\r') goto yy249; + if (yych <= 0x1F) goto yy256; + if (yych <= '"') goto yy249; + goto yy256; } } else { if (yych <= ':') { - if (yych <= ')') goto yy252; - if (yych <= '/') goto yy259; - if (yych <= '9') goto yy260; - goto yy259; + if (yych <= ')') goto yy249; + if (yych <= '/') goto yy256; + if (yych <= '9') goto yy257; + goto yy256; } else { if (yych <= '<') { - if (yych <= ';') goto yy252; - goto yy259; + if (yych <= ';') goto yy249; + goto yy256; } else { - if (yych <= '=') goto yy252; - if (yych <= '@') goto yy259; - goto yy260; + if (yych <= '=') goto yy249; + if (yych <= '@') goto yy256; + goto yy257; } } } } else { if (yych <= 'n') { if (yych <= 'Z') { - if (yych <= 'O') goto yy279; - if (yych == 'U') goto yy280; - goto yy260; + if (yych <= 'O') goto yy276; + if (yych == 'U') goto yy277; + goto yy257; } else { - if (yych == '_') goto yy260; - if (yych <= '`') goto yy259; - goto yy260; + if (yych == '_') goto yy257; + if (yych <= '`') goto yy256; + goto yy257; } } else { if (yych <= 'z') { - if (yych <= 'o') goto yy279; - if (yych == 'u') goto yy280; - goto yy260; + if (yych <= 'o') goto yy276; + if (yych == 'u') goto yy277; + goto yy257; } else { if (yych <= '|') { - if (yych <= '{') goto yy259; - goto yy252; + if (yych <= '{') goto yy256; + goto yy249; } else { - if (yych == '~') goto yy252; - goto yy259; + if (yych == '~') goto yy249; + goto yy256; } } } } -yy255: - YYDEBUG(255, *YYCURSOR); +yy252: + YYDEBUG(252, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'E') { if (yych <= '%') { if (yych <= '\f') { - if (yych <= 0x00) goto yy252; - if (yych <= 0x08) goto yy259; - if (yych <= '\n') goto yy252; - goto yy259; + if (yych <= 0x00) goto yy249; + if (yych <= 0x08) goto yy256; + if (yych <= '\n') goto yy249; + goto yy256; } else { - if (yych <= '\r') goto yy252; - if (yych <= 0x1F) goto yy259; - if (yych <= '"') goto yy252; - goto yy259; + if (yych <= '\r') goto yy249; + if (yych <= 0x1F) goto yy256; + if (yych <= '"') goto yy249; + goto yy256; } } else { if (yych <= ':') { - if (yych <= ')') goto yy252; - if (yych <= '/') goto yy259; - if (yych <= '9') goto yy260; - goto yy259; + if (yych <= ')') goto yy249; + if (yych <= '/') goto yy256; + if (yych <= '9') goto yy257; + goto yy256; } else { if (yych <= '<') { - if (yych <= ';') goto yy252; - goto yy259; + if (yych <= ';') goto yy249; + goto yy256; } else { - if (yych <= '=') goto yy252; - if (yych <= '@') goto yy259; - goto yy260; + if (yych <= '=') goto yy249; + if (yych <= '@') goto yy256; + goto yy257; } } } } else { if (yych <= 'e') { if (yych <= 'Z') { - if (yych <= 'F') goto yy274; - if (yych == 'N') goto yy268; - goto yy260; + if (yych <= 'F') goto yy271; + if (yych == 'N') goto yy265; + goto yy257; } else { - if (yych == '_') goto yy260; - if (yych <= '`') goto yy259; - goto yy260; + if (yych == '_') goto yy257; + if (yych <= '`') goto yy256; + goto yy257; } } else { if (yych <= 'z') { - if (yych <= 'f') goto yy274; - if (yych == 'n') goto yy268; - goto yy260; + if (yych <= 'f') goto yy271; + if (yych == 'n') goto yy265; + goto yy257; } else { if (yych <= '|') { - if (yych <= '{') goto yy259; - goto yy252; + if (yych <= '{') goto yy256; + goto yy249; } else { - if (yych == '~') goto yy252; - goto yy259; + if (yych == '~') goto yy249; + goto yy256; } } } } -yy256: - YYDEBUG(256, *YYCURSOR); +yy253: + YYDEBUG(253, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy252; - if (yych <= 0x08) goto yy259; - goto yy252; + if (yych <= 0x00) goto yy249; + if (yych <= 0x08) goto yy256; + goto yy249; } else { - if (yych == '\r') goto yy252; - if (yych <= 0x1F) goto yy259; - goto yy252; + if (yych == '\r') goto yy249; + if (yych <= 0x1F) goto yy256; + goto yy249; } } else { if (yych <= '9') { - if (yych <= '%') goto yy259; - if (yych <= ')') goto yy252; - if (yych <= '/') goto yy259; - goto yy260; + if (yych <= '%') goto yy256; + if (yych <= ')') goto yy249; + if (yych <= '/') goto yy256; + goto yy257; } else { - if (yych == ';') goto yy252; - if (yych <= '<') goto yy259; - goto yy252; + if (yych == ';') goto yy249; + if (yych <= '<') goto yy256; + goto yy249; } } } else { if (yych <= '`') { if (yych <= 'R') { - if (yych <= '@') goto yy259; - if (yych <= 'Q') goto yy260; - goto yy272; + if (yych <= '@') goto yy256; + if (yych <= 'Q') goto yy257; + goto yy269; } else { - if (yych <= 'Z') goto yy260; - if (yych == '_') goto yy260; - goto yy259; + if (yych <= 'Z') goto yy257; + if (yych == '_') goto yy257; + goto yy256; } } else { if (yych <= '{') { - if (yych == 'r') goto yy272; - if (yych <= 'z') goto yy260; - goto yy259; + if (yych == 'r') goto yy269; + if (yych <= 'z') goto yy257; + goto yy256; } else { - if (yych == '}') goto yy259; - if (yych <= '~') goto yy252; - goto yy259; + if (yych == '}') goto yy256; + if (yych <= '~') goto yy249; + goto yy256; } } } -yy257: - YYDEBUG(257, *YYCURSOR); +yy254: + YYDEBUG(254, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy252; - if (yych <= 0x08) goto yy259; - goto yy252; + if (yych <= 0x00) goto yy249; + if (yych <= 0x08) goto yy256; + goto yy249; } else { - if (yych == '\r') goto yy252; - if (yych <= 0x1F) goto yy259; - goto yy252; + if (yych == '\r') goto yy249; + if (yych <= 0x1F) goto yy256; + goto yy249; } } else { if (yych <= '9') { - if (yych <= '%') goto yy259; - if (yych <= ')') goto yy252; - if (yych <= '/') goto yy259; - goto yy260; + if (yych <= '%') goto yy256; + if (yych <= ')') goto yy249; + if (yych <= '/') goto yy256; + goto yy257; } else { - if (yych == ';') goto yy252; - if (yych <= '<') goto yy259; - goto yy252; + if (yych == ';') goto yy249; + if (yych <= '<') goto yy256; + goto yy249; } } } else { if (yych <= '`') { if (yych <= 'E') { - if (yych <= '@') goto yy259; - if (yych <= 'D') goto yy260; - goto yy262; - } else { - if (yych <= 'Z') goto yy260; - if (yych == '_') goto yy260; + if (yych <= '@') goto yy256; + if (yych <= 'D') goto yy257; goto yy259; + } else { + if (yych <= 'Z') goto yy257; + if (yych == '_') goto yy257; + goto yy256; } } else { if (yych <= '{') { - if (yych == 'e') goto yy262; - if (yych <= 'z') goto yy260; - goto yy259; + if (yych == 'e') goto yy259; + if (yych <= 'z') goto yy257; + goto yy256; } else { - if (yych == '}') goto yy259; - if (yych <= '~') goto yy252; - goto yy259; + if (yych == '}') goto yy256; + if (yych <= '~') goto yy249; + goto yy256; } } } -yy258: - YYDEBUG(258, *YYCURSOR); +yy255: + YYDEBUG(255, *YYCURSOR); yyaccept = 0; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy259: - YYDEBUG(259, *YYCURSOR); +yy256: + YYDEBUG(256, *YYCURSOR); if (yybm[0+yych] & 2) { - goto yy258; + goto yy255; } - if (yych == '$') goto yy263; - goto yy232; -yy260: - YYDEBUG(260, *YYCURSOR); + if (yych == '$') goto yy260; + goto yy229; +yy257: + YYDEBUG(257, *YYCURSOR); yyaccept = 4; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(261, *YYCURSOR); + YYDEBUG(258, *YYCURSOR); if (yybm[0+yych] & 4) { - goto yy260; + goto yy257; } if (yych <= '%') { if (yych <= '\r') { if (yych <= 0x08) { - if (yych <= 0x00) goto yy252; - goto yy258; + if (yych <= 0x00) goto yy249; + goto yy255; } else { - if (yych <= '\n') goto yy252; - if (yych <= '\f') goto yy258; - goto yy252; + if (yych <= '\n') goto yy249; + if (yych <= '\f') goto yy255; + goto yy249; } } else { if (yych <= '"') { - if (yych <= 0x1F) goto yy258; - goto yy252; + if (yych <= 0x1F) goto yy255; + goto yy249; } else { - if (yych == '$') goto yy263; - goto yy258; + if (yych == '$') goto yy260; + goto yy255; } } } else { if (yych <= '=') { if (yych <= ':') { - if (yych <= ')') goto yy252; - goto yy258; + if (yych <= ')') goto yy249; + goto yy255; } else { - if (yych == '<') goto yy258; - goto yy252; + if (yych == '<') goto yy255; + goto yy249; } } else { if (yych <= '|') { - if (yych <= '{') goto yy258; - goto yy252; + if (yych <= '{') goto yy255; + goto yy249; } else { - if (yych == '~') goto yy252; - goto yy258; + if (yych == '~') goto yy249; + goto yy255; } } } -yy262: - YYDEBUG(262, *YYCURSOR); +yy259: + YYDEBUG(259, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy252; - if (yych <= 0x08) goto yy259; - goto yy252; + if (yych <= 0x00) goto yy249; + if (yych <= 0x08) goto yy256; + goto yy249; } else { - if (yych == '\r') goto yy252; - if (yych <= 0x1F) goto yy259; - goto yy252; + if (yych == '\r') goto yy249; + if (yych <= 0x1F) goto yy256; + goto yy249; } } else { if (yych <= '9') { - if (yych <= '%') goto yy259; - if (yych <= ')') goto yy252; - if (yych <= '/') goto yy259; - goto yy260; + if (yych <= '%') goto yy256; + if (yych <= ')') goto yy249; + if (yych <= '/') goto yy256; + goto yy257; } else { - if (yych == ';') goto yy252; - if (yych <= '<') goto yy259; - goto yy252; + if (yych == ';') goto yy249; + if (yych <= '<') goto yy256; + goto yy249; } } } else { if (yych <= '`') { if (yych <= 'S') { - if (yych <= '@') goto yy259; - if (yych <= 'R') goto yy260; - goto yy268; + if (yych <= '@') goto yy256; + if (yych <= 'R') goto yy257; + goto yy265; } else { - if (yych <= 'Z') goto yy260; - if (yych == '_') goto yy260; - goto yy259; + if (yych <= 'Z') goto yy257; + if (yych == '_') goto yy257; + goto yy256; } } else { if (yych <= '{') { - if (yych == 's') goto yy268; - if (yych <= 'z') goto yy260; - goto yy259; + if (yych == 's') goto yy265; + if (yych <= 'z') goto yy257; + goto yy256; } else { - if (yych == '}') goto yy259; - if (yych <= '~') goto yy252; - goto yy259; + if (yych == '}') goto yy256; + if (yych <= '~') goto yy249; + goto yy256; } } } -yy263: - YYDEBUG(263, *YYCURSOR); +yy260: + YYDEBUG(260, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; if (yych <= '\\') { - if (yych <= 0x00) goto yy264; - if (yych <= '[') goto yy258; - goto yy265; + if (yych <= 0x00) goto yy261; + if (yych <= '[') goto yy255; + goto yy262; } else { - if (yych != '{') goto yy258; + if (yych != '{') goto yy255; } -yy264: - YYDEBUG(264, *YYCURSOR); +yy261: + YYDEBUG(261, *YYCURSOR); YYCURSOR = YYMARKER; if (yyaccept <= 3) { if (yyaccept <= 1) { if (yyaccept <= 0) { - goto yy232; + goto yy229; } else { - goto yy234; + goto yy231; } } else { if (yyaccept <= 2) { - goto yy230; + goto yy227; } else { - goto yy247; + goto yy244; } } } else { if (yyaccept <= 5) { if (yyaccept <= 4) { - goto yy252; + goto yy249; } else { - goto yy269; + goto yy266; } } else { - goto yy276; + goto yy273; } } -yy265: - YYDEBUG(265, *YYCURSOR); +yy262: + YYDEBUG(262, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 8) { - goto yy266; + goto yy263; } - goto yy258; -yy266: - YYDEBUG(266, *YYCURSOR); + goto yy255; +yy263: + YYDEBUG(263, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(267, *YYCURSOR); + YYDEBUG(264, *YYCURSOR); if (yybm[0+yych] & 8) { - goto yy266; + goto yy263; } - if (yych <= 0x00) goto yy232; - if (yych == '\\') goto yy265; - goto yy258; -yy268: - YYDEBUG(268, *YYCURSOR); + 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 yy270; + goto yy267; } if (yych <= ';') { if (yych <= ' ') { if (yych <= '\n') { - if (yych <= 0x00) goto yy269; - if (yych <= '\t') goto yy259; + if (yych <= 0x00) goto yy266; + if (yych <= '\t') goto yy256; } else { - if (yych != '\r') goto yy259; + if (yych != '\r') goto yy256; } } else { if (yych <= ')') { - if (yych <= '"') goto yy269; - if (yych <= '%') goto yy259; + if (yych <= '"') goto yy266; + if (yych <= '%') goto yy256; } else { - if (yych <= '/') goto yy259; - if (yych <= '9') goto yy260; - if (yych <= ':') goto yy259; + if (yych <= '/') goto yy256; + if (yych <= '9') goto yy257; + if (yych <= ':') goto yy256; } } } else { if (yych <= '_') { if (yych <= '@') { - if (yych != '=') goto yy259; + if (yych != '=') goto yy256; } else { - if (yych <= 'Z') goto yy260; - if (yych <= '^') goto yy259; - goto yy260; + if (yych <= 'Z') goto yy257; + if (yych <= '^') goto yy256; + goto yy257; } } else { if (yych <= '{') { - if (yych <= '`') goto yy259; - if (yych <= 'z') goto yy260; - goto yy259; + if (yych <= '`') goto yy256; + if (yych <= 'z') goto yy257; + goto yy256; } else { - if (yych == '}') goto yy259; - if (yych >= 0x7F) goto yy259; + if (yych == '}') goto yy256; + if (yych >= 0x7F) goto yy256; } } } -yy269: - YYDEBUG(269, *YYCURSOR); +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 3637 "Zend/zend_ini_scanner.c" -yy270: - YYDEBUG(270, *YYCURSOR); +#line 3623 "Zend/zend_ini_scanner.c" +yy267: + YYDEBUG(267, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(271, *YYCURSOR); + YYDEBUG(268, *YYCURSOR); if (yybm[0+yych] & 16) { - goto yy270; + goto yy267; } - goto yy269; -yy272: - YYDEBUG(272, *YYCURSOR); + goto yy266; +yy269: + YYDEBUG(269, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy252; - if (yych <= 0x08) goto yy259; - goto yy252; + if (yych <= 0x00) goto yy249; + if (yych <= 0x08) goto yy256; + goto yy249; } else { - if (yych == '\r') goto yy252; - if (yych <= 0x1F) goto yy259; - goto yy252; + if (yych == '\r') goto yy249; + if (yych <= 0x1F) goto yy256; + goto yy249; } } else { if (yych <= '9') { - if (yych <= '%') goto yy259; - if (yych <= ')') goto yy252; - if (yych <= '/') goto yy259; - goto yy260; + if (yych <= '%') goto yy256; + if (yych <= ')') goto yy249; + if (yych <= '/') goto yy256; + goto yy257; } else { - if (yych == ';') goto yy252; - if (yych <= '<') goto yy259; - goto yy252; + if (yych == ';') goto yy249; + if (yych <= '<') goto yy256; + goto yy249; } } } else { if (yych <= '`') { if (yych <= 'U') { - if (yych <= '@') goto yy259; - if (yych <= 'T') goto yy260; + if (yych <= '@') goto yy256; + if (yych <= 'T') goto yy257; } else { - if (yych <= 'Z') goto yy260; - if (yych == '_') goto yy260; - goto yy259; + if (yych <= 'Z') goto yy257; + if (yych == '_') goto yy257; + goto yy256; } } else { if (yych <= '{') { - if (yych == 'u') goto yy273; - if (yych <= 'z') goto yy260; - goto yy259; + if (yych == 'u') goto yy270; + if (yych <= 'z') goto yy257; + goto yy256; } else { - if (yych == '}') goto yy259; - if (yych <= '~') goto yy252; - goto yy259; + if (yych == '}') goto yy256; + if (yych <= '~') goto yy249; + goto yy256; } } } -yy273: - YYDEBUG(273, *YYCURSOR); +yy270: + YYDEBUG(270, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy252; - if (yych <= 0x08) goto yy259; - goto yy252; + if (yych <= 0x00) goto yy249; + if (yych <= 0x08) goto yy256; + goto yy249; } else { - if (yych == '\r') goto yy252; - if (yych <= 0x1F) goto yy259; - goto yy252; + if (yych == '\r') goto yy249; + if (yych <= 0x1F) goto yy256; + goto yy249; } } else { if (yych <= '9') { - if (yych <= '%') goto yy259; - if (yych <= ')') goto yy252; - if (yych <= '/') goto yy259; - goto yy260; + if (yych <= '%') goto yy256; + if (yych <= ')') goto yy249; + if (yych <= '/') goto yy256; + goto yy257; } else { - if (yych == ';') goto yy252; - if (yych <= '<') goto yy259; - goto yy252; + if (yych == ';') goto yy249; + if (yych <= '<') goto yy256; + goto yy249; } } } else { if (yych <= '`') { if (yych <= 'E') { - if (yych <= '@') goto yy259; - if (yych <= 'D') goto yy260; - goto yy268; + if (yych <= '@') goto yy256; + if (yych <= 'D') goto yy257; + goto yy265; } else { - if (yych <= 'Z') goto yy260; - if (yych == '_') goto yy260; - goto yy259; + if (yych <= 'Z') goto yy257; + if (yych == '_') goto yy257; + goto yy256; } } else { if (yych <= '{') { - if (yych == 'e') goto yy268; - if (yych <= 'z') goto yy260; - goto yy259; + if (yych == 'e') goto yy265; + if (yych <= 'z') goto yy257; + goto yy256; } else { - if (yych == '}') goto yy259; - if (yych <= '~') goto yy252; - goto yy259; + if (yych == '}') goto yy256; + if (yych <= '~') goto yy249; + goto yy256; } } } -yy274: - YYDEBUG(274, *YYCURSOR); +yy271: + YYDEBUG(271, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy252; - if (yych <= 0x08) goto yy259; - goto yy252; + if (yych <= 0x00) goto yy249; + if (yych <= 0x08) goto yy256; + goto yy249; } else { - if (yych == '\r') goto yy252; - if (yych <= 0x1F) goto yy259; - goto yy252; + if (yych == '\r') goto yy249; + if (yych <= 0x1F) goto yy256; + goto yy249; } } else { if (yych <= '9') { - if (yych <= '%') goto yy259; - if (yych <= ')') goto yy252; - if (yych <= '/') goto yy259; - goto yy260; + if (yych <= '%') goto yy256; + if (yych <= ')') goto yy249; + if (yych <= '/') goto yy256; + goto yy257; } else { - if (yych == ';') goto yy252; - if (yych <= '<') goto yy259; - goto yy252; + if (yych == ';') goto yy249; + if (yych <= '<') goto yy256; + goto yy249; } } } else { if (yych <= '`') { if (yych <= 'F') { - if (yych <= '@') goto yy259; - if (yych <= 'E') goto yy260; + if (yych <= '@') goto yy256; + if (yych <= 'E') goto yy257; } else { - if (yych <= 'Z') goto yy260; - if (yych == '_') goto yy260; - goto yy259; + if (yych <= 'Z') goto yy257; + if (yych == '_') goto yy257; + goto yy256; } } else { if (yych <= '{') { - if (yych == 'f') goto yy275; - if (yych <= 'z') goto yy260; - goto yy259; + if (yych == 'f') goto yy272; + if (yych <= 'z') goto yy257; + goto yy256; } else { - if (yych == '}') goto yy259; - if (yych <= '~') goto yy252; - goto yy259; + if (yych == '}') goto yy256; + if (yych <= '~') goto yy249; + goto yy256; } } } -yy275: - YYDEBUG(275, *YYCURSOR); +yy272: + YYDEBUG(272, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 4) { - goto yy260; + goto yy257; } if (yych <= '%') { if (yych <= '\f') { if (yych <= 0x08) { - if (yych >= 0x01) goto yy259; + if (yych >= 0x01) goto yy256; } else { - if (yych <= '\t') goto yy277; - if (yych >= '\v') goto yy259; + if (yych <= '\t') goto yy274; + if (yych >= '\v') goto yy256; } } else { if (yych <= 0x1F) { - if (yych >= 0x0E) goto yy259; + if (yych >= 0x0E) goto yy256; } else { - if (yych <= ' ') goto yy277; - if (yych >= '#') goto yy259; + if (yych <= ' ') goto yy274; + if (yych >= '#') goto yy256; } } } else { if (yych <= '=') { if (yych <= ':') { - if (yych >= '*') goto yy259; + if (yych >= '*') goto yy256; } else { - if (yych == '<') goto yy259; + if (yych == '<') goto yy256; } } else { if (yych <= '|') { - if (yych <= '{') goto yy259; + if (yych <= '{') goto yy256; } else { - if (yych != '~') goto yy259; + if (yych != '~') goto yy256; } } } -yy276: - YYDEBUG(276, *YYCURSOR); +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 3841 "Zend/zend_ini_scanner.c" -yy277: - YYDEBUG(277, *YYCURSOR); +#line 3827 "Zend/zend_ini_scanner.c" +yy274: + YYDEBUG(274, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(278, *YYCURSOR); - if (yych == '\t') goto yy277; - if (yych == ' ') goto yy277; - goto yy276; -yy279: - YYDEBUG(279, *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 yy276; - if (yych <= 0x08) goto yy259; - if (yych <= '\t') goto yy277; - goto yy276; + if (yych <= 0x00) goto yy273; + if (yych <= 0x08) goto yy256; + if (yych <= '\t') goto yy274; + goto yy273; } else { - if (yych == '\r') goto yy276; - if (yych <= 0x1F) goto yy259; - goto yy277; + if (yych == '\r') goto yy273; + if (yych <= 0x1F) goto yy256; + goto yy274; } } else { if (yych <= '/') { - if (yych <= '"') goto yy276; - if (yych <= '%') goto yy259; - if (yych <= ')') goto yy276; - goto yy259; + if (yych <= '"') goto yy273; + if (yych <= '%') goto yy256; + if (yych <= ')') goto yy273; + goto yy256; } else { - if (yych <= '9') goto yy260; - if (yych == ';') goto yy276; - goto yy259; + if (yych <= '9') goto yy257; + if (yych == ';') goto yy273; + goto yy256; } } } else { if (yych <= '`') { if (yych <= 'N') { - if (yych <= '=') goto yy276; - if (yych <= '@') goto yy259; - if (yych <= 'M') goto yy260; - goto yy282; + if (yych <= '=') goto yy273; + if (yych <= '@') goto yy256; + if (yych <= 'M') goto yy257; + goto yy279; } else { - if (yych <= 'Z') goto yy260; - if (yych == '_') goto yy260; - goto yy259; + if (yych <= 'Z') goto yy257; + if (yych == '_') goto yy257; + goto yy256; } } else { if (yych <= '{') { - if (yych == 'n') goto yy282; - if (yych <= 'z') goto yy260; - goto yy259; + if (yych == 'n') goto yy279; + if (yych <= 'z') goto yy257; + goto yy256; } else { - if (yych == '}') goto yy259; - if (yych <= '~') goto yy276; - goto yy259; + if (yych == '}') goto yy256; + if (yych <= '~') goto yy273; + goto yy256; } } } -yy280: - YYDEBUG(280, *YYCURSOR); +yy277: + YYDEBUG(277, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy252; - if (yych <= 0x08) goto yy259; - goto yy252; + if (yych <= 0x00) goto yy249; + if (yych <= 0x08) goto yy256; + goto yy249; } else { - if (yych == '\r') goto yy252; - if (yych <= 0x1F) goto yy259; - goto yy252; + if (yych == '\r') goto yy249; + if (yych <= 0x1F) goto yy256; + goto yy249; } } else { if (yych <= '9') { - if (yych <= '%') goto yy259; - if (yych <= ')') goto yy252; - if (yych <= '/') goto yy259; - goto yy260; + if (yych <= '%') goto yy256; + if (yych <= ')') goto yy249; + if (yych <= '/') goto yy256; + goto yy257; } else { - if (yych == ';') goto yy252; - if (yych <= '<') goto yy259; - goto yy252; + if (yych == ';') goto yy249; + if (yych <= '<') goto yy256; + goto yy249; } } } else { if (yych <= '`') { if (yych <= 'L') { - if (yych <= '@') goto yy259; - if (yych <= 'K') goto yy260; + if (yych <= '@') goto yy256; + if (yych <= 'K') goto yy257; } else { - if (yych <= 'Z') goto yy260; - if (yych == '_') goto yy260; - goto yy259; + if (yych <= 'Z') goto yy257; + if (yych == '_') goto yy257; + goto yy256; } } else { if (yych <= '{') { - if (yych == 'l') goto yy281; - if (yych <= 'z') goto yy260; - goto yy259; + if (yych == 'l') goto yy278; + if (yych <= 'z') goto yy257; + goto yy256; } else { - if (yych == '}') goto yy259; - if (yych <= '~') goto yy252; - goto yy259; + if (yych == '}') goto yy256; + if (yych <= '~') goto yy249; + goto yy256; } } } -yy281: - YYDEBUG(281, *YYCURSOR); +yy278: + YYDEBUG(278, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy252; - if (yych <= 0x08) goto yy259; - goto yy252; + if (yych <= 0x00) goto yy249; + if (yych <= 0x08) goto yy256; + goto yy249; } else { - if (yych == '\r') goto yy252; - if (yych <= 0x1F) goto yy259; - goto yy252; + if (yych == '\r') goto yy249; + if (yych <= 0x1F) goto yy256; + goto yy249; } } else { if (yych <= '9') { - if (yych <= '%') goto yy259; - if (yych <= ')') goto yy252; - if (yych <= '/') goto yy259; - goto yy260; + if (yych <= '%') goto yy256; + if (yych <= ')') goto yy249; + if (yych <= '/') goto yy256; + goto yy257; } else { - if (yych == ';') goto yy252; - if (yych <= '<') goto yy259; - goto yy252; + if (yych == ';') goto yy249; + if (yych <= '<') goto yy256; + goto yy249; } } } else { if (yych <= '`') { if (yych <= 'L') { - if (yych <= '@') goto yy259; - if (yych <= 'K') goto yy260; - goto yy275; + if (yych <= '@') goto yy256; + if (yych <= 'K') goto yy257; + goto yy272; } else { - if (yych <= 'Z') goto yy260; - if (yych == '_') goto yy260; - goto yy259; + if (yych <= 'Z') goto yy257; + if (yych == '_') goto yy257; + goto yy256; } } else { if (yych <= '{') { - if (yych == 'l') goto yy275; - if (yych <= 'z') goto yy260; - goto yy259; + if (yych == 'l') goto yy272; + if (yych <= 'z') goto yy257; + goto yy256; } else { - if (yych == '}') goto yy259; - if (yych <= '~') goto yy252; - goto yy259; + if (yych == '}') goto yy256; + if (yych <= '~') goto yy249; + goto yy256; } } } -yy282: - YYDEBUG(282, *YYCURSOR); +yy279: + YYDEBUG(279, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy252; - if (yych <= 0x08) goto yy259; - goto yy252; + if (yych <= 0x00) goto yy249; + if (yych <= 0x08) goto yy256; + goto yy249; } else { - if (yych == '\r') goto yy252; - if (yych <= 0x1F) goto yy259; - goto yy252; + if (yych == '\r') goto yy249; + if (yych <= 0x1F) goto yy256; + goto yy249; } } else { if (yych <= '9') { - if (yych <= '%') goto yy259; - if (yych <= ')') goto yy252; - if (yych <= '/') goto yy259; - goto yy260; + if (yych <= '%') goto yy256; + if (yych <= ')') goto yy249; + if (yych <= '/') goto yy256; + goto yy257; } else { - if (yych == ';') goto yy252; - if (yych <= '<') goto yy259; - goto yy252; + if (yych == ';') goto yy249; + if (yych <= '<') goto yy256; + goto yy249; } } } else { if (yych <= '`') { if (yych <= 'E') { - if (yych <= '@') goto yy259; - if (yych <= 'D') goto yy260; - goto yy275; + if (yych <= '@') goto yy256; + if (yych <= 'D') goto yy257; + goto yy272; } else { - if (yych <= 'Z') goto yy260; - if (yych == '_') goto yy260; - goto yy259; + if (yych <= 'Z') goto yy257; + if (yych == '_') goto yy257; + goto yy256; } } else { if (yych <= '{') { - if (yych == 'e') goto yy275; - if (yych <= 'z') goto yy260; - goto yy259; + if (yych == 'e') goto yy272; + if (yych <= 'z') goto yy257; + goto yy256; } else { - if (yych == '}') goto yy259; - if (yych <= '~') goto yy252; - goto yy259; + if (yych == '}') goto yy256; + if (yych <= '~') goto yy249; + goto yy256; } } } -yy283: - YYDEBUG(283, *YYCURSOR); +yy280: + YYDEBUG(280, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy252; - if (yych <= 0x08) goto yy259; - goto yy252; + if (yych <= 0x00) goto yy249; + if (yych <= 0x08) goto yy256; + goto yy249; } else { - if (yych == '\r') goto yy252; - if (yych <= 0x1F) goto yy259; - goto yy252; + if (yych == '\r') goto yy249; + if (yych <= 0x1F) goto yy256; + goto yy249; } } else { if (yych <= '9') { - if (yych <= '%') goto yy259; - if (yych <= ')') goto yy252; - if (yych <= '/') goto yy259; - goto yy260; + if (yych <= '%') goto yy256; + if (yych <= ')') goto yy249; + if (yych <= '/') goto yy256; + goto yy257; } else { - if (yych == ';') goto yy252; - if (yych <= '<') goto yy259; - goto yy252; + if (yych == ';') goto yy249; + if (yych <= '<') goto yy256; + goto yy249; } } } else { if (yych <= '`') { if (yych <= 'L') { - if (yych <= '@') goto yy259; - if (yych <= 'K') goto yy260; + if (yych <= '@') goto yy256; + if (yych <= 'K') goto yy257; } else { - if (yych <= 'Z') goto yy260; - if (yych == '_') goto yy260; - goto yy259; + if (yych <= 'Z') goto yy257; + if (yych == '_') goto yy257; + goto yy256; } } else { if (yych <= '{') { - if (yych == 'l') goto yy284; - if (yych <= 'z') goto yy260; - goto yy259; + if (yych == 'l') goto yy281; + if (yych <= 'z') goto yy257; + goto yy256; } else { - if (yych == '}') goto yy259; - if (yych <= '~') goto yy252; - goto yy259; + if (yych == '}') goto yy256; + if (yych <= '~') goto yy249; + goto yy256; } } } -yy284: - YYDEBUG(284, *YYCURSOR); +yy281: + YYDEBUG(281, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy252; - if (yych <= 0x08) goto yy259; - goto yy252; + if (yych <= 0x00) goto yy249; + if (yych <= 0x08) goto yy256; + goto yy249; } else { - if (yych == '\r') goto yy252; - if (yych <= 0x1F) goto yy259; - goto yy252; + if (yych == '\r') goto yy249; + if (yych <= 0x1F) goto yy256; + goto yy249; } } else { if (yych <= '9') { - if (yych <= '%') goto yy259; - if (yych <= ')') goto yy252; - if (yych <= '/') goto yy259; - goto yy260; + if (yych <= '%') goto yy256; + if (yych <= ')') goto yy249; + if (yych <= '/') goto yy256; + goto yy257; } else { - if (yych == ';') goto yy252; - if (yych <= '<') goto yy259; - goto yy252; + if (yych == ';') goto yy249; + if (yych <= '<') goto yy256; + goto yy249; } } } else { if (yych <= '`') { if (yych <= 'S') { - if (yych <= '@') goto yy259; - if (yych <= 'R') goto yy260; + if (yych <= '@') goto yy256; + if (yych <= 'R') goto yy257; } else { - if (yych <= 'Z') goto yy260; - if (yych == '_') goto yy260; - goto yy259; + if (yych <= 'Z') goto yy257; + if (yych == '_') goto yy257; + goto yy256; } } else { if (yych <= '{') { - if (yych == 's') goto yy285; - if (yych <= 'z') goto yy260; - goto yy259; + if (yych == 's') goto yy282; + if (yych <= 'z') goto yy257; + goto yy256; } else { - if (yych == '}') goto yy259; - if (yych <= '~') goto yy252; - goto yy259; + if (yych == '}') goto yy256; + if (yych <= '~') goto yy249; + goto yy256; } } } -yy285: - YYDEBUG(285, *YYCURSOR); +yy282: + YYDEBUG(282, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '=') { if (yych <= '"') { if (yych <= '\n') { - if (yych <= 0x00) goto yy252; - if (yych <= 0x08) goto yy259; - goto yy252; + if (yych <= 0x00) goto yy249; + if (yych <= 0x08) goto yy256; + goto yy249; } else { - if (yych == '\r') goto yy252; - if (yych <= 0x1F) goto yy259; - goto yy252; + if (yych == '\r') goto yy249; + if (yych <= 0x1F) goto yy256; + goto yy249; } } else { if (yych <= '9') { - if (yych <= '%') goto yy259; - if (yych <= ')') goto yy252; - if (yych <= '/') goto yy259; - goto yy260; + if (yych <= '%') goto yy256; + if (yych <= ')') goto yy249; + if (yych <= '/') goto yy256; + goto yy257; } else { - if (yych == ';') goto yy252; - if (yych <= '<') goto yy259; - goto yy252; + if (yych == ';') goto yy249; + if (yych <= '<') goto yy256; + goto yy249; } } } else { if (yych <= '`') { if (yych <= 'E') { - if (yych <= '@') goto yy259; - if (yych <= 'D') goto yy260; - goto yy275; + if (yych <= '@') goto yy256; + if (yych <= 'D') goto yy257; + goto yy272; } else { - if (yych <= 'Z') goto yy260; - if (yych == '_') goto yy260; - goto yy259; + if (yych <= 'Z') goto yy257; + if (yych == '_') goto yy257; + goto yy256; } } else { if (yych <= '{') { - if (yych == 'e') goto yy275; - if (yych <= 'z') goto yy260; - goto yy259; + if (yych == 'e') goto yy272; + if (yych <= 'z') goto yy257; + goto yy256; } else { - if (yych == '}') goto yy259; - if (yych <= '~') goto yy252; - goto yy259; + if (yych == '}') goto yy256; + if (yych <= '~') goto yy249; + goto yy256; } } } -yy286: - YYDEBUG(286, *YYCURSOR); +yy283: + YYDEBUG(283, *YYCURSOR); ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; -yy287: - YYDEBUG(287, *YYCURSOR); +yy284: + YYDEBUG(284, *YYCURSOR); if (yybm[0+yych] & 32) { - goto yy286; + goto yy283; } - if (yych >= '\r') goto yy290; -yy288: - YYDEBUG(288, *YYCURSOR); + if (yych >= '\r') goto yy287; +yy285: + YYDEBUG(285, *YYCURSOR); ++YYCURSOR; -yy289: - YYDEBUG(289, *YYCURSOR); +yy286: + YYDEBUG(286, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 578 "Zend/zend_ini_scanner.l" +#line 585 "Zend/zend_ini_scanner.l" { /* Comment */ BEGIN(INITIAL); SCNG(lineno)++; return END_OF_LINE; } -#line 4223 "Zend/zend_ini_scanner.c" -yy290: - YYDEBUG(290, *YYCURSOR); +#line 4209 "Zend/zend_ini_scanner.c" +yy287: + YYDEBUG(287, *YYCURSOR); yych = *++YYCURSOR; - if (yych == '\n') goto yy288; - goto yy289; -yy291: - YYDEBUG(291, *YYCURSOR); + if (yych == '\n') goto yy285; + goto yy286; +yy288: + YYDEBUG(288, *YYCURSOR); yyaccept = 3; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(292, *YYCURSOR); + YYDEBUG(289, *YYCURSOR); if (yybm[0+yych] & 64) { - goto yy291; + goto yy288; } if (yych <= '%') { if (yych <= '\r') { if (yych <= 0x08) { - if (yych <= 0x00) goto yy247; - goto yy258; + if (yych <= 0x00) goto yy244; + goto yy255; } else { - if (yych <= '\n') goto yy247; - if (yych <= '\f') goto yy258; - goto yy247; + if (yych <= '\n') goto yy244; + if (yych <= '\f') goto yy255; + goto yy244; } } else { if (yych <= '"') { - if (yych <= 0x1F) goto yy258; - goto yy247; + if (yych <= 0x1F) goto yy255; + goto yy244; } else { - if (yych == '$') goto yy263; - goto yy258; + if (yych == '$') goto yy260; + goto yy255; } } } else { if (yych <= '=') { if (yych <= ':') { - if (yych <= ')') goto yy247; - goto yy258; + if (yych <= ')') goto yy244; + goto yy255; } else { - if (yych == '<') goto yy258; - goto yy247; + if (yych == '<') goto yy255; + goto yy244; } } else { if (yych <= '|') { - if (yych <= '{') goto yy258; - goto yy247; + if (yych <= '{') goto yy255; + goto yy244; } else { - if (yych == '~') goto yy247; - goto yy258; + if (yych == '~') goto yy244; + goto yy255; } } } -yy293: - YYDEBUG(293, *YYCURSOR); +yy290: + YYDEBUG(290, *YYCURSOR); yyaccept = 3; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(294, *YYCURSOR); + YYDEBUG(291, *YYCURSOR); if (yych <= '-') { if (yych <= 0x1F) { if (yych <= '\n') { - if (yych <= 0x00) goto yy247; - if (yych <= 0x08) goto yy258; - goto yy247; + if (yych <= 0x00) goto yy244; + if (yych <= 0x08) goto yy255; + goto yy244; } else { - if (yych == '\r') goto yy247; - goto yy258; + if (yych == '\r') goto yy244; + goto yy255; } } else { if (yych <= '$') { - if (yych <= '"') goto yy247; - if (yych <= '#') goto yy258; - goto yy263; + if (yych <= '"') goto yy244; + if (yych <= '#') goto yy255; + goto yy260; } else { - if (yych <= '%') goto yy258; - if (yych <= ')') goto yy247; - goto yy258; + if (yych <= '%') goto yy255; + if (yych <= ')') goto yy244; + goto yy255; } } } else { if (yych <= '<') { if (yych <= '9') { - if (yych <= '.') goto yy291; - if (yych <= '/') goto yy258; - goto yy293; + if (yych <= '.') goto yy288; + if (yych <= '/') goto yy255; + goto yy290; } else { - if (yych == ';') goto yy247; - goto yy258; + if (yych == ';') goto yy244; + goto yy255; } } else { if (yych <= '|') { - if (yych <= '=') goto yy247; - if (yych <= '{') goto yy258; - goto yy247; + if (yych <= '=') goto yy244; + if (yych <= '{') goto yy255; + goto yy244; } else { - if (yych == '~') goto yy247; - goto yy258; + if (yych == '~') goto yy244; + goto yy255; } } } -yy295: - YYDEBUG(295, *YYCURSOR); +yy292: + YYDEBUG(292, *YYCURSOR); yyaccept = 3; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(296, *YYCURSOR); + YYDEBUG(293, *YYCURSOR); if (yych <= ')') { if (yych <= '\r') { if (yych <= 0x08) { - if (yych <= 0x00) goto yy247; - goto yy258; + if (yych <= 0x00) goto yy244; + goto yy255; } else { - if (yych <= '\n') goto yy247; - if (yych <= '\f') goto yy258; - goto yy247; + if (yych <= '\n') goto yy244; + if (yych <= '\f') goto yy255; + goto yy244; } } else { if (yych <= '#') { - if (yych <= 0x1F) goto yy258; - if (yych <= '"') goto yy247; - goto yy258; + if (yych <= 0x1F) goto yy255; + if (yych <= '"') goto yy244; + goto yy255; } else { - if (yych <= '$') goto yy263; - if (yych <= '%') goto yy258; - goto yy247; + if (yych <= '$') goto yy260; + if (yych <= '%') goto yy255; + goto yy244; } } } else { if (yych <= '<') { if (yych <= '9') { - if (yych <= '/') goto yy258; - goto yy295; + if (yych <= '/') goto yy255; + goto yy292; } else { - if (yych == ';') goto yy247; - goto yy258; + if (yych == ';') goto yy244; + goto yy255; } } else { if (yych <= '|') { - if (yych <= '=') goto yy247; - if (yych <= '{') goto yy258; - goto yy247; + if (yych <= '=') goto yy244; + if (yych <= '{') goto yy255; + goto yy244; } else { - if (yych == '~') goto yy247; - goto yy258; + if (yych == '~') goto yy244; + goto yy255; } } } -yy297: - YYDEBUG(297, *YYCURSOR); +yy294: + YYDEBUG(294, *YYCURSOR); yyaccept = 3; YYMARKER = ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(298, *YYCURSOR); + YYDEBUG(295, *YYCURSOR); if (yych <= ')') { if (yych <= '\r') { if (yych <= 0x08) { - if (yych <= 0x00) goto yy247; - goto yy258; + if (yych <= 0x00) goto yy244; + goto yy255; } else { - if (yych <= '\n') goto yy247; - if (yych <= '\f') goto yy258; - goto yy247; + if (yych <= '\n') goto yy244; + if (yych <= '\f') goto yy255; + goto yy244; } } else { if (yych <= '#') { - if (yych <= 0x1F) goto yy258; - if (yych <= '"') goto yy247; - goto yy258; + if (yych <= 0x1F) goto yy255; + if (yych <= '"') goto yy244; + goto yy255; } else { - if (yych <= '$') goto yy263; - if (yych <= '%') goto yy258; - goto yy247; + if (yych <= '$') goto yy260; + if (yych <= '%') goto yy255; + goto yy244; } } } else { if (yych <= '<') { if (yych <= '9') { - if (yych <= '/') goto yy258; - goto yy297; + if (yych <= '/') goto yy255; + goto yy294; } else { - if (yych == ';') goto yy247; - goto yy258; + if (yych == ';') goto yy244; + goto yy255; } } else { if (yych <= '|') { - if (yych <= '=') goto yy247; - if (yych <= '{') goto yy258; - goto yy247; + if (yych <= '=') goto yy244; + if (yych <= '{') goto yy255; + goto yy244; } else { - if (yych == '~') goto yy247; - goto yy258; + if (yych == '~') goto yy244; + goto yy255; } } } -yy299: - YYDEBUG(299, *YYCURSOR); +yy296: + YYDEBUG(296, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; - YYDEBUG(300, *YYCURSOR); + YYDEBUG(297, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy299; + goto yy296; } - YYDEBUG(301, *YYCURSOR); + YYDEBUG(298, *YYCURSOR); ++YYCURSOR; - YYDEBUG(302, *YYCURSOR); + YYDEBUG(299, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 368 "Zend/zend_ini_scanner.l" { /* Raw string */ @@ -4440,66 +4426,66 @@ yy299: } RETURN_TOKEN(TC_RAW, yytext, yyleng); } -#line 4444 "Zend/zend_ini_scanner.c" -yy303: - YYDEBUG(303, *YYCURSOR); +#line 4430 "Zend/zend_ini_scanner.c" +yy300: + YYDEBUG(300, *YYCURSOR); ++YYCURSOR; - YYDEBUG(304, *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 4455 "Zend/zend_ini_scanner.c" -yy305: - YYDEBUG(305, *YYCURSOR); +#line 4441 "Zend/zend_ini_scanner.c" +yy302: + YYDEBUG(302, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy306: - YYDEBUG(306, *YYCURSOR); - if (yych == '\t') goto yy305; - if (yych == ' ') goto yy305; - goto yy239; -yy307: - YYDEBUG(307, *YYCURSOR); - yych = *++YYCURSOR; +yy303: + YYDEBUG(303, *YYCURSOR); + if (yych == '\t') goto yy302; + if (yych == ' ') goto yy302; goto yy236; -yy308: - YYDEBUG(308, *YYCURSOR); +yy304: + YYDEBUG(304, *YYCURSOR); + yych = *++YYCURSOR; + goto yy233; +yy305: + YYDEBUG(305, *YYCURSOR); yyaccept = 1; YYMARKER = ++YYCURSOR; YYFILL(2); yych = *YYCURSOR; -yy309: - YYDEBUG(309, *YYCURSOR); +yy306: + YYDEBUG(306, *YYCURSOR); if (yych <= 0x1F) { if (yych <= '\n') { - if (yych <= 0x08) goto yy234; - if (yych <= '\t') goto yy308; - goto yy307; + if (yych <= 0x08) goto yy231; + if (yych <= '\t') goto yy305; + goto yy304; } else { - if (yych == '\r') goto yy311; - goto yy234; + if (yych == '\r') goto yy308; + goto yy231; } } else { if (yych <= '"') { - if (yych <= ' ') goto yy308; - if (yych <= '!') goto yy234; + if (yych <= ' ') goto yy305; + if (yych <= '!') goto yy231; } else { - if (yych == ';') goto yy286; - goto yy234; + if (yych == ';') goto yy283; + goto yy231; } } - YYDEBUG(310, *YYCURSOR); + YYDEBUG(307, *YYCURSOR); yych = *++YYCURSOR; - goto yy241; -yy311: - YYDEBUG(311, *YYCURSOR); + goto yy238; +yy308: + YYDEBUG(308, *YYCURSOR); ++YYCURSOR; - if ((yych = *YYCURSOR) == '\n') goto yy307; - goto yy236; + if ((yych = *YYCURSOR) == '\n') goto yy304; + goto yy233; } /* *********************************** */ yyc_ST_VARNAME: @@ -4538,47 +4524,47 @@ yyc_ST_VARNAME: 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, }; - YYDEBUG(312, *YYCURSOR); + YYDEBUG(309, *YYCURSOR); YYFILL(2); yych = *YYCURSOR; if (yych <= '\'') { if (yych <= ' ') { if (yych <= '\n') { - if (yych >= '\t') goto yy316; + if (yych >= '\t') goto yy313; } else { - if (yych == '\r') goto yy316; + if (yych == '\r') goto yy313; } } else { if (yych <= '$') { - if (yych != '#') goto yy316; + if (yych != '#') goto yy313; } else { - if (yych == '&') goto yy316; + if (yych == '&') goto yy313; } } } else { if (yych <= 'Z') { if (yych <= ';') { - if (yych <= ')') goto yy316; - if (yych >= ';') goto yy316; + if (yych <= ')') goto yy313; + if (yych >= ';') goto yy313; } else { - if (yych == '=') goto yy316; + if (yych == '=') goto yy313; } } else { if (yych <= '|') { - if (yych <= '[') goto yy316; - if (yych >= '{') goto yy316; + if (yych <= '[') goto yy313; + if (yych >= '{') goto yy313; } else { - if (yych <= '}') goto yy318; - if (yych <= '~') goto yy316; + if (yych <= '}') goto yy315; + if (yych <= '~') goto yy313; } } } - YYDEBUG(314, *YYCURSOR); + YYDEBUG(311, *YYCURSOR); ++YYCURSOR; yych = *YYCURSOR; - goto yy321; -yy315: - YYDEBUG(315, *YYCURSOR); + goto yy318; +yy312: + YYDEBUG(312, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); #line 406 "Zend/zend_ini_scanner.l" { /* Variable name */ @@ -4590,41 +4576,41 @@ yy315: RETURN_TOKEN(TC_VARNAME, yytext, yyleng); } -#line 4594 "Zend/zend_ini_scanner.c" -yy316: - YYDEBUG(316, *YYCURSOR); +#line 4580 "Zend/zend_ini_scanner.c" +yy313: + YYDEBUG(313, *YYCURSOR); ++YYCURSOR; - YYDEBUG(317, *YYCURSOR); + YYDEBUG(314, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 596 "Zend/zend_ini_scanner.l" +#line 603 "Zend/zend_ini_scanner.l" { return 0; } -#line 4604 "Zend/zend_ini_scanner.c" -yy318: - YYDEBUG(318, *YYCURSOR); +#line 4590 "Zend/zend_ini_scanner.c" +yy315: + YYDEBUG(315, *YYCURSOR); ++YYCURSOR; - YYDEBUG(319, *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 4615 "Zend/zend_ini_scanner.c" -yy320: - YYDEBUG(320, *YYCURSOR); +#line 4601 "Zend/zend_ini_scanner.c" +yy317: + YYDEBUG(317, *YYCURSOR); ++YYCURSOR; YYFILL(1); yych = *YYCURSOR; -yy321: - YYDEBUG(321, *YYCURSOR); +yy318: + YYDEBUG(318, *YYCURSOR); if (yybm[0+yych] & 128) { - goto yy320; + goto yy317; } - goto yy315; + goto yy312; } } -#line 600 "Zend/zend_ini_scanner.l" +#line 607 "Zend/zend_ini_scanner.l" } diff --git a/Zend/zend_ini_scanner.h b/Zend/zend_ini_scanner.h index 16deace65..2655fc873 100644 --- a/Zend/zend_ini_scanner.h +++ b/Zend/zend_ini_scanner.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_ini_scanner.l b/Zend/zend_ini_scanner.l index 8aeb076ea..5fb28d425 100644 --- a/Zend/zend_ini_scanner.l +++ b/Zend/zend_ini_scanner.l @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -347,7 +347,7 @@ DOLLAR_CURLY "${" SECTION_RAW_CHARS [^\]\n\r] SINGLE_QUOTED_CHARS [^'] -RAW_VALUE_CHARS [^"\n\r;\000] +RAW_VALUE_CHARS [^\n\r;\000] LITERAL_DOLLAR ("$"([^{\000]|("\\"{ANY_CHAR}))) VALUE_CHARS ([^$= \t\n\r;&|~()!"'\000]|{LITERAL_DOLLAR}) @@ -445,33 +445,40 @@ SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR}) return '='; } -<ST_RAW>["] { +<ST_RAW>{RAW_VALUE_CHARS} { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */ + char *sc = NULL; while (YYCURSOR < YYLIMIT) { - switch (*YYCURSOR++) { + switch (*YYCURSOR) { case '\n': - SCNG(lineno)++; - break; case '\r': - if (*YYCURSOR != '\n') { - SCNG(lineno)++; - } + goto end_raw_value_chars; break; - case '"': - yyleng = YYCURSOR - SCNG(yy_text) - 2; - SCNG(yy_text)++; - RETURN_TOKEN(TC_RAW, yytext, yyleng); - case '\\': - if (YYCURSOR < YYLIMIT) { - YYCURSOR++; + case ';': + if (sc == NULL) { + sc = YYCURSOR; } + /* no break */ + default: + YYCURSOR++; break; } } +end_raw_value_chars: yyleng = YYCURSOR - SCNG(yy_text); - RETURN_TOKEN(TC_RAW, yytext, yyleng); -} -<ST_RAW>{RAW_VALUE_CHARS}+ { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */ + /* 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); } diff --git a/Zend/zend_ini_scanner_defs.h b/Zend/zend_ini_scanner_defs.h index 9c99cc43d..287d7bc1f 100644 --- a/Zend/zend_ini_scanner_defs.h +++ b/Zend/zend_ini_scanner_defs.h @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Thu Jun 7 17:55:41 2012 */ +/* Generated by re2c 0.13.5 */ #line 3 "Zend/zend_ini_scanner_defs.h" enum YYCONDTYPE { diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c index aee0d612d..384b66da4 100644 --- a/Zend/zend_interfaces.c +++ b/Zend/zend_interfaces.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_interfaces.h b/Zend/zend_interfaces.h index e3e3629c5..23547951e 100644 --- a/Zend/zend_interfaces.h +++ b/Zend/zend_interfaces.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_istdiostream.h b/Zend/zend_istdiostream.h index fbefb2357..d7edf172f 100644 --- a/Zend/zend_istdiostream.h +++ b/Zend/zend_istdiostream.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_iterators.c b/Zend/zend_iterators.c index d0572b25c..f2c27fa63 100644 --- a/Zend/zend_iterators.c +++ b/Zend/zend_iterators.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_iterators.h b/Zend/zend_iterators.h index dba05850a..b484102b2 100644 --- a/Zend/zend_iterators.h +++ b/Zend/zend_iterators.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_language_parser.c b/Zend/zend_language_parser.c index 7b941accb..23bf762f2 100644 --- a/Zend/zend_language_parser.c +++ b/Zend/zend_language_parser.c @@ -78,7 +78,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -3793,7 +3793,7 @@ yyreduce: case 62: - { (yyval) = (yyvsp[(1) - (2)]); } + { zend_do_free(&(yyvsp[(1) - (2)]) TSRMLS_CC); } break; case 66: @@ -3993,7 +3993,7 @@ yyreduce: case 109: - { zend_do_end_class_declaration(&(yyvsp[(1) - (8)]), &(yyvsp[(2) - (8)]) TSRMLS_CC); } + { zend_do_end_class_declaration(&(yyvsp[(1) - (8)]), &(yyvsp[(3) - (8)]) TSRMLS_CC); } break; case 110: @@ -4003,7 +4003,7 @@ yyreduce: case 111: - { zend_do_end_class_declaration(&(yyvsp[(1) - (7)]), &(yyvsp[(2) - (7)]) TSRMLS_CC); } + { zend_do_end_class_declaration(&(yyvsp[(1) - (7)]), NULL TSRMLS_CC); } break; case 112: @@ -4323,27 +4323,17 @@ yyreduce: case 203: - { zend_do_implements_trait(&(yyvsp[(1) - (1)]) TSRMLS_CC); } + { zend_do_use_trait(&(yyvsp[(1) - (1)]) TSRMLS_CC); } break; case 204: - { zend_do_implements_trait(&(yyvsp[(3) - (3)]) TSRMLS_CC); } - break; - - case 211: - - { zend_add_trait_precedence(&(yyvsp[(1) - (2)]) TSRMLS_CC); } - break; - - case 212: - - { zend_add_trait_alias(&(yyvsp[(1) - (2)]) TSRMLS_CC); } + { zend_do_use_trait(&(yyvsp[(3) - (3)]) TSRMLS_CC); } break; case 213: - { zend_prepare_trait_precedence(&(yyval), &(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]) TSRMLS_CC); } + { zend_add_trait_precedence(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]) TSRMLS_CC); } break; case 214: @@ -4373,12 +4363,12 @@ yyreduce: case 219: - { zend_prepare_trait_alias(&(yyval), &(yyvsp[(1) - (4)]), &(yyvsp[(3) - (4)]), &(yyvsp[(4) - (4)]) TSRMLS_CC); } + { zend_add_trait_alias(&(yyvsp[(1) - (4)]), &(yyvsp[(3) - (4)]), &(yyvsp[(4) - (4)]) TSRMLS_CC); } break; case 220: - { zend_prepare_trait_alias(&(yyval), &(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]), NULL TSRMLS_CC); } + { zend_add_trait_alias(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]), NULL TSRMLS_CC); } break; case 221: diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y index c1514c5d7..781d806fe 100644 --- a/Zend/zend_language_parser.y +++ b/Zend/zend_language_parser.y @@ -3,7 +3,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -300,7 +300,7 @@ unticked_statement: | T_RETURN ';' { zend_do_return(NULL, 0 TSRMLS_CC); } | T_RETURN expr_without_variable ';' { zend_do_return(&$2, 0 TSRMLS_CC); } | T_RETURN variable ';' { zend_do_return(&$2, 1 TSRMLS_CC); } - | yield_expr ';' { $$ = $1; } + | yield_expr ';' { zend_do_free(&$1 TSRMLS_CC); } | T_GLOBAL global_var_list ';' | T_STATIC static_var_list ';' | T_ECHO echo_expr_list ';' @@ -386,13 +386,13 @@ unticked_class_declaration_statement: implements_list '{' class_statement_list - '}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); } + '}' { zend_do_end_class_declaration(&$1, &$3 TSRMLS_CC); } | interface_entry T_STRING { zend_do_begin_class_declaration(&$1, &$2, NULL TSRMLS_CC); } interface_extends_list '{' class_statement_list - '}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); } + '}' { zend_do_end_class_declaration(&$1, NULL TSRMLS_CC); } ; @@ -598,8 +598,8 @@ trait_use_statement: ; trait_list: - fully_qualified_class_name { zend_do_implements_trait(&$1 TSRMLS_CC); } - | trait_list ',' fully_qualified_class_name { zend_do_implements_trait(&$3 TSRMLS_CC); } + fully_qualified_class_name { zend_do_use_trait(&$1 TSRMLS_CC); } + | trait_list ',' fully_qualified_class_name { zend_do_use_trait(&$3 TSRMLS_CC); } ; trait_adaptations: @@ -618,12 +618,12 @@ non_empty_trait_adaptation_list: ; trait_adaptation_statement: - trait_precedence ';' { zend_add_trait_precedence(&$1 TSRMLS_CC); } - | trait_alias ';' { zend_add_trait_alias(&$1 TSRMLS_CC); } + trait_precedence ';' + | trait_alias ';' ; trait_precedence: - trait_method_reference_fully_qualified T_INSTEADOF trait_reference_list { zend_prepare_trait_precedence(&$$, &$1, &$3 TSRMLS_CC); } + trait_method_reference_fully_qualified T_INSTEADOF trait_reference_list { zend_add_trait_precedence(&$1, &$3 TSRMLS_CC); } ; trait_reference_list: @@ -641,8 +641,8 @@ trait_method_reference_fully_qualified: ; trait_alias: - trait_method_reference T_AS trait_modifiers T_STRING { zend_prepare_trait_alias(&$$, &$1, &$3, &$4 TSRMLS_CC); } - | trait_method_reference T_AS member_modifier { zend_prepare_trait_alias(&$$, &$1, &$3, NULL TSRMLS_CC); } + trait_method_reference T_AS trait_modifiers T_STRING { zend_add_trait_alias(&$1, &$3, &$4 TSRMLS_CC); } + | trait_method_reference T_AS member_modifier { zend_add_trait_alias(&$1, &$3, NULL TSRMLS_CC); } ; trait_modifiers: diff --git a/Zend/zend_language_scanner.c b/Zend/zend_language_scanner.c index 07ccb5d75..f2ba6bf9d 100644 --- a/Zend/zend_language_scanner.c +++ b/Zend/zend_language_scanner.c @@ -1,10 +1,10 @@ -/* Generated by re2c 0.13.5 on Mon Aug 20 13:34:50 2012 */ +/* Generated by re2c 0.13.5 */ #line 1 "Zend/zend_language_scanner.l" /* +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -582,6 +582,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE TSRMLS_CC); CG(in_compilation) = 1; CG(active_op_array) = op_array; + zend_stack_push(&CG(context_stack), (void *) &CG(context), sizeof(CG(context))); zend_init_compiler_context(TSRMLS_C); compiler_result = zendparse(TSRMLS_C); zend_do_return(&retval_znode, 0 TSRMLS_CC); @@ -751,6 +752,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC) init_op_array(op_array, ZEND_EVAL_CODE, INITIAL_OP_ARRAY_SIZE TSRMLS_CC); CG(interactive) = orig_interactive; CG(active_op_array) = op_array; + zend_stack_push(&CG(context_stack), (void *) &CG(context), sizeof(CG(context))); zend_init_compiler_context(TSRMLS_C); BEGIN(ST_IN_SCRIPTING); compiler_result = zendparse(TSRMLS_C); @@ -1000,7 +1002,7 @@ restart: yymore_restart: -#line 1004 "Zend/zend_language_scanner.c" +#line 1006 "Zend/zend_language_scanner.c" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -1099,7 +1101,7 @@ yyc_INITIAL: yy3: YYDEBUG(3, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1801 "Zend/zend_language_scanner.l" +#line 1803 "Zend/zend_language_scanner.l" { if (YYCURSOR > YYLIMIT) { return 0; @@ -1159,7 +1161,7 @@ inline_html: HANDLE_NEWLINES(yytext, yyleng); return T_INLINE_HTML; } -#line 1163 "Zend/zend_language_scanner.c" +#line 1165 "Zend/zend_language_scanner.c" yy4: YYDEBUG(4, *YYCURSOR); yych = *++YYCURSOR; @@ -1177,7 +1179,7 @@ yy5: yy6: YYDEBUG(6, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1789 "Zend/zend_language_scanner.l" +#line 1791 "Zend/zend_language_scanner.l" { if (CG(short_tags)) { zendlval->value.str.val = yytext; /* no copying - intentional */ @@ -1189,14 +1191,14 @@ yy6: goto inline_char_handler; } } -#line 1193 "Zend/zend_language_scanner.c" +#line 1195 "Zend/zend_language_scanner.c" yy7: YYDEBUG(7, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) == '=') goto yy43; YYDEBUG(8, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1766 "Zend/zend_language_scanner.l" +#line 1768 "Zend/zend_language_scanner.l" { if (CG(asp_tags)) { zendlval->value.str.val = yytext; /* no copying - intentional */ @@ -1208,7 +1210,7 @@ yy7: goto inline_char_handler; } } -#line 1212 "Zend/zend_language_scanner.c" +#line 1214 "Zend/zend_language_scanner.c" yy9: YYDEBUG(9, *YYCURSOR); yych = *++YYCURSOR; @@ -1394,7 +1396,7 @@ yy35: ++YYCURSOR; YYDEBUG(38, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1726 "Zend/zend_language_scanner.l" +#line 1728 "Zend/zend_language_scanner.l" { YYCTYPE *bracket = (YYCTYPE*)zend_memrchr(yytext, '<', yyleng - (sizeof("script language=php>") - 1)); @@ -1411,7 +1413,7 @@ yy35: BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG; } -#line 1415 "Zend/zend_language_scanner.c" +#line 1417 "Zend/zend_language_scanner.c" yy39: YYDEBUG(39, *YYCURSOR); yych = *++YYCURSOR; @@ -1438,7 +1440,7 @@ yy43: ++YYCURSOR; YYDEBUG(44, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1744 "Zend/zend_language_scanner.l" +#line 1746 "Zend/zend_language_scanner.l" { if (CG(asp_tags)) { zendlval->value.str.val = yytext; /* no copying - intentional */ @@ -1450,13 +1452,13 @@ yy43: goto inline_char_handler; } } -#line 1454 "Zend/zend_language_scanner.c" +#line 1456 "Zend/zend_language_scanner.c" yy45: YYDEBUG(45, *YYCURSOR); ++YYCURSOR; YYDEBUG(46, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1757 "Zend/zend_language_scanner.l" +#line 1759 "Zend/zend_language_scanner.l" { zendlval->value.str.val = yytext; /* no copying - intentional */ zendlval->value.str.len = yyleng; @@ -1464,7 +1466,7 @@ yy45: BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG_WITH_ECHO; } -#line 1468 "Zend/zend_language_scanner.c" +#line 1470 "Zend/zend_language_scanner.c" yy47: YYDEBUG(47, *YYCURSOR); yych = *++YYCURSOR; @@ -1491,7 +1493,7 @@ yy50: yy51: YYDEBUG(51, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1779 "Zend/zend_language_scanner.l" +#line 1781 "Zend/zend_language_scanner.l" { zendlval->value.str.val = yytext; /* no copying - intentional */ zendlval->value.str.len = yyleng; @@ -1500,7 +1502,7 @@ yy51: BEGIN(ST_IN_SCRIPTING); return T_OPEN_TAG; } -#line 1504 "Zend/zend_language_scanner.c" +#line 1506 "Zend/zend_language_scanner.c" yy52: YYDEBUG(52, *YYCURSOR); ++YYCURSOR; @@ -1571,7 +1573,7 @@ yyc_ST_BACKQUOTE: yy56: YYDEBUG(56, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2252 "Zend/zend_language_scanner.l" +#line 2254 "Zend/zend_language_scanner.l" { if (YYCURSOR > YYLIMIT) { return 0; @@ -1612,7 +1614,7 @@ yy56: zend_scan_escape_string(zendlval, yytext, yyleng, '`' TSRMLS_CC); return T_ENCAPSED_AND_WHITESPACE; } -#line 1616 "Zend/zend_language_scanner.c" +#line 1618 "Zend/zend_language_scanner.c" yy57: YYDEBUG(57, *YYCURSOR); yych = *++YYCURSOR; @@ -1623,12 +1625,12 @@ yy58: ++YYCURSOR; YYDEBUG(59, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2196 "Zend/zend_language_scanner.l" +#line 2198 "Zend/zend_language_scanner.l" { BEGIN(ST_IN_SCRIPTING); return '`'; } -#line 1632 "Zend/zend_language_scanner.c" +#line 1634 "Zend/zend_language_scanner.c" yy60: YYDEBUG(60, *YYCURSOR); yych = *++YYCURSOR; @@ -1638,14 +1640,14 @@ yy61: ++YYCURSOR; YYDEBUG(62, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2183 "Zend/zend_language_scanner.l" +#line 2185 "Zend/zend_language_scanner.l" { zendlval->value.lval = (long) '{'; yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); yyless(1); return T_CURLY_OPEN; } -#line 1649 "Zend/zend_language_scanner.c" +#line 1651 "Zend/zend_language_scanner.c" yy63: YYDEBUG(63, *YYCURSOR); yyaccept = 0; @@ -1661,24 +1663,24 @@ yy63: yy65: YYDEBUG(65, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1883 "Zend/zend_language_scanner.l" +#line 1885 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); zendlval->type = IS_STRING; return T_VARIABLE; } -#line 1671 "Zend/zend_language_scanner.c" +#line 1673 "Zend/zend_language_scanner.c" yy66: YYDEBUG(66, *YYCURSOR); ++YYCURSOR; YYDEBUG(67, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1459 "Zend/zend_language_scanner.l" +#line 1461 "Zend/zend_language_scanner.l" { yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC); return T_DOLLAR_OPEN_CURLY_BRACES; } -#line 1682 "Zend/zend_language_scanner.c" +#line 1684 "Zend/zend_language_scanner.c" yy68: YYDEBUG(68, *YYCURSOR); yych = *++YYCURSOR; @@ -1692,7 +1694,7 @@ yy70: ++YYCURSOR; YYDEBUG(71, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1875 "Zend/zend_language_scanner.l" +#line 1877 "Zend/zend_language_scanner.l" { yyless(yyleng - 1); yy_push_state(ST_VAR_OFFSET TSRMLS_CC); @@ -1700,7 +1702,7 @@ yy70: zendlval->type = IS_STRING; return T_VARIABLE; } -#line 1704 "Zend/zend_language_scanner.c" +#line 1706 "Zend/zend_language_scanner.c" yy72: YYDEBUG(72, *YYCURSOR); yych = *++YYCURSOR; @@ -1718,7 +1720,7 @@ yy73: ++YYCURSOR; YYDEBUG(74, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1865 "Zend/zend_language_scanner.l" +#line 1867 "Zend/zend_language_scanner.l" { yyless(yyleng - 3); yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC); @@ -1726,7 +1728,7 @@ yy73: zendlval->type = IS_STRING; return T_VARIABLE; } -#line 1730 "Zend/zend_language_scanner.c" +#line 1732 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_DOUBLE_QUOTES: @@ -1794,7 +1796,7 @@ yy77: yy78: YYDEBUG(78, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2202 "Zend/zend_language_scanner.l" +#line 2204 "Zend/zend_language_scanner.l" { if (GET_DOUBLE_QUOTES_SCANNED_LENGTH()) { YYCURSOR += GET_DOUBLE_QUOTES_SCANNED_LENGTH() - 1; @@ -1843,7 +1845,7 @@ double_quotes_scan_done: zend_scan_escape_string(zendlval, yytext, yyleng, '"' TSRMLS_CC); return T_ENCAPSED_AND_WHITESPACE; } -#line 1847 "Zend/zend_language_scanner.c" +#line 1849 "Zend/zend_language_scanner.c" yy79: YYDEBUG(79, *YYCURSOR); yych = *++YYCURSOR; @@ -1854,12 +1856,12 @@ yy80: ++YYCURSOR; YYDEBUG(81, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2191 "Zend/zend_language_scanner.l" +#line 2193 "Zend/zend_language_scanner.l" { BEGIN(ST_IN_SCRIPTING); return '"'; } -#line 1863 "Zend/zend_language_scanner.c" +#line 1865 "Zend/zend_language_scanner.c" yy82: YYDEBUG(82, *YYCURSOR); yych = *++YYCURSOR; @@ -1869,14 +1871,14 @@ yy83: ++YYCURSOR; YYDEBUG(84, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2183 "Zend/zend_language_scanner.l" +#line 2185 "Zend/zend_language_scanner.l" { zendlval->value.lval = (long) '{'; yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); yyless(1); return T_CURLY_OPEN; } -#line 1880 "Zend/zend_language_scanner.c" +#line 1882 "Zend/zend_language_scanner.c" yy85: YYDEBUG(85, *YYCURSOR); yyaccept = 0; @@ -1892,24 +1894,24 @@ yy85: yy87: YYDEBUG(87, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1883 "Zend/zend_language_scanner.l" +#line 1885 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); zendlval->type = IS_STRING; return T_VARIABLE; } -#line 1902 "Zend/zend_language_scanner.c" +#line 1904 "Zend/zend_language_scanner.c" yy88: YYDEBUG(88, *YYCURSOR); ++YYCURSOR; YYDEBUG(89, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1459 "Zend/zend_language_scanner.l" +#line 1461 "Zend/zend_language_scanner.l" { yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC); return T_DOLLAR_OPEN_CURLY_BRACES; } -#line 1913 "Zend/zend_language_scanner.c" +#line 1915 "Zend/zend_language_scanner.c" yy90: YYDEBUG(90, *YYCURSOR); yych = *++YYCURSOR; @@ -1923,7 +1925,7 @@ yy92: ++YYCURSOR; YYDEBUG(93, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1875 "Zend/zend_language_scanner.l" +#line 1877 "Zend/zend_language_scanner.l" { yyless(yyleng - 1); yy_push_state(ST_VAR_OFFSET TSRMLS_CC); @@ -1931,7 +1933,7 @@ yy92: zendlval->type = IS_STRING; return T_VARIABLE; } -#line 1935 "Zend/zend_language_scanner.c" +#line 1937 "Zend/zend_language_scanner.c" yy94: YYDEBUG(94, *YYCURSOR); yych = *++YYCURSOR; @@ -1949,7 +1951,7 @@ yy95: ++YYCURSOR; YYDEBUG(96, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1865 "Zend/zend_language_scanner.l" +#line 1867 "Zend/zend_language_scanner.l" { yyless(yyleng - 3); yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC); @@ -1957,7 +1959,7 @@ yy95: zendlval->type = IS_STRING; return T_VARIABLE; } -#line 1961 "Zend/zend_language_scanner.c" +#line 1963 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_END_HEREDOC: @@ -1968,7 +1970,7 @@ yyc_ST_END_HEREDOC: ++YYCURSOR; YYDEBUG(100, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2169 "Zend/zend_language_scanner.l" +#line 2171 "Zend/zend_language_scanner.l" { zend_heredoc_label *heredoc_label = zend_ptr_stack_pop(&SCNG(heredoc_label_stack)); @@ -1981,7 +1983,7 @@ yyc_ST_END_HEREDOC: BEGIN(ST_IN_SCRIPTING); return T_END_HEREDOC; } -#line 1985 "Zend/zend_language_scanner.c" +#line 1987 "Zend/zend_language_scanner.c" /* *********************************** */ yyc_ST_HEREDOC: { @@ -2043,7 +2045,7 @@ yy103: yy104: YYDEBUG(104, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2294 "Zend/zend_language_scanner.l" +#line 2296 "Zend/zend_language_scanner.l" { int newline = 0; @@ -2116,7 +2118,7 @@ heredoc_scan_done: zend_scan_escape_string(zendlval, yytext, yyleng - newline, 0 TSRMLS_CC); return T_ENCAPSED_AND_WHITESPACE; } -#line 2120 "Zend/zend_language_scanner.c" +#line 2122 "Zend/zend_language_scanner.c" yy105: YYDEBUG(105, *YYCURSOR); yych = *++YYCURSOR; @@ -2131,14 +2133,14 @@ yy107: ++YYCURSOR; YYDEBUG(108, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2183 "Zend/zend_language_scanner.l" +#line 2185 "Zend/zend_language_scanner.l" { zendlval->value.lval = (long) '{'; yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); yyless(1); return T_CURLY_OPEN; } -#line 2142 "Zend/zend_language_scanner.c" +#line 2144 "Zend/zend_language_scanner.c" yy109: YYDEBUG(109, *YYCURSOR); yyaccept = 0; @@ -2154,24 +2156,24 @@ yy109: yy111: YYDEBUG(111, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1883 "Zend/zend_language_scanner.l" +#line 1885 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); zendlval->type = IS_STRING; return T_VARIABLE; } -#line 2164 "Zend/zend_language_scanner.c" +#line 2166 "Zend/zend_language_scanner.c" yy112: YYDEBUG(112, *YYCURSOR); ++YYCURSOR; YYDEBUG(113, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1459 "Zend/zend_language_scanner.l" +#line 1461 "Zend/zend_language_scanner.l" { yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC); return T_DOLLAR_OPEN_CURLY_BRACES; } -#line 2175 "Zend/zend_language_scanner.c" +#line 2177 "Zend/zend_language_scanner.c" yy114: YYDEBUG(114, *YYCURSOR); yych = *++YYCURSOR; @@ -2185,7 +2187,7 @@ yy116: ++YYCURSOR; YYDEBUG(117, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1875 "Zend/zend_language_scanner.l" +#line 1877 "Zend/zend_language_scanner.l" { yyless(yyleng - 1); yy_push_state(ST_VAR_OFFSET TSRMLS_CC); @@ -2193,7 +2195,7 @@ yy116: zendlval->type = IS_STRING; return T_VARIABLE; } -#line 2197 "Zend/zend_language_scanner.c" +#line 2199 "Zend/zend_language_scanner.c" yy118: YYDEBUG(118, *YYCURSOR); yych = *++YYCURSOR; @@ -2211,7 +2213,7 @@ yy119: ++YYCURSOR; YYDEBUG(120, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1865 "Zend/zend_language_scanner.l" +#line 1867 "Zend/zend_language_scanner.l" { yyless(yyleng - 3); yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC); @@ -2219,7 +2221,7 @@ yy119: zendlval->type = IS_STRING; return T_VARIABLE; } -#line 2223 "Zend/zend_language_scanner.c" +#line 2225 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_IN_SCRIPTING: @@ -2402,13 +2404,13 @@ yy123: yy124: YYDEBUG(124, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1906 "Zend/zend_language_scanner.l" +#line 1908 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, yytext, yyleng); zendlval->type = IS_STRING; return T_STRING; } -#line 2412 "Zend/zend_language_scanner.c" +#line 2414 "Zend/zend_language_scanner.c" yy125: YYDEBUG(125, *YYCURSOR); yych = *++YYCURSOR; @@ -2640,11 +2642,11 @@ yy138: yy139: YYDEBUG(139, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1448 "Zend/zend_language_scanner.l" +#line 1450 "Zend/zend_language_scanner.l" { return yytext[0]; } -#line 2648 "Zend/zend_language_scanner.c" +#line 2650 "Zend/zend_language_scanner.c" yy140: YYDEBUG(140, *YYCURSOR); ++YYCURSOR; @@ -2653,7 +2655,7 @@ yy140: yy141: YYDEBUG(141, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1179 "Zend/zend_language_scanner.l" +#line 1181 "Zend/zend_language_scanner.l" { zendlval->value.str.val = yytext; /* no copying - intentional */ zendlval->value.str.len = yyleng; @@ -2661,7 +2663,7 @@ yy141: HANDLE_NEWLINES(yytext, yyleng); return T_WHITESPACE; } -#line 2665 "Zend/zend_language_scanner.c" +#line 2667 "Zend/zend_language_scanner.c" yy142: YYDEBUG(142, *YYCURSOR); yych = *++YYCURSOR; @@ -2672,11 +2674,11 @@ yy143: ++YYCURSOR; YYDEBUG(144, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1208 "Zend/zend_language_scanner.l" +#line 1210 "Zend/zend_language_scanner.l" { return T_NS_SEPARATOR; } -#line 2680 "Zend/zend_language_scanner.c" +#line 2682 "Zend/zend_language_scanner.c" yy145: YYDEBUG(145, *YYCURSOR); yych = *++YYCURSOR; @@ -2904,18 +2906,18 @@ yy168: ++YYCURSOR; YYDEBUG(169, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1453 "Zend/zend_language_scanner.l" +#line 1455 "Zend/zend_language_scanner.l" { yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); return '{'; } -#line 2913 "Zend/zend_language_scanner.c" +#line 2915 "Zend/zend_language_scanner.c" yy170: YYDEBUG(170, *YYCURSOR); ++YYCURSOR; YYDEBUG(171, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1465 "Zend/zend_language_scanner.l" +#line 1467 "Zend/zend_language_scanner.l" { RESET_DOC_COMMENT(); if (!zend_stack_is_empty(&SCNG(state_stack))) { @@ -2923,7 +2925,7 @@ yy170: } return '}'; } -#line 2927 "Zend/zend_language_scanner.c" +#line 2929 "Zend/zend_language_scanner.c" yy172: YYDEBUG(172, *YYCURSOR); yyaccept = 2; @@ -2951,7 +2953,7 @@ yy172: yy173: YYDEBUG(173, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1516 "Zend/zend_language_scanner.l" +#line 1518 "Zend/zend_language_scanner.l" { if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */ zendlval->value.lval = strtol(yytext, NULL, 0); @@ -2972,7 +2974,7 @@ yy173: zendlval->type = IS_LONG; return T_LNUMBER; } -#line 2976 "Zend/zend_language_scanner.c" +#line 2978 "Zend/zend_language_scanner.c" yy174: YYDEBUG(174, *YYCURSOR); yyaccept = 2; @@ -3000,7 +3002,7 @@ yy176: yy177: YYDEBUG(177, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1913 "Zend/zend_language_scanner.l" +#line 1915 "Zend/zend_language_scanner.l" { while (YYCURSOR < YYLIMIT) { switch (*YYCURSOR++) { @@ -3034,14 +3036,14 @@ yy177: return T_COMMENT; } -#line 3038 "Zend/zend_language_scanner.c" +#line 3040 "Zend/zend_language_scanner.c" yy178: YYDEBUG(178, *YYCURSOR); ++YYCURSOR; yy179: YYDEBUG(179, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2004 "Zend/zend_language_scanner.l" +#line 2006 "Zend/zend_language_scanner.l" { register char *s, *t; char *end; @@ -3109,14 +3111,14 @@ yy179: } return T_CONSTANT_ENCAPSED_STRING; } -#line 3113 "Zend/zend_language_scanner.c" +#line 3115 "Zend/zend_language_scanner.c" yy180: YYDEBUG(180, *YYCURSOR); ++YYCURSOR; yy181: YYDEBUG(181, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2073 "Zend/zend_language_scanner.l" +#line 2075 "Zend/zend_language_scanner.l" { int bprefix = (yytext[0] != '"') ? 1 : 0; @@ -3157,24 +3159,24 @@ yy181: BEGIN(ST_DOUBLE_QUOTES); return '"'; } -#line 3161 "Zend/zend_language_scanner.c" +#line 3163 "Zend/zend_language_scanner.c" yy182: YYDEBUG(182, *YYCURSOR); ++YYCURSOR; YYDEBUG(183, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2163 "Zend/zend_language_scanner.l" +#line 2165 "Zend/zend_language_scanner.l" { BEGIN(ST_BACKQUOTE); return '`'; } -#line 3172 "Zend/zend_language_scanner.c" +#line 3174 "Zend/zend_language_scanner.c" yy184: YYDEBUG(184, *YYCURSOR); ++YYCURSOR; YYDEBUG(185, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2426 "Zend/zend_language_scanner.l" +#line 2428 "Zend/zend_language_scanner.l" { if (YYCURSOR > YYLIMIT) { return 0; @@ -3183,7 +3185,7 @@ yy184: zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE); goto restart; } -#line 3187 "Zend/zend_language_scanner.c" +#line 3189 "Zend/zend_language_scanner.c" yy186: YYDEBUG(186, *YYCURSOR); ++YYCURSOR; @@ -3210,13 +3212,13 @@ yy188: yy190: YYDEBUG(190, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1581 "Zend/zend_language_scanner.l" +#line 1583 "Zend/zend_language_scanner.l" { zendlval->value.dval = zend_strtod(yytext, NULL); zendlval->type = IS_DOUBLE; return T_DNUMBER; } -#line 3220 "Zend/zend_language_scanner.c" +#line 3222 "Zend/zend_language_scanner.c" yy191: YYDEBUG(191, *YYCURSOR); yyaccept = 2; @@ -3308,7 +3310,7 @@ yy200: } YYDEBUG(202, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1491 "Zend/zend_language_scanner.l" +#line 1493 "Zend/zend_language_scanner.l" { char *bin = yytext + 2; /* Skip "0b" */ int len = yyleng - 2; @@ -3333,7 +3335,7 @@ yy200: return T_DNUMBER; } } -#line 3337 "Zend/zend_language_scanner.c" +#line 3339 "Zend/zend_language_scanner.c" yy203: YYDEBUG(203, *YYCURSOR); ++YYCURSOR; @@ -3345,7 +3347,7 @@ yy203: } YYDEBUG(205, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1537 "Zend/zend_language_scanner.l" +#line 1539 "Zend/zend_language_scanner.l" { char *hex = yytext + 2; /* Skip "0x" */ int len = yyleng - 2; @@ -3370,7 +3372,7 @@ yy203: return T_DNUMBER; } } -#line 3374 "Zend/zend_language_scanner.c" +#line 3376 "Zend/zend_language_scanner.c" yy206: YYDEBUG(206, *YYCURSOR); ++YYCURSOR; @@ -3379,7 +3381,7 @@ yy206: yy207: YYDEBUG(207, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1981 "Zend/zend_language_scanner.l" +#line 1983 "Zend/zend_language_scanner.l" { zendlval->value.str.val = yytext; /* no copying - intentional */ zendlval->value.str.len = yyleng; @@ -3387,7 +3389,7 @@ yy207: BEGIN(INITIAL); return T_CLOSE_TAG; /* implicit ';' at php-end tag */ } -#line 3391 "Zend/zend_language_scanner.c" +#line 3393 "Zend/zend_language_scanner.c" yy208: YYDEBUG(208, *YYCURSOR); yych = *++YYCURSOR; @@ -3421,13 +3423,13 @@ yy210: yy212: YYDEBUG(212, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1883 "Zend/zend_language_scanner.l" +#line 1885 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); zendlval->type = IS_STRING; return T_VARIABLE; } -#line 3431 "Zend/zend_language_scanner.c" +#line 3433 "Zend/zend_language_scanner.c" yy213: YYDEBUG(213, *YYCURSOR); yych = *++YYCURSOR; @@ -3441,11 +3443,11 @@ yy214: } YYDEBUG(215, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1436 "Zend/zend_language_scanner.l" +#line 1438 "Zend/zend_language_scanner.l" { return T_LOGICAL_XOR; } -#line 3449 "Zend/zend_language_scanner.c" +#line 3451 "Zend/zend_language_scanner.c" yy216: YYDEBUG(216, *YYCURSOR); ++YYCURSOR; @@ -3454,61 +3456,61 @@ yy216: } YYDEBUG(217, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1428 "Zend/zend_language_scanner.l" +#line 1430 "Zend/zend_language_scanner.l" { return T_LOGICAL_OR; } -#line 3462 "Zend/zend_language_scanner.c" +#line 3464 "Zend/zend_language_scanner.c" yy218: YYDEBUG(218, *YYCURSOR); ++YYCURSOR; YYDEBUG(219, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1416 "Zend/zend_language_scanner.l" +#line 1418 "Zend/zend_language_scanner.l" { return T_XOR_EQUAL; } -#line 3472 "Zend/zend_language_scanner.c" +#line 3474 "Zend/zend_language_scanner.c" yy220: YYDEBUG(220, *YYCURSOR); ++YYCURSOR; YYDEBUG(221, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1420 "Zend/zend_language_scanner.l" +#line 1422 "Zend/zend_language_scanner.l" { return T_BOOLEAN_OR; } -#line 3482 "Zend/zend_language_scanner.c" +#line 3484 "Zend/zend_language_scanner.c" yy222: YYDEBUG(222, *YYCURSOR); ++YYCURSOR; YYDEBUG(223, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1412 "Zend/zend_language_scanner.l" +#line 1414 "Zend/zend_language_scanner.l" { return T_OR_EQUAL; } -#line 3492 "Zend/zend_language_scanner.c" +#line 3494 "Zend/zend_language_scanner.c" yy224: YYDEBUG(224, *YYCURSOR); ++YYCURSOR; YYDEBUG(225, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1424 "Zend/zend_language_scanner.l" +#line 1426 "Zend/zend_language_scanner.l" { return T_BOOLEAN_AND; } -#line 3502 "Zend/zend_language_scanner.c" +#line 3504 "Zend/zend_language_scanner.c" yy226: YYDEBUG(226, *YYCURSOR); ++YYCURSOR; YYDEBUG(227, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1408 "Zend/zend_language_scanner.l" +#line 1410 "Zend/zend_language_scanner.l" { return T_AND_EQUAL; } -#line 3512 "Zend/zend_language_scanner.c" +#line 3514 "Zend/zend_language_scanner.c" yy228: YYDEBUG(228, *YYCURSOR); ++YYCURSOR; @@ -3517,7 +3519,7 @@ yy228: yy229: YYDEBUG(229, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1990 "Zend/zend_language_scanner.l" +#line 1992 "Zend/zend_language_scanner.l" { if (CG(asp_tags)) { BEGIN(INITIAL); @@ -3530,17 +3532,17 @@ yy229: return yytext[0]; } } -#line 3534 "Zend/zend_language_scanner.c" +#line 3536 "Zend/zend_language_scanner.c" yy230: YYDEBUG(230, *YYCURSOR); ++YYCURSOR; YYDEBUG(231, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1396 "Zend/zend_language_scanner.l" +#line 1398 "Zend/zend_language_scanner.l" { return T_MOD_EQUAL; } -#line 3544 "Zend/zend_language_scanner.c" +#line 3546 "Zend/zend_language_scanner.c" yy232: YYDEBUG(232, *YYCURSOR); yych = *++YYCURSOR; @@ -3571,11 +3573,11 @@ yy236: ++YYCURSOR; YYDEBUG(237, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1392 "Zend/zend_language_scanner.l" +#line 1394 "Zend/zend_language_scanner.l" { return T_CONCAT_EQUAL; } -#line 3579 "Zend/zend_language_scanner.c" +#line 3581 "Zend/zend_language_scanner.c" yy238: YYDEBUG(238, *YYCURSOR); yyaccept = 4; @@ -3584,7 +3586,7 @@ yy238: yy239: YYDEBUG(239, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1947 "Zend/zend_language_scanner.l" +#line 1949 "Zend/zend_language_scanner.l" { int doc_com; @@ -3618,7 +3620,7 @@ yy239: return T_COMMENT; } -#line 3622 "Zend/zend_language_scanner.c" +#line 3624 "Zend/zend_language_scanner.c" yy240: YYDEBUG(240, *YYCURSOR); yych = *++YYCURSOR; @@ -3628,11 +3630,11 @@ yy241: ++YYCURSOR; YYDEBUG(242, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1388 "Zend/zend_language_scanner.l" +#line 1390 "Zend/zend_language_scanner.l" { return T_DIV_EQUAL; } -#line 3636 "Zend/zend_language_scanner.c" +#line 3638 "Zend/zend_language_scanner.c" yy243: YYDEBUG(243, *YYCURSOR); yych = *++YYCURSOR; @@ -3655,42 +3657,42 @@ yy246: ++YYCURSOR; YYDEBUG(247, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1384 "Zend/zend_language_scanner.l" +#line 1386 "Zend/zend_language_scanner.l" { return T_MUL_EQUAL; } -#line 3663 "Zend/zend_language_scanner.c" +#line 3665 "Zend/zend_language_scanner.c" yy248: YYDEBUG(248, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) == '=') goto yy252; YYDEBUG(249, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1444 "Zend/zend_language_scanner.l" +#line 1446 "Zend/zend_language_scanner.l" { return T_SR; } -#line 3674 "Zend/zend_language_scanner.c" +#line 3676 "Zend/zend_language_scanner.c" yy250: YYDEBUG(250, *YYCURSOR); ++YYCURSOR; YYDEBUG(251, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1372 "Zend/zend_language_scanner.l" +#line 1374 "Zend/zend_language_scanner.l" { return T_IS_GREATER_OR_EQUAL; } -#line 3684 "Zend/zend_language_scanner.c" +#line 3686 "Zend/zend_language_scanner.c" yy252: YYDEBUG(252, *YYCURSOR); ++YYCURSOR; YYDEBUG(253, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1404 "Zend/zend_language_scanner.l" +#line 1406 "Zend/zend_language_scanner.l" { return T_SR_EQUAL; } -#line 3694 "Zend/zend_language_scanner.c" +#line 3696 "Zend/zend_language_scanner.c" yy254: YYDEBUG(254, *YYCURSOR); yyaccept = 5; @@ -3701,11 +3703,11 @@ yy254: yy255: YYDEBUG(255, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1440 "Zend/zend_language_scanner.l" +#line 1442 "Zend/zend_language_scanner.l" { return T_SL; } -#line 3709 "Zend/zend_language_scanner.c" +#line 3711 "Zend/zend_language_scanner.c" yy256: YYDEBUG(256, *YYCURSOR); yych = *++YYCURSOR; @@ -3717,22 +3719,22 @@ yy257: ++YYCURSOR; YYDEBUG(258, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1368 "Zend/zend_language_scanner.l" +#line 1370 "Zend/zend_language_scanner.l" { return T_IS_SMALLER_OR_EQUAL; } -#line 3725 "Zend/zend_language_scanner.c" +#line 3727 "Zend/zend_language_scanner.c" yy259: YYDEBUG(259, *YYCURSOR); ++YYCURSOR; yy260: YYDEBUG(260, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1364 "Zend/zend_language_scanner.l" +#line 1366 "Zend/zend_language_scanner.l" { return T_IS_NOT_EQUAL; } -#line 3736 "Zend/zend_language_scanner.c" +#line 3738 "Zend/zend_language_scanner.c" yy261: YYDEBUG(261, *YYCURSOR); yych = *++YYCURSOR; @@ -3783,11 +3785,11 @@ yy268: ++YYCURSOR; YYDEBUG(269, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1400 "Zend/zend_language_scanner.l" +#line 1402 "Zend/zend_language_scanner.l" { return T_SL_EQUAL; } -#line 3791 "Zend/zend_language_scanner.c" +#line 3793 "Zend/zend_language_scanner.c" yy270: YYDEBUG(270, *YYCURSOR); ++YYCURSOR; @@ -3892,7 +3894,7 @@ yy279: yy280: YYDEBUG(280, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2115 "Zend/zend_language_scanner.l" +#line 2117 "Zend/zend_language_scanner.l" { char *s; int bprefix = (yytext[0] != '<') ? 1 : 0; @@ -3939,7 +3941,7 @@ yy280: return T_START_HEREDOC; } -#line 3943 "Zend/zend_language_scanner.c" +#line 3945 "Zend/zend_language_scanner.c" yy281: YYDEBUG(281, *YYCURSOR); yych = *++YYCURSOR; @@ -3979,31 +3981,31 @@ yy284: ++YYCURSOR; YYDEBUG(286, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1356 "Zend/zend_language_scanner.l" +#line 1358 "Zend/zend_language_scanner.l" { return T_IS_NOT_IDENTICAL; } -#line 3987 "Zend/zend_language_scanner.c" +#line 3989 "Zend/zend_language_scanner.c" yy287: YYDEBUG(287, *YYCURSOR); ++YYCURSOR; YYDEBUG(288, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1376 "Zend/zend_language_scanner.l" +#line 1378 "Zend/zend_language_scanner.l" { return T_PLUS_EQUAL; } -#line 3997 "Zend/zend_language_scanner.c" +#line 3999 "Zend/zend_language_scanner.c" yy289: YYDEBUG(289, *YYCURSOR); ++YYCURSOR; YYDEBUG(290, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1344 "Zend/zend_language_scanner.l" +#line 1346 "Zend/zend_language_scanner.l" { return T_INC; } -#line 4007 "Zend/zend_language_scanner.c" +#line 4009 "Zend/zend_language_scanner.c" yy291: YYDEBUG(291, *YYCURSOR); yych = *++YYCURSOR; @@ -4022,42 +4024,42 @@ yy293: } YYDEBUG(294, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1332 "Zend/zend_language_scanner.l" +#line 1334 "Zend/zend_language_scanner.l" { return T_LIST; } -#line 4030 "Zend/zend_language_scanner.c" +#line 4032 "Zend/zend_language_scanner.c" yy295: YYDEBUG(295, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) == '=') goto yy299; YYDEBUG(296, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1360 "Zend/zend_language_scanner.l" +#line 1362 "Zend/zend_language_scanner.l" { return T_IS_EQUAL; } -#line 4041 "Zend/zend_language_scanner.c" +#line 4043 "Zend/zend_language_scanner.c" yy297: YYDEBUG(297, *YYCURSOR); ++YYCURSOR; YYDEBUG(298, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1328 "Zend/zend_language_scanner.l" +#line 1330 "Zend/zend_language_scanner.l" { return T_DOUBLE_ARROW; } -#line 4051 "Zend/zend_language_scanner.c" +#line 4053 "Zend/zend_language_scanner.c" yy299: YYDEBUG(299, *YYCURSOR); ++YYCURSOR; YYDEBUG(300, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1352 "Zend/zend_language_scanner.l" +#line 1354 "Zend/zend_language_scanner.l" { return T_IS_IDENTICAL; } -#line 4061 "Zend/zend_language_scanner.c" +#line 4063 "Zend/zend_language_scanner.c" yy301: YYDEBUG(301, *YYCURSOR); yych = *++YYCURSOR; @@ -4187,7 +4189,7 @@ yy317: } YYDEBUG(320, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1716 "Zend/zend_language_scanner.l" +#line 1718 "Zend/zend_language_scanner.l" { if (CG(current_namespace)) { *zendlval = *CG(current_namespace); @@ -4197,7 +4199,7 @@ yy317: } return T_NS_C; } -#line 4201 "Zend/zend_language_scanner.c" +#line 4203 "Zend/zend_language_scanner.c" yy321: YYDEBUG(321, *YYCURSOR); yych = *++YYCURSOR; @@ -4217,7 +4219,7 @@ yy322: } YYDEBUG(325, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1689 "Zend/zend_language_scanner.l" +#line 1691 "Zend/zend_language_scanner.l" { char *filename = zend_get_compiled_filename(TSRMLS_C); const size_t filename_len = strlen(filename); @@ -4244,7 +4246,7 @@ yy322: zendlval->type = IS_STRING; return T_DIR; } -#line 4248 "Zend/zend_language_scanner.c" +#line 4250 "Zend/zend_language_scanner.c" yy326: YYDEBUG(326, *YYCURSOR); yych = *++YYCURSOR; @@ -4269,13 +4271,13 @@ yy328: } YYDEBUG(331, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1671 "Zend/zend_language_scanner.l" +#line 1673 "Zend/zend_language_scanner.l" { zendlval->value.lval = CG(zend_lineno); zendlval->type = IS_LONG; return T_LINE; } -#line 4279 "Zend/zend_language_scanner.c" +#line 4281 "Zend/zend_language_scanner.c" yy332: YYDEBUG(332, *YYCURSOR); yych = *++YYCURSOR; @@ -4310,7 +4312,7 @@ yy336: } YYDEBUG(339, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1650 "Zend/zend_language_scanner.l" +#line 1652 "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; @@ -4331,7 +4333,7 @@ yy336: zendlval->type = IS_STRING; return T_METHOD_C; } -#line 4335 "Zend/zend_language_scanner.c" +#line 4337 "Zend/zend_language_scanner.c" yy340: YYDEBUG(340, *YYCURSOR); yych = *++YYCURSOR; @@ -4382,7 +4384,7 @@ yy347: } YYDEBUG(350, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1634 "Zend/zend_language_scanner.l" +#line 1636 "Zend/zend_language_scanner.l" { const char *func_name = NULL; @@ -4398,7 +4400,7 @@ yy347: zendlval->type = IS_STRING; return T_FUNC_C; } -#line 4402 "Zend/zend_language_scanner.c" +#line 4404 "Zend/zend_language_scanner.c" yy351: YYDEBUG(351, *YYCURSOR); yych = *++YYCURSOR; @@ -4418,7 +4420,7 @@ yy352: } YYDEBUG(355, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1677 "Zend/zend_language_scanner.l" +#line 1679 "Zend/zend_language_scanner.l" { char *filename = zend_get_compiled_filename(TSRMLS_C); @@ -4430,7 +4432,7 @@ yy352: zendlval->type = IS_STRING; return T_FILE; } -#line 4434 "Zend/zend_language_scanner.c" +#line 4436 "Zend/zend_language_scanner.c" yy356: YYDEBUG(356, *YYCURSOR); yych = *++YYCURSOR; @@ -4460,7 +4462,7 @@ yy359: } YYDEBUG(362, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1614 "Zend/zend_language_scanner.l" +#line 1616 "Zend/zend_language_scanner.l" { const char *trait_name = NULL; @@ -4480,7 +4482,7 @@ yy359: return T_TRAIT_C; } -#line 4484 "Zend/zend_language_scanner.c" +#line 4486 "Zend/zend_language_scanner.c" yy363: YYDEBUG(363, *YYCURSOR); yych = *++YYCURSOR; @@ -4510,7 +4512,7 @@ yy366: } YYDEBUG(369, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1587 "Zend/zend_language_scanner.l" +#line 1589 "Zend/zend_language_scanner.l" { const char *class_name = NULL; @@ -4537,7 +4539,7 @@ yy366: } return T_CLASS_C; } -#line 4541 "Zend/zend_language_scanner.c" +#line 4543 "Zend/zend_language_scanner.c" yy370: YYDEBUG(370, *YYCURSOR); yych = *++YYCURSOR; @@ -4599,11 +4601,11 @@ yy381: } YYDEBUG(382, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1296 "Zend/zend_language_scanner.l" +#line 1298 "Zend/zend_language_scanner.l" { return T_HALT_COMPILER; } -#line 4607 "Zend/zend_language_scanner.c" +#line 4609 "Zend/zend_language_scanner.c" yy383: YYDEBUG(383, *YYCURSOR); yych = *++YYCURSOR; @@ -4623,11 +4625,11 @@ yy385: } YYDEBUG(386, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1276 "Zend/zend_language_scanner.l" +#line 1278 "Zend/zend_language_scanner.l" { return T_USE; } -#line 4631 "Zend/zend_language_scanner.c" +#line 4633 "Zend/zend_language_scanner.c" yy387: YYDEBUG(387, *YYCURSOR); yych = *++YYCURSOR; @@ -4646,11 +4648,11 @@ yy389: } YYDEBUG(390, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1324 "Zend/zend_language_scanner.l" +#line 1326 "Zend/zend_language_scanner.l" { return T_UNSET; } -#line 4654 "Zend/zend_language_scanner.c" +#line 4656 "Zend/zend_language_scanner.c" yy391: YYDEBUG(391, *YYCURSOR); ++YYCURSOR; @@ -4822,11 +4824,11 @@ yy406: ++YYCURSOR; YYDEBUG(408, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1224 "Zend/zend_language_scanner.l" +#line 1226 "Zend/zend_language_scanner.l" { return T_INT_CAST; } -#line 4830 "Zend/zend_language_scanner.c" +#line 4832 "Zend/zend_language_scanner.c" yy409: YYDEBUG(409, *YYCURSOR); yych = *++YYCURSOR; @@ -4870,11 +4872,11 @@ yy414: ++YYCURSOR; YYDEBUG(417, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1228 "Zend/zend_language_scanner.l" +#line 1230 "Zend/zend_language_scanner.l" { return T_DOUBLE_CAST; } -#line 4878 "Zend/zend_language_scanner.c" +#line 4880 "Zend/zend_language_scanner.c" yy418: YYDEBUG(418, *YYCURSOR); yych = *++YYCURSOR; @@ -4944,11 +4946,11 @@ yy428: ++YYCURSOR; YYDEBUG(431, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1232 "Zend/zend_language_scanner.l" +#line 1234 "Zend/zend_language_scanner.l" { return T_STRING_CAST; } -#line 4952 "Zend/zend_language_scanner.c" +#line 4954 "Zend/zend_language_scanner.c" yy432: YYDEBUG(432, *YYCURSOR); yych = *++YYCURSOR; @@ -4981,11 +4983,11 @@ yy435: ++YYCURSOR; YYDEBUG(438, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1236 "Zend/zend_language_scanner.l" +#line 1238 "Zend/zend_language_scanner.l" { return T_ARRAY_CAST; } -#line 4989 "Zend/zend_language_scanner.c" +#line 4991 "Zend/zend_language_scanner.c" yy439: YYDEBUG(439, *YYCURSOR); yych = *++YYCURSOR; @@ -5023,11 +5025,11 @@ yy443: ++YYCURSOR; YYDEBUG(446, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1240 "Zend/zend_language_scanner.l" +#line 1242 "Zend/zend_language_scanner.l" { return T_OBJECT_CAST; } -#line 5031 "Zend/zend_language_scanner.c" +#line 5033 "Zend/zend_language_scanner.c" yy447: YYDEBUG(447, *YYCURSOR); yych = *++YYCURSOR; @@ -5068,11 +5070,11 @@ yy452: ++YYCURSOR; YYDEBUG(454, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1244 "Zend/zend_language_scanner.l" +#line 1246 "Zend/zend_language_scanner.l" { return T_BOOL_CAST; } -#line 5076 "Zend/zend_language_scanner.c" +#line 5078 "Zend/zend_language_scanner.c" yy455: YYDEBUG(455, *YYCURSOR); yych = *++YYCURSOR; @@ -5132,11 +5134,11 @@ yy463: ++YYCURSOR; YYDEBUG(466, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1248 "Zend/zend_language_scanner.l" +#line 1250 "Zend/zend_language_scanner.l" { return T_UNSET_CAST; } -#line 5140 "Zend/zend_language_scanner.c" +#line 5142 "Zend/zend_language_scanner.c" yy467: YYDEBUG(467, *YYCURSOR); yych = *++YYCURSOR; @@ -5150,11 +5152,11 @@ yy468: } YYDEBUG(469, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1220 "Zend/zend_language_scanner.l" +#line 1222 "Zend/zend_language_scanner.l" { return T_VAR; } -#line 5158 "Zend/zend_language_scanner.c" +#line 5160 "Zend/zend_language_scanner.c" yy470: YYDEBUG(470, *YYCURSOR); yych = *++YYCURSOR; @@ -5174,11 +5176,11 @@ yy472: } YYDEBUG(473, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1212 "Zend/zend_language_scanner.l" +#line 1214 "Zend/zend_language_scanner.l" { return T_NEW; } -#line 5182 "Zend/zend_language_scanner.c" +#line 5184 "Zend/zend_language_scanner.c" yy474: YYDEBUG(474, *YYCURSOR); yych = *++YYCURSOR; @@ -5217,21 +5219,21 @@ yy480: } YYDEBUG(481, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1272 "Zend/zend_language_scanner.l" +#line 1274 "Zend/zend_language_scanner.l" { return T_NAMESPACE; } -#line 5225 "Zend/zend_language_scanner.c" +#line 5227 "Zend/zend_language_scanner.c" yy482: YYDEBUG(482, *YYCURSOR); ++YYCURSOR; YYDEBUG(483, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1204 "Zend/zend_language_scanner.l" +#line 1206 "Zend/zend_language_scanner.l" { return T_PAAMAYIM_NEKUDOTAYIM; } -#line 5235 "Zend/zend_language_scanner.c" +#line 5237 "Zend/zend_language_scanner.c" yy484: YYDEBUG(484, *YYCURSOR); ++YYCURSOR; @@ -5253,32 +5255,32 @@ yy486: ++YYCURSOR; YYDEBUG(487, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1380 "Zend/zend_language_scanner.l" +#line 1382 "Zend/zend_language_scanner.l" { return T_MINUS_EQUAL; } -#line 5261 "Zend/zend_language_scanner.c" +#line 5263 "Zend/zend_language_scanner.c" yy488: YYDEBUG(488, *YYCURSOR); ++YYCURSOR; YYDEBUG(489, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1348 "Zend/zend_language_scanner.l" +#line 1350 "Zend/zend_language_scanner.l" { return T_DEC; } -#line 5271 "Zend/zend_language_scanner.c" +#line 5273 "Zend/zend_language_scanner.c" yy490: YYDEBUG(490, *YYCURSOR); ++YYCURSOR; YYDEBUG(491, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1174 "Zend/zend_language_scanner.l" +#line 1176 "Zend/zend_language_scanner.l" { yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC); return T_OBJECT_OPERATOR; } -#line 5282 "Zend/zend_language_scanner.c" +#line 5284 "Zend/zend_language_scanner.c" yy492: YYDEBUG(492, *YYCURSOR); yych = *++YYCURSOR; @@ -5323,11 +5325,11 @@ yy497: } YYDEBUG(498, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1320 "Zend/zend_language_scanner.l" +#line 1322 "Zend/zend_language_scanner.l" { return T_PUBLIC; } -#line 5331 "Zend/zend_language_scanner.c" +#line 5333 "Zend/zend_language_scanner.c" yy499: YYDEBUG(499, *YYCURSOR); yych = *++YYCURSOR; @@ -5382,11 +5384,11 @@ yy506: } YYDEBUG(507, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1316 "Zend/zend_language_scanner.l" +#line 1318 "Zend/zend_language_scanner.l" { return T_PROTECTED; } -#line 5390 "Zend/zend_language_scanner.c" +#line 5392 "Zend/zend_language_scanner.c" yy508: YYDEBUG(508, *YYCURSOR); yych = *++YYCURSOR; @@ -5416,11 +5418,11 @@ yy512: } YYDEBUG(513, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1312 "Zend/zend_language_scanner.l" +#line 1314 "Zend/zend_language_scanner.l" { return T_PRIVATE; } -#line 5424 "Zend/zend_language_scanner.c" +#line 5426 "Zend/zend_language_scanner.c" yy514: YYDEBUG(514, *YYCURSOR); ++YYCURSOR; @@ -5429,11 +5431,11 @@ yy514: } YYDEBUG(515, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1150 "Zend/zend_language_scanner.l" +#line 1152 "Zend/zend_language_scanner.l" { return T_PRINT; } -#line 5437 "Zend/zend_language_scanner.c" +#line 5439 "Zend/zend_language_scanner.c" yy516: YYDEBUG(516, *YYCURSOR); yych = *++YYCURSOR; @@ -5458,11 +5460,11 @@ yy519: } YYDEBUG(520, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1142 "Zend/zend_language_scanner.l" +#line 1144 "Zend/zend_language_scanner.l" { return T_GOTO; } -#line 5466 "Zend/zend_language_scanner.c" +#line 5468 "Zend/zend_language_scanner.c" yy521: YYDEBUG(521, *YYCURSOR); yych = *++YYCURSOR; @@ -5486,11 +5488,11 @@ yy524: } YYDEBUG(525, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1284 "Zend/zend_language_scanner.l" +#line 1286 "Zend/zend_language_scanner.l" { return T_GLOBAL; } -#line 5494 "Zend/zend_language_scanner.c" +#line 5496 "Zend/zend_language_scanner.c" yy526: YYDEBUG(526, *YYCURSOR); yych = *++YYCURSOR; @@ -5527,11 +5529,11 @@ yy532: } YYDEBUG(533, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1134 "Zend/zend_language_scanner.l" +#line 1136 "Zend/zend_language_scanner.l" { return T_BREAK; } -#line 5535 "Zend/zend_language_scanner.c" +#line 5537 "Zend/zend_language_scanner.c" yy534: YYDEBUG(534, *YYCURSOR); yych = *++YYCURSOR; @@ -5571,11 +5573,11 @@ yy540: } YYDEBUG(541, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1118 "Zend/zend_language_scanner.l" +#line 1120 "Zend/zend_language_scanner.l" { return T_SWITCH; } -#line 5579 "Zend/zend_language_scanner.c" +#line 5581 "Zend/zend_language_scanner.c" yy542: YYDEBUG(542, *YYCURSOR); yych = *++YYCURSOR; @@ -5599,11 +5601,11 @@ yy545: } YYDEBUG(546, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1300 "Zend/zend_language_scanner.l" +#line 1302 "Zend/zend_language_scanner.l" { return T_STATIC; } -#line 5607 "Zend/zend_language_scanner.c" +#line 5609 "Zend/zend_language_scanner.c" yy547: YYDEBUG(547, *YYCURSOR); yych = *++YYCURSOR; @@ -5630,11 +5632,11 @@ yy550: } YYDEBUG(551, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1114 "Zend/zend_language_scanner.l" +#line 1116 "Zend/zend_language_scanner.l" { return T_AS; } -#line 5638 "Zend/zend_language_scanner.c" +#line 5640 "Zend/zend_language_scanner.c" yy552: YYDEBUG(552, *YYCURSOR); yych = *++YYCURSOR; @@ -5653,11 +5655,11 @@ yy554: } YYDEBUG(555, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1336 "Zend/zend_language_scanner.l" +#line 1338 "Zend/zend_language_scanner.l" { return T_ARRAY; } -#line 5661 "Zend/zend_language_scanner.c" +#line 5663 "Zend/zend_language_scanner.c" yy556: YYDEBUG(556, *YYCURSOR); ++YYCURSOR; @@ -5666,11 +5668,11 @@ yy556: } YYDEBUG(557, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1432 "Zend/zend_language_scanner.l" +#line 1434 "Zend/zend_language_scanner.l" { return T_LOGICAL_AND; } -#line 5674 "Zend/zend_language_scanner.c" +#line 5676 "Zend/zend_language_scanner.c" yy558: YYDEBUG(558, *YYCURSOR); yych = *++YYCURSOR; @@ -5704,11 +5706,11 @@ yy563: } YYDEBUG(564, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1304 "Zend/zend_language_scanner.l" +#line 1306 "Zend/zend_language_scanner.l" { return T_ABSTRACT; } -#line 5712 "Zend/zend_language_scanner.c" +#line 5714 "Zend/zend_language_scanner.c" yy565: YYDEBUG(565, *YYCURSOR); yych = *++YYCURSOR; @@ -5732,11 +5734,11 @@ yy568: } YYDEBUG(569, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1074 "Zend/zend_language_scanner.l" +#line 1076 "Zend/zend_language_scanner.l" { return T_WHILE; } -#line 5740 "Zend/zend_language_scanner.c" +#line 5742 "Zend/zend_language_scanner.c" yy570: YYDEBUG(570, *YYCURSOR); ++YYCURSOR; @@ -5745,11 +5747,11 @@ yy570: } YYDEBUG(571, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1058 "Zend/zend_language_scanner.l" +#line 1060 "Zend/zend_language_scanner.l" { return T_IF; } -#line 5753 "Zend/zend_language_scanner.c" +#line 5755 "Zend/zend_language_scanner.c" yy572: YYDEBUG(572, *YYCURSOR); yych = *++YYCURSOR; @@ -5801,11 +5803,11 @@ yy577: } YYDEBUG(578, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1288 "Zend/zend_language_scanner.l" +#line 1290 "Zend/zend_language_scanner.l" { return T_ISSET; } -#line 5809 "Zend/zend_language_scanner.c" +#line 5811 "Zend/zend_language_scanner.c" yy579: YYDEBUG(579, *YYCURSOR); yych = *++YYCURSOR; @@ -5859,11 +5861,11 @@ yy585: yy586: YYDEBUG(586, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1256 "Zend/zend_language_scanner.l" +#line 1258 "Zend/zend_language_scanner.l" { return T_INCLUDE; } -#line 5867 "Zend/zend_language_scanner.c" +#line 5869 "Zend/zend_language_scanner.c" yy587: YYDEBUG(587, *YYCURSOR); yych = *++YYCURSOR; @@ -5892,11 +5894,11 @@ yy591: } YYDEBUG(592, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1260 "Zend/zend_language_scanner.l" +#line 1262 "Zend/zend_language_scanner.l" { return T_INCLUDE_ONCE; } -#line 5900 "Zend/zend_language_scanner.c" +#line 5902 "Zend/zend_language_scanner.c" yy593: YYDEBUG(593, *YYCURSOR); yych = *++YYCURSOR; @@ -5930,11 +5932,11 @@ yy598: } YYDEBUG(599, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1158 "Zend/zend_language_scanner.l" +#line 1160 "Zend/zend_language_scanner.l" { return T_INTERFACE; } -#line 5938 "Zend/zend_language_scanner.c" +#line 5940 "Zend/zend_language_scanner.c" yy600: YYDEBUG(600, *YYCURSOR); yych = *++YYCURSOR; @@ -5984,11 +5986,11 @@ yy606: } YYDEBUG(607, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1280 "Zend/zend_language_scanner.l" +#line 1282 "Zend/zend_language_scanner.l" { return T_INSTEADOF; } -#line 5992 "Zend/zend_language_scanner.c" +#line 5994 "Zend/zend_language_scanner.c" yy608: YYDEBUG(608, *YYCURSOR); yych = *++YYCURSOR; @@ -6017,11 +6019,11 @@ yy612: } YYDEBUG(613, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1110 "Zend/zend_language_scanner.l" +#line 1112 "Zend/zend_language_scanner.l" { return T_INSTANCEOF; } -#line 6025 "Zend/zend_language_scanner.c" +#line 6027 "Zend/zend_language_scanner.c" yy614: YYDEBUG(614, *YYCURSOR); yych = *++YYCURSOR; @@ -6065,11 +6067,11 @@ yy621: } YYDEBUG(622, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1170 "Zend/zend_language_scanner.l" +#line 1172 "Zend/zend_language_scanner.l" { return T_IMPLEMENTS; } -#line 6073 "Zend/zend_language_scanner.c" +#line 6075 "Zend/zend_language_scanner.c" yy623: YYDEBUG(623, *YYCURSOR); yych = *++YYCURSOR; @@ -6097,11 +6099,11 @@ yy624: } YYDEBUG(626, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1042 "Zend/zend_language_scanner.l" +#line 1044 "Zend/zend_language_scanner.l" { return T_TRY; } -#line 6105 "Zend/zend_language_scanner.c" +#line 6107 "Zend/zend_language_scanner.c" yy627: YYDEBUG(627, *YYCURSOR); yych = *++YYCURSOR; @@ -6120,11 +6122,11 @@ yy629: } YYDEBUG(630, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1162 "Zend/zend_language_scanner.l" +#line 1164 "Zend/zend_language_scanner.l" { return T_TRAIT; } -#line 6128 "Zend/zend_language_scanner.c" +#line 6130 "Zend/zend_language_scanner.c" yy631: YYDEBUG(631, *YYCURSOR); yych = *++YYCURSOR; @@ -6143,11 +6145,11 @@ yy633: } YYDEBUG(634, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1054 "Zend/zend_language_scanner.l" +#line 1056 "Zend/zend_language_scanner.l" { return T_THROW; } -#line 6151 "Zend/zend_language_scanner.c" +#line 6153 "Zend/zend_language_scanner.c" yy635: YYDEBUG(635, *YYCURSOR); yych = *++YYCURSOR; @@ -6171,11 +6173,11 @@ yy638: } YYDEBUG(639, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1038 "Zend/zend_language_scanner.l" +#line 1040 "Zend/zend_language_scanner.l" { return T_YIELD; } -#line 6179 "Zend/zend_language_scanner.c" +#line 6181 "Zend/zend_language_scanner.c" yy640: YYDEBUG(640, *YYCURSOR); yych = *++YYCURSOR; @@ -6236,11 +6238,11 @@ yy646: yy647: YYDEBUG(647, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1264 "Zend/zend_language_scanner.l" +#line 1266 "Zend/zend_language_scanner.l" { return T_REQUIRE; } -#line 6244 "Zend/zend_language_scanner.c" +#line 6246 "Zend/zend_language_scanner.c" yy648: YYDEBUG(648, *YYCURSOR); yych = *++YYCURSOR; @@ -6269,11 +6271,11 @@ yy652: } YYDEBUG(653, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1268 "Zend/zend_language_scanner.l" +#line 1270 "Zend/zend_language_scanner.l" { return T_REQUIRE_ONCE; } -#line 6277 "Zend/zend_language_scanner.c" +#line 6279 "Zend/zend_language_scanner.c" yy654: YYDEBUG(654, *YYCURSOR); yych = *++YYCURSOR; @@ -6292,11 +6294,11 @@ yy656: } YYDEBUG(657, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1034 "Zend/zend_language_scanner.l" +#line 1036 "Zend/zend_language_scanner.l" { return T_RETURN; } -#line 6300 "Zend/zend_language_scanner.c" +#line 6302 "Zend/zend_language_scanner.c" yy658: YYDEBUG(658, *YYCURSOR); yych = *++YYCURSOR; @@ -6386,11 +6388,11 @@ yy667: } YYDEBUG(668, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1138 "Zend/zend_language_scanner.l" +#line 1140 "Zend/zend_language_scanner.l" { return T_CONTINUE; } -#line 6394 "Zend/zend_language_scanner.c" +#line 6396 "Zend/zend_language_scanner.c" yy669: YYDEBUG(669, *YYCURSOR); ++YYCURSOR; @@ -6399,11 +6401,11 @@ yy669: } YYDEBUG(670, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1030 "Zend/zend_language_scanner.l" +#line 1032 "Zend/zend_language_scanner.l" { return T_CONST; } -#line 6407 "Zend/zend_language_scanner.c" +#line 6409 "Zend/zend_language_scanner.c" yy671: YYDEBUG(671, *YYCURSOR); yych = *++YYCURSOR; @@ -6428,11 +6430,11 @@ yy674: } YYDEBUG(675, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1216 "Zend/zend_language_scanner.l" +#line 1218 "Zend/zend_language_scanner.l" { return T_CLONE; } -#line 6436 "Zend/zend_language_scanner.c" +#line 6438 "Zend/zend_language_scanner.c" yy676: YYDEBUG(676, *YYCURSOR); yych = *++YYCURSOR; @@ -6446,11 +6448,11 @@ yy677: } YYDEBUG(678, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1154 "Zend/zend_language_scanner.l" +#line 1156 "Zend/zend_language_scanner.l" { return T_CLASS; } -#line 6454 "Zend/zend_language_scanner.c" +#line 6456 "Zend/zend_language_scanner.c" yy679: YYDEBUG(679, *YYCURSOR); yych = *++YYCURSOR; @@ -6496,11 +6498,11 @@ yy686: } YYDEBUG(687, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1340 "Zend/zend_language_scanner.l" +#line 1342 "Zend/zend_language_scanner.l" { return T_CALLABLE; } -#line 6504 "Zend/zend_language_scanner.c" +#line 6506 "Zend/zend_language_scanner.c" yy688: YYDEBUG(688, *YYCURSOR); ++YYCURSOR; @@ -6509,11 +6511,11 @@ yy688: } YYDEBUG(689, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1126 "Zend/zend_language_scanner.l" +#line 1128 "Zend/zend_language_scanner.l" { return T_CASE; } -#line 6517 "Zend/zend_language_scanner.c" +#line 6519 "Zend/zend_language_scanner.c" yy690: YYDEBUG(690, *YYCURSOR); yych = *++YYCURSOR; @@ -6527,11 +6529,11 @@ yy691: } YYDEBUG(692, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1046 "Zend/zend_language_scanner.l" +#line 1048 "Zend/zend_language_scanner.l" { return T_CATCH; } -#line 6535 "Zend/zend_language_scanner.c" +#line 6537 "Zend/zend_language_scanner.c" yy693: YYDEBUG(693, *YYCURSOR); yych = *++YYCURSOR; @@ -6582,11 +6584,11 @@ yy701: } YYDEBUG(702, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1026 "Zend/zend_language_scanner.l" +#line 1028 "Zend/zend_language_scanner.l" { return T_FUNCTION; } -#line 6590 "Zend/zend_language_scanner.c" +#line 6592 "Zend/zend_language_scanner.c" yy703: YYDEBUG(703, *YYCURSOR); ++YYCURSOR; @@ -6610,11 +6612,11 @@ yy703: yy704: YYDEBUG(704, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1086 "Zend/zend_language_scanner.l" +#line 1088 "Zend/zend_language_scanner.l" { return T_FOR; } -#line 6618 "Zend/zend_language_scanner.c" +#line 6620 "Zend/zend_language_scanner.c" yy705: YYDEBUG(705, *YYCURSOR); yych = *++YYCURSOR; @@ -6638,11 +6640,11 @@ yy708: } YYDEBUG(709, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1094 "Zend/zend_language_scanner.l" +#line 1096 "Zend/zend_language_scanner.l" { return T_FOREACH; } -#line 6646 "Zend/zend_language_scanner.c" +#line 6648 "Zend/zend_language_scanner.c" yy710: YYDEBUG(710, *YYCURSOR); yych = *++YYCURSOR; @@ -6676,11 +6678,11 @@ yy712: yy713: YYDEBUG(713, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1308 "Zend/zend_language_scanner.l" +#line 1310 "Zend/zend_language_scanner.l" { return T_FINAL; } -#line 6684 "Zend/zend_language_scanner.c" +#line 6686 "Zend/zend_language_scanner.c" yy714: YYDEBUG(714, *YYCURSOR); yych = *++YYCURSOR; @@ -6694,11 +6696,11 @@ yy715: } YYDEBUG(716, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1050 "Zend/zend_language_scanner.l" +#line 1052 "Zend/zend_language_scanner.l" { return T_FINALLY; } -#line 6702 "Zend/zend_language_scanner.c" +#line 6704 "Zend/zend_language_scanner.c" yy717: YYDEBUG(717, *YYCURSOR); yych = *++YYCURSOR; @@ -6729,11 +6731,11 @@ yy719: } YYDEBUG(720, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1082 "Zend/zend_language_scanner.l" +#line 1084 "Zend/zend_language_scanner.l" { return T_DO; } -#line 6737 "Zend/zend_language_scanner.c" +#line 6739 "Zend/zend_language_scanner.c" yy721: YYDEBUG(721, *YYCURSOR); ++YYCURSOR; @@ -6742,11 +6744,11 @@ yy721: } YYDEBUG(722, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1022 "Zend/zend_language_scanner.l" +#line 1024 "Zend/zend_language_scanner.l" { return T_EXIT; } -#line 6750 "Zend/zend_language_scanner.c" +#line 6752 "Zend/zend_language_scanner.c" yy723: YYDEBUG(723, *YYCURSOR); yych = *++YYCURSOR; @@ -6781,11 +6783,11 @@ yy728: } YYDEBUG(729, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1130 "Zend/zend_language_scanner.l" +#line 1132 "Zend/zend_language_scanner.l" { return T_DEFAULT; } -#line 6789 "Zend/zend_language_scanner.c" +#line 6791 "Zend/zend_language_scanner.c" yy730: YYDEBUG(730, *YYCURSOR); yych = *++YYCURSOR; @@ -6809,11 +6811,11 @@ yy733: } YYDEBUG(734, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1102 "Zend/zend_language_scanner.l" +#line 1104 "Zend/zend_language_scanner.l" { return T_DECLARE; } -#line 6817 "Zend/zend_language_scanner.c" +#line 6819 "Zend/zend_language_scanner.c" yy735: YYDEBUG(735, *YYCURSOR); yych = *++YYCURSOR; @@ -6893,11 +6895,11 @@ yy746: } YYDEBUG(747, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1166 "Zend/zend_language_scanner.l" +#line 1168 "Zend/zend_language_scanner.l" { return T_EXTENDS; } -#line 6901 "Zend/zend_language_scanner.c" +#line 6903 "Zend/zend_language_scanner.c" yy748: YYDEBUG(748, *YYCURSOR); ++YYCURSOR; @@ -6906,11 +6908,11 @@ yy748: } YYDEBUG(749, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1018 "Zend/zend_language_scanner.l" +#line 1020 "Zend/zend_language_scanner.l" { return T_EXIT; } -#line 6914 "Zend/zend_language_scanner.c" +#line 6916 "Zend/zend_language_scanner.c" yy750: YYDEBUG(750, *YYCURSOR); yych = *++YYCURSOR; @@ -6924,11 +6926,11 @@ yy751: } YYDEBUG(752, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1252 "Zend/zend_language_scanner.l" +#line 1254 "Zend/zend_language_scanner.l" { return T_EVAL; } -#line 6932 "Zend/zend_language_scanner.c" +#line 6934 "Zend/zend_language_scanner.c" yy753: YYDEBUG(753, *YYCURSOR); yych = *++YYCURSOR; @@ -6998,11 +7000,11 @@ yy762: } YYDEBUG(763, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1078 "Zend/zend_language_scanner.l" +#line 1080 "Zend/zend_language_scanner.l" { return T_ENDWHILE; } -#line 7006 "Zend/zend_language_scanner.c" +#line 7008 "Zend/zend_language_scanner.c" yy764: YYDEBUG(764, *YYCURSOR); yych = *++YYCURSOR; @@ -7031,11 +7033,11 @@ yy768: } YYDEBUG(769, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1122 "Zend/zend_language_scanner.l" +#line 1124 "Zend/zend_language_scanner.l" { return T_ENDSWITCH; } -#line 7039 "Zend/zend_language_scanner.c" +#line 7041 "Zend/zend_language_scanner.c" yy770: YYDEBUG(770, *YYCURSOR); ++YYCURSOR; @@ -7044,11 +7046,11 @@ yy770: } YYDEBUG(771, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1066 "Zend/zend_language_scanner.l" +#line 1068 "Zend/zend_language_scanner.l" { return T_ENDIF; } -#line 7052 "Zend/zend_language_scanner.c" +#line 7054 "Zend/zend_language_scanner.c" yy772: YYDEBUG(772, *YYCURSOR); yych = *++YYCURSOR; @@ -7077,11 +7079,11 @@ yy773: yy774: YYDEBUG(774, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1090 "Zend/zend_language_scanner.l" +#line 1092 "Zend/zend_language_scanner.l" { return T_ENDFOR; } -#line 7085 "Zend/zend_language_scanner.c" +#line 7087 "Zend/zend_language_scanner.c" yy775: YYDEBUG(775, *YYCURSOR); yych = *++YYCURSOR; @@ -7105,11 +7107,11 @@ yy778: } YYDEBUG(779, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1098 "Zend/zend_language_scanner.l" +#line 1100 "Zend/zend_language_scanner.l" { return T_ENDFOREACH; } -#line 7113 "Zend/zend_language_scanner.c" +#line 7115 "Zend/zend_language_scanner.c" yy780: YYDEBUG(780, *YYCURSOR); yych = *++YYCURSOR; @@ -7143,11 +7145,11 @@ yy785: } YYDEBUG(786, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1106 "Zend/zend_language_scanner.l" +#line 1108 "Zend/zend_language_scanner.l" { return T_ENDDECLARE; } -#line 7151 "Zend/zend_language_scanner.c" +#line 7153 "Zend/zend_language_scanner.c" yy787: YYDEBUG(787, *YYCURSOR); yych = *++YYCURSOR; @@ -7166,11 +7168,11 @@ yy789: } YYDEBUG(790, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1292 "Zend/zend_language_scanner.l" +#line 1294 "Zend/zend_language_scanner.l" { return T_EMPTY; } -#line 7174 "Zend/zend_language_scanner.c" +#line 7176 "Zend/zend_language_scanner.c" yy791: YYDEBUG(791, *YYCURSOR); yych = *++YYCURSOR; @@ -7199,11 +7201,11 @@ yy792: yy793: YYDEBUG(793, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1070 "Zend/zend_language_scanner.l" +#line 1072 "Zend/zend_language_scanner.l" { return T_ELSE; } -#line 7207 "Zend/zend_language_scanner.c" +#line 7209 "Zend/zend_language_scanner.c" yy794: YYDEBUG(794, *YYCURSOR); yych = *++YYCURSOR; @@ -7217,11 +7219,11 @@ yy795: } YYDEBUG(796, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1062 "Zend/zend_language_scanner.l" +#line 1064 "Zend/zend_language_scanner.l" { return T_ELSEIF; } -#line 7225 "Zend/zend_language_scanner.c" +#line 7227 "Zend/zend_language_scanner.c" yy797: YYDEBUG(797, *YYCURSOR); yych = *++YYCURSOR; @@ -7235,11 +7237,11 @@ yy798: } YYDEBUG(799, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1146 "Zend/zend_language_scanner.l" +#line 1148 "Zend/zend_language_scanner.l" { return T_ECHO; } -#line 7243 "Zend/zend_language_scanner.c" +#line 7245 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_LOOKING_FOR_PROPERTY: @@ -7312,7 +7314,7 @@ yy802: yy803: YYDEBUG(803, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1179 "Zend/zend_language_scanner.l" +#line 1181 "Zend/zend_language_scanner.l" { zendlval->value.str.val = yytext; /* no copying - intentional */ zendlval->value.str.len = yyleng; @@ -7320,7 +7322,7 @@ yy803: HANDLE_NEWLINES(yytext, yyleng); return T_WHITESPACE; } -#line 7324 "Zend/zend_language_scanner.c" +#line 7326 "Zend/zend_language_scanner.c" yy804: YYDEBUG(804, *YYCURSOR); ++YYCURSOR; @@ -7328,13 +7330,13 @@ yy804: yy805: YYDEBUG(805, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1198 "Zend/zend_language_scanner.l" +#line 1200 "Zend/zend_language_scanner.l" { yyless(0); yy_pop_state(TSRMLS_C); goto restart; } -#line 7338 "Zend/zend_language_scanner.c" +#line 7340 "Zend/zend_language_scanner.c" yy806: YYDEBUG(806, *YYCURSOR); ++YYCURSOR; @@ -7343,14 +7345,14 @@ yy806: yy807: YYDEBUG(807, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1191 "Zend/zend_language_scanner.l" +#line 1193 "Zend/zend_language_scanner.l" { yy_pop_state(TSRMLS_C); zend_copy_value(zendlval, yytext, yyleng); zendlval->type = IS_STRING; return T_STRING; } -#line 7354 "Zend/zend_language_scanner.c" +#line 7356 "Zend/zend_language_scanner.c" yy808: YYDEBUG(808, *YYCURSOR); yych = *++YYCURSOR; @@ -7371,11 +7373,11 @@ yy811: ++YYCURSOR; YYDEBUG(812, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1187 "Zend/zend_language_scanner.l" +#line 1189 "Zend/zend_language_scanner.l" { return T_OBJECT_OPERATOR; } -#line 7379 "Zend/zend_language_scanner.c" +#line 7381 "Zend/zend_language_scanner.c" yy813: YYDEBUG(813, *YYCURSOR); ++YYCURSOR; @@ -7460,14 +7462,14 @@ yy817: yy818: YYDEBUG(818, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1484 "Zend/zend_language_scanner.l" +#line 1486 "Zend/zend_language_scanner.l" { yyless(0); yy_pop_state(TSRMLS_C); yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); goto restart; } -#line 7471 "Zend/zend_language_scanner.c" +#line 7473 "Zend/zend_language_scanner.c" yy819: YYDEBUG(819, *YYCURSOR); yych = *++YYCURSOR; @@ -7492,7 +7494,7 @@ yy823: ++YYCURSOR; YYDEBUG(824, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1474 "Zend/zend_language_scanner.l" +#line 1476 "Zend/zend_language_scanner.l" { yyless(yyleng - 1); zend_copy_value(zendlval, yytext, yyleng); @@ -7501,7 +7503,7 @@ yy823: yy_push_state(ST_IN_SCRIPTING TSRMLS_CC); return T_STRING_VARNAME; } -#line 7505 "Zend/zend_language_scanner.c" +#line 7507 "Zend/zend_language_scanner.c" } /* *********************************** */ yyc_ST_NOWDOC: @@ -7512,7 +7514,7 @@ yyc_ST_NOWDOC: ++YYCURSOR; YYDEBUG(828, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2368 "Zend/zend_language_scanner.l" +#line 2370 "Zend/zend_language_scanner.l" { int newline = 0; @@ -7569,7 +7571,7 @@ nowdoc_scan_done: HANDLE_NEWLINES(yytext, yyleng - newline); return T_ENCAPSED_AND_WHITESPACE; } -#line 7573 "Zend/zend_language_scanner.c" +#line 7575 "Zend/zend_language_scanner.c" /* *********************************** */ yyc_ST_VAR_OFFSET: { @@ -7676,7 +7678,7 @@ yy831: yy832: YYDEBUG(832, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1562 "Zend/zend_language_scanner.l" +#line 1564 "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); @@ -7688,7 +7690,7 @@ yy832: } return T_NUM_STRING; } -#line 7692 "Zend/zend_language_scanner.c" +#line 7694 "Zend/zend_language_scanner.c" yy833: YYDEBUG(833, *YYCURSOR); yych = *++YYCURSOR; @@ -7708,23 +7710,23 @@ yy834: yy835: YYDEBUG(835, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1894 "Zend/zend_language_scanner.l" +#line 1896 "Zend/zend_language_scanner.l" { /* Only '[' can be valid, but returning other tokens will allow a more explicit parse error */ return yytext[0]; } -#line 7717 "Zend/zend_language_scanner.c" +#line 7719 "Zend/zend_language_scanner.c" yy836: YYDEBUG(836, *YYCURSOR); ++YYCURSOR; YYDEBUG(837, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1889 "Zend/zend_language_scanner.l" +#line 1891 "Zend/zend_language_scanner.l" { yy_pop_state(TSRMLS_C); return ']'; } -#line 7728 "Zend/zend_language_scanner.c" +#line 7730 "Zend/zend_language_scanner.c" yy838: YYDEBUG(838, *YYCURSOR); yych = *++YYCURSOR; @@ -7734,14 +7736,14 @@ yy839: ++YYCURSOR; YYDEBUG(840, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1899 "Zend/zend_language_scanner.l" +#line 1901 "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 7745 "Zend/zend_language_scanner.c" +#line 7747 "Zend/zend_language_scanner.c" yy841: YYDEBUG(841, *YYCURSOR); ++YYCURSOR; @@ -7750,19 +7752,19 @@ yy841: yy842: YYDEBUG(842, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1906 "Zend/zend_language_scanner.l" +#line 1908 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, yytext, yyleng); zendlval->type = IS_STRING; return T_STRING; } -#line 7760 "Zend/zend_language_scanner.c" +#line 7762 "Zend/zend_language_scanner.c" yy843: YYDEBUG(843, *YYCURSOR); ++YYCURSOR; YYDEBUG(844, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 2426 "Zend/zend_language_scanner.l" +#line 2428 "Zend/zend_language_scanner.l" { if (YYCURSOR > YYLIMIT) { return 0; @@ -7771,7 +7773,7 @@ yy843: zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE); goto restart; } -#line 7775 "Zend/zend_language_scanner.c" +#line 7777 "Zend/zend_language_scanner.c" yy845: YYDEBUG(845, *YYCURSOR); ++YYCURSOR; @@ -7807,13 +7809,13 @@ yy847: yy849: YYDEBUG(849, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1883 "Zend/zend_language_scanner.l" +#line 1885 "Zend/zend_language_scanner.l" { zend_copy_value(zendlval, (yytext+1), (yyleng-1)); zendlval->type = IS_STRING; return T_VARIABLE; } -#line 7817 "Zend/zend_language_scanner.c" +#line 7819 "Zend/zend_language_scanner.c" yy850: YYDEBUG(850, *YYCURSOR); ++YYCURSOR; @@ -7853,14 +7855,14 @@ yy855: yy857: YYDEBUG(857, *YYCURSOR); yyleng = YYCURSOR - SCNG(yy_text); -#line 1574 "Zend/zend_language_scanner.l" +#line 1576 "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; return T_NUM_STRING; } -#line 7864 "Zend/zend_language_scanner.c" +#line 7866 "Zend/zend_language_scanner.c" yy858: YYDEBUG(858, *YYCURSOR); ++YYCURSOR; @@ -7883,6 +7885,6 @@ yy860: goto yy857; } } -#line 2435 "Zend/zend_language_scanner.l" +#line 2437 "Zend/zend_language_scanner.l" } diff --git a/Zend/zend_language_scanner.h b/Zend/zend_language_scanner.h index c1a2313b2..03ca91126 100644 --- a/Zend/zend_language_scanner.h +++ b/Zend/zend_language_scanner.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l index dbf43977f..d44ba20e1 100644 --- a/Zend/zend_language_scanner.l +++ b/Zend/zend_language_scanner.l @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -580,6 +580,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE TSRMLS_CC); CG(in_compilation) = 1; CG(active_op_array) = op_array; + zend_stack_push(&CG(context_stack), (void *) &CG(context), sizeof(CG(context))); zend_init_compiler_context(TSRMLS_C); compiler_result = zendparse(TSRMLS_C); zend_do_return(&retval_znode, 0 TSRMLS_CC); @@ -749,6 +750,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC) init_op_array(op_array, ZEND_EVAL_CODE, INITIAL_OP_ARRAY_SIZE TSRMLS_CC); CG(interactive) = orig_interactive; CG(active_op_array) = op_array; + zend_stack_push(&CG(context_stack), (void *) &CG(context), sizeof(CG(context))); zend_init_compiler_context(TSRMLS_C); BEGIN(ST_IN_SCRIPTING); compiler_result = zendparse(TSRMLS_C); diff --git a/Zend/zend_language_scanner_defs.h b/Zend/zend_language_scanner_defs.h index 47df7e92d..5926e3c61 100644 --- a/Zend/zend_language_scanner_defs.h +++ b/Zend/zend_language_scanner_defs.h @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Mon Aug 20 13:34:50 2012 */ +/* Generated by re2c 0.13.5 */ #line 3 "Zend/zend_language_scanner_defs.h" enum YYCONDTYPE { diff --git a/Zend/zend_list.c b/Zend/zend_list.c index a75d6846d..e60deb1cd 100644 --- a/Zend/zend_list.c +++ b/Zend/zend_list.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_list.h b/Zend/zend_list.h index b33c09da8..23f51140f 100644 --- a/Zend/zend_list.h +++ b/Zend/zend_list.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_llist.c b/Zend/zend_llist.c index 465642078..20f847c78 100644 --- a/Zend/zend_llist.c +++ b/Zend/zend_llist.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -91,15 +91,13 @@ ZEND_API void zend_llist_prepend_element(zend_llist *l, void *element) ZEND_API void zend_llist_del_element(zend_llist *l, void *element, int (*compare)(void *element1, void *element2)) { zend_llist_element *current=l->head; - zend_llist_element *next; while (current) { - next = current->next; if (compare(current->data, element)) { DEL_LLIST_ELEMENT(current, l); break; } - current = next; + current = current->next; } } diff --git a/Zend/zend_llist.h b/Zend/zend_llist.h index 3f67258e3..0a03e6ce5 100644 --- a/Zend/zend_llist.h +++ b/Zend/zend_llist.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_modules.h b/Zend/zend_modules.h index 442535bc6..d4adcf5aa 100644 --- a/Zend/zend_modules.h +++ b/Zend/zend_modules.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -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 20121113 +#define ZEND_MODULE_API_NO 20121212 #ifdef ZTS #define USING_ZTS 1 #else diff --git a/Zend/zend_multibyte.c b/Zend/zend_multibyte.c index 379f50b01..dafcf1839 100644 --- a/Zend/zend_multibyte.c +++ b/Zend/zend_multibyte.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_multibyte.h b/Zend/zend_multibyte.h index 38b13c2d1..c537e133f 100644 --- a/Zend/zend_multibyte.h +++ b/Zend/zend_multibyte.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_multiply.h b/Zend/zend_multiply.h index 33a86d7dd..c3c9657f3 100644 --- a/Zend/zend_multiply.h +++ b/Zend/zend_multiply.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index d82493aea..3881c0e87 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -35,6 +35,17 @@ #define Z_OBJ_P(zval_p) \ ((zend_object*)(EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(zval_p)].bucket.obj.object)) +#define Z_OBJ_PROTECT_RECURSION(zval_p) \ + do { \ + if (EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(zval_p)].apply_count++ >= 3) { \ + zend_error(E_ERROR, "Nesting level too deep - recursive dependency?"); \ + } \ + } while (0) + + +#define Z_OBJ_UNPROTECT_RECURSION(zval_p) \ + EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(zval_p)].apply_count-- + /* __X accessors explanation: @@ -539,6 +550,8 @@ ZEND_API void zend_std_write_property(zval *object, zval *member, zval *value, c (*variable_ptr)->value = value->value; if (Z_REFCOUNT_P(value) > 0) { zval_copy_ctor(*variable_ptr); + } else { + efree(value); } zval_dtor(&garbage); } else { @@ -1317,28 +1330,43 @@ static int zend_std_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */ } if (!zobj1->properties && !zobj2->properties) { int i; + + Z_OBJ_PROTECT_RECURSION(o1); + Z_OBJ_PROTECT_RECURSION(o2); for (i = 0; i < zobj1->ce->default_properties_count; i++) { if (zobj1->properties_table[i]) { if (zobj2->properties_table[i]) { zval result; if (compare_function(&result, zobj1->properties_table[i], zobj2->properties_table[i] TSRMLS_CC)==FAILURE) { + Z_OBJ_UNPROTECT_RECURSION(o1); + Z_OBJ_UNPROTECT_RECURSION(o2); return 1; } if (Z_LVAL(result) != 0) { + Z_OBJ_UNPROTECT_RECURSION(o1); + Z_OBJ_UNPROTECT_RECURSION(o2); return Z_LVAL(result); } } else { + Z_OBJ_UNPROTECT_RECURSION(o1); + Z_OBJ_UNPROTECT_RECURSION(o2); return 1; } } else { if (zobj2->properties_table[i]) { + Z_OBJ_UNPROTECT_RECURSION(o1); + Z_OBJ_UNPROTECT_RECURSION(o2); return 1; } else { + Z_OBJ_UNPROTECT_RECURSION(o1); + Z_OBJ_UNPROTECT_RECURSION(o2); return 0; } } } + Z_OBJ_UNPROTECT_RECURSION(o1); + Z_OBJ_UNPROTECT_RECURSION(o2); return 0; } else { if (!zobj1->properties) { diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h index d0d7a7b84..11635328c 100644 --- a/Zend/zend_object_handlers.h +++ b/Zend/zend_object_handlers.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c index f7470fa57..ce6284439 100644 --- a/Zend/zend_objects.c +++ b/Zend/zend_objects.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_objects.h b/Zend/zend_objects.h index 3db9d2e64..17d8430fc 100644 --- a/Zend/zend_objects.h +++ b/Zend/zend_objects.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_objects_API.c b/Zend/zend_objects_API.c index 91b767657..1fe5d0c19 100644 --- a/Zend/zend_objects_API.c +++ b/Zend/zend_objects_API.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -117,6 +117,7 @@ ZEND_API zend_object_handle zend_objects_store_put(void *object, zend_objects_st obj = &EG(objects_store).object_buckets[handle].bucket.obj; EG(objects_store).object_buckets[handle].destructor_called = 0; EG(objects_store).object_buckets[handle].valid = 1; + EG(objects_store).object_buckets[handle].apply_count = 0; obj->refcount = 1; GC_OBJ_INIT(obj); diff --git a/Zend/zend_objects_API.h b/Zend/zend_objects_API.h index 12f1c0684..a6ea9b8c0 100644 --- a/Zend/zend_objects_API.h +++ b/Zend/zend_objects_API.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -31,6 +31,7 @@ typedef void (*zend_objects_store_clone_t)(void *object, void **object_clone TSR typedef struct _zend_object_store_bucket { zend_bool destructor_called; zend_bool valid; + zend_uchar apply_count; union _store_bucket { struct _store_object { void *object; diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index 224c7a209..db0a40035 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -70,6 +70,9 @@ void init_op_array(zend_op_array *op_array, zend_uchar type, int initial_ops_siz op_array->T = 0; + op_array->nested_calls = 0; + op_array->used_stack = 0; + op_array->function_name = NULL; op_array->filename = zend_get_compiled_filename(TSRMLS_C); op_array->doc_comment = NULL; @@ -216,12 +219,6 @@ ZEND_API int zend_cleanup_class_data(zend_class_entry **pce TSRMLS_DC) void _destroy_zend_class_traits_info(zend_class_entry *ce) { if (ce->num_traits > 0 && ce->traits) { - size_t i; - for (i = 0; i < ce->num_traits; i++) { - if (ce->traits[i]) { - destroy_zend_class(&ce->traits[i]); - } - } efree(ce->traits); } @@ -268,15 +265,6 @@ void _destroy_zend_class_traits_info(zend_class_entry *ce) } } -static int zend_clear_trait_method_name(zend_op_array *op_array TSRMLS_DC) -{ - if (op_array->function_name && (op_array->fn_flags & ZEND_ACC_ALIAS) == 0) { - efree(op_array->function_name); - op_array->function_name = NULL; - } - return 0; -} - ZEND_API void destroy_zend_class(zend_class_entry **pce) { zend_class_entry *ce = *pce; @@ -308,10 +296,6 @@ ZEND_API void destroy_zend_class(zend_class_entry **pce) } zend_hash_destroy(&ce->properties_info); str_efree(ce->name); - if ((ce->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) { - TSRMLS_FETCH(); - zend_hash_apply(&ce->function_table, (apply_func_t)zend_clear_trait_method_name TSRMLS_CC); - } zend_hash_destroy(&ce->function_table); zend_hash_destroy(&ce->constants_table); if (ce->num_interfaces > 0 && ce->interfaces) { @@ -401,7 +385,7 @@ ZEND_API void destroy_op_array(zend_op_array *op_array TSRMLS_DC) } efree(op_array->opcodes); - if (op_array->function_name && (op_array->fn_flags & ZEND_ACC_ALIAS) == 0) { + if (op_array->function_name) { efree((char*)op_array->function_name); } if (op_array->doc_comment) { @@ -499,24 +483,170 @@ static void zend_extension_op_array_handler(zend_extension *extension, zend_op_a } } -static void zend_check_finally_breakout(zend_op_array *op_array, zend_op *opline, zend_uint dst_num TSRMLS_DC) { - zend_uint i, op_num = opline - op_array->opcodes; - for (i=0; i < op_array->last_try_catch; i++) { +static void zend_check_finally_breakout(zend_op_array *op_array, zend_uint op_num, zend_uint dst_num TSRMLS_DC) +{ + zend_uint i; + + for (i = 0; i < op_array->last_try_catch; i++) { if (op_array->try_catch_array[i].try_op > op_num) { break; } if ((op_num >= op_array->try_catch_array[i].finally_op - && op_num < op_array->try_catch_array[i].finally_end) - && (dst_num >= op_array->try_catch_array[i].finally_end + && op_num <= op_array->try_catch_array[i].finally_end) + && (dst_num > op_array->try_catch_array[i].finally_end || dst_num < op_array->try_catch_array[i].finally_op)) { CG(in_compilation) = 1; CG(active_op_array) = op_array; - CG(zend_lineno) = opline->lineno; + CG(zend_lineno) = op_array->opcodes[op_num].lineno; zend_error(E_COMPILE_ERROR, "jump out of a finally block is disallowed"); } } } +static void zend_resolve_finally_call(zend_op_array *op_array, zend_uint op_num, zend_uint dst_num TSRMLS_DC) +{ + zend_uint start_op; + zend_op *opline; + zend_uint i = op_array->last_try_catch; + + if (dst_num != (zend_uint)-1) { + zend_check_finally_breakout(op_array, op_num, dst_num TSRMLS_CC); + } + + /* the backward order is mater */ + 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)) { + /* we have a jump out of try block that needs executing finally */ + + /* generate a FAST_CALL to finally block */ + start_op = get_next_op_number(op_array); + + opline = get_next_op(op_array TSRMLS_CC); + opline->opcode = ZEND_FAST_CALL; + SET_UNUSED(opline->op1); + SET_UNUSED(opline->op2); + opline->op1.opline_num = op_array->try_catch_array[i].finally_op; + if (op_array->try_catch_array[i].catch_op) { + opline->extended_value = 1; + opline->op2.opline_num = op_array->try_catch_array[i].catch_op; + } + + /* generate a sequence of FAST_CALL to upward finally block */ + 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)) { + + opline = get_next_op(op_array TSRMLS_CC); + opline->opcode = ZEND_FAST_CALL; + SET_UNUSED(opline->op1); + SET_UNUSED(opline->op2); + opline->op1.opline_num = op_array->try_catch_array[i].finally_op; + } + } + + /* Finish the sequence with original opcode */ + opline = get_next_op(op_array TSRMLS_CC); + *opline = op_array->opcodes[op_num]; + + /* Replace original opcode with jump to this sequence */ + opline = op_array->opcodes + op_num; + opline->opcode = ZEND_JMP; + SET_UNUSED(opline->op1); + SET_UNUSED(opline->op2); + opline->op1.opline_num = start_op; + + break; + } + } +} + +static void zend_resolve_finally_ret(zend_op_array *op_array, zend_uint op_num TSRMLS_DC) +{ + int i; + zend_uint catch_op_num = 0, finally_op_num = 0; + + for (i = 0; i < op_array->last_try_catch; i++) { + if (op_array->try_catch_array[i].try_op > op_num) { + break; + } + if (op_num < op_array->try_catch_array[i].finally_op) { + finally_op_num = op_array->try_catch_array[i].finally_op; + } + if (op_num < op_array->try_catch_array[i].catch_op) { + catch_op_num = op_array->try_catch_array[i].catch_op; + } + } + + if (finally_op_num && (!catch_op_num || catch_op_num >= finally_op_num)) { + /* in case of unhandled exception return to upward finally block */ + op_array->opcodes[op_num].extended_value = ZEND_FAST_RET_TO_FINALLY; + op_array->opcodes[op_num].op2.opline_num = finally_op_num; + } else if (catch_op_num) { + /* in case of unhandled exception return to upward catch block */ + op_array->opcodes[op_num].extended_value = ZEND_FAST_RET_TO_CATCH; + op_array->opcodes[op_num].op2.opline_num = catch_op_num; + } +} + +static void zend_resolve_finally_calls(zend_op_array *op_array TSRMLS_DC) +{ + zend_uint i; + zend_op *opline; + + for (i = 0; i < op_array->last; i++) { + opline = op_array->opcodes + i; + switch (opline->opcode) { + case ZEND_RETURN: + case ZEND_RETURN_BY_REF: + case ZEND_GENERATOR_RETURN: + zend_resolve_finally_call(op_array, i, (zend_uint)-1 TSRMLS_CC); + break; + case ZEND_BRK: + case ZEND_CONT: + { + int nest_levels, array_offset; + zend_brk_cont_element *jmp_to; + + nest_levels = Z_LVAL(op_array->literals[opline->op2.constant].constant); + array_offset = opline->op1.opline_num; + do { + jmp_to = &op_array->brk_cont_array[array_offset]; + if (nest_levels > 1) { + array_offset = jmp_to->parent; + } + } while (--nest_levels > 0); + zend_resolve_finally_call(op_array, i, opline->opcode == ZEND_BRK ? jmp_to->brk : jmp_to->cont TSRMLS_CC); + break; + } + case ZEND_GOTO: + if (Z_TYPE(op_array->literals[opline->op2.constant].constant) != IS_LONG) { + zend_uint num = opline->op2.constant; + opline->op2.zv = &op_array->literals[opline->op2.constant].constant; + zend_resolve_goto_label(op_array, opline, 1 TSRMLS_CC); + opline->op2.constant = num; + } + /* break omitted intentionally */ + case ZEND_JMP: + zend_resolve_finally_call(op_array, i, opline->op1.opline_num TSRMLS_CC); + break; + case ZEND_FAST_RET: + zend_resolve_finally_ret(op_array, i TSRMLS_CC); + break; + default: + break; + } + } +} + ZEND_API int pass_two(zend_op_array *op_array TSRMLS_DC) { zend_op *opline, *end; @@ -524,6 +654,9 @@ ZEND_API int pass_two(zend_op_array *op_array TSRMLS_DC) if (op_array->type!=ZEND_USER_FUNCTION && op_array->type!=ZEND_EVAL_CODE) { return 0; } + if (op_array->has_finally_block) { + zend_resolve_finally_calls(op_array TSRMLS_CC); + } if (CG(compiler_options) & ZEND_COMPILE_EXTENDED_INFO) { zend_update_extended_info(op_array TSRMLS_CC); } @@ -560,30 +693,9 @@ ZEND_API int pass_two(zend_op_array *op_array TSRMLS_DC) } /* break omitted intentionally */ case ZEND_JMP: - if (op_array->last_try_catch) { - zend_check_finally_breakout(op_array, opline, opline->op1.opline_num TSRMLS_CC); - } + case ZEND_FAST_CALL: opline->op1.jmp_addr = &op_array->opcodes[opline->op1.opline_num]; break; - case ZEND_BRK: - case ZEND_CONT: - if (op_array->last_try_catch) { - int nest_levels, array_offset; - zend_brk_cont_element *jmp_to; - - nest_levels = Z_LVAL_P(opline->op2.zv); - array_offset = opline->op1.opline_num; - do { - jmp_to = &op_array->brk_cont_array[array_offset]; - if (nest_levels > 1) { - array_offset = jmp_to->parent; - } - } while (--nest_levels > 0); - if (op_array->last_try_catch) { - zend_check_finally_breakout(op_array, opline, jmp_to->brk TSRMLS_CC); - } - } - break; case ZEND_JMPZ: case ZEND_JMPNZ: case ZEND_JMPZ_EX: diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index cf3a908ad..bccccd96b 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index 08a6b19bd..d3f5e5a3d 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_ptr_stack.c b/Zend/zend_ptr_stack.c index d178cc018..9dbdb3ddd 100644 --- a/Zend/zend_ptr_stack.c +++ b/Zend/zend_ptr_stack.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -110,23 +110,6 @@ ZEND_API int zend_ptr_stack_num_elements(zend_ptr_stack *stack) { return stack->top; } - -ZEND_API void zend_ptr_stack_push_from_memory(zend_ptr_stack *stack, int count, void **pointers) -{ - ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, count); - - memcpy(stack->top_element, pointers, count * sizeof(void *)); - stack->top_element += count; - stack->top += count; -} - -ZEND_API void zend_ptr_stack_pop_into_memory(zend_ptr_stack *stack, int count, void **pointers) -{ - memcpy(pointers, stack->top_element - count, count * sizeof(void *)); - stack->top_element -= count; - stack->top -= count; -} - /* * Local variables: * tab-width: 4 diff --git a/Zend/zend_ptr_stack.h b/Zend/zend_ptr_stack.h index fe93e93b5..109924079 100644 --- a/Zend/zend_ptr_stack.h +++ b/Zend/zend_ptr_stack.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -41,8 +41,6 @@ ZEND_API void zend_ptr_stack_destroy(zend_ptr_stack *stack); ZEND_API void zend_ptr_stack_apply(zend_ptr_stack *stack, void (*func)(void *)); ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *), zend_bool free_elements); ZEND_API int zend_ptr_stack_num_elements(zend_ptr_stack *stack); -ZEND_API void zend_ptr_stack_push_from_memory(zend_ptr_stack *stack, int count, void **pointers); -ZEND_API void zend_ptr_stack_pop_into_memory(zend_ptr_stack *stack, int count, void **pointers); END_EXTERN_C() #define ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, count) \ diff --git a/Zend/zend_qsort.c b/Zend/zend_qsort.c index 3797901d8..bf179904e 100644 --- a/Zend/zend_qsort.c +++ b/Zend/zend_qsort.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_qsort.h b/Zend/zend_qsort.h index b4e658854..58c99f26c 100644 --- a/Zend/zend_qsort.h +++ b/Zend/zend_qsort.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_sprintf.c b/Zend/zend_sprintf.c index 41acec46f..79ee5a9d6 100644 --- a/Zend/zend_sprintf.c +++ b/Zend/zend_sprintf.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_stack.c b/Zend/zend_stack.c index cbc8a0043..3e7401f5f 100644 --- a/Zend/zend_stack.c +++ b/Zend/zend_stack.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_stack.h b/Zend/zend_stack.h index 8d0908746..f18dfeca7 100644 --- a/Zend/zend_stack.h +++ b/Zend/zend_stack.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_static_allocator.c b/Zend/zend_static_allocator.c index 503a7c79d..1150deb57 100644 --- a/Zend/zend_static_allocator.c +++ b/Zend/zend_static_allocator.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_static_allocator.h b/Zend/zend_static_allocator.h index bd20fa66a..555625653 100644 --- a/Zend/zend_static_allocator.h +++ b/Zend/zend_static_allocator.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_stream.c b/Zend/zend_stream.c index 30cc3a5ba..835fdbbd7 100644 --- a/Zend/zend_stream.c +++ b/Zend/zend_stream.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_stream.h b/Zend/zend_stream.h index aff87eb6d..a65d25895 100644 --- a/Zend/zend_stream.h +++ b/Zend/zend_stream.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_string.c b/Zend/zend_string.c index 8e9009f9f..ff7ee3fd8 100644 --- a/Zend/zend_string.c +++ b/Zend/zend_string.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_string.h b/Zend/zend_string.h index 0a4738466..ebf8c816c 100644 --- a/Zend/zend_string.h +++ b/Zend/zend_string.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_strtod.h b/Zend/zend_strtod.h index 4516d203d..aac17cea1 100644 --- a/Zend/zend_strtod.h +++ b/Zend/zend_strtod.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_ts_hash.c b/Zend/zend_ts_hash.c index 51c4b1de7..f517fe856 100644 --- a/Zend/zend_ts_hash.c +++ b/Zend/zend_ts_hash.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_ts_hash.h b/Zend/zend_ts_hash.h index 706b0b1f8..9a849e15a 100644 --- a/Zend/zend_ts_hash.h +++ b/Zend/zend_ts_hash.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_types.h b/Zend/zend_types.h index f33138aaa..3e68add3d 100644 --- a/Zend/zend_types.h +++ b/Zend/zend_types.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c index 25a66a197..c0e1849ee 100644 --- a/Zend/zend_variables.c +++ b/Zend/zend_variables.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_variables.h b/Zend/zend_variables.h index eb9f0d22c..e52dbd785 100644 --- a/Zend/zend_variables.h +++ b/Zend/zend_variables.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_vm.h b/Zend/zend_vm.h index bbf739e5b..c406c1a89 100644 --- a/Zend/zend_vm.h +++ b/Zend/zend_vm.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index b06c09f48..82826c904 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -334,7 +334,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR zval **object_ptr = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_RW); zval *object; zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R); - zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); + zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); int have_get_ptr = 0; if (OP1_TYPE == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -465,8 +465,8 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_helper, VAR|UNUSED|CV, CONST|TMP|VAR|UNU zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R); zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, OP2_TYPE, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } } break; @@ -1161,7 +1161,7 @@ ZEND_VM_HANDLER(92, ZEND_FETCH_FUNC_ARG, CONST|TMP|VAR|CV, UNUSED|CONST|VAR) USE_OPLINE ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, - ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R); + ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R); } ZEND_VM_HANDLER(95, ZEND_FETCH_UNSET, CONST|TMP|VAR|CV, UNUSED|CONST|VAR) @@ -1283,7 +1283,7 @@ ZEND_VM_HANDLER(93, ZEND_FETCH_DIM_FUNC_ARG, VAR|CV, CONST|TMP|VAR|UNUSED|CV) SAVE_OPLINE(); - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) { container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W); if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); @@ -1330,6 +1330,7 @@ ZEND_VM_HANDLER(96, ZEND_FETCH_DIM_UNSET, VAR|CV, CONST|TMP|VAR|CV) FREE_OP1_VAR_PTR(); if (UNEXPECTED(EX_T(opline->result.var).var.ptr_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); + ZEND_VM_NEXT_OPCODE(); } else { zend_free_op free_res; zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr; @@ -1519,7 +1520,7 @@ ZEND_VM_HANDLER(94, ZEND_FETCH_OBJ_FUNC_ARG, VAR|UNUSED|CV, CONST|TMP|VAR|CV) { USE_OPLINE - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) { /* Behave like FETCH_OBJ_W */ zend_free_op free_op1, free_op2; zval *property; @@ -1636,7 +1637,7 @@ ZEND_VM_HANDLER(136, ZEND_ASSIGN_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV) if (OP1_TYPE == IS_VAR && UNEXPECTED(object_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } - zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_OBJ, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); + zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); if (IS_OP2_TMP_FREE()) { zval_ptr_dtor(&property_name); } else { @@ -1668,7 +1669,7 @@ ZEND_VM_HANDLER(147, ZEND_ASSIGN_DIM, VAR|CV, CONST|TMP|VAR|UNUSED|CV) if (IS_OP2_TMP_FREE()) { MAKE_REAL_ZVAL_PTR(property_name); } - zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_DIM, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); + zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); if (IS_OP2_TMP_FREE()) { zval_ptr_dtor(&property_name); } else { @@ -1683,8 +1684,8 @@ ZEND_VM_HANDLER(147, ZEND_ASSIGN_DIM, VAR|CV, CONST|TMP|VAR|UNUSED|CV) zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), object_ptr, dim, OP2_TYPE, BP_VAR_W TSRMLS_CC); FREE_OP2(); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + 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); if (UNEXPECTED(variable_ptr_ptr == NULL)) { if (zend_assign_to_string_offset(&EX_T((opline+1)->op2.var), value, (opline+1)->op1_type TSRMLS_CC)) { if (RETURN_VALUE_USED(opline)) { @@ -1842,35 +1843,21 @@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV) ZEND_VM_HELPER(zend_leave_helper, ANY, ANY) { - zend_bool nested; + zend_bool nested = EX(nested); zend_op_array *op_array = EX(op_array); - /* Generators go throw a different cleanup process */ - if (EX(op_array)->fn_flags & ZEND_ACC_GENERATOR) { - /* The generator object is stored in return_value_ptr_ptr */ - zend_generator *generator = (zend_generator *) EG(return_value_ptr_ptr); - - /* Close the generator to free up resources */ - zend_generator_close(generator, 1 TSRMLS_CC); - - /* Pass execution back to handling code */ - ZEND_VM_RETURN(); - } - EG(current_execute_data) = EX(prev_execute_data); EG(opline_ptr) = NULL; if (!EG(active_symbol_table)) { - zend_free_compiled_variables(EX_CVs(), op_array->last_var); + i_free_compiled_variables(execute_data); } + zend_vm_stack_free((char*)execute_data - (ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * op_array->T) TSRMLS_CC); + if ((op_array->fn_flags & ZEND_ACC_CLOSURE) && op_array->prototype) { zval_ptr_dtor((zval**)&op_array->prototype); } - nested = EX(nested); - - zend_vm_stack_free(execute_data TSRMLS_CC); - if (nested) { execute_data = EG(current_execute_data); } @@ -1883,7 +1870,6 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY) EX(function_state).function = (zend_function *) EX(op_array); EX(function_state).arguments = NULL; - EX(object) = EX(current_object); EG(opline_ptr) = &EX(opline); EG(active_op_array) = EX(op_array); @@ -1893,15 +1879,6 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY) if (UNEXPECTED(EG(exception) != NULL)) { zend_throw_exception_internal(NULL TSRMLS_CC); HANDLE_EXCEPTION_LEAVE(); - } else if (RETURN_VALUE_USED(opline)) { - if (!EX_T(opline->result.var).var.ptr) { /* there was no return statement */ - zval *retval; - - ALLOC_ZVAL(retval); - ZVAL_BOOL(retval, 1); - INIT_PZVAL(retval); - EX_T(opline->result.var).var.ptr = retval; - } } ZEND_VM_INC_OPCODE(); @@ -1919,8 +1896,8 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY) EX(function_state).arguments = NULL; if (EG(This)) { - if (UNEXPECTED(EG(exception) != NULL) && IS_CTOR_CALL(EX(called_scope))) { - if (IS_CTOR_USED(EX(called_scope))) { + if (UNEXPECTED(EG(exception) != NULL) && EX(call)->is_ctor_call) { + if (EX(call)->is_ctor_result_used) { Z_DELREF_P(EG(This)); } if (Z_REFCOUNT_P(EG(This)) == 1) { @@ -1933,10 +1910,9 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY) EG(scope) = EX(current_scope); EG(called_scope) = EX(current_called_scope); - EX(object) = EX(current_object); - EX(called_scope) = DECODE_CTOR(EX(called_scope)); + EX(call)--; - zend_vm_stack_clear_multiple(TSRMLS_C); + zend_vm_stack_clear_multiple(1 TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { zend_throw_exception_internal(NULL TSRMLS_CC); @@ -1960,6 +1936,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY) zend_function *fbc = EX(function_state).function; SAVE_OPLINE(); + EX(object) = EX(call)->object; 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); @@ -1994,11 +1971,11 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY) EX(current_called_scope) = EG(called_scope); EG(This) = EX(object); EG(scope) = (fbc->type == ZEND_USER_FUNCTION || !EX(object)) ? fbc->common.scope : NULL; - EG(called_scope) = EX(called_scope); + EG(called_scope) = EX(call)->called_scope; } - zend_arg_types_stack_3_pop(&EG(arg_types_stack), &EX(called_scope), &EX(current_object), &EX(fbc)); - EX(function_state).arguments = zend_vm_stack_push_args(opline->extended_value TSRMLS_CC); + EX(function_state).arguments = zend_vm_stack_top(TSRMLS_C); + zend_vm_stack_push((void*)(zend_uintptr_t)opline->extended_value TSRMLS_CC); LOAD_OPLINE(); if (fbc->type == ZEND_INTERNAL_FUNCTION) { @@ -2024,7 +2001,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY) /* 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); } else { - zend_execute_internal(EXECUTE_DATA, NULL, RETURN_VALUE_USED(opline) TSRMLS_CC); + zend_execute_internal(execute_data, NULL, RETURN_VALUE_USED(opline) TSRMLS_CC); } if (!RETURN_VALUE_USED(opline)) { @@ -2044,11 +2021,11 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY) ret->var.fcall_returned_reference = (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0; } - if (EG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) { + if (UNEXPECTED((EG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) != 0)) { if (RETURN_VALUE_USED(opline)) { EX_T(opline->result.var).var.ptr = zend_generator_create_zval(EG(active_op_array) TSRMLS_CC); } - } else if (EXPECTED(zend_execute == execute)) { + } else if (EXPECTED(zend_execute_ex == execute_ex)) { if (EXPECTED(EG(exception) == NULL)) { ZEND_VM_ENTER(); } @@ -2094,8 +2071,8 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY) if (should_change_scope) { if (EG(This)) { - if (UNEXPECTED(EG(exception) != NULL) && IS_CTOR_CALL(EX(called_scope))) { - if (IS_CTOR_USED(EX(called_scope))) { + if (UNEXPECTED(EG(exception) != NULL) && EX(call)->is_ctor_call) { + if (EX(call)->is_ctor_result_used) { Z_DELREF_P(EG(This)); } if (Z_REFCOUNT_P(EG(This)) == 1) { @@ -2109,10 +2086,9 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY) EG(called_scope) = EX(current_called_scope); } - EX(object) = EX(current_object); - EX(called_scope) = DECODE_CTOR(EX(called_scope)); + EX(call)--; - zend_vm_stack_clear_multiple(TSRMLS_C); + zend_vm_stack_clear_multiple(1 TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { zend_throw_exception_internal(NULL TSRMLS_CC); @@ -2125,101 +2101,6 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY) ZEND_VM_NEXT_OPCODE(); } -ZEND_VM_HELPER_EX(zend_finally_handler_leaving, ANY, ANY, int type) -{ - USE_OPLINE - zend_uint i, op_num = opline - EX(op_array)->opcodes; - zend_uint catch_op_num = 0, finally_op_num = 0; - - SAVE_OPLINE(); - - switch (type) { - case ZEND_THROW: - case ZEND_RETURN: - case ZEND_RETURN_BY_REF: - case ZEND_LEAVE: - { - if (EG(prev_exception) || (type == ZEND_LEAVE && EG(exception))) { - for (i=0; i<EX(op_array)->last_try_catch; i++) { - if (EX(op_array)->try_catch_array[i].try_op > op_num) { - break; - } - if (op_num < EX(op_array)->try_catch_array[i].finally_op) { - finally_op_num = EX(op_array)->try_catch_array[i].finally_op; - } - if (op_num < EX(op_array)->try_catch_array[i].catch_op) { - catch_op_num = EX(op_array)->try_catch_array[i].catch_op; - } - } - } else { - for (i=0; i<EX(op_array)->last_try_catch; i++) { - if (EX(op_array)->try_catch_array[i].try_op > op_num) { - break; - } - if (op_num < EX(op_array)->try_catch_array[i].finally_op) { - finally_op_num = EX(op_array)->try_catch_array[i].finally_op; - } - } - } - - if (catch_op_num && finally_op_num) { - /* EG(exception) || EG(prev_exception) */ - if (catch_op_num > finally_op_num) { - zend_exception_save(TSRMLS_C); - EX(leaving) = ZEND_THROW; - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[finally_op_num]); - } else { - EX(leaving) = 0; - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[catch_op_num]); - } - } else if (catch_op_num) { - EX(leaving) = 0; - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[catch_op_num]); - } else if (finally_op_num) { - zend_exception_save(TSRMLS_C); - if (type != ZEND_LEAVE) { - EX(leaving) = type; - } - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[finally_op_num]); - } else if (EX(leaving) && type != ZEND_LEAVE) { - /* leave it to ZEND_LEAVE */ - EX(leaving) = type; - ZEND_VM_NEXT_OPCODE(); - } else { - ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper); - } - } - break; - case ZEND_JMP: - case ZEND_BRK: - case ZEND_CONT: - case ZEND_GOTO: - { - /* these can not occurred in exception context */ - for (i=0; i<EG(active_op_array)->last_try_catch; i++) { - if (EG(active_op_array)->try_catch_array[i].try_op > op_num) { - break; - } - if (op_num < EG(active_op_array)->try_catch_array[i].finally_op - && (EX(leaving_dest) < EG(active_op_array)->try_catch_array[i].try_op - || EX(leaving_dest) >= EG(active_op_array)->try_catch_array[i].finally_end)) { - finally_op_num = EG(active_op_array)->try_catch_array[i].finally_op; - } - } - - if (finally_op_num) { - EX(leaving) = type; - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[finally_op_num]); - } else { - EX(leaving) = 0; - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[EX(leaving_dest)]); - } - } - break; - } - ZEND_VM_CONTINUE(); -} - ZEND_VM_HANDLER(42, ZEND_JMP, ANY, ANY) { USE_OPLINE @@ -2227,12 +2108,8 @@ ZEND_VM_HANDLER(42, ZEND_JMP, ANY, ANY) #if DEBUG_ZEND>=2 printf("Jumping to %d\n", opline->op1.opline_num); #endif - if (EXPECTED(!EX(op_array)->has_finally_block)) { - ZEND_VM_SET_OPCODE(opline->op1.jmp_addr); - ZEND_VM_CONTINUE(); /* CHECK_ME */ - } - EX(leaving_dest) = opline->op1.jmp_addr - EX(op_array)->opcodes; - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_finally_handler_leaving, type, ZEND_JMP); + ZEND_VM_SET_OPCODE(opline->op1.jmp_addr); + ZEND_VM_CONTINUE(); } ZEND_VM_HANDLER(43, ZEND_JMPZ, CONST|TMP|VAR|CV, ANY) @@ -2556,9 +2433,9 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, TMP|VAR|UNUSED|CV, CONST|TMP|VAR|CV) char *function_name_strval; int function_name_strlen; zend_free_op free_op1, free_op2; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); function_name = GET_OP2_ZVAL_PTR(BP_VAR_R); @@ -2570,49 +2447,51 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, TMP|VAR|UNUSED|CV, CONST|TMP|VAR|CV) function_name_strval = Z_STRVAL_P(function_name); function_name_strlen = Z_STRLEN_P(function_name); - EX(object) = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_R); + call->object = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_R); - if (EXPECTED(EX(object) != NULL) && - EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) { - EX(called_scope) = Z_OBJCE_P(EX(object)); + if (EXPECTED(call->object != NULL) && + EXPECTED(Z_TYPE_P(call->object) == IS_OBJECT)) { + call->called_scope = Z_OBJCE_P(call->object); if (OP2_TYPE != IS_CONST || - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) { - zval *object = EX(object); + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope)) == NULL) { + zval *object = call->object; - if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) { + if (UNEXPECTED(Z_OBJ_HT_P(call->object)->get_method == NULL)) { zend_error_noreturn(E_ERROR, "Object does not support method calls"); } /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((OP2_TYPE == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); - if (UNEXPECTED(EX(fbc) == NULL)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); + call->fbc = Z_OBJ_HT_P(call->object)->get_method(&call->object, function_name_strval, function_name_strlen, ((OP2_TYPE == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + if (UNEXPECTED(call->fbc == NULL)) { + zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(call->object), function_name_strval); } if (OP2_TYPE == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && - EXPECTED(EX(object) == object)) { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc)); + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && + EXPECTED(call->object == object)) { + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope, call->fbc); } } } else { zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); } - if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) { - EX(object) = NULL; + if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { + call->object = NULL; } else { - if (!PZVAL_IS_REF(EX(object))) { - Z_ADDREF_P(EX(object)); /* For $this pointer */ + if (!PZVAL_IS_REF(call->object)) { + Z_ADDREF_P(call->object); /* For $this pointer */ } else { zval *this_ptr; ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); + INIT_PZVAL_COPY(this_ptr, call->object); zval_copy_ctor(this_ptr); - EX(object) = this_ptr; + call->object = this_ptr; } } + call->is_ctor_call = 0; + EX(call) = call; FREE_OP2(); FREE_OP1_IF_VAR(); @@ -2626,9 +2505,9 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS USE_OPLINE zval *function_name; zend_class_entry *ce; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); if (OP1_TYPE == IS_CONST) { /* no function found. try a static method in class */ @@ -2642,24 +2521,24 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS } CACHE_PTR(opline->op1.literal->cache_slot, ce); } - EX(called_scope) = ce; + call->called_scope = ce; } else { ce = EX_T(opline->op1.var).class_entry; if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) { - EX(called_scope) = EG(called_scope); + call->called_scope = EG(called_scope); } else { - EX(called_scope) = ce; + call->called_scope = ce; } } if (OP1_TYPE == IS_CONST && OP2_TYPE == IS_CONST && CACHED_PTR(opline->op2.literal->cache_slot)) { - EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot); + call->fbc = CACHED_PTR(opline->op2.literal->cache_slot); } else if (OP1_TYPE != IS_CONST && OP2_TYPE == IS_CONST && - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) { + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) { /* do nothing */ } else if (OP2_TYPE != IS_UNUSED) { char *function_name_strval = NULL; @@ -2682,20 +2561,20 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS if (function_name_strval) { if (ce->get_static_method) { - EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + call->fbc = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); } else { - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((OP2_TYPE == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + call->fbc = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((OP2_TYPE == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); } - if (UNEXPECTED(EX(fbc) == NULL)) { + if (UNEXPECTED(call->fbc == NULL)) { zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval); } if (OP2_TYPE == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) { + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) { if (OP1_TYPE == IS_CONST) { - CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc)); + CACHE_PTR(opline->op2.literal->cache_slot, call->fbc); } else { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, EX(fbc)); + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, call->fbc); } } } @@ -2709,29 +2588,31 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name); } - EX(fbc) = ce->constructor; + call->fbc = ce->constructor; } - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; + if (call->fbc->common.fn_flags & ZEND_ACC_STATIC) { + call->object = NULL; } else { if (EG(This) && Z_OBJ_HT_P(EG(This))->get_class_entry && !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) { /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ - if (EX(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", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); + 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); } 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", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); + 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); } } - if ((EX(object) = EG(This))) { - Z_ADDREF_P(EX(object)); - EX(called_scope) = Z_OBJCE_P(EX(object)); + if ((call->object = EG(This))) { + Z_ADDREF_P(call->object); + call->called_scope = Z_OBJCE_P(call->object); } } + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -2741,19 +2622,22 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV) { USE_OPLINE zval *function_name; - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); + call_slot *call = EX(call_slots) + opline->result.num; if (OP2_TYPE == IS_CONST) { function_name = (zval*)(opline->op2.literal+1); if (CACHED_PTR(opline->op2.literal->cache_slot)) { - EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot); - } else if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL_P(function_name), Z_STRLEN_P(function_name)+1, Z_HASH_P(function_name), (void **) &EX(fbc)) == FAILURE)) { + call->fbc = CACHED_PTR(opline->op2.literal->cache_slot); + } else if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL_P(function_name), Z_STRLEN_P(function_name)+1, Z_HASH_P(function_name), (void **) &call->fbc) == FAILURE)) { SAVE_OPLINE(); zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(opline->op2.zv)); } else { - CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc)); + CACHE_PTR(opline->op2.literal->cache_slot, call->fbc); } - EX(object) = NULL; + call->object = NULL; + call->called_scope = NULL; + call->is_ctor_call = 0; + EX(call) = call; /*CHECK_EXCEPTION();*/ ZEND_VM_NEXT_OPCODE(); } else { @@ -2773,28 +2657,33 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV) } else { lcname = zend_str_tolower_dup(function_name_strval, function_name_strlen); } - if (UNEXPECTED(zend_hash_find(EG(function_table), lcname, function_name_strlen+1, (void **) &EX(fbc)) == FAILURE)) { + if (UNEXPECTED(zend_hash_find(EG(function_table), lcname, function_name_strlen+1, (void **) &call->fbc) == FAILURE)) { zend_error_noreturn(E_ERROR, "Call to undefined function %s()", function_name_strval); } efree(lcname); FREE_OP2(); - EX(object) = NULL; + call->object = NULL; + call->called_scope = NULL; + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else if (OP2_TYPE != IS_CONST && OP2_TYPE != IS_TMP_VAR && EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) && Z_OBJ_HANDLER_P(function_name, get_closure) && - Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &EX(called_scope), &EX(fbc), &EX(object) TSRMLS_CC) == SUCCESS) { - if (EX(object)) { - Z_ADDREF_P(EX(object)); + Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &call->called_scope, &call->fbc, &call->object TSRMLS_CC) == SUCCESS) { + if (call->object) { + Z_ADDREF_P(call->object); } if (OP2_TYPE == IS_VAR && OP2_FREE && - EX(fbc)->common.fn_flags & ZEND_ACC_CLOSURE) { + call->fbc->common.fn_flags & ZEND_ACC_CLOSURE) { /* Delay closure destruction until its invocation */ - EX(fbc)->common.prototype = (zend_function*)function_name; + call->fbc->common.prototype = (zend_function*)function_name; } else { FREE_OP2(); } + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else if (OP2_TYPE != IS_CONST && @@ -2825,46 +2714,49 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV) CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } - EX(called_scope) = ce; - EX(object) = NULL; + call->called_scope = ce; + call->object = NULL; if (ce->get_static_method) { - EX(fbc) = ce->get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method) TSRMLS_CC); + call->fbc = ce->get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method) TSRMLS_CC); } else { - EX(fbc) = zend_std_get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC); + call->fbc = zend_std_get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC); } } else { - EX(object) = *obj; - ce = EX(called_scope) = Z_OBJCE_PP(obj); + call->object = *obj; + ce = call->called_scope = Z_OBJCE_PP(obj); - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC); - if (UNEXPECTED(EX(fbc) == NULL)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), Z_STRVAL_PP(method)); + call->fbc = Z_OBJ_HT_P(call->object)->get_method(&call->object, Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC); + if (UNEXPECTED(call->fbc == NULL)) { + zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(call->object), Z_STRVAL_PP(method)); } - if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) { - EX(object) = NULL; + if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { + call->object = NULL; } else { - if (!PZVAL_IS_REF(EX(object))) { - Z_ADDREF_P(EX(object)); /* For $this pointer */ + if (!PZVAL_IS_REF(call->object)) { + Z_ADDREF_P(call->object); /* For $this pointer */ } else { zval *this_ptr; ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); + INIT_PZVAL_COPY(this_ptr, call->object); zval_copy_ctor(this_ptr); - EX(object) = this_ptr; + call->object = this_ptr; } } } - if (UNEXPECTED(EX(fbc) == NULL)) { + if (UNEXPECTED(call->fbc == NULL)) { zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, Z_STRVAL_PP(method)); } + call->is_ctor_call = 0; + EX(call) = call; FREE_OP2(); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { zend_error_noreturn(E_ERROR, "Function name must be a string"); + ZEND_VM_NEXT_OPCODE(); /* Never reached */ } } } @@ -2874,31 +2766,33 @@ ZEND_VM_HANDLER(69, ZEND_INIT_NS_FCALL_BY_NAME, ANY, CONST) { USE_OPLINE zend_literal *func_name; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); + call_slot *call = EX(call_slots) + opline->result.num; func_name = opline->op2.literal + 1; if (CACHED_PTR(opline->op2.literal->cache_slot)) { - EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot); - } else if (zend_hash_quick_find(EG(function_table), Z_STRVAL(func_name->constant), Z_STRLEN(func_name->constant)+1, func_name->hash_value, (void **) &EX(fbc))==FAILURE) { + call->fbc = CACHED_PTR(opline->op2.literal->cache_slot); + } else if (zend_hash_quick_find(EG(function_table), Z_STRVAL(func_name->constant), Z_STRLEN(func_name->constant)+1, func_name->hash_value, (void **) &call->fbc)==FAILURE) { func_name++; - if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL(func_name->constant), Z_STRLEN(func_name->constant)+1, func_name->hash_value, (void **) &EX(fbc))==FAILURE)) { + if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL(func_name->constant), Z_STRLEN(func_name->constant)+1, func_name->hash_value, (void **) &call->fbc)==FAILURE)) { SAVE_OPLINE(); zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(opline->op2.zv)); } else { - CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc)); + CACHE_PTR(opline->op2.literal->cache_slot, call->fbc); } } else { - CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc)); + CACHE_PTR(opline->op2.literal->cache_slot, call->fbc); } - EX(object) = NULL; + call->object = NULL; + call->called_scope = NULL; + call->is_ctor_call = 0; + EX(call) = call; ZEND_VM_NEXT_OPCODE(); } ZEND_VM_HANDLER(61, ZEND_DO_FCALL_BY_NAME, ANY, ANY) { - EX(function_state).function = EX(fbc); + EX(function_state).function = EX(call)->fbc; ZEND_VM_DISPATCH_TO_HELPER(zend_do_fcall_common_helper); } @@ -2907,8 +2801,7 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, CONST, ANY) USE_OPLINE zend_free_op free_op1; zval *fname = GET_OP1_ZVAL_PTR(BP_VAR_R); - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); + call_slot *call = EX(call_slots) + opline->op2.num; if (CACHED_PTR(opline->op1.literal->cache_slot)) { EX(function_state).function = CACHED_PTR(opline->op1.literal->cache_slot); @@ -2918,7 +2811,11 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, CONST, ANY) } else { CACHE_PTR(opline->op1.literal->cache_slot, EX(function_state).function); } - EX(object) = NULL; + call->fbc = EX(function_state).function; + call->object = NULL; + call->called_scope = NULL; + call->is_ctor_call = 0; + EX(call) = call; FREE_OP1(); @@ -2972,11 +2869,7 @@ ZEND_VM_HANDLER(62, ZEND_RETURN, CONST|TMP|VAR|CV, ANY) *EG(return_value_ptr_ptr) = ret; } FREE_OP1_IF_VAR(); - - if (EXPECTED(!EX(op_array)->has_finally_block)) { - ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper); - } - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_finally_handler_leaving, type, ZEND_RETURN); + ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper); } ZEND_VM_HANDLER(111, ZEND_RETURN_BY_REF, CONST|TMP|VAR|CV, ANY) @@ -3048,19 +2941,19 @@ ZEND_VM_HANDLER(111, ZEND_RETURN_BY_REF, CONST|TMP|VAR|CV, ANY) } while (0); FREE_OP1_IF_VAR(); - - if (EXPECTED(!EX(op_array)->has_finally_block)) { - ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper); - } - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_finally_handler_leaving, type, ZEND_RETURN_BY_REF); + ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper); } ZEND_VM_HANDLER(161, ZEND_GENERATOR_RETURN, ANY, ANY) { - if (EX(op_array)->has_finally_block) { - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_finally_handler_leaving, type, ZEND_RETURN); - } - ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper); + /* The generator object is stored in return_value_ptr_ptr */ + zend_generator *generator = (zend_generator *) EG(return_value_ptr_ptr); + + /* Close the generator to free up resources */ + zend_generator_close(generator, 1 TSRMLS_CC); + + /* Pass execution back to handling code */ + ZEND_VM_RETURN(); } ZEND_VM_HANDLER(108, ZEND_THROW, CONST|TMP|VAR|CV, ANY) @@ -3134,7 +3027,7 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV) if (EX_CV(opline->op2.var)) { zval_ptr_dtor(EX_CV(opline->op2.var)); } - EX_CV(opline->op2.var) = (zval**)EX_CVs() + (EX(op_array)->last_var + opline->op2.var); + EX_CV(opline->op2.var) = (zval**)EX_CV_NUM(execute_data, EX(op_array)->last_var + opline->op2.var); *EX_CV(opline->op2.var) = EG(exception); } else { zend_compiled_variable *cv = &CV_DEF_OF(opline->op2.var); @@ -3156,7 +3049,7 @@ ZEND_VM_HANDLER(65, ZEND_SEND_VAL, CONST|TMP, ANY) SAVE_OPLINE(); if (opline->extended_value==ZEND_DO_FCALL_BY_NAME - && ARG_MUST_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) { + && ARG_MUST_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) { zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.opline_num); } { @@ -3217,7 +3110,7 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY) if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) { ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper); } - } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) { + } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) { ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper); } @@ -3243,7 +3136,7 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY) if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ? !(opline->extended_value & ZEND_ARG_SEND_SILENT) : - !ARG_MAY_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) { + !ARG_MAY_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) { zend_error(E_STRICT, "Only variables should be passed by reference"); } ALLOC_ZVAL(valptr); @@ -3279,7 +3172,7 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY) ZEND_VM_NEXT_OPCODE(); } - if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) { + if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) { ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper); } @@ -3298,7 +3191,7 @@ ZEND_VM_HANDLER(66, ZEND_SEND_VAR, VAR|CV, ANY) USE_OPLINE if ((opline->extended_value == ZEND_DO_FCALL_BY_NAME) - && ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) { + && ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) { ZEND_VM_DISPATCH_TO_HANDLER(ZEND_SEND_REF); } SAVE_OPLINE(); @@ -3336,7 +3229,7 @@ ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY) zval **var_ptr; zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->result.var TSRMLS_CC); + var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC); Z_DELREF_PP(var_ptr); *var_ptr = *param; Z_ADDREF_PP(var_ptr); @@ -3372,7 +3265,7 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST) } zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->result.var TSRMLS_CC); + var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC); Z_DELREF_PP(var_ptr); *var_ptr = assignment_value; @@ -3402,13 +3295,9 @@ ZEND_VM_HANDLER(50, ZEND_BRK, ANY, CONST) SAVE_OPLINE(); el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->op1.opline_num, - EX(op_array), EX_Ts() TSRMLS_CC); + EX(op_array), execute_data TSRMLS_CC); FREE_OP2(); - if (EXPECTED(!EX(op_array)->has_finally_block)) { - ZEND_VM_JMP(EX(op_array)->opcodes + el->brk); - } - EX(leaving_dest) = el->brk; - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_finally_handler_leaving, type, ZEND_BRK); + ZEND_VM_JMP(EX(op_array)->opcodes + el->brk); } ZEND_VM_HANDLER(51, ZEND_CONT, ANY, CONST) @@ -3418,13 +3307,9 @@ ZEND_VM_HANDLER(51, ZEND_CONT, ANY, CONST) SAVE_OPLINE(); el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->op1.opline_num, - EX(op_array), EX_Ts() TSRMLS_CC); + EX(op_array), execute_data TSRMLS_CC); FREE_OP2(); - if (EXPECTED(!EX(op_array)->has_finally_block)) { - ZEND_VM_JMP(EX(op_array)->opcodes + el->cont); - } - EX(leaving_dest) = el->cont; - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_finally_handler_leaving, type, ZEND_CONT); + ZEND_VM_JMP(EX(op_array)->opcodes + el->cont); } ZEND_VM_HANDLER(100, ZEND_GOTO, ANY, CONST) @@ -3435,7 +3320,7 @@ ZEND_VM_HANDLER(100, ZEND_GOTO, ANY, CONST) SAVE_OPLINE(); el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->extended_value, - EX(op_array), EX_Ts() TSRMLS_CC); + EX(op_array), execute_data TSRMLS_CC); brk_opline = EX(op_array)->opcodes + el->brk; @@ -3451,11 +3336,7 @@ ZEND_VM_HANDLER(100, ZEND_GOTO, ANY, CONST) } break; } - if (EXPECTED(!EX(op_array)->has_finally_block)) { - ZEND_VM_JMP(opline->op1.jmp_addr); - } - EX(leaving_dest) = opline->op1.jmp_addr - EX(op_array)->opcodes; - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_finally_handler_leaving, type, ZEND_GOTO); + ZEND_VM_JMP(opline->op1.jmp_addr); } ZEND_VM_HANDLER(48, ZEND_CASE, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) @@ -3516,17 +3397,20 @@ ZEND_VM_HANDLER(68, ZEND_NEW, ANY, ANY) } ZEND_VM_JMP(EX(op_array)->opcodes + opline->op2.opline_num); } else { + call_slot *call = EX(call_slots) + opline->extended_value; + if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(object_zval); AI_SET_PTR(&EX_T(opline->result.var), object_zval); } - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), ENCODE_CTOR(EX(called_scope), RETURN_VALUE_USED(opline))); - /* We are not handling overloaded classes right now */ - EX(object) = object_zval; - EX(fbc) = constructor; - EX(called_scope) = EX_T(opline->op1.var).class_entry; + call->fbc = constructor; + call->object = object_zval; + call->called_scope = EX_T(opline->op1.var).class_entry; + call->is_ctor_call = 1; + call->is_ctor_result_used = RETURN_VALUE_USED(opline); + EX(call) = call; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -3945,8 +3829,6 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY) EG(return_value_ptr_ptr) = NULL; } - EX(current_object) = EX(object); - EX(function_state).function = (zend_function *) new_op_array; EX(object) = NULL; @@ -3954,14 +3836,13 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY) zend_rebuild_symbol_table(TSRMLS_C); } - if (EXPECTED(zend_execute == execute)) { + if (EXPECTED(zend_execute_ex == execute_ex)) { ZEND_VM_ENTER(); } else { zend_execute(new_op_array TSRMLS_CC); } EX(function_state).function = (zend_function *) EX(op_array); - EX(object) = EX(current_object); EG(opline_ptr) = &EX(opline); EG(active_op_array) = EX(op_array); @@ -3971,15 +3852,6 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY) if (UNEXPECTED(EG(exception) != NULL)) { zend_throw_exception_internal(NULL TSRMLS_CC); HANDLE_EXCEPTION(); - } else if (RETURN_VALUE_USED(opline)) { - if (!EX_T(opline->result.var).var.ptr) { /* there was no return statement */ - zval *retval; - - ALLOC_ZVAL(retval); - ZVAL_BOOL(retval, 1); - INIT_PZVAL(retval); - EX_T(opline->result.var).var.ptr = retval; - } } } else if (RETURN_VALUE_USED(opline)) { @@ -4056,7 +3928,7 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR) ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1); target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC); - zend_delete_variable(EXECUTE_DATA, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC); + zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC); } if (OP1_TYPE != IS_CONST && varname == &tmp) { @@ -5134,24 +5006,11 @@ 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; - int catched = 0, finally = 0; void **stack_frame; /* Figure out where the next stack frame (which maybe contains pushed * arguments that have to be dtor'ed) starts */ - if (EX(op_array)->fn_flags & ZEND_ACC_GENERATOR) { - /* The generator object is stored in return_value_ptr_ptr */ - zend_generator *generator = (zend_generator *) EG(return_value_ptr_ptr); - - /* For generators the next stack frame is conveniently stored in the - * generator object. */ - stack_frame = generator->original_stack_top; - } else { - /* In all other cases the next stack frame starts after the temporary - * variables section of the current execution context */ - stack_frame = (void **) ((char *) EX_Ts() + - ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * EX(op_array)->T); - } + stack_frame = zend_vm_stack_frame_base(execute_data); /* If the exception was thrown during a function call there might be * arguments pushed to the stack that have to be dtor'ed. */ @@ -5167,29 +5026,29 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY) } if (op_num < EG(active_op_array)->try_catch_array[i].catch_op) { catch_op_num = EX(op_array)->try_catch_array[i].catch_op; - catched = i + 1; } 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; - finally = i + 1; } } - while (EX(fbc)) { - EX(called_scope) = (zend_class_entry*)zend_ptr_stack_pop(&EG(arg_types_stack)); - if (EX(object)) { - if (IS_CTOR_CALL(EX(called_scope))) { - if (IS_CTOR_USED(EX(called_scope))) { - Z_DELREF_P(EX(object)); - } - if (Z_REFCOUNT_P(EX(object)) == 1) { - zend_object_store_ctor_failed(EX(object) TSRMLS_CC); + if (EX(call) >= EX(call_slots)) { + call_slot *call = EX(call); + do { + if (call->object) { + if (call->is_ctor_call) { + if (call->is_ctor_result_used) { + Z_DELREF_P(call->object); + } + if (Z_REFCOUNT_P(call->object) == 1) { + zend_object_store_ctor_failed(call->object TSRMLS_CC); + } } + zval_ptr_dtor(&call->object); } - zval_ptr_dtor(&EX(object)); - } - EX(called_scope) = DECODE_CTOR(EX(called_scope)); - zend_arg_types_stack_2_pop(&EG(arg_types_stack), &EX(object), &EX(fbc)); + call--; + } while (call >= EX(call_slots)); + EX(call) = NULL; } for (i=0; i<EX(op_array)->last_brk_cont; i++) { @@ -5199,7 +5058,7 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY) /* further blocks will not be relevant... */ break; } else if (op_num < EX(op_array)->brk_cont_array[i].brk) { - if (!catched || + if (!catch_op_num || catch_op_num >= EX(op_array)->brk_cont_array[i].brk) { zend_op *brk_opline = &EX(op_array)->opcodes[EX(op_array)->brk_cont_array[i].brk]; @@ -5231,28 +5090,20 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY) } EX(old_error_reporting) = NULL; - if (catched && finally) { - if (finally_op_num > catch_op_num) { - EX(leaving) = 0; - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[catch_op_num]); - ZEND_VM_CONTINUE(); - } else { - zend_exception_save(TSRMLS_C); - EX(leaving) = ZEND_THROW; - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[finally_op_num]); - ZEND_VM_CONTINUE(); - } - } else if (catched) { - EX(leaving) = 0; - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[catch_op_num]); - ZEND_VM_CONTINUE(); - } else if (finally) { + if (finally_op_num && (!catch_op_num || catch_op_num >= finally_op_num)) { zend_exception_save(TSRMLS_C); - EX(leaving) = ZEND_THROW; + EX(fast_ret) = NULL; ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[finally_op_num]); ZEND_VM_CONTINUE(); + } else if (catch_op_num) { + ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[catch_op_num]); + ZEND_VM_CONTINUE(); } else { - ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper); + 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); + } } } @@ -5279,7 +5130,11 @@ ZEND_VM_HANDLER(150, ZEND_USER_OPCODE, ANY, ANY) case ZEND_USER_OPCODE_CONTINUE: ZEND_VM_CONTINUE(); case ZEND_USER_OPCODE_RETURN: - ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper); + 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); + } case ZEND_USER_OPCODE_ENTER: ZEND_VM_ENTER(); case ZEND_USER_OPCODE_LEAVE: @@ -5371,30 +5226,6 @@ ZEND_VM_HANDLER(156, ZEND_SEPARATE, VAR, UNUSED) ZEND_VM_NEXT_OPCODE(); } -ZEND_VM_HANDLER(159, ZEND_LEAVE, ANY, ANY) -{ - zend_exception_restore(TSRMLS_C); - if (!EX(leaving)) { - ZEND_VM_NEXT_OPCODE(); - } else { - zend_uint leaving = EX(leaving); - switch (leaving) { - case ZEND_RETURN: - case ZEND_RETURN_BY_REF: - case ZEND_THROW: - leaving = ZEND_LEAVE; - case ZEND_JMP: - case ZEND_BRK: - case ZEND_CONT: - case ZEND_GOTO: - ZEND_VM_DISPATCH_TO_HELPER_EX(zend_finally_handler_leaving, type, leaving); - break; - } - } - - ZEND_VM_CONTINUE(); -} - ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSED) { USE_OPLINE @@ -5538,8 +5369,7 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE generator->send_target = &EX_T(opline->result.var); /* Initialize the sent value to NULL */ - Z_ADDREF(EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).tmp_var = EG(uninitialized_zval); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ @@ -5552,4 +5382,56 @@ ZEND_VM_HANDLER(160, ZEND_YIELD, CONST|TMP|VAR|CV|UNUSED, CONST|TMP|VAR|CV|UNUSE ZEND_VM_RETURN(); } +ZEND_VM_HANDLER(159, ZEND_DISCARD_EXCEPTION, ANY, ANY) +{ + if (EG(prev_exception) != NULL) { + /* discard the previously thrown exception */ + zval_ptr_dtor(&EG(prev_exception)); + EG(prev_exception) = NULL; + } + + ZEND_VM_NEXT_OPCODE(); +} + +ZEND_VM_HANDLER(162, ZEND_FAST_CALL, ANY, ANY) +{ + USE_OPLINE + + if (opline->extended_value && + UNEXPECTED(EG(prev_exception) != NULL)) { + /* in case of unhandled exception jump to catch block instead of finally */ + ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]); + ZEND_VM_CONTINUE(); + } + EX(fast_ret) = opline + 1; + ZEND_VM_SET_OPCODE(opline->op1.jmp_addr); + ZEND_VM_CONTINUE(); +} + +ZEND_VM_HANDLER(163, ZEND_FAST_RET, ANY, ANY) +{ + if (EX(fast_ret)) { + ZEND_VM_SET_OPCODE(EX(fast_ret)); + ZEND_VM_CONTINUE(); + } else { + /* special case for unhandled exceptions */ + USE_OPLINE + + 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); + } + } +} + ZEND_VM_EXPORT_HELPER(zend_do_fcall, zend_do_fcall_common_helper) diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 7a2cfc88d..23f6187ae 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -326,91 +326,6 @@ static opcode_handler_t zend_vm_get_opcode_handler(zend_uchar opcode, zend_op* o #define ZEND_VM_DISPATCH(opcode, opline) return zend_vm_get_opcode_handler(opcode, opline)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); #define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data TSRMLS_CC -#undef EX -#define EX(element) execute_data->element - -#undef EX_CV -#define EX_CV(var) EX(CVs)[var] -#undef EX_CVs -#define EX_CVs() EX(CVs) -#undef EX_T -#define EX_T(offset) (*(temp_variable *)((char *) EX(Ts) + offset)) -#undef EX_Ts -#define EX_Ts() EX(Ts) - - -zend_execute_data *zend_create_execute_data_from_op_array(zend_op_array *op_array, zend_bool nested TSRMLS_DC) { - zend_execute_data *execute_data; - - /* - * When allocating the execute_data, memory for compiled variables and - * temporary variables is also allocated after the actual zend_execute_data - * struct. op_array->last_var specifies the number of compiled variables and - * op_array->T is the number of temporary variables. If there is no symbol - * table, then twice as much memory is allocated for compiled variables. - * In that case the first half contains zval**s and the second half the - * actual zval*s (which would otherwise be in the symbol table). - */ - size_t execute_data_size = ZEND_MM_ALIGNED_SIZE(sizeof(zend_execute_data)); - size_t CVs_size = ZEND_MM_ALIGNED_SIZE(sizeof(zval **) * op_array->last_var * (EG(active_symbol_table) ? 1 : 2)); - size_t Ts_size = ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * op_array->T; - size_t total_size = execute_data_size + CVs_size + Ts_size; - - /* - * Normally the execute_data is allocated on the VM stack (because it does - * not actually do any allocation and thus is faster). For generators - * though this behavior would be suboptimal, because the (rather large) - * structure would have to be copied back and forth every time execution is - * suspended or resumed. That's why for generators the execution context - * is allocated using emalloc, thus allowing to save and restore it simply - * by replacing a pointer. - */ - if (op_array->fn_flags & ZEND_ACC_GENERATOR) { - execute_data = emalloc(total_size); - } else { - execute_data = zend_vm_stack_alloc(total_size TSRMLS_CC); - } - - EX(CVs) = (zval ***) ((char *) execute_data + execute_data_size); - memset(EX(CVs), 0, sizeof(zval **) * op_array->last_var); - - EX(Ts) = (temp_variable *) ((char *) EX(CVs) + CVs_size); - - EX(fbc) = NULL; - EX(called_scope) = NULL; - EX(object) = NULL; - EX(old_error_reporting) = NULL; - EX(op_array) = op_array; - EX(symbol_table) = EG(active_symbol_table); - EX(prev_execute_data) = EG(current_execute_data); - EG(current_execute_data) = execute_data; - EX(nested) = nested; - EX(leaving) = 0; - - if (!op_array->run_time_cache && op_array->last_cache_slot) { - op_array->run_time_cache = ecalloc(op_array->last_cache_slot, sizeof(void*)); - } - - if (op_array->this_var != -1 && EG(This)) { - Z_ADDREF_P(EG(This)); /* For $this pointer */ - if (!EG(active_symbol_table)) { - EX(CVs)[op_array->this_var] = (zval **) EX(CVs) + op_array->last_var + op_array->this_var; - *EX(CVs)[op_array->this_var] = EG(This); - } else { - if (zend_hash_add(EG(active_symbol_table), "this", sizeof("this"), &EG(This), sizeof(zval *), (void **) &EX(CVs)[op_array->this_var])==FAILURE) { - Z_DELREF_P(EG(This)); - } - } - } - - EX(opline) = UNEXPECTED((op_array->fn_flags & ZEND_ACC_INTERACTIVE) != 0) && EG(start_op) ? EG(start_op) : op_array->opcodes; - EG(opline_ptr) = &EX(opline); - - EX(function_state).function = (zend_function *) op_array; - EX(function_state).arguments = NULL; - - return execute_data; -} ZEND_API void execute_ex(zend_execute_data *execute_data TSRMLS_DC) { @@ -422,6 +337,11 @@ ZEND_API void execute_ex(zend_execute_data *execute_data TSRMLS_DC) original_in_execution = EG(in_execution); EG(in_execution) = 1; + if (0) { +zend_vm_enter: + execute_data = i_create_execute_data_from_op_array(EG(active_op_array), 1 TSRMLS_CC); + } + LOAD_REGS(); LOAD_OPLINE(); @@ -439,7 +359,7 @@ ZEND_API void execute_ex(zend_execute_data *execute_data TSRMLS_DC) EG(in_execution) = original_in_execution; return; case 2: - execute_data = zend_create_execute_data_from_op_array(EG(active_op_array), 1 TSRMLS_CC); + goto zend_vm_enter; break; case 3: execute_data = EG(current_execute_data); @@ -453,45 +373,31 @@ ZEND_API void execute_ex(zend_execute_data *execute_data TSRMLS_DC) zend_error_noreturn(E_ERROR, "Arrived at end of main loop which shouldn't happen"); } -ZEND_API void execute(zend_op_array *op_array TSRMLS_DC) +ZEND_API void zend_execute(zend_op_array *op_array TSRMLS_DC) { if (EG(exception)) { return; } - execute_ex(zend_create_execute_data_from_op_array(op_array, 0 TSRMLS_CC) TSRMLS_CC); + zend_execute_ex(i_create_execute_data_from_op_array(op_array, 0 TSRMLS_CC) TSRMLS_CC); } static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) { - zend_bool nested; + zend_bool nested = EX(nested); zend_op_array *op_array = EX(op_array); - /* Generators go throw a different cleanup process */ - if (EX(op_array)->fn_flags & ZEND_ACC_GENERATOR) { - /* The generator object is stored in return_value_ptr_ptr */ - zend_generator *generator = (zend_generator *) EG(return_value_ptr_ptr); - - /* Close the generator to free up resources */ - zend_generator_close(generator, 1 TSRMLS_CC); - - /* Pass execution back to handling code */ - ZEND_VM_RETURN(); - } - EG(current_execute_data) = EX(prev_execute_data); EG(opline_ptr) = NULL; if (!EG(active_symbol_table)) { - zend_free_compiled_variables(EX_CVs(), op_array->last_var); + i_free_compiled_variables(execute_data); } + zend_vm_stack_free((char*)execute_data - (ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * op_array->T) TSRMLS_CC); + if ((op_array->fn_flags & ZEND_ACC_CLOSURE) && op_array->prototype) { zval_ptr_dtor((zval**)&op_array->prototype); } - nested = EX(nested); - - zend_vm_stack_free(execute_data TSRMLS_CC); - if (nested) { execute_data = EG(current_execute_data); } @@ -504,7 +410,6 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) EX(function_state).function = (zend_function *) EX(op_array); EX(function_state).arguments = NULL; - EX(object) = EX(current_object); EG(opline_ptr) = &EX(opline); EG(active_op_array) = EX(op_array); @@ -514,15 +419,6 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) if (UNEXPECTED(EG(exception) != NULL)) { zend_throw_exception_internal(NULL TSRMLS_CC); HANDLE_EXCEPTION_LEAVE(); - } else if (RETURN_VALUE_USED(opline)) { - if (!EX_T(opline->result.var).var.ptr) { /* there was no return statement */ - zval *retval; - - ALLOC_ZVAL(retval); - ZVAL_BOOL(retval, 1); - INIT_PZVAL(retval); - EX_T(opline->result.var).var.ptr = retval; - } } ZEND_VM_INC_OPCODE(); @@ -540,8 +436,8 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) EX(function_state).arguments = NULL; if (EG(This)) { - if (UNEXPECTED(EG(exception) != NULL) && IS_CTOR_CALL(EX(called_scope))) { - if (IS_CTOR_USED(EX(called_scope))) { + if (UNEXPECTED(EG(exception) != NULL) && EX(call)->is_ctor_call) { + if (EX(call)->is_ctor_result_used) { Z_DELREF_P(EG(This)); } if (Z_REFCOUNT_P(EG(This)) == 1) { @@ -554,10 +450,9 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS) EG(scope) = EX(current_scope); EG(called_scope) = EX(current_called_scope); - EX(object) = EX(current_object); - EX(called_scope) = DECODE_CTOR(EX(called_scope)); + EX(call)--; - zend_vm_stack_clear_multiple(TSRMLS_C); + zend_vm_stack_clear_multiple(1 TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { zend_throw_exception_internal(NULL TSRMLS_CC); @@ -581,6 +476,7 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR zend_function *fbc = EX(function_state).function; SAVE_OPLINE(); + EX(object) = EX(call)->object; 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); @@ -615,11 +511,11 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR EX(current_called_scope) = EG(called_scope); EG(This) = EX(object); EG(scope) = (fbc->type == ZEND_USER_FUNCTION || !EX(object)) ? fbc->common.scope : NULL; - EG(called_scope) = EX(called_scope); + EG(called_scope) = EX(call)->called_scope; } - zend_arg_types_stack_3_pop(&EG(arg_types_stack), &EX(called_scope), &EX(current_object), &EX(fbc)); - EX(function_state).arguments = zend_vm_stack_push_args(opline->extended_value TSRMLS_CC); + EX(function_state).arguments = zend_vm_stack_top(TSRMLS_C); + zend_vm_stack_push((void*)(zend_uintptr_t)opline->extended_value TSRMLS_CC); LOAD_OPLINE(); if (fbc->type == ZEND_INTERNAL_FUNCTION) { @@ -665,11 +561,11 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR ret->var.fcall_returned_reference = (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0; } - if (EG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) { + if (UNEXPECTED((EG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) != 0)) { if (RETURN_VALUE_USED(opline)) { EX_T(opline->result.var).var.ptr = zend_generator_create_zval(EG(active_op_array) TSRMLS_CC); } - } else if (EXPECTED(zend_execute == execute)) { + } else if (EXPECTED(zend_execute_ex == execute_ex)) { if (EXPECTED(EG(exception) == NULL)) { ZEND_VM_ENTER(); } @@ -715,8 +611,8 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR if (should_change_scope) { if (EG(This)) { - if (UNEXPECTED(EG(exception) != NULL) && IS_CTOR_CALL(EX(called_scope))) { - if (IS_CTOR_USED(EX(called_scope))) { + if (UNEXPECTED(EG(exception) != NULL) && EX(call)->is_ctor_call) { + if (EX(call)->is_ctor_result_used) { Z_DELREF_P(EG(This)); } if (Z_REFCOUNT_P(EG(This)) == 1) { @@ -730,10 +626,9 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR EG(called_scope) = EX(current_called_scope); } - EX(object) = EX(current_object); - EX(called_scope) = DECODE_CTOR(EX(called_scope)); + EX(call)--; - zend_vm_stack_clear_multiple(TSRMLS_C); + zend_vm_stack_clear_multiple(1 TSRMLS_CC); if (UNEXPECTED(EG(exception) != NULL)) { zend_throw_exception_internal(NULL TSRMLS_CC); @@ -746,101 +641,6 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR ZEND_VM_NEXT_OPCODE(); } -static int ZEND_FASTCALL zend_finally_handler_leaving_SPEC(int type, ZEND_OPCODE_HANDLER_ARGS) -{ - USE_OPLINE - zend_uint i, op_num = opline - EX(op_array)->opcodes; - zend_uint catch_op_num = 0, finally_op_num = 0; - - SAVE_OPLINE(); - - switch (type) { - case ZEND_THROW: - case ZEND_RETURN: - case ZEND_RETURN_BY_REF: - case ZEND_LEAVE: - { - if (EG(prev_exception) || (type == ZEND_LEAVE && EG(exception))) { - for (i=0; i<EX(op_array)->last_try_catch; i++) { - if (EX(op_array)->try_catch_array[i].try_op > op_num) { - break; - } - if (op_num < EX(op_array)->try_catch_array[i].finally_op) { - finally_op_num = EX(op_array)->try_catch_array[i].finally_op; - } - if (op_num < EX(op_array)->try_catch_array[i].catch_op) { - catch_op_num = EX(op_array)->try_catch_array[i].catch_op; - } - } - } else { - for (i=0; i<EX(op_array)->last_try_catch; i++) { - if (EX(op_array)->try_catch_array[i].try_op > op_num) { - break; - } - if (op_num < EX(op_array)->try_catch_array[i].finally_op) { - finally_op_num = EX(op_array)->try_catch_array[i].finally_op; - } - } - } - - if (catch_op_num && finally_op_num) { - /* EG(exception) || EG(prev_exception) */ - if (catch_op_num > finally_op_num) { - zend_exception_save(TSRMLS_C); - EX(leaving) = ZEND_THROW; - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[finally_op_num]); - } else { - EX(leaving) = 0; - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[catch_op_num]); - } - } else if (catch_op_num) { - EX(leaving) = 0; - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[catch_op_num]); - } else if (finally_op_num) { - zend_exception_save(TSRMLS_C); - if (type != ZEND_LEAVE) { - EX(leaving) = type; - } - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[finally_op_num]); - } else if (EX(leaving) && type != ZEND_LEAVE) { - /* leave it to ZEND_LEAVE */ - EX(leaving) = type; - ZEND_VM_NEXT_OPCODE(); - } else { - return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - } - break; - case ZEND_JMP: - case ZEND_BRK: - case ZEND_CONT: - case ZEND_GOTO: - { - /* these can not occurred in exception context */ - for (i=0; i<EG(active_op_array)->last_try_catch; i++) { - if (EG(active_op_array)->try_catch_array[i].try_op > op_num) { - break; - } - if (op_num < EG(active_op_array)->try_catch_array[i].finally_op - && (EX(leaving_dest) < EG(active_op_array)->try_catch_array[i].try_op - || EX(leaving_dest) >= EG(active_op_array)->try_catch_array[i].finally_end)) { - finally_op_num = EG(active_op_array)->try_catch_array[i].finally_op; - } - } - - if (finally_op_num) { - EX(leaving) = type; - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[finally_op_num]); - } else { - EX(leaving) = 0; - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[EX(leaving_dest)]); - } - } - break; - } - ZEND_VM_CONTINUE(); -} - static int ZEND_FASTCALL ZEND_JMP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -848,12 +648,8 @@ static int ZEND_FASTCALL ZEND_JMP_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) #if DEBUG_ZEND>=2 printf("Jumping to %d\n", opline->op1.opline_num); #endif - if (EXPECTED(!EX(op_array)->has_finally_block)) { - ZEND_VM_SET_OPCODE(opline->op1.jmp_addr); - ZEND_VM_CONTINUE(); /* CHECK_ME */ - } - EX(leaving_dest) = opline->op1.jmp_addr - EX(op_array)->opcodes; - return zend_finally_handler_leaving_SPEC(ZEND_JMP, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + ZEND_VM_SET_OPCODE(opline->op1.jmp_addr); + ZEND_VM_CONTINUE(); } static int ZEND_FASTCALL ZEND_INIT_STRING_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) @@ -874,16 +670,20 @@ static int ZEND_FASTCALL ZEND_INIT_STRING_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS static int ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { - EX(function_state).function = EX(fbc); + EX(function_state).function = EX(call)->fbc; return zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } static int ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { - if (EX(op_array)->has_finally_block) { - return zend_finally_handler_leaving_SPEC(ZEND_RETURN, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + /* The generator object is stored in return_value_ptr_ptr */ + zend_generator *generator = (zend_generator *) EG(return_value_ptr_ptr); + + /* Close the generator to free up resources */ + zend_generator_close(generator, 1 TSRMLS_CC); + + /* Pass execution back to handling code */ + ZEND_VM_RETURN(); } static int ZEND_FASTCALL ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) @@ -917,7 +717,7 @@ static int ZEND_FASTCALL ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zval **var_ptr; zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->result.var TSRMLS_CC); + var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC); Z_DELREF_PP(var_ptr); *var_ptr = *param; Z_ADDREF_PP(var_ptr); @@ -957,17 +757,20 @@ static int ZEND_FASTCALL ZEND_NEW_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) } ZEND_VM_JMP(EX(op_array)->opcodes + opline->op2.opline_num); } else { + call_slot *call = EX(call_slots) + opline->extended_value; + if (RETURN_VALUE_USED(opline)) { PZVAL_LOCK(object_zval); AI_SET_PTR(&EX_T(opline->result.var), object_zval); } - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), ENCODE_CTOR(EX(called_scope), RETURN_VALUE_USED(opline))); - /* We are not handling overloaded classes right now */ - EX(object) = object_zval; - EX(fbc) = constructor; - EX(called_scope) = EX_T(opline->op1.var).class_entry; + call->fbc = constructor; + call->object = object_zval; + call->called_scope = EX_T(opline->op1.var).class_entry; + call->is_ctor_call = 1; + call->is_ctor_result_used = RETURN_VALUE_USED(opline); + EX(call) = call; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -1168,24 +971,11 @@ 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; - int catched = 0, finally = 0; void **stack_frame; /* Figure out where the next stack frame (which maybe contains pushed * arguments that have to be dtor'ed) starts */ - if (EX(op_array)->fn_flags & ZEND_ACC_GENERATOR) { - /* The generator object is stored in return_value_ptr_ptr */ - zend_generator *generator = (zend_generator *) EG(return_value_ptr_ptr); - - /* For generators the next stack frame is conveniently stored in the - * generator object. */ - stack_frame = generator->original_stack_top; - } else { - /* In all other cases the next stack frame starts after the temporary - * variables section of the current execution context */ - stack_frame = (void **) ((char *) EX_Ts() + - ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * EX(op_array)->T); - } + stack_frame = zend_vm_stack_frame_base(execute_data); /* If the exception was thrown during a function call there might be * arguments pushed to the stack that have to be dtor'ed. */ @@ -1201,29 +991,29 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER } if (op_num < EG(active_op_array)->try_catch_array[i].catch_op) { catch_op_num = EX(op_array)->try_catch_array[i].catch_op; - catched = i + 1; } 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; - finally = i + 1; } } - while (EX(fbc)) { - EX(called_scope) = (zend_class_entry*)zend_ptr_stack_pop(&EG(arg_types_stack)); - if (EX(object)) { - if (IS_CTOR_CALL(EX(called_scope))) { - if (IS_CTOR_USED(EX(called_scope))) { - Z_DELREF_P(EX(object)); - } - if (Z_REFCOUNT_P(EX(object)) == 1) { - zend_object_store_ctor_failed(EX(object) TSRMLS_CC); + if (EX(call) >= EX(call_slots)) { + call_slot *call = EX(call); + do { + if (call->object) { + if (call->is_ctor_call) { + if (call->is_ctor_result_used) { + Z_DELREF_P(call->object); + } + if (Z_REFCOUNT_P(call->object) == 1) { + zend_object_store_ctor_failed(call->object TSRMLS_CC); + } } + zval_ptr_dtor(&call->object); } - zval_ptr_dtor(&EX(object)); - } - EX(called_scope) = DECODE_CTOR(EX(called_scope)); - zend_arg_types_stack_2_pop(&EG(arg_types_stack), &EX(object), &EX(fbc)); + call--; + } while (call >= EX(call_slots)); + EX(call) = NULL; } for (i=0; i<EX(op_array)->last_brk_cont; i++) { @@ -1233,7 +1023,7 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER /* further blocks will not be relevant... */ break; } else if (op_num < EX(op_array)->brk_cont_array[i].brk) { - if (!catched || + if (!catch_op_num || catch_op_num >= EX(op_array)->brk_cont_array[i].brk) { zend_op *brk_opline = &EX(op_array)->opcodes[EX(op_array)->brk_cont_array[i].brk]; @@ -1265,28 +1055,20 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER } EX(old_error_reporting) = NULL; - if (catched && finally) { - if (finally_op_num > catch_op_num) { - EX(leaving) = 0; - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[catch_op_num]); - ZEND_VM_CONTINUE(); - } else { - zend_exception_save(TSRMLS_C); - EX(leaving) = ZEND_THROW; - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[finally_op_num]); - ZEND_VM_CONTINUE(); - } - } else if (catched) { - EX(leaving) = 0; - ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[catch_op_num]); - ZEND_VM_CONTINUE(); - } else if (finally) { + if (finally_op_num && (!catch_op_num || catch_op_num >= finally_op_num)) { zend_exception_save(TSRMLS_C); - EX(leaving) = ZEND_THROW; + EX(fast_ret) = NULL; ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[finally_op_num]); ZEND_VM_CONTINUE(); + } else if (catch_op_num) { + ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[catch_op_num]); + ZEND_VM_CONTINUE(); } else { - return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + 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); + } } } @@ -1313,7 +1095,11 @@ static int ZEND_FASTCALL ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS case ZEND_USER_OPCODE_CONTINUE: ZEND_VM_CONTINUE(); case ZEND_USER_OPCODE_RETURN: - return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + 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); + } case ZEND_USER_OPCODE_ENTER: ZEND_VM_ENTER(); case ZEND_USER_OPCODE_LEAVE: @@ -1325,30 +1111,58 @@ static int ZEND_FASTCALL ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS } } -static int ZEND_FASTCALL ZEND_LEAVE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +static int ZEND_FASTCALL ZEND_DISCARD_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { - zend_exception_restore(TSRMLS_C); - if (!EX(leaving)) { - ZEND_VM_NEXT_OPCODE(); - } else { - zend_uint leaving = EX(leaving); - switch (leaving) { - case ZEND_RETURN: - case ZEND_RETURN_BY_REF: - case ZEND_THROW: - leaving = ZEND_LEAVE; - case ZEND_JMP: - case ZEND_BRK: - case ZEND_CONT: - case ZEND_GOTO: - return zend_finally_handler_leaving_SPEC(leaving, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - break; - } + if (EG(prev_exception) != NULL) { + /* discard the previously thrown exception */ + zval_ptr_dtor(&EG(prev_exception)); + EG(prev_exception) = NULL; } + ZEND_VM_NEXT_OPCODE(); +} + +static int ZEND_FASTCALL ZEND_FAST_CALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + USE_OPLINE + + if (opline->extended_value && + UNEXPECTED(EG(prev_exception) != NULL)) { + /* in case of unhandled exception jump to catch block instead of finally */ + ZEND_VM_SET_OPCODE(&EX(op_array)->opcodes[opline->op2.opline_num]); + ZEND_VM_CONTINUE(); + } + EX(fast_ret) = opline + 1; + ZEND_VM_SET_OPCODE(opline->op1.jmp_addr); ZEND_VM_CONTINUE(); } +static int ZEND_FASTCALL ZEND_FAST_RET_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) +{ + if (EX(fast_ret)) { + ZEND_VM_SET_OPCODE(EX(fast_ret)); + ZEND_VM_CONTINUE(); + } else { + /* special case for unhandled exceptions */ + USE_OPLINE + + 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); + } + } +} + static int ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { USE_OPLINE @@ -1389,19 +1203,22 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE { USE_OPLINE zval *function_name; - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); + call_slot *call = EX(call_slots) + opline->result.num; if (IS_CONST == IS_CONST) { function_name = (zval*)(opline->op2.literal+1); if (CACHED_PTR(opline->op2.literal->cache_slot)) { - EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot); - } else if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL_P(function_name), Z_STRLEN_P(function_name)+1, Z_HASH_P(function_name), (void **) &EX(fbc)) == FAILURE)) { + call->fbc = CACHED_PTR(opline->op2.literal->cache_slot); + } else if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL_P(function_name), Z_STRLEN_P(function_name)+1, Z_HASH_P(function_name), (void **) &call->fbc) == FAILURE)) { SAVE_OPLINE(); zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(opline->op2.zv)); } else { - CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc)); + CACHE_PTR(opline->op2.literal->cache_slot, call->fbc); } - EX(object) = NULL; + call->object = NULL; + call->called_scope = NULL; + call->is_ctor_call = 0; + EX(call) = call; /*CHECK_EXCEPTION();*/ ZEND_VM_NEXT_OPCODE(); } else { @@ -1421,28 +1238,33 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE } else { lcname = zend_str_tolower_dup(function_name_strval, function_name_strlen); } - if (UNEXPECTED(zend_hash_find(EG(function_table), lcname, function_name_strlen+1, (void **) &EX(fbc)) == FAILURE)) { + if (UNEXPECTED(zend_hash_find(EG(function_table), lcname, function_name_strlen+1, (void **) &call->fbc) == FAILURE)) { zend_error_noreturn(E_ERROR, "Call to undefined function %s()", function_name_strval); } efree(lcname); - EX(object) = NULL; + call->object = NULL; + call->called_scope = NULL; + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else if (IS_CONST != IS_CONST && IS_CONST != IS_TMP_VAR && EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) && Z_OBJ_HANDLER_P(function_name, get_closure) && - Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &EX(called_scope), &EX(fbc), &EX(object) TSRMLS_CC) == SUCCESS) { - if (EX(object)) { - Z_ADDREF_P(EX(object)); + Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &call->called_scope, &call->fbc, &call->object TSRMLS_CC) == SUCCESS) { + if (call->object) { + Z_ADDREF_P(call->object); } if (IS_CONST == IS_VAR && 0 && - EX(fbc)->common.fn_flags & ZEND_ACC_CLOSURE) { + call->fbc->common.fn_flags & ZEND_ACC_CLOSURE) { /* Delay closure destruction until its invocation */ - EX(fbc)->common.prototype = (zend_function*)function_name; + call->fbc->common.prototype = (zend_function*)function_name; } else { } + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else if (IS_CONST != IS_CONST && @@ -1473,46 +1295,49 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } - EX(called_scope) = ce; - EX(object) = NULL; + call->called_scope = ce; + call->object = NULL; if (ce->get_static_method) { - EX(fbc) = ce->get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method) TSRMLS_CC); + call->fbc = ce->get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method) TSRMLS_CC); } else { - EX(fbc) = zend_std_get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC); + call->fbc = zend_std_get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC); } } else { - EX(object) = *obj; - ce = EX(called_scope) = Z_OBJCE_PP(obj); + call->object = *obj; + ce = call->called_scope = Z_OBJCE_PP(obj); - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC); - if (UNEXPECTED(EX(fbc) == NULL)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), Z_STRVAL_PP(method)); + call->fbc = Z_OBJ_HT_P(call->object)->get_method(&call->object, Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC); + if (UNEXPECTED(call->fbc == NULL)) { + zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(call->object), Z_STRVAL_PP(method)); } - if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) { - EX(object) = NULL; + if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { + call->object = NULL; } else { - if (!PZVAL_IS_REF(EX(object))) { - Z_ADDREF_P(EX(object)); /* For $this pointer */ + if (!PZVAL_IS_REF(call->object)) { + Z_ADDREF_P(call->object); /* For $this pointer */ } else { zval *this_ptr; ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); + INIT_PZVAL_COPY(this_ptr, call->object); zval_copy_ctor(this_ptr); - EX(object) = this_ptr; + call->object = this_ptr; } } } - if (UNEXPECTED(EX(fbc) == NULL)) { + if (UNEXPECTED(call->fbc == NULL)) { zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, Z_STRVAL_PP(method)); } + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { zend_error_noreturn(E_ERROR, "Function name must be a string"); + ZEND_VM_NEXT_OPCODE(); /* Never reached */ } } } @@ -1522,25 +1347,27 @@ static int ZEND_FASTCALL ZEND_INIT_NS_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPC { USE_OPLINE zend_literal *func_name; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); + call_slot *call = EX(call_slots) + opline->result.num; func_name = opline->op2.literal + 1; if (CACHED_PTR(opline->op2.literal->cache_slot)) { - EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot); - } else if (zend_hash_quick_find(EG(function_table), Z_STRVAL(func_name->constant), Z_STRLEN(func_name->constant)+1, func_name->hash_value, (void **) &EX(fbc))==FAILURE) { + call->fbc = CACHED_PTR(opline->op2.literal->cache_slot); + } else if (zend_hash_quick_find(EG(function_table), Z_STRVAL(func_name->constant), Z_STRLEN(func_name->constant)+1, func_name->hash_value, (void **) &call->fbc)==FAILURE) { func_name++; - if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL(func_name->constant), Z_STRLEN(func_name->constant)+1, func_name->hash_value, (void **) &EX(fbc))==FAILURE)) { + if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL(func_name->constant), Z_STRLEN(func_name->constant)+1, func_name->hash_value, (void **) &call->fbc)==FAILURE)) { SAVE_OPLINE(); zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(opline->op2.zv)); } else { - CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc)); + CACHE_PTR(opline->op2.literal->cache_slot, call->fbc); } } else { - CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc)); + CACHE_PTR(opline->op2.literal->cache_slot, call->fbc); } - EX(object) = NULL; + call->object = NULL; + call->called_scope = NULL; + call->is_ctor_call = 0; + EX(call) = call; ZEND_VM_NEXT_OPCODE(); } @@ -1570,7 +1397,7 @@ static int ZEND_FASTCALL ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ } zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->result.var TSRMLS_CC); + var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC); Z_DELREF_PP(var_ptr); *var_ptr = assignment_value; @@ -1585,13 +1412,9 @@ static int ZEND_FASTCALL ZEND_BRK_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->op1.opline_num, - EX(op_array), EX_Ts() TSRMLS_CC); + EX(op_array), execute_data TSRMLS_CC); - if (EXPECTED(!EX(op_array)->has_finally_block)) { - ZEND_VM_JMP(EX(op_array)->opcodes + el->brk); - } - EX(leaving_dest) = el->brk; - return zend_finally_handler_leaving_SPEC(ZEND_BRK, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + ZEND_VM_JMP(EX(op_array)->opcodes + el->brk); } static int ZEND_FASTCALL ZEND_CONT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) @@ -1601,13 +1424,9 @@ static int ZEND_FASTCALL ZEND_CONT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->op1.opline_num, - EX(op_array), EX_Ts() TSRMLS_CC); + EX(op_array), execute_data TSRMLS_CC); - if (EXPECTED(!EX(op_array)->has_finally_block)) { - ZEND_VM_JMP(EX(op_array)->opcodes + el->cont); - } - EX(leaving_dest) = el->cont; - return zend_finally_handler_leaving_SPEC(ZEND_CONT, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + ZEND_VM_JMP(EX(op_array)->opcodes + el->cont); } static int ZEND_FASTCALL ZEND_GOTO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) @@ -1618,7 +1437,7 @@ static int ZEND_FASTCALL ZEND_GOTO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->extended_value, - EX(op_array), EX_Ts() TSRMLS_CC); + EX(op_array), execute_data TSRMLS_CC); brk_opline = EX(op_array)->opcodes + el->brk; @@ -1634,11 +1453,7 @@ static int ZEND_FASTCALL ZEND_GOTO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) } break; } - if (EXPECTED(!EX(op_array)->has_finally_block)) { - ZEND_VM_JMP(opline->op1.jmp_addr); - } - EX(leaving_dest) = opline->op1.jmp_addr - EX(op_array)->opcodes; - return zend_finally_handler_leaving_SPEC(ZEND_GOTO, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + ZEND_VM_JMP(opline->op1.jmp_addr); } static int ZEND_FASTCALL ZEND_ADD_INTERFACE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) @@ -1682,7 +1497,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ ZEND_VM_NEXT_OPCODE(); } else { zend_free_op free_op2; - zval *class_name = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *class_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_TMP_VAR == IS_CONST) { if (CACHED_PTR(opline->op2.literal->cache_slot)) { @@ -1709,19 +1524,22 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H { USE_OPLINE zval *function_name; - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); + call_slot *call = EX(call_slots) + opline->result.num; if (IS_TMP_VAR == IS_CONST) { function_name = (zval*)(opline->op2.literal+1); if (CACHED_PTR(opline->op2.literal->cache_slot)) { - EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot); - } else if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL_P(function_name), Z_STRLEN_P(function_name)+1, Z_HASH_P(function_name), (void **) &EX(fbc)) == FAILURE)) { + call->fbc = CACHED_PTR(opline->op2.literal->cache_slot); + } else if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL_P(function_name), Z_STRLEN_P(function_name)+1, Z_HASH_P(function_name), (void **) &call->fbc) == FAILURE)) { SAVE_OPLINE(); zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(opline->op2.zv)); } else { - CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc)); + CACHE_PTR(opline->op2.literal->cache_slot, call->fbc); } - EX(object) = NULL; + call->object = NULL; + call->called_scope = NULL; + call->is_ctor_call = 0; + EX(call) = call; /*CHECK_EXCEPTION();*/ ZEND_VM_NEXT_OPCODE(); } else { @@ -1730,7 +1548,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H zend_free_op free_op2; SAVE_OPLINE(); - function_name = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + function_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { function_name_strval = Z_STRVAL_P(function_name); @@ -1741,28 +1559,33 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H } else { lcname = zend_str_tolower_dup(function_name_strval, function_name_strlen); } - if (UNEXPECTED(zend_hash_find(EG(function_table), lcname, function_name_strlen+1, (void **) &EX(fbc)) == FAILURE)) { + if (UNEXPECTED(zend_hash_find(EG(function_table), lcname, function_name_strlen+1, (void **) &call->fbc) == FAILURE)) { zend_error_noreturn(E_ERROR, "Call to undefined function %s()", function_name_strval); } efree(lcname); zval_dtor(free_op2.var); - EX(object) = NULL; + call->object = NULL; + call->called_scope = NULL; + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else if (IS_TMP_VAR != IS_CONST && IS_TMP_VAR != IS_TMP_VAR && EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) && Z_OBJ_HANDLER_P(function_name, get_closure) && - Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &EX(called_scope), &EX(fbc), &EX(object) TSRMLS_CC) == SUCCESS) { - if (EX(object)) { - Z_ADDREF_P(EX(object)); + Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &call->called_scope, &call->fbc, &call->object TSRMLS_CC) == SUCCESS) { + if (call->object) { + Z_ADDREF_P(call->object); } if (IS_TMP_VAR == IS_VAR && 1 && - EX(fbc)->common.fn_flags & ZEND_ACC_CLOSURE) { + call->fbc->common.fn_flags & ZEND_ACC_CLOSURE) { /* Delay closure destruction until its invocation */ - EX(fbc)->common.prototype = (zend_function*)function_name; + call->fbc->common.prototype = (zend_function*)function_name; } else { zval_dtor(free_op2.var); } + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else if (IS_TMP_VAR != IS_CONST && @@ -1793,46 +1616,49 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } - EX(called_scope) = ce; - EX(object) = NULL; + call->called_scope = ce; + call->object = NULL; if (ce->get_static_method) { - EX(fbc) = ce->get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method) TSRMLS_CC); + call->fbc = ce->get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method) TSRMLS_CC); } else { - EX(fbc) = zend_std_get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC); + call->fbc = zend_std_get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC); } } else { - EX(object) = *obj; - ce = EX(called_scope) = Z_OBJCE_PP(obj); + call->object = *obj; + ce = call->called_scope = Z_OBJCE_PP(obj); - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC); - if (UNEXPECTED(EX(fbc) == NULL)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), Z_STRVAL_PP(method)); + call->fbc = Z_OBJ_HT_P(call->object)->get_method(&call->object, Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC); + if (UNEXPECTED(call->fbc == NULL)) { + zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(call->object), Z_STRVAL_PP(method)); } - if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) { - EX(object) = NULL; + if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { + call->object = NULL; } else { - if (!PZVAL_IS_REF(EX(object))) { - Z_ADDREF_P(EX(object)); /* For $this pointer */ + if (!PZVAL_IS_REF(call->object)) { + Z_ADDREF_P(call->object); /* For $this pointer */ } else { zval *this_ptr; ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); + INIT_PZVAL_COPY(this_ptr, call->object); zval_copy_ctor(this_ptr); - EX(object) = this_ptr; + call->object = this_ptr; } } } - if (UNEXPECTED(EX(fbc) == NULL)) { + if (UNEXPECTED(call->fbc == NULL)) { zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, Z_STRVAL_PP(method)); } + call->is_ctor_call = 0; + EX(call) = call; zval_dtor(free_op2.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { zend_error_noreturn(E_ERROR, "Function name must be a string"); + ZEND_VM_NEXT_OPCODE(); /* Never reached */ } } } @@ -1852,7 +1678,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ ZEND_VM_NEXT_OPCODE(); } else { zend_free_op free_op2; - zval *class_name = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *class_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_VAR == IS_CONST) { if (CACHED_PTR(opline->op2.literal->cache_slot)) { @@ -1879,19 +1705,22 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H { USE_OPLINE zval *function_name; - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); + call_slot *call = EX(call_slots) + opline->result.num; if (IS_VAR == IS_CONST) { function_name = (zval*)(opline->op2.literal+1); if (CACHED_PTR(opline->op2.literal->cache_slot)) { - EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot); - } else if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL_P(function_name), Z_STRLEN_P(function_name)+1, Z_HASH_P(function_name), (void **) &EX(fbc)) == FAILURE)) { + call->fbc = CACHED_PTR(opline->op2.literal->cache_slot); + } else if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL_P(function_name), Z_STRLEN_P(function_name)+1, Z_HASH_P(function_name), (void **) &call->fbc) == FAILURE)) { SAVE_OPLINE(); zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(opline->op2.zv)); } else { - CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc)); + CACHE_PTR(opline->op2.literal->cache_slot, call->fbc); } - EX(object) = NULL; + call->object = NULL; + call->called_scope = NULL; + call->is_ctor_call = 0; + EX(call) = call; /*CHECK_EXCEPTION();*/ ZEND_VM_NEXT_OPCODE(); } else { @@ -1900,7 +1729,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H zend_free_op free_op2; SAVE_OPLINE(); - function_name = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + function_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { function_name_strval = Z_STRVAL_P(function_name); @@ -1911,28 +1740,33 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H } else { lcname = zend_str_tolower_dup(function_name_strval, function_name_strlen); } - if (UNEXPECTED(zend_hash_find(EG(function_table), lcname, function_name_strlen+1, (void **) &EX(fbc)) == FAILURE)) { + if (UNEXPECTED(zend_hash_find(EG(function_table), lcname, function_name_strlen+1, (void **) &call->fbc) == FAILURE)) { 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);}; - EX(object) = NULL; + call->object = NULL; + call->called_scope = NULL; + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else if (IS_VAR != IS_CONST && IS_VAR != IS_TMP_VAR && EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) && Z_OBJ_HANDLER_P(function_name, get_closure) && - Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &EX(called_scope), &EX(fbc), &EX(object) TSRMLS_CC) == SUCCESS) { - if (EX(object)) { - Z_ADDREF_P(EX(object)); + Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &call->called_scope, &call->fbc, &call->object TSRMLS_CC) == SUCCESS) { + if (call->object) { + Z_ADDREF_P(call->object); } if (IS_VAR == IS_VAR && (free_op2.var != NULL) && - EX(fbc)->common.fn_flags & ZEND_ACC_CLOSURE) { + call->fbc->common.fn_flags & ZEND_ACC_CLOSURE) { /* Delay closure destruction until its invocation */ - EX(fbc)->common.prototype = (zend_function*)function_name; + call->fbc->common.prototype = (zend_function*)function_name; } else { if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; } + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else if (IS_VAR != IS_CONST && @@ -1963,46 +1797,49 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } - EX(called_scope) = ce; - EX(object) = NULL; + call->called_scope = ce; + call->object = NULL; if (ce->get_static_method) { - EX(fbc) = ce->get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method) TSRMLS_CC); + call->fbc = ce->get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method) TSRMLS_CC); } else { - EX(fbc) = zend_std_get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC); + call->fbc = zend_std_get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC); } } else { - EX(object) = *obj; - ce = EX(called_scope) = Z_OBJCE_PP(obj); + call->object = *obj; + ce = call->called_scope = Z_OBJCE_PP(obj); - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC); - if (UNEXPECTED(EX(fbc) == NULL)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), Z_STRVAL_PP(method)); + call->fbc = Z_OBJ_HT_P(call->object)->get_method(&call->object, Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC); + if (UNEXPECTED(call->fbc == NULL)) { + zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(call->object), Z_STRVAL_PP(method)); } - if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) { - EX(object) = NULL; + if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { + call->object = NULL; } else { - if (!PZVAL_IS_REF(EX(object))) { - Z_ADDREF_P(EX(object)); /* For $this pointer */ + if (!PZVAL_IS_REF(call->object)) { + Z_ADDREF_P(call->object); /* For $this pointer */ } else { zval *this_ptr; ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); + INIT_PZVAL_COPY(this_ptr, call->object); zval_copy_ctor(this_ptr); - EX(object) = this_ptr; + call->object = this_ptr; } } } - if (UNEXPECTED(EX(fbc) == NULL)) { + if (UNEXPECTED(call->fbc == NULL)) { zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, Z_STRVAL_PP(method)); } + call->is_ctor_call = 0; + EX(call) = call; if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { zend_error_noreturn(E_ERROR, "Function name must be a string"); + ZEND_VM_NEXT_OPCODE(); /* Never reached */ } } } @@ -2058,7 +1895,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_A ZEND_VM_NEXT_OPCODE(); } else { - zval *class_name = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + zval *class_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (IS_CV == IS_CONST) { if (CACHED_PTR(opline->op2.literal->cache_slot)) { @@ -2084,19 +1921,22 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HA { USE_OPLINE zval *function_name; - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); + call_slot *call = EX(call_slots) + opline->result.num; if (IS_CV == IS_CONST) { function_name = (zval*)(opline->op2.literal+1); if (CACHED_PTR(opline->op2.literal->cache_slot)) { - EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot); - } else if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL_P(function_name), Z_STRLEN_P(function_name)+1, Z_HASH_P(function_name), (void **) &EX(fbc)) == FAILURE)) { + call->fbc = CACHED_PTR(opline->op2.literal->cache_slot); + } else if (UNEXPECTED(zend_hash_quick_find(EG(function_table), Z_STRVAL_P(function_name), Z_STRLEN_P(function_name)+1, Z_HASH_P(function_name), (void **) &call->fbc) == FAILURE)) { SAVE_OPLINE(); zend_error_noreturn(E_ERROR, "Call to undefined function %s()", Z_STRVAL_P(opline->op2.zv)); } else { - CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc)); + CACHE_PTR(opline->op2.literal->cache_slot, call->fbc); } - EX(object) = NULL; + call->object = NULL; + call->called_scope = NULL; + call->is_ctor_call = 0; + EX(call) = call; /*CHECK_EXCEPTION();*/ ZEND_VM_NEXT_OPCODE(); } else { @@ -2105,7 +1945,7 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HA SAVE_OPLINE(); - function_name = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) { function_name_strval = Z_STRVAL_P(function_name); @@ -2116,28 +1956,33 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HA } else { lcname = zend_str_tolower_dup(function_name_strval, function_name_strlen); } - if (UNEXPECTED(zend_hash_find(EG(function_table), lcname, function_name_strlen+1, (void **) &EX(fbc)) == FAILURE)) { + if (UNEXPECTED(zend_hash_find(EG(function_table), lcname, function_name_strlen+1, (void **) &call->fbc) == FAILURE)) { zend_error_noreturn(E_ERROR, "Call to undefined function %s()", function_name_strval); } efree(lcname); - EX(object) = NULL; + call->object = NULL; + call->called_scope = NULL; + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else if (IS_CV != IS_CONST && IS_CV != IS_TMP_VAR && EXPECTED(Z_TYPE_P(function_name) == IS_OBJECT) && Z_OBJ_HANDLER_P(function_name, get_closure) && - Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &EX(called_scope), &EX(fbc), &EX(object) TSRMLS_CC) == SUCCESS) { - if (EX(object)) { - Z_ADDREF_P(EX(object)); + Z_OBJ_HANDLER_P(function_name, get_closure)(function_name, &call->called_scope, &call->fbc, &call->object TSRMLS_CC) == SUCCESS) { + if (call->object) { + Z_ADDREF_P(call->object); } if (IS_CV == IS_VAR && 0 && - EX(fbc)->common.fn_flags & ZEND_ACC_CLOSURE) { + call->fbc->common.fn_flags & ZEND_ACC_CLOSURE) { /* Delay closure destruction until its invocation */ - EX(fbc)->common.prototype = (zend_function*)function_name; + call->fbc->common.prototype = (zend_function*)function_name; } else { } + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else if (IS_CV != IS_CONST && @@ -2168,46 +2013,49 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HA CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } - EX(called_scope) = ce; - EX(object) = NULL; + call->called_scope = ce; + call->object = NULL; if (ce->get_static_method) { - EX(fbc) = ce->get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method) TSRMLS_CC); + call->fbc = ce->get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method) TSRMLS_CC); } else { - EX(fbc) = zend_std_get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC); + call->fbc = zend_std_get_static_method(ce, Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC); } } else { - EX(object) = *obj; - ce = EX(called_scope) = Z_OBJCE_PP(obj); + call->object = *obj; + ce = call->called_scope = Z_OBJCE_PP(obj); - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC); - if (UNEXPECTED(EX(fbc) == NULL)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), Z_STRVAL_PP(method)); + call->fbc = Z_OBJ_HT_P(call->object)->get_method(&call->object, Z_STRVAL_PP(method), Z_STRLEN_PP(method), NULL TSRMLS_CC); + if (UNEXPECTED(call->fbc == NULL)) { + zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(call->object), Z_STRVAL_PP(method)); } - if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) { - EX(object) = NULL; + if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { + call->object = NULL; } else { - if (!PZVAL_IS_REF(EX(object))) { - Z_ADDREF_P(EX(object)); /* For $this pointer */ + if (!PZVAL_IS_REF(call->object)) { + Z_ADDREF_P(call->object); /* For $this pointer */ } else { zval *this_ptr; ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); + INIT_PZVAL_COPY(this_ptr, call->object); zval_copy_ctor(this_ptr); - EX(object) = this_ptr; + call->object = this_ptr; } } } - if (UNEXPECTED(EX(fbc) == NULL)) { + if (UNEXPECTED(call->fbc == NULL)) { zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, Z_STRVAL_PP(method)); } + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } else { zend_error_noreturn(E_ERROR, "Function name must be a string"); + ZEND_VM_NEXT_OPCODE(); /* Never reached */ } } } @@ -2438,8 +2286,7 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A USE_OPLINE zval *fname = opline->op1.zv; - - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); + call_slot *call = EX(call_slots) + opline->op2.num; if (CACHED_PTR(opline->op1.literal->cache_slot)) { EX(function_state).function = CACHED_PTR(opline->op1.literal->cache_slot); @@ -2449,7 +2296,11 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A } else { CACHE_PTR(opline->op1.literal->cache_slot, EX(function_state).function); } - EX(object) = NULL; + call->fbc = EX(function_state).function; + call->object = NULL; + call->called_scope = NULL; + call->is_ctor_call = 0; + EX(call) = call; return zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } @@ -2501,10 +2352,7 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG *EG(return_value_ptr_ptr) = ret; } - if (EXPECTED(!EX(op_array)->has_finally_block)) { - return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - return zend_finally_handler_leaving_SPEC(ZEND_RETURN, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) @@ -2575,10 +2423,7 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CONST_HANDLER(ZEND_OPCODE_HAND } } while (0); - if (EXPECTED(!EX(op_array)->has_finally_block)) { - return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - return zend_finally_handler_leaving_SPEC(ZEND_RETURN_BY_REF, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } static int ZEND_FASTCALL ZEND_THROW_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) @@ -2614,7 +2459,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A SAVE_OPLINE(); if (opline->extended_value==ZEND_DO_FCALL_BY_NAME - && ARG_MUST_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) { + && ARG_MUST_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) { zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.opline_num); } { @@ -2870,8 +2715,6 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA EG(return_value_ptr_ptr) = NULL; } - EX(current_object) = EX(object); - EX(function_state).function = (zend_function *) new_op_array; EX(object) = NULL; @@ -2879,14 +2722,13 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA zend_rebuild_symbol_table(TSRMLS_C); } - if (EXPECTED(zend_execute == execute)) { + if (EXPECTED(zend_execute_ex == execute_ex)) { ZEND_VM_ENTER(); } else { zend_execute(new_op_array TSRMLS_CC); } EX(function_state).function = (zend_function *) EX(op_array); - EX(object) = EX(current_object); EG(opline_ptr) = &EX(opline); EG(active_op_array) = EX(op_array); @@ -2896,15 +2738,6 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA if (UNEXPECTED(EG(exception) != NULL)) { zend_throw_exception_internal(NULL TSRMLS_CC); HANDLE_EXCEPTION(); - } else if (RETURN_VALUE_USED(opline)) { - if (!EX_T(opline->result.var).var.ptr) { /* there was no return statement */ - zval *retval; - - ALLOC_ZVAL(retval); - ZVAL_BOOL(retval, 1); - INIT_PZVAL(retval); - EX_T(opline->result.var).var.ptr = retval; - } } } else if (RETURN_VALUE_USED(opline)) { @@ -3613,7 +3446,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CONST_CONST_HANDLER(ZEND_OPCO { USE_OPLINE - return zend_fetch_var_address_helper_SPEC_CONST_CONST(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return zend_fetch_var_address_helper_SPEC_CONST_CONST(ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) @@ -3685,9 +3518,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER( USE_OPLINE zval *function_name; zend_class_entry *ce; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); if (IS_CONST == IS_CONST) { /* no function found. try a static method in class */ @@ -3701,24 +3534,24 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER( } CACHE_PTR(opline->op1.literal->cache_slot, ce); } - EX(called_scope) = ce; + call->called_scope = ce; } else { ce = EX_T(opline->op1.var).class_entry; if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) { - EX(called_scope) = EG(called_scope); + call->called_scope = EG(called_scope); } else { - EX(called_scope) = ce; + call->called_scope = ce; } } if (IS_CONST == IS_CONST && IS_CONST == IS_CONST && CACHED_PTR(opline->op2.literal->cache_slot)) { - EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot); + call->fbc = CACHED_PTR(opline->op2.literal->cache_slot); } else if (IS_CONST != IS_CONST && IS_CONST == IS_CONST && - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) { + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) { /* do nothing */ } else if (IS_CONST != IS_UNUSED) { char *function_name_strval = NULL; @@ -3741,20 +3574,20 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER( if (function_name_strval) { if (ce->get_static_method) { - EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + call->fbc = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); } else { - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_CONST == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + call->fbc = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_CONST == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); } - if (UNEXPECTED(EX(fbc) == NULL)) { + if (UNEXPECTED(call->fbc == NULL)) { zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval); } if (IS_CONST == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) { + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) { if (IS_CONST == IS_CONST) { - CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc)); + CACHE_PTR(opline->op2.literal->cache_slot, call->fbc); } else { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, EX(fbc)); + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, call->fbc); } } } @@ -3768,29 +3601,31 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER( if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name); } - EX(fbc) = ce->constructor; + call->fbc = ce->constructor; } - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; + if (call->fbc->common.fn_flags & ZEND_ACC_STATIC) { + call->object = NULL; } else { if (EG(This) && Z_OBJ_HT_P(EG(This))->get_class_entry && !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) { /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ - if (EX(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", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); + 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); } 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", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); + 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); } } - if ((EX(object) = EG(This))) { - Z_ADDREF_P(EX(object)); - EX(called_scope) = Z_OBJCE_P(EX(object)); + if ((call->object = EG(This))) { + Z_ADDREF_P(call->object); + call->called_scope = Z_OBJCE_P(call->object); } } + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -4346,8 +4181,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLE generator->send_target = &EX_T(opline->result.var); /* Initialize the sent value to NULL */ - Z_ADDREF(EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).tmp_var = EG(uninitialized_zval); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ @@ -4368,7 +4202,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); fast_add_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -4383,7 +4217,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); fast_sub_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -4398,7 +4232,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); fast_mul_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -4413,7 +4247,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); fast_div_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -4428,7 +4262,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); fast_mod_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -4443,7 +4277,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); shift_left_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -4458,7 +4292,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); shift_right_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -4473,7 +4307,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER SAVE_OPLINE(); concat_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -4488,7 +4322,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_H SAVE_OPLINE(); is_identical_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -4504,7 +4338,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCO SAVE_OPLINE(); is_identical_function(result, opline->op1.zv, - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) 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); zval_dtor(free_op2.var); @@ -4521,7 +4355,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDL SAVE_OPLINE(); ZVAL_BOOL(result, fast_equal_function(result, opline->op1.zv, - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -4537,7 +4371,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_H SAVE_OPLINE(); ZVAL_BOOL(result, fast_not_equal_function(result, opline->op1.zv, - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -4553,7 +4387,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HAN SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_function(result, opline->op1.zv, - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -4569,7 +4403,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMP_HANDLER(ZEND_O SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result, opline->op1.zv, - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC)); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -4584,7 +4418,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ SAVE_OPLINE(); bitwise_or_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -4599,7 +4433,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER SAVE_OPLINE(); bitwise_and_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -4614,7 +4448,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER SAVE_OPLINE(); bitwise_xor_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -4629,7 +4463,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDL SAVE_OPLINE(); boolean_xor_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -4652,12 +4486,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HA if (IS_CONST == IS_TMP_VAR || IS_CONST == IS_CONST) { zval *container = opline->op1.zv; - zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R 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); } else { container = NULL; - zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R 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); } @@ -4671,9 +4505,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE USE_OPLINE zval *function_name; zend_class_entry *ce; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); if (IS_CONST == IS_CONST) { /* no function found. try a static method in class */ @@ -4687,24 +4521,24 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE } CACHE_PTR(opline->op1.literal->cache_slot, ce); } - EX(called_scope) = ce; + call->called_scope = ce; } else { ce = EX_T(opline->op1.var).class_entry; if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) { - EX(called_scope) = EG(called_scope); + call->called_scope = EG(called_scope); } else { - EX(called_scope) = ce; + call->called_scope = ce; } } if (IS_CONST == IS_CONST && IS_TMP_VAR == IS_CONST && CACHED_PTR(opline->op2.literal->cache_slot)) { - EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot); + call->fbc = CACHED_PTR(opline->op2.literal->cache_slot); } else if (IS_CONST != IS_CONST && IS_TMP_VAR == IS_CONST && - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) { + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) { /* do nothing */ } else if (IS_TMP_VAR != IS_UNUSED) { char *function_name_strval = NULL; @@ -4715,7 +4549,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE function_name_strval = Z_STRVAL_P(opline->op2.zv); function_name_strlen = Z_STRLEN_P(opline->op2.zv); } else { - function_name = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + function_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { zend_error_noreturn(E_ERROR, "Function name must be a string"); @@ -4727,20 +4561,20 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE if (function_name_strval) { if (ce->get_static_method) { - EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + call->fbc = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); } else { - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_TMP_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + call->fbc = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_TMP_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); } - if (UNEXPECTED(EX(fbc) == NULL)) { + if (UNEXPECTED(call->fbc == NULL)) { zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval); } if (IS_TMP_VAR == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) { + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) { if (IS_CONST == IS_CONST) { - CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc)); + CACHE_PTR(opline->op2.literal->cache_slot, call->fbc); } else { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, EX(fbc)); + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, call->fbc); } } } @@ -4754,29 +4588,31 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name); } - EX(fbc) = ce->constructor; + call->fbc = ce->constructor; } - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; + if (call->fbc->common.fn_flags & ZEND_ACC_STATIC) { + call->object = NULL; } else { if (EG(This) && Z_OBJ_HT_P(EG(This))->get_class_entry && !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) { /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ - if (EX(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", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); + 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); } 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", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); + 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); } } - if ((EX(object) = EG(This))) { - Z_ADDREF_P(EX(object)); - EX(called_scope) = Z_OBJCE_P(EX(object)); + if ((call->object = EG(This))) { + Z_ADDREF_P(call->object); + call->called_scope = Z_OBJCE_P(call->object); } } + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -4793,7 +4629,7 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_A } is_equal_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -4838,7 +4674,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_TMP_HANDLER(ZEND_OPC if (IS_TMP_VAR != IS_UNUSED) { zend_free_op free_op2; - zval *offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); ulong hval; switch (Z_TYPE_P(offset)) { @@ -5000,7 +4836,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ /* Set the new yielded key */ if (IS_TMP_VAR != IS_UNUSED) { zend_free_op free_op2; - zval *key = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *key = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR @@ -5040,8 +4876,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ generator->send_target = &EX_T(opline->result.var); /* Initialize the sent value to NULL */ - Z_ADDREF(EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).tmp_var = EG(uninitialized_zval); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ @@ -5062,7 +4897,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); fast_add_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) 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);}; CHECK_EXCEPTION(); @@ -5077,7 +4912,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); fast_sub_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) 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);}; CHECK_EXCEPTION(); @@ -5092,7 +4927,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); fast_mul_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) 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);}; CHECK_EXCEPTION(); @@ -5107,7 +4942,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); fast_div_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) 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);}; CHECK_EXCEPTION(); @@ -5122,7 +4957,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); fast_mod_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) 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);}; CHECK_EXCEPTION(); @@ -5137,7 +4972,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); shift_left_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) 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);}; CHECK_EXCEPTION(); @@ -5152,7 +4987,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); shift_right_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) 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);}; CHECK_EXCEPTION(); @@ -5167,7 +5002,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER SAVE_OPLINE(); concat_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) 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);}; CHECK_EXCEPTION(); @@ -5182,7 +5017,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_H SAVE_OPLINE(); is_identical_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) 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);}; CHECK_EXCEPTION(); @@ -5198,7 +5033,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCO SAVE_OPLINE(); is_identical_function(result, opline->op1.zv, - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) 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_op2.var) {zval_ptr_dtor(&free_op2.var);}; @@ -5215,7 +5050,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDL SAVE_OPLINE(); ZVAL_BOOL(result, fast_equal_function(result, opline->op1.zv, - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) 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);}; CHECK_EXCEPTION(); @@ -5231,7 +5066,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_H SAVE_OPLINE(); ZVAL_BOOL(result, fast_not_equal_function(result, opline->op1.zv, - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) 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);}; CHECK_EXCEPTION(); @@ -5247,7 +5082,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HAN SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_function(result, opline->op1.zv, - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) 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);}; CHECK_EXCEPTION(); @@ -5263,7 +5098,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_VAR_HANDLER(ZEND_O SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result, opline->op1.zv, - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) 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);}; CHECK_EXCEPTION(); @@ -5278,7 +5113,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ SAVE_OPLINE(); bitwise_or_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) 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);}; CHECK_EXCEPTION(); @@ -5293,7 +5128,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER SAVE_OPLINE(); bitwise_and_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) 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);}; CHECK_EXCEPTION(); @@ -5308,7 +5143,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER SAVE_OPLINE(); bitwise_xor_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) 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);}; CHECK_EXCEPTION(); @@ -5323,7 +5158,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDL SAVE_OPLINE(); boolean_xor_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) 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);}; CHECK_EXCEPTION(); @@ -5481,7 +5316,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE { USE_OPLINE - return zend_fetch_var_address_helper_SPEC_CONST_VAR(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return zend_fetch_var_address_helper_SPEC_CONST_VAR(ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) @@ -5510,12 +5345,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HA if (IS_CONST == IS_TMP_VAR || IS_CONST == IS_CONST) { zval *container = opline->op1.zv; - zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R 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);}; } else { container = NULL; - zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R 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);}; } @@ -5529,9 +5364,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE USE_OPLINE zval *function_name; zend_class_entry *ce; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); if (IS_CONST == IS_CONST) { /* no function found. try a static method in class */ @@ -5545,24 +5380,24 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE } CACHE_PTR(opline->op1.literal->cache_slot, ce); } - EX(called_scope) = ce; + call->called_scope = ce; } else { ce = EX_T(opline->op1.var).class_entry; if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) { - EX(called_scope) = EG(called_scope); + call->called_scope = EG(called_scope); } else { - EX(called_scope) = ce; + call->called_scope = ce; } } if (IS_CONST == IS_CONST && IS_VAR == IS_CONST && CACHED_PTR(opline->op2.literal->cache_slot)) { - EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot); + call->fbc = CACHED_PTR(opline->op2.literal->cache_slot); } else if (IS_CONST != IS_CONST && IS_VAR == IS_CONST && - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) { + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) { /* do nothing */ } else if (IS_VAR != IS_UNUSED) { char *function_name_strval = NULL; @@ -5573,7 +5408,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE function_name_strval = Z_STRVAL_P(opline->op2.zv); function_name_strlen = Z_STRLEN_P(opline->op2.zv); } else { - function_name = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + function_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { zend_error_noreturn(E_ERROR, "Function name must be a string"); @@ -5585,20 +5420,20 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE if (function_name_strval) { if (ce->get_static_method) { - EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + call->fbc = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); } else { - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + call->fbc = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); } - if (UNEXPECTED(EX(fbc) == NULL)) { + if (UNEXPECTED(call->fbc == NULL)) { zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval); } if (IS_VAR == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) { + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) { if (IS_CONST == IS_CONST) { - CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc)); + CACHE_PTR(opline->op2.literal->cache_slot, call->fbc); } else { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, EX(fbc)); + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, call->fbc); } } } @@ -5612,29 +5447,31 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name); } - EX(fbc) = ce->constructor; + call->fbc = ce->constructor; } - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; + if (call->fbc->common.fn_flags & ZEND_ACC_STATIC) { + call->object = NULL; } else { if (EG(This) && Z_OBJ_HT_P(EG(This))->get_class_entry && !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) { /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ - if (EX(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", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); + 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); } 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", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); + 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); } } - if ((EX(object) = EG(This))) { - Z_ADDREF_P(EX(object)); - EX(called_scope) = Z_OBJCE_P(EX(object)); + if ((call->object = EG(This))) { + Z_ADDREF_P(call->object); + call->called_scope = Z_OBJCE_P(call->object); } } + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -5651,7 +5488,7 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_A } is_equal_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) 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);}; CHECK_EXCEPTION(); @@ -5696,7 +5533,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_VAR_HANDLER(ZEND_OPC if (IS_VAR != IS_UNUSED) { zend_free_op free_op2; - zval *offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); ulong hval; switch (Z_TYPE_P(offset)) { @@ -6019,7 +5856,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ /* Set the new yielded key */ if (IS_VAR != IS_UNUSED) { zend_free_op free_op2; - zval *key = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *key = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR @@ -6060,8 +5897,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ generator->send_target = &EX_T(opline->result.var); /* Initialize the sent value to NULL */ - Z_ADDREF(EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).tmp_var = EG(uninitialized_zval); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ @@ -6225,7 +6061,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CONST_UNUSED_HANDLER(ZEND_OPC { USE_OPLINE - return zend_fetch_var_address_helper_SPEC_CONST_UNUSED(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return zend_fetch_var_address_helper_SPEC_CONST_UNUSED(ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) @@ -6243,9 +6079,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER USE_OPLINE zval *function_name; zend_class_entry *ce; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); if (IS_CONST == IS_CONST) { /* no function found. try a static method in class */ @@ -6259,24 +6095,24 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER } CACHE_PTR(opline->op1.literal->cache_slot, ce); } - EX(called_scope) = ce; + call->called_scope = ce; } else { ce = EX_T(opline->op1.var).class_entry; if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) { - EX(called_scope) = EG(called_scope); + call->called_scope = EG(called_scope); } else { - EX(called_scope) = ce; + call->called_scope = ce; } } if (IS_CONST == IS_CONST && IS_UNUSED == IS_CONST && CACHED_PTR(opline->op2.literal->cache_slot)) { - EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot); + call->fbc = CACHED_PTR(opline->op2.literal->cache_slot); } else if (IS_CONST != IS_CONST && IS_UNUSED == IS_CONST && - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) { + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) { /* do nothing */ } else if (IS_UNUSED != IS_UNUSED) { char *function_name_strval = NULL; @@ -6299,20 +6135,20 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER if (function_name_strval) { if (ce->get_static_method) { - EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + call->fbc = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); } else { - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_UNUSED == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + call->fbc = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_UNUSED == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); } - if (UNEXPECTED(EX(fbc) == NULL)) { + if (UNEXPECTED(call->fbc == NULL)) { zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval); } if (IS_UNUSED == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) { + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) { if (IS_CONST == IS_CONST) { - CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc)); + CACHE_PTR(opline->op2.literal->cache_slot, call->fbc); } else { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, EX(fbc)); + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, call->fbc); } } } @@ -6326,29 +6162,31 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name); } - EX(fbc) = ce->constructor; + call->fbc = ce->constructor; } - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; + if (call->fbc->common.fn_flags & ZEND_ACC_STATIC) { + call->object = NULL; } else { if (EG(This) && Z_OBJ_HT_P(EG(This))->get_class_entry && !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) { /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ - if (EX(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", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); + 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); } 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", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); + 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); } } - if ((EX(object) = EG(This))) { - Z_ADDREF_P(EX(object)); - EX(called_scope) = Z_OBJCE_P(EX(object)); + if ((call->object = EG(This))) { + Z_ADDREF_P(call->object); + call->called_scope = Z_OBJCE_P(call->object); } } + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -6773,8 +6611,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDL generator->send_target = &EX_T(opline->result.var); /* Initialize the sent value to NULL */ - Z_ADDREF(EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).tmp_var = EG(uninitialized_zval); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ @@ -6795,7 +6632,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); fast_add_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); CHECK_EXCEPTION(); @@ -6810,7 +6647,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); fast_sub_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); CHECK_EXCEPTION(); @@ -6825,7 +6662,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); fast_mul_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); CHECK_EXCEPTION(); @@ -6840,7 +6677,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); fast_div_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); CHECK_EXCEPTION(); @@ -6855,7 +6692,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); fast_mod_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); CHECK_EXCEPTION(); @@ -6870,7 +6707,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); shift_left_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); CHECK_EXCEPTION(); @@ -6885,7 +6722,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); shift_right_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); CHECK_EXCEPTION(); @@ -6900,7 +6737,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ SAVE_OPLINE(); concat_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); CHECK_EXCEPTION(); @@ -6915,7 +6752,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HA SAVE_OPLINE(); is_identical_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); CHECK_EXCEPTION(); @@ -6931,7 +6768,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CV_HANDLER(ZEND_OPCOD SAVE_OPLINE(); is_identical_function(result, opline->op1.zv, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) 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); @@ -6948,7 +6785,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLE SAVE_OPLINE(); ZVAL_BOOL(result, fast_equal_function(result, opline->op1.zv, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC)); + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC)); CHECK_EXCEPTION(); @@ -6964,7 +6801,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HA SAVE_OPLINE(); ZVAL_BOOL(result, fast_not_equal_function(result, opline->op1.zv, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC)); + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC)); CHECK_EXCEPTION(); @@ -6980,7 +6817,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HAND SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_function(result, opline->op1.zv, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC)); + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC)); CHECK_EXCEPTION(); @@ -6996,7 +6833,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OP SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result, opline->op1.zv, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC)); + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC)); CHECK_EXCEPTION(); @@ -7011,7 +6848,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A SAVE_OPLINE(); bitwise_or_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); CHECK_EXCEPTION(); @@ -7026,7 +6863,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ SAVE_OPLINE(); bitwise_and_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); CHECK_EXCEPTION(); @@ -7041,7 +6878,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ SAVE_OPLINE(); bitwise_xor_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); CHECK_EXCEPTION(); @@ -7056,7 +6893,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLE SAVE_OPLINE(); boolean_xor_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); CHECK_EXCEPTION(); @@ -7079,12 +6916,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HAN if (IS_CONST == IS_TMP_VAR || IS_CONST == IS_CONST) { zval *container = opline->op1.zv; - zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R 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); } else { container = NULL; - zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R 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); } @@ -7098,9 +6935,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN USE_OPLINE zval *function_name; zend_class_entry *ce; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); if (IS_CONST == IS_CONST) { /* no function found. try a static method in class */ @@ -7114,24 +6951,24 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN } CACHE_PTR(opline->op1.literal->cache_slot, ce); } - EX(called_scope) = ce; + call->called_scope = ce; } else { ce = EX_T(opline->op1.var).class_entry; if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) { - EX(called_scope) = EG(called_scope); + call->called_scope = EG(called_scope); } else { - EX(called_scope) = ce; + call->called_scope = ce; } } if (IS_CONST == IS_CONST && IS_CV == IS_CONST && CACHED_PTR(opline->op2.literal->cache_slot)) { - EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot); + call->fbc = CACHED_PTR(opline->op2.literal->cache_slot); } else if (IS_CONST != IS_CONST && IS_CV == IS_CONST && - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) { + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) { /* do nothing */ } else if (IS_CV != IS_UNUSED) { char *function_name_strval = NULL; @@ -7142,7 +6979,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN function_name_strval = Z_STRVAL_P(opline->op2.zv); function_name_strlen = Z_STRLEN_P(opline->op2.zv); } else { - function_name = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { zend_error_noreturn(E_ERROR, "Function name must be a string"); @@ -7154,20 +6991,20 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN if (function_name_strval) { if (ce->get_static_method) { - EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + call->fbc = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); } else { - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_CV == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + call->fbc = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_CV == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); } - if (UNEXPECTED(EX(fbc) == NULL)) { + if (UNEXPECTED(call->fbc == NULL)) { zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval); } if (IS_CV == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) { + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) { if (IS_CONST == IS_CONST) { - CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc)); + CACHE_PTR(opline->op2.literal->cache_slot, call->fbc); } else { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, EX(fbc)); + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, call->fbc); } } } @@ -7181,29 +7018,31 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name); } - EX(fbc) = ce->constructor; + call->fbc = ce->constructor; } - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; + if (call->fbc->common.fn_flags & ZEND_ACC_STATIC) { + call->object = NULL; } else { if (EG(This) && Z_OBJ_HT_P(EG(This))->get_class_entry && !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) { /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ - if (EX(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", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); + 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); } 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", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); + 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); } } - if ((EX(object) = EG(This))) { - Z_ADDREF_P(EX(object)); - EX(called_scope) = Z_OBJCE_P(EX(object)); + if ((call->object = EG(This))) { + Z_ADDREF_P(call->object); + call->called_scope = Z_OBJCE_P(call->object); } } + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -7253,7 +7092,7 @@ static int ZEND_FASTCALL ZEND_CATCH_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A if (EX_CV(opline->op2.var)) { zval_ptr_dtor(EX_CV(opline->op2.var)); } - EX_CV(opline->op2.var) = (zval**)EX_CVs() + (EX(op_array)->last_var + opline->op2.var); + EX_CV(opline->op2.var) = (zval**)EX_CV_NUM(execute_data, EX(op_array)->last_var + opline->op2.var); *EX_CV(opline->op2.var) = EG(exception); } else { zend_compiled_variable *cv = &CV_DEF_OF(opline->op2.var); @@ -7280,7 +7119,7 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_AR } is_equal_function(&EX_T(opline->result.var).tmp_var, opline->op1.zv, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC) TSRMLS_CC); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -7324,7 +7163,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCO if (IS_CV != IS_UNUSED) { - zval *offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + zval *offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); ulong hval; switch (Z_TYPE_P(offset)) { @@ -7486,7 +7325,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A /* Set the new yielded key */ if (IS_CV != IS_UNUSED) { - zval *key = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + zval *key = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR @@ -7526,8 +7365,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_A generator->send_target = &EX_T(opline->result.var); /* Initialize the sent value to NULL */ - Z_ADDREF(EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).tmp_var = EG(uninitialized_zval); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ @@ -7547,7 +7385,7 @@ static int ZEND_FASTCALL ZEND_BW_NOT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); bitwise_not_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -7560,7 +7398,7 @@ static int ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); boolean_not_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC) TSRMLS_CC); zval_dtor(free_op1.var); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -7574,7 +7412,7 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zval *z; SAVE_OPLINE(); - z = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + z = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_TMP_VAR != IS_CONST && UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && @@ -7613,7 +7451,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) int ret; SAVE_OPLINE(); - val = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + val = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_TMP_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { ret = Z_LVAL_P(val); @@ -7643,7 +7481,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) int ret; SAVE_OPLINE(); - val = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + val = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_TMP_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { ret = Z_LVAL_P(val); @@ -7673,7 +7511,7 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) int retval; SAVE_OPLINE(); - val = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + val = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_TMP_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { retval = Z_LVAL_P(val); @@ -7707,7 +7545,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS int retval; SAVE_OPLINE(); - val = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + val = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_TMP_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { retval = Z_LVAL_P(val); @@ -7738,7 +7576,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG int retval; SAVE_OPLINE(); - val = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + val = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_TMP_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { retval = Z_LVAL_P(val); @@ -7782,7 +7620,7 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zend_free_op free_op1; SAVE_OPLINE(); - retval_ptr = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + 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) { @@ -7822,10 +7660,7 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) *EG(return_value_ptr_ptr) = ret; } - if (EXPECTED(!EX(op_array)->has_finally_block)) { - return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - return zend_finally_handler_leaving_SPEC(ZEND_RETURN, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) @@ -7846,7 +7681,7 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLE /* 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_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + 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); @@ -7896,10 +7731,7 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLE } } while (0); - if (EXPECTED(!EX(op_array)->has_finally_block)) { - return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - return zend_finally_handler_leaving_SPEC(ZEND_RETURN_BY_REF, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } static int ZEND_FASTCALL ZEND_THROW_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) @@ -7910,7 +7742,7 @@ static int ZEND_FASTCALL ZEND_THROW_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zend_free_op free_op1; SAVE_OPLINE(); - value = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_TMP_VAR == IS_CONST || UNEXPECTED(Z_TYPE_P(value) != IS_OBJECT)) { zend_error_noreturn(E_ERROR, "Can only throw objects"); @@ -7935,7 +7767,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); if (opline->extended_value==ZEND_DO_FCALL_BY_NAME - && ARG_MUST_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) { + && ARG_MUST_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) { zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.opline_num); } { @@ -7943,7 +7775,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG zval *value; zend_free_op free_op1; - value = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); ALLOC_ZVAL(valptr); INIT_PZVAL_COPY(valptr, value); @@ -7965,7 +7797,7 @@ static int ZEND_FASTCALL ZEND_BOOL_SPEC_TMP_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_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC))); + ZVAL_BOOL(retval, i_zend_is_true(_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC))); zval_dtor(free_op1.var); CHECK_EXCEPTION(); @@ -7982,7 +7814,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zend_object_clone_obj_t clone_call; SAVE_OPLINE(); - obj = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + obj = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_TMP_VAR == IS_CONST || UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT)) { @@ -8043,7 +7875,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zval *result = &EX_T(opline->result.var).tmp_var; SAVE_OPLINE(); - expr = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + expr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (opline->extended_value != IS_STRING) { ZVAL_COPY_VALUE(result, expr); @@ -8104,7 +7936,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND zend_bool failure_retval=0; SAVE_OPLINE(); - inc_filename = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + inc_filename = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (inc_filename->type!=IS_STRING) { MAKE_STD_ZVAL(tmp_inc_filename); @@ -8192,8 +8024,6 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND EG(return_value_ptr_ptr) = NULL; } - EX(current_object) = EX(object); - EX(function_state).function = (zend_function *) new_op_array; EX(object) = NULL; @@ -8201,14 +8031,13 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND zend_rebuild_symbol_table(TSRMLS_C); } - if (EXPECTED(zend_execute == execute)) { + if (EXPECTED(zend_execute_ex == execute_ex)) { ZEND_VM_ENTER(); } else { zend_execute(new_op_array TSRMLS_CC); } EX(function_state).function = (zend_function *) EX(op_array); - EX(object) = EX(current_object); EG(opline_ptr) = &EX(opline); EG(active_op_array) = EX(op_array); @@ -8218,15 +8047,6 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND if (UNEXPECTED(EG(exception) != NULL)) { zend_throw_exception_internal(NULL TSRMLS_CC); HANDLE_EXCEPTION(); - } else if (RETURN_VALUE_USED(opline)) { - if (!EX_T(opline->result.var).var.ptr) { /* there was no return statement */ - zval *retval; - - ALLOC_ZVAL(retval); - ZVAL_BOOL(retval, 1); - INIT_PZVAL(retval); - EX_T(opline->result.var).var.ptr = retval; - } } } else if (RETURN_VALUE_USED(opline)) { @@ -8281,7 +8101,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG Z_ADDREF_P(array_ptr); } } else { - array_ptr = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + array_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (1) { /* IS_TMP_VAR */ zval *tmp; @@ -8390,7 +8210,7 @@ static int ZEND_FASTCALL ZEND_EXIT_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); if (IS_TMP_VAR != IS_UNUSED) { zend_free_op free_op1; - zval *ptr = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval *ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (Z_TYPE_P(ptr) == IS_LONG) { EG(exit_status) = Z_LVAL_P(ptr); @@ -8440,7 +8260,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS zval *value; SAVE_OPLINE(); - value = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (i_zend_is_true(value)) { ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, value); @@ -8466,7 +8286,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ zval *value, *ret; SAVE_OPLINE(); - value = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (i_zend_is_true(value)) { if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) { @@ -8501,7 +8321,7 @@ static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR zval *value; SAVE_OPLINE(); - value = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, value); if (!1) { @@ -8519,7 +8339,7 @@ static int ZEND_FASTCALL ZEND_QM_ASSIGN_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLE zval *value, *ret; SAVE_OPLINE(); - value = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) { Z_ADDREF_P(value); @@ -8547,7 +8367,7 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_A zend_bool result; SAVE_OPLINE(); - expr = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + expr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->get_class_entry) { result = instanceof_function(Z_OBJCE_P(expr), EX_T(opline->op2.var).class_entry TSRMLS_CC); @@ -8567,7 +8387,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); fast_add_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); zval_dtor(free_op1.var); @@ -8582,7 +8402,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); fast_sub_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); zval_dtor(free_op1.var); @@ -8597,7 +8417,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); fast_mul_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); zval_dtor(free_op1.var); @@ -8612,7 +8432,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); fast_div_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); zval_dtor(free_op1.var); @@ -8627,7 +8447,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); fast_mod_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); zval_dtor(free_op1.var); @@ -8642,7 +8462,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); shift_left_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); zval_dtor(free_op1.var); @@ -8657,7 +8477,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); shift_right_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); zval_dtor(free_op1.var); @@ -8672,7 +8492,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER SAVE_OPLINE(); concat_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); zval_dtor(free_op1.var); @@ -8687,7 +8507,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_H SAVE_OPLINE(); is_identical_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); zval_dtor(free_op1.var); @@ -8703,7 +8523,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCO SAVE_OPLINE(); is_identical_function(result, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); Z_LVAL_P(result) = !Z_LVAL_P(result); zval_dtor(free_op1.var); @@ -8720,7 +8540,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDL SAVE_OPLINE(); ZVAL_BOOL(result, fast_equal_function(result, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC)); zval_dtor(free_op1.var); @@ -8736,7 +8556,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_H SAVE_OPLINE(); ZVAL_BOOL(result, fast_not_equal_function(result, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC)); zval_dtor(free_op1.var); @@ -8752,7 +8572,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HAN SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_function(result, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC)); zval_dtor(free_op1.var); @@ -8768,7 +8588,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_CONST_HANDLER(ZEND_O SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC)); zval_dtor(free_op1.var); @@ -8783,7 +8603,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ SAVE_OPLINE(); bitwise_or_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); zval_dtor(free_op1.var); @@ -8798,7 +8618,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER SAVE_OPLINE(); bitwise_and_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); zval_dtor(free_op1.var); @@ -8813,7 +8633,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER SAVE_OPLINE(); bitwise_xor_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); zval_dtor(free_op1.var); @@ -8828,7 +8648,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDL SAVE_OPLINE(); boolean_xor_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); zval_dtor(free_op1.var); @@ -8847,7 +8667,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_CONST(int type, ulong hash_value; SAVE_OPLINE(); - varname = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_TMP_VAR != IS_CONST && UNEXPECTED(Z_TYPE_P(varname) != IS_STRING)) { ZVAL_COPY_VALUE(&tmp_varname, varname); @@ -8987,7 +8807,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE { USE_OPLINE - return zend_fetch_var_address_helper_SPEC_TMP_CONST(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return zend_fetch_var_address_helper_SPEC_TMP_CONST(ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) @@ -9015,7 +8835,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HA } if (IS_TMP_VAR == IS_TMP_VAR || IS_TMP_VAR == IS_CONST) { - zval *container = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval *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); @@ -9037,7 +8857,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_TMP_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPC zval *container; SAVE_OPLINE(); - container = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (UNEXPECTED(Z_TYPE_P(container) != IS_ARRAY)) { PZVAL_LOCK(&EG(uninitialized_zval)); @@ -9107,9 +8927,9 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_CONST_HANDLER(ZEND_OPCO char *function_name_strval; int function_name_strlen; zend_free_op free_op1; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); function_name = opline->op2.zv; @@ -9121,49 +8941,51 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_CONST_HANDLER(ZEND_OPCO function_name_strval = Z_STRVAL_P(function_name); function_name_strlen = Z_STRLEN_P(function_name); - EX(object) = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + call->object = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - if (EXPECTED(EX(object) != NULL) && - EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) { - EX(called_scope) = Z_OBJCE_P(EX(object)); + if (EXPECTED(call->object != NULL) && + EXPECTED(Z_TYPE_P(call->object) == IS_OBJECT)) { + call->called_scope = Z_OBJCE_P(call->object); if (IS_CONST != IS_CONST || - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) { - zval *object = EX(object); + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope)) == NULL) { + zval *object = call->object; - if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) { + if (UNEXPECTED(Z_OBJ_HT_P(call->object)->get_method == NULL)) { zend_error_noreturn(E_ERROR, "Object does not support method calls"); } /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_CONST == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); - if (UNEXPECTED(EX(fbc) == NULL)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); + call->fbc = Z_OBJ_HT_P(call->object)->get_method(&call->object, function_name_strval, function_name_strlen, ((IS_CONST == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + if (UNEXPECTED(call->fbc == NULL)) { + zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(call->object), function_name_strval); } if (IS_CONST == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && - EXPECTED(EX(object) == object)) { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc)); + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && + EXPECTED(call->object == object)) { + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope, call->fbc); } } } else { zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); } - if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) { - EX(object) = NULL; + if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { + call->object = NULL; } else { - if (!PZVAL_IS_REF(EX(object))) { - Z_ADDREF_P(EX(object)); /* For $this pointer */ + if (!PZVAL_IS_REF(call->object)) { + Z_ADDREF_P(call->object); /* For $this pointer */ } else { zval *this_ptr; ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); + INIT_PZVAL_COPY(this_ptr, call->object); zval_copy_ctor(this_ptr); - EX(object) = this_ptr; + call->object = this_ptr; } } + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); @@ -9180,7 +9002,7 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_A 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, EX_Ts(), &free_op1 TSRMLS_CC), + _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); CHECK_EXCEPTION(); @@ -9204,7 +9026,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CONST_HANDLER(ZEND_OPC expr_ptr = *expr_ptr_ptr; Z_ADDREF_P(expr_ptr); } else { - expr_ptr=_get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + expr_ptr=_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (1) { /* temporary variable */ zval *new_expr; @@ -9311,7 +9133,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HAND ZEND_VM_NEXT_OPCODE(); } - varname = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_COPY_VALUE(&tmp, varname); @@ -9387,7 +9209,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPC } else { HashTable *target_symbol_table; zend_free_op free_op1; - zval tmp, *varname = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval tmp, *varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_COPY_VALUE(&tmp, varname); @@ -9481,7 +9303,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ zend_error(E_NOTICE, "Only variable references should be yielded by reference"); - value = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); ALLOC_ZVAL(copy); INIT_PZVAL_COPY(copy, value); @@ -9516,7 +9338,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ } } else { - zval *value = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval *value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR @@ -9588,8 +9410,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ generator->send_target = &EX_T(opline->result.var); /* Initialize the sent value to NULL */ - Z_ADDREF(EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).tmp_var = EG(uninitialized_zval); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ @@ -9609,8 +9430,8 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); fast_add_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -9624,8 +9445,8 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); fast_sub_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -9639,8 +9460,8 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); fast_mul_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -9654,8 +9475,8 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); fast_div_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -9669,8 +9490,8 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); fast_mod_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -9684,8 +9505,8 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); shift_left_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -9699,8 +9520,8 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); shift_right_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -9714,8 +9535,8 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_A SAVE_OPLINE(); concat_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -9729,8 +9550,8 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HAN SAVE_OPLINE(); is_identical_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -9745,8 +9566,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE SAVE_OPLINE(); is_identical_function(result, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); Z_LVAL_P(result) = !Z_LVAL_P(result); zval_dtor(free_op1.var); zval_dtor(free_op2.var); @@ -9762,8 +9583,8 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER SAVE_OPLINE(); ZVAL_BOOL(result, fast_equal_function(result, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _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)); zval_dtor(free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -9778,8 +9599,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HAN SAVE_OPLINE(); ZVAL_BOOL(result, fast_not_equal_function(result, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _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)); zval_dtor(free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -9794,8 +9615,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDL SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_function(result, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _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)); zval_dtor(free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -9810,8 +9631,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_TMP_HANDLER(ZEND_OPC SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _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)); zval_dtor(free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -9825,8 +9646,8 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); bitwise_or_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -9840,8 +9661,8 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_A SAVE_OPLINE(); bitwise_and_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -9855,8 +9676,8 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_A SAVE_OPLINE(); bitwise_xor_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -9870,8 +9691,8 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER SAVE_OPLINE(); boolean_xor_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op1.var); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -9893,13 +9714,13 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HAND } if (IS_TMP_VAR == IS_TMP_VAR || IS_TMP_VAR == IS_CONST) { - zval *container = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC); + zval *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); } else { container = NULL; - zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R 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); } @@ -9918,7 +9739,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ int use_copy = 0; SAVE_OPLINE(); - var = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + var = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_TMP_VAR == IS_UNUSED) { /* Initialize for erealloc in add_string_to_string */ @@ -9960,11 +9781,11 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE char *function_name_strval; int function_name_strlen; zend_free_op free_op1, free_op2; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); - function_name = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + function_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_TMP_VAR != IS_CONST && UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { @@ -9974,49 +9795,51 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE function_name_strval = Z_STRVAL_P(function_name); function_name_strlen = Z_STRLEN_P(function_name); - EX(object) = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + call->object = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - if (EXPECTED(EX(object) != NULL) && - EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) { - EX(called_scope) = Z_OBJCE_P(EX(object)); + if (EXPECTED(call->object != NULL) && + EXPECTED(Z_TYPE_P(call->object) == IS_OBJECT)) { + call->called_scope = Z_OBJCE_P(call->object); if (IS_TMP_VAR != IS_CONST || - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) { - zval *object = EX(object); + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope)) == NULL) { + zval *object = call->object; - if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) { + if (UNEXPECTED(Z_OBJ_HT_P(call->object)->get_method == NULL)) { zend_error_noreturn(E_ERROR, "Object does not support method calls"); } /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_TMP_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); - if (UNEXPECTED(EX(fbc) == NULL)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); + call->fbc = Z_OBJ_HT_P(call->object)->get_method(&call->object, function_name_strval, function_name_strlen, ((IS_TMP_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + if (UNEXPECTED(call->fbc == NULL)) { + zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(call->object), function_name_strval); } if (IS_TMP_VAR == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && - EXPECTED(EX(object) == object)) { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc)); + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && + EXPECTED(call->object == object)) { + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope, call->fbc); } } } else { zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); } - if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) { - EX(object) = NULL; + if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { + call->object = NULL; } else { - if (!PZVAL_IS_REF(EX(object))) { - Z_ADDREF_P(EX(object)); /* For $this pointer */ + if (!PZVAL_IS_REF(call->object)) { + Z_ADDREF_P(call->object); /* For $this pointer */ } else { zval *this_ptr; ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); + INIT_PZVAL_COPY(this_ptr, call->object); zval_copy_ctor(this_ptr); - EX(object) = this_ptr; + call->object = this_ptr; } } + call->is_ctor_call = 0; + EX(call) = call; zval_dtor(free_op2.var); @@ -10034,8 +9857,8 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG 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, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -10059,7 +9882,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCOD expr_ptr = *expr_ptr_ptr; Z_ADDREF_P(expr_ptr); } else { - expr_ptr=_get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + expr_ptr=_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (1) { /* temporary variable */ zval *new_expr; @@ -10080,7 +9903,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_TMP_HANDLER(ZEND_OPCOD if (IS_TMP_VAR != IS_UNUSED) { zend_free_op free_op2; - zval *offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); ulong hval; switch (Z_TYPE_P(offset)) { @@ -10175,7 +9998,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR zend_error(E_NOTICE, "Only variable references should be yielded by reference"); - value = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); ALLOC_ZVAL(copy); INIT_PZVAL_COPY(copy, value); @@ -10210,7 +10033,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR } } else { - zval *value = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval *value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR @@ -10242,7 +10065,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR /* Set the new yielded key */ if (IS_TMP_VAR != IS_UNUSED) { zend_free_op free_op2; - zval *key = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *key = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR @@ -10282,8 +10105,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR generator->send_target = &EX_T(opline->result.var); /* Initialize the sent value to NULL */ - Z_ADDREF(EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).tmp_var = EG(uninitialized_zval); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ @@ -10303,8 +10125,8 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); fast_add_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -10318,8 +10140,8 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); fast_sub_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -10333,8 +10155,8 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); fast_mul_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -10348,8 +10170,8 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); fast_div_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -10363,8 +10185,8 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); fast_mod_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -10378,8 +10200,8 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); shift_left_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -10393,8 +10215,8 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); shift_right_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -10408,8 +10230,8 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_A SAVE_OPLINE(); concat_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -10423,8 +10245,8 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAN SAVE_OPLINE(); is_identical_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -10439,8 +10261,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE SAVE_OPLINE(); is_identical_function(result, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); Z_LVAL_P(result) = !Z_LVAL_P(result); zval_dtor(free_op1.var); if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; @@ -10456,8 +10278,8 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER SAVE_OPLINE(); ZVAL_BOOL(result, fast_equal_function(result, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _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);}; CHECK_EXCEPTION(); @@ -10472,8 +10294,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAN SAVE_OPLINE(); ZVAL_BOOL(result, fast_not_equal_function(result, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _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);}; CHECK_EXCEPTION(); @@ -10488,8 +10310,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDL SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_function(result, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _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);}; CHECK_EXCEPTION(); @@ -10504,8 +10326,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_VAR_HANDLER(ZEND_OPC SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _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);}; CHECK_EXCEPTION(); @@ -10519,8 +10341,8 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); bitwise_or_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -10534,8 +10356,8 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_A SAVE_OPLINE(); bitwise_and_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -10549,8 +10371,8 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_A SAVE_OPLINE(); bitwise_xor_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -10564,8 +10386,8 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER SAVE_OPLINE(); boolean_xor_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -10583,7 +10405,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_VAR(int type, ZE ulong hash_value; SAVE_OPLINE(); - varname = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_TMP_VAR != IS_CONST && UNEXPECTED(Z_TYPE_P(varname) != IS_STRING)) { ZVAL_COPY_VALUE(&tmp_varname, varname); @@ -10723,7 +10545,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_H { USE_OPLINE - return zend_fetch_var_address_helper_SPEC_TMP_VAR(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return zend_fetch_var_address_helper_SPEC_TMP_VAR(ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) @@ -10751,13 +10573,13 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HAND } if (IS_TMP_VAR == IS_TMP_VAR || IS_TMP_VAR == IS_CONST) { - zval *container = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC); + zval *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); } else { container = NULL; - zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R 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);}; } @@ -10776,7 +10598,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ int use_copy = 0; SAVE_OPLINE(); - var = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + var = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_TMP_VAR == IS_UNUSED) { /* Initialize for erealloc in add_string_to_string */ @@ -10818,11 +10640,11 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE char *function_name_strval; int function_name_strlen; zend_free_op free_op1, free_op2; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); - function_name = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + function_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_VAR != IS_CONST && UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { @@ -10832,49 +10654,51 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE function_name_strval = Z_STRVAL_P(function_name); function_name_strlen = Z_STRLEN_P(function_name); - EX(object) = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + call->object = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - if (EXPECTED(EX(object) != NULL) && - EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) { - EX(called_scope) = Z_OBJCE_P(EX(object)); + if (EXPECTED(call->object != NULL) && + EXPECTED(Z_TYPE_P(call->object) == IS_OBJECT)) { + call->called_scope = Z_OBJCE_P(call->object); if (IS_VAR != IS_CONST || - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) { - zval *object = EX(object); + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope)) == NULL) { + zval *object = call->object; - if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) { + if (UNEXPECTED(Z_OBJ_HT_P(call->object)->get_method == NULL)) { zend_error_noreturn(E_ERROR, "Object does not support method calls"); } /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); - if (UNEXPECTED(EX(fbc) == NULL)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); + call->fbc = Z_OBJ_HT_P(call->object)->get_method(&call->object, function_name_strval, function_name_strlen, ((IS_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + if (UNEXPECTED(call->fbc == NULL)) { + zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(call->object), function_name_strval); } if (IS_VAR == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && - EXPECTED(EX(object) == object)) { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc)); + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && + EXPECTED(call->object == object)) { + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope, call->fbc); } } } else { zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); } - if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) { - EX(object) = NULL; + if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { + call->object = NULL; } else { - if (!PZVAL_IS_REF(EX(object))) { - Z_ADDREF_P(EX(object)); /* For $this pointer */ + if (!PZVAL_IS_REF(call->object)) { + Z_ADDREF_P(call->object); /* For $this pointer */ } else { zval *this_ptr; ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); + INIT_PZVAL_COPY(this_ptr, call->object); zval_copy_ctor(this_ptr); - EX(object) = this_ptr; + call->object = this_ptr; } } + call->is_ctor_call = 0; + EX(call) = call; if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; @@ -10892,8 +10716,8 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG 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, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -10917,7 +10741,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCOD expr_ptr = *expr_ptr_ptr; Z_ADDREF_P(expr_ptr); } else { - expr_ptr=_get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + expr_ptr=_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (1) { /* temporary variable */ zval *new_expr; @@ -10938,7 +10762,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_VAR_HANDLER(ZEND_OPCOD if (IS_VAR != IS_UNUSED) { zend_free_op free_op2; - zval *offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); ulong hval; switch (Z_TYPE_P(offset)) { @@ -11024,7 +10848,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLE ZEND_VM_NEXT_OPCODE(); } - varname = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_COPY_VALUE(&tmp, varname); @@ -11100,7 +10924,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCOD } else { HashTable *target_symbol_table; zend_free_op free_op1; - zval tmp, *varname = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval tmp, *varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_COPY_VALUE(&tmp, varname); @@ -11194,7 +11018,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR zend_error(E_NOTICE, "Only variable references should be yielded by reference"); - value = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); ALLOC_ZVAL(copy); INIT_PZVAL_COPY(copy, value); @@ -11229,7 +11053,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR } } else { - zval *value = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval *value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR @@ -11261,7 +11085,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR /* Set the new yielded key */ if (IS_VAR != IS_UNUSED) { zend_free_op free_op2; - zval *key = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *key = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR @@ -11302,8 +11126,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR generator->send_target = &EX_T(opline->result.var); /* Initialize the sent value to NULL */ - Z_ADDREF(EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).tmp_var = EG(uninitialized_zval); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ @@ -11327,7 +11150,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_UNUSED(int type, ulong hash_value; SAVE_OPLINE(); - varname = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_TMP_VAR != IS_CONST && UNEXPECTED(Z_TYPE_P(varname) != IS_STRING)) { ZVAL_COPY_VALUE(&tmp_varname, varname); @@ -11467,7 +11290,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCOD { USE_OPLINE - return zend_fetch_var_address_helper_SPEC_TMP_UNUSED(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return zend_fetch_var_address_helper_SPEC_TMP_UNUSED(ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) @@ -11497,7 +11320,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_UNUSED_HANDLER(ZEND_OP expr_ptr = *expr_ptr_ptr; Z_ADDREF_P(expr_ptr); } else { - expr_ptr=_get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + expr_ptr=_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (1) { /* temporary variable */ zval *new_expr; @@ -11604,7 +11427,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HAN ZEND_VM_NEXT_OPCODE(); } - varname = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_COPY_VALUE(&tmp, varname); @@ -11680,7 +11503,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_UNUSED_HANDLER(ZEND_OP } else { HashTable *target_symbol_table; zend_free_op free_op1; - zval tmp, *varname = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval tmp, *varname = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_TMP_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_COPY_VALUE(&tmp, varname); @@ -11774,7 +11597,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER zend_error(E_NOTICE, "Only variable references should be yielded by reference"); - value = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); ALLOC_ZVAL(copy); INIT_PZVAL_COPY(copy, value); @@ -11809,7 +11632,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER } } else { - zval *value = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval *value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR @@ -11881,8 +11704,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER generator->send_target = &EX_T(opline->result.var); /* Initialize the sent value to NULL */ - Z_ADDREF(EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).tmp_var = EG(uninitialized_zval); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ @@ -11902,8 +11724,8 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); fast_add_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op1.var); CHECK_EXCEPTION(); @@ -11917,8 +11739,8 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); fast_sub_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op1.var); CHECK_EXCEPTION(); @@ -11932,8 +11754,8 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); fast_mul_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op1.var); CHECK_EXCEPTION(); @@ -11947,8 +11769,8 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); fast_div_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op1.var); CHECK_EXCEPTION(); @@ -11962,8 +11784,8 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); fast_mod_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op1.var); CHECK_EXCEPTION(); @@ -11977,8 +11799,8 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); shift_left_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op1.var); CHECK_EXCEPTION(); @@ -11992,8 +11814,8 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); shift_right_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op1.var); CHECK_EXCEPTION(); @@ -12007,8 +11829,8 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); concat_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op1.var); CHECK_EXCEPTION(); @@ -12022,8 +11844,8 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HAND SAVE_OPLINE(); is_identical_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op1.var); CHECK_EXCEPTION(); @@ -12038,8 +11860,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_ SAVE_OPLINE(); is_identical_function(result, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); Z_LVAL_P(result) = !Z_LVAL_P(result); zval_dtor(free_op1.var); @@ -12055,8 +11877,8 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ SAVE_OPLINE(); ZVAL_BOOL(result, fast_equal_function(result, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC)); + _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)); zval_dtor(free_op1.var); CHECK_EXCEPTION(); @@ -12071,8 +11893,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HAND SAVE_OPLINE(); ZVAL_BOOL(result, fast_not_equal_function(result, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC)); + _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)); zval_dtor(free_op1.var); CHECK_EXCEPTION(); @@ -12087,8 +11909,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLE SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_function(result, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC)); + _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)); zval_dtor(free_op1.var); CHECK_EXCEPTION(); @@ -12103,8 +11925,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMP_CV_HANDLER(ZEND_OPCO SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC)); + _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)); zval_dtor(free_op1.var); CHECK_EXCEPTION(); @@ -12118,8 +11940,8 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); bitwise_or_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op1.var); CHECK_EXCEPTION(); @@ -12133,8 +11955,8 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); bitwise_and_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op1.var); CHECK_EXCEPTION(); @@ -12148,8 +11970,8 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); bitwise_xor_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op1.var); CHECK_EXCEPTION(); @@ -12163,8 +11985,8 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ SAVE_OPLINE(); boolean_xor_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op1.var); CHECK_EXCEPTION(); @@ -12186,13 +12008,13 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDL } if (IS_TMP_VAR == IS_TMP_VAR || IS_TMP_VAR == IS_CONST) { - zval *container = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC); + zval *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); } else { container = NULL; - zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R 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); } @@ -12211,7 +12033,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_A int use_copy = 0; SAVE_OPLINE(); - var = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + var = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (IS_TMP_VAR == IS_UNUSED) { /* Initialize for erealloc in add_string_to_string */ @@ -12252,11 +12074,11 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_ char *function_name_strval; int function_name_strlen; zend_free_op free_op1; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); - function_name = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (IS_CV != IS_CONST && UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { @@ -12266,49 +12088,51 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_ function_name_strval = Z_STRVAL_P(function_name); function_name_strlen = Z_STRLEN_P(function_name); - EX(object) = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + call->object = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - if (EXPECTED(EX(object) != NULL) && - EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) { - EX(called_scope) = Z_OBJCE_P(EX(object)); + if (EXPECTED(call->object != NULL) && + EXPECTED(Z_TYPE_P(call->object) == IS_OBJECT)) { + call->called_scope = Z_OBJCE_P(call->object); if (IS_CV != IS_CONST || - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) { - zval *object = EX(object); + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope)) == NULL) { + zval *object = call->object; - if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) { + if (UNEXPECTED(Z_OBJ_HT_P(call->object)->get_method == NULL)) { zend_error_noreturn(E_ERROR, "Object does not support method calls"); } /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_CV == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); - if (UNEXPECTED(EX(fbc) == NULL)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); + call->fbc = Z_OBJ_HT_P(call->object)->get_method(&call->object, function_name_strval, function_name_strlen, ((IS_CV == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + if (UNEXPECTED(call->fbc == NULL)) { + zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(call->object), function_name_strval); } if (IS_CV == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && - EXPECTED(EX(object) == object)) { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc)); + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && + EXPECTED(call->object == object)) { + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope, call->fbc); } } } else { zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); } - if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) { - EX(object) = NULL; + if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { + call->object = NULL; } else { - if (!PZVAL_IS_REF(EX(object))) { - Z_ADDREF_P(EX(object)); /* For $this pointer */ + if (!PZVAL_IS_REF(call->object)) { + Z_ADDREF_P(call->object); /* For $this pointer */ } else { zval *this_ptr; ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); + INIT_PZVAL_COPY(this_ptr, call->object); zval_copy_ctor(this_ptr); - EX(object) = this_ptr; + call->object = this_ptr; } } + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); @@ -12325,8 +12149,8 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS 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, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -12349,7 +12173,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE expr_ptr = *expr_ptr_ptr; Z_ADDREF_P(expr_ptr); } else { - expr_ptr=_get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + expr_ptr=_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (1) { /* temporary variable */ zval *new_expr; @@ -12370,7 +12194,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CV_HANDLER(ZEND_OPCODE if (IS_CV != IS_UNUSED) { - zval *offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + zval *offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); ulong hval; switch (Z_TYPE_P(offset)) { @@ -12465,7 +12289,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG zend_error(E_NOTICE, "Only variable references should be yielded by reference"); - value = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); ALLOC_ZVAL(copy); INIT_PZVAL_COPY(copy, value); @@ -12500,7 +12324,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG } } else { - zval *value = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval *value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR @@ -12532,7 +12356,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG /* Set the new yielded key */ if (IS_CV != IS_UNUSED) { - zval *key = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + zval *key = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR @@ -12572,8 +12396,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG generator->send_target = &EX_T(opline->result.var); /* Initialize the sent value to NULL */ - Z_ADDREF(EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).tmp_var = EG(uninitialized_zval); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ @@ -12593,7 +12416,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, EX_Ts(), &free_op1 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -12606,7 +12429,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, EX_Ts(), &free_op1 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -12619,7 +12442,7 @@ static int ZEND_FASTCALL ZEND_PRE_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS zval **var_ptr; SAVE_OPLINE(); - var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); @@ -12666,7 +12489,7 @@ static int ZEND_FASTCALL ZEND_PRE_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS zval **var_ptr; SAVE_OPLINE(); - var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); @@ -12713,7 +12536,7 @@ static int ZEND_FASTCALL ZEND_POST_INC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG zval **var_ptr, *retval; SAVE_OPLINE(); - var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); @@ -12756,7 +12579,7 @@ static int ZEND_FASTCALL ZEND_POST_DEC_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG zval **var_ptr, *retval; SAVE_OPLINE(); - var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(var_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); @@ -12800,7 +12623,7 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zval *z; SAVE_OPLINE(); - z = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + z = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR != IS_CONST && UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && @@ -12839,7 +12662,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) int ret; SAVE_OPLINE(); - val = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + val = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { ret = Z_LVAL_P(val); @@ -12869,7 +12692,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) int ret; SAVE_OPLINE(); - val = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + val = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { ret = Z_LVAL_P(val); @@ -12899,7 +12722,7 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) int retval; SAVE_OPLINE(); - val = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + val = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { retval = Z_LVAL_P(val); @@ -12933,7 +12756,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS int retval; SAVE_OPLINE(); - val = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + val = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { retval = Z_LVAL_P(val); @@ -12964,7 +12787,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG int retval; SAVE_OPLINE(); - val = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + val = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { retval = Z_LVAL_P(val); @@ -13008,7 +12831,7 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zend_free_op free_op1; SAVE_OPLINE(); - retval_ptr = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + 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) { @@ -13048,11 +12871,7 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) *EG(return_value_ptr_ptr) = ret; } if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; - - if (EXPECTED(!EX(op_array)->has_finally_block)) { - return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - return zend_finally_handler_leaving_SPEC(ZEND_RETURN, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) @@ -13073,7 +12892,7 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLE /* 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, EX_Ts(), &free_op1 TSRMLS_CC); + 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);}; @@ -13095,7 +12914,7 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLE break; } - retval_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + retval_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(retval_ptr_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference"); @@ -13124,11 +12943,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 (EXPECTED(!EX(op_array)->has_finally_block)) { - return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - return zend_finally_handler_leaving_SPEC(ZEND_RETURN_BY_REF, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } static int ZEND_FASTCALL ZEND_THROW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) @@ -13139,7 +12954,7 @@ static int ZEND_FASTCALL ZEND_THROW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zend_free_op free_op1; SAVE_OPLINE(); - value = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_CONST || UNEXPECTED(Z_TYPE_P(value) != IS_OBJECT)) { zend_error_noreturn(E_ERROR, "Can only throw objects"); @@ -13163,7 +12978,7 @@ static int ZEND_FASTCALL zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_AR USE_OPLINE zval *varptr; zend_free_op free_op1; - varptr = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + varptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (varptr == &EG(uninitialized_zval)) { ALLOC_ZVAL(varptr); @@ -13197,7 +13012,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) { return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } - } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) { + } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) { return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } @@ -13208,7 +13023,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND varptr = EX_T(opline->op1.var).var.ptr; PZVAL_UNLOCK_EX(varptr, &free_op1, 0); } else { - varptr = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &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) && @@ -13223,7 +13038,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ? !(opline->extended_value & ZEND_ARG_SEND_SILENT) : - !ARG_MAY_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) { + !ARG_MAY_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) { zend_error(E_STRICT, "Only variables should be passed by reference"); } ALLOC_ZVAL(valptr); @@ -13246,7 +13061,7 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG zval *varptr; SAVE_OPLINE(); - varptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + varptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(varptr_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Only variables can be passed by reference"); @@ -13259,7 +13074,7 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG ZEND_VM_NEXT_OPCODE(); } - if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) { + if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) { return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } @@ -13278,7 +13093,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG USE_OPLINE if ((opline->extended_value == ZEND_DO_FCALL_BY_NAME) - && ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) { + && ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) { return ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } SAVE_OPLINE(); @@ -13293,7 +13108,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, EX_Ts(), &free_op1 TSRMLS_CC))); + 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);}; CHECK_EXCEPTION(); @@ -13320,7 +13135,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zend_object_clone_obj_t clone_call; SAVE_OPLINE(); - obj = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + obj = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_CONST || UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT)) { @@ -13381,7 +13196,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zval *result = &EX_T(opline->result.var).tmp_var; SAVE_OPLINE(); - expr = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + expr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (opline->extended_value != IS_STRING) { ZVAL_COPY_VALUE(result, expr); @@ -13442,7 +13257,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND zend_bool failure_retval=0; SAVE_OPLINE(); - inc_filename = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + inc_filename = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (inc_filename->type!=IS_STRING) { MAKE_STD_ZVAL(tmp_inc_filename); @@ -13530,8 +13345,6 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND EG(return_value_ptr_ptr) = NULL; } - EX(current_object) = EX(object); - EX(function_state).function = (zend_function *) new_op_array; EX(object) = NULL; @@ -13539,14 +13352,13 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND zend_rebuild_symbol_table(TSRMLS_C); } - if (EXPECTED(zend_execute == execute)) { + if (EXPECTED(zend_execute_ex == execute_ex)) { ZEND_VM_ENTER(); } else { zend_execute(new_op_array TSRMLS_CC); } EX(function_state).function = (zend_function *) EX(op_array); - EX(object) = EX(current_object); EG(opline_ptr) = &EX(opline); EG(active_op_array) = EX(op_array); @@ -13556,15 +13368,6 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND if (UNEXPECTED(EG(exception) != NULL)) { zend_throw_exception_internal(NULL TSRMLS_CC); HANDLE_EXCEPTION(); - } else if (RETURN_VALUE_USED(opline)) { - if (!EX_T(opline->result.var).var.ptr) { /* there was no return statement */ - zval *retval; - - ALLOC_ZVAL(retval); - ZVAL_BOOL(retval, 1); - INIT_PZVAL(retval); - EX_T(opline->result.var).var.ptr = retval; - } } } else if (RETURN_VALUE_USED(opline)) { @@ -13592,7 +13395,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) && (opline->extended_value & ZEND_FE_RESET_VARIABLE)) { - array_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + array_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (array_ptr_ptr == NULL || array_ptr_ptr == &EG(uninitialized_zval_ptr)) { MAKE_STD_ZVAL(array_ptr); ZVAL_NULL(array_ptr); @@ -13619,7 +13422,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG Z_ADDREF_P(array_ptr); } } else { - array_ptr = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + array_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (0) { /* IS_TMP_VAR */ zval *tmp; @@ -13871,7 +13674,7 @@ static int ZEND_FASTCALL ZEND_EXIT_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); if (IS_VAR != IS_UNUSED) { zend_free_op free_op1; - zval *ptr = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval *ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (Z_TYPE_P(ptr) == IS_LONG) { EG(exit_status) = Z_LVAL_P(ptr); @@ -13892,7 +13695,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS zval *value; SAVE_OPLINE(); - value = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (i_zend_is_true(value)) { ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, value); @@ -13918,7 +13721,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ zval *value, *ret; SAVE_OPLINE(); - value = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (i_zend_is_true(value)) { if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { @@ -13953,7 +13756,7 @@ static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR zval *value; SAVE_OPLINE(); - value = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, value); if (!0) { @@ -13971,7 +13774,7 @@ static int ZEND_FASTCALL ZEND_QM_ASSIGN_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLE zval *value, *ret; SAVE_OPLINE(); - value = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR || IS_VAR == IS_CV) { Z_ADDREF_P(value); @@ -14000,7 +13803,7 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_A zend_bool result; SAVE_OPLINE(); - expr = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + expr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->get_class_entry) { result = instanceof_function(Z_OBJCE_P(expr), EX_T(opline->op2.var).class_entry TSRMLS_CC); @@ -14020,7 +13823,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); fast_add_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _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);}; @@ -14035,7 +13838,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); fast_sub_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _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);}; @@ -14050,7 +13853,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); fast_mul_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _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);}; @@ -14065,7 +13868,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); fast_div_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _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);}; @@ -14080,7 +13883,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); fast_mod_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _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);}; @@ -14095,7 +13898,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); shift_left_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _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);}; @@ -14110,7 +13913,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); shift_right_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _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);}; @@ -14125,7 +13928,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER SAVE_OPLINE(); concat_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _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);}; @@ -14140,7 +13943,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H SAVE_OPLINE(); is_identical_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _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);}; @@ -14156,7 +13959,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCO SAVE_OPLINE(); is_identical_function(result, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _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);}; @@ -14173,7 +13976,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDL SAVE_OPLINE(); ZVAL_BOOL(result, fast_equal_function(result, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _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);}; @@ -14189,7 +13992,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H SAVE_OPLINE(); ZVAL_BOOL(result, fast_not_equal_function(result, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _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);}; @@ -14205,7 +14008,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_function(result, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _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);}; @@ -14221,7 +14024,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CONST_HANDLER(ZEND_O SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _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);}; @@ -14236,7 +14039,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ SAVE_OPLINE(); bitwise_or_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _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);}; @@ -14251,7 +14054,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER SAVE_OPLINE(); bitwise_and_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _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);}; @@ -14266,7 +14069,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER SAVE_OPLINE(); bitwise_xor_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _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);}; @@ -14281,7 +14084,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDL SAVE_OPLINE(); boolean_xor_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), + _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);}; @@ -14293,10 +14096,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b { USE_OPLINE zend_free_op free_op1, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval **object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zval *object; zval *property = opline->op2.zv; - zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); + zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); int have_get_ptr = 0; if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -14414,7 +14217,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CONST(int (*binar return zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); break; case ZEND_ASSIGN_DIM: { - zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval **container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); @@ -14427,14 +14230,14 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CONST(int (*binar zval *dim = opline->op2.zv; zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_CONST, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } } break; default: value = opline->op2.zv; - var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); /* do nothing */ break; } @@ -14556,7 +14359,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t int have_get_ptr = 0; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); property = opline->op2.zv; retval = &EX_T(opline->result.var).var.ptr; @@ -14660,7 +14463,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_ int have_get_ptr = 0; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); property = opline->op2.zv; retval = &EX_T(opline->result.var).tmp_var; @@ -14762,7 +14565,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_CONST(int type, ulong hash_value; SAVE_OPLINE(); - varname = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR != IS_CONST && UNEXPECTED(Z_TYPE_P(varname) != IS_STRING)) { ZVAL_COPY_VALUE(&tmp_varname, varname); @@ -14902,7 +14705,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE { USE_OPLINE - return zend_fetch_var_address_helper_SPEC_VAR_CONST(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return zend_fetch_var_address_helper_SPEC_VAR_CONST(ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) @@ -14930,12 +14733,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA } if (IS_VAR == IS_TMP_VAR || IS_VAR == IS_CONST) { - zval *container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval *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);}; } else { - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_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);}; @@ -14952,7 +14755,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); @@ -14986,7 +14789,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); @@ -15008,7 +14811,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_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);}; @@ -15024,8 +14827,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP SAVE_OPLINE(); - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) { + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } @@ -15037,7 +14840,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP if (IS_CONST == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_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); } @@ -15053,7 +14856,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCOD zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_CV) { if (container != &EG(uninitialized_zval_ptr)) { @@ -15071,6 +14874,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCOD if (free_op1.var) {zval_ptr_dtor(&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(); } else { zend_free_op free_res; zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr; @@ -15095,7 +14899,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_CONST( zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); offset = opline->op2.zv; if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || @@ -15152,7 +14956,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA if (0) { MAKE_REAL_ZVAL_PTR(property); } - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an object"); } @@ -15192,7 +14996,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H SAVE_OPLINE(); property = opline->op2.zv; - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (0) { MAKE_REAL_ZVAL_PTR(property); @@ -15223,7 +15027,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); offset = opline->op2.zv; if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || @@ -15260,7 +15064,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP { USE_OPLINE - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) { /* Behave like FETCH_OBJ_W */ zend_free_op free_op1; zval *property; @@ -15268,7 +15072,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP SAVE_OPLINE(); property = opline->op2.zv; - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (0) { MAKE_REAL_ZVAL_PTR(property); @@ -15301,7 +15105,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST_HANDLER(ZEND_OPCOD zval *property; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); property = opline->op2.zv; if (IS_VAR == IS_CV) { @@ -15344,7 +15148,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN zval *property_name; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); property_name = opline->op2.zv; if (0) { @@ -15353,7 +15157,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } - zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_OBJ, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); + zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); if (0) { zval_ptr_dtor(&property_name); } else { @@ -15373,7 +15177,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN zval **object_ptr; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); @@ -15385,7 +15189,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN if (0) { MAKE_REAL_ZVAL_PTR(property_name); } - zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_DIM, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); + zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); if (0) { zval_ptr_dtor(&property_name); } else { @@ -15399,8 +15203,8 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), object_ptr, dim, IS_CONST, BP_VAR_W TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + 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); if (UNEXPECTED(variable_ptr_ptr == NULL)) { if (zend_assign_to_string_offset(&EX_T((opline+1)->op2.var), value, (opline+1)->op1_type TSRMLS_CC)) { if (RETURN_VALUE_USED(opline)) { @@ -15455,7 +15259,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER SAVE_OPLINE(); value = opline->op2.zv; - variable_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + variable_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL)) { if (zend_assign_to_string_offset(&EX_T(opline->op1.var), value, IS_CONST TSRMLS_CC)) { @@ -15508,9 +15312,9 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZEND_OPCO char *function_name_strval; int function_name_strlen; zend_free_op free_op1; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); function_name = opline->op2.zv; @@ -15522,49 +15326,51 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZEND_OPCO function_name_strval = Z_STRVAL_P(function_name); function_name_strlen = Z_STRLEN_P(function_name); - EX(object) = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + call->object = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - if (EXPECTED(EX(object) != NULL) && - EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) { - EX(called_scope) = Z_OBJCE_P(EX(object)); + if (EXPECTED(call->object != NULL) && + EXPECTED(Z_TYPE_P(call->object) == IS_OBJECT)) { + call->called_scope = Z_OBJCE_P(call->object); if (IS_CONST != IS_CONST || - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) { - zval *object = EX(object); + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope)) == NULL) { + zval *object = call->object; - if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) { + if (UNEXPECTED(Z_OBJ_HT_P(call->object)->get_method == NULL)) { zend_error_noreturn(E_ERROR, "Object does not support method calls"); } /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_CONST == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); - if (UNEXPECTED(EX(fbc) == NULL)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); + call->fbc = Z_OBJ_HT_P(call->object)->get_method(&call->object, function_name_strval, function_name_strlen, ((IS_CONST == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + if (UNEXPECTED(call->fbc == NULL)) { + zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(call->object), function_name_strval); } if (IS_CONST == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && - EXPECTED(EX(object) == object)) { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc)); + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && + EXPECTED(call->object == object)) { + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope, call->fbc); } } } else { zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); } - if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) { - EX(object) = NULL; + if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { + call->object = NULL; } else { - if (!PZVAL_IS_REF(EX(object))) { - Z_ADDREF_P(EX(object)); /* For $this pointer */ + if (!PZVAL_IS_REF(call->object)) { + Z_ADDREF_P(call->object); /* For $this pointer */ } else { zval *this_ptr; ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); + INIT_PZVAL_COPY(this_ptr, call->object); zval_copy_ctor(this_ptr); - EX(object) = this_ptr; + call->object = this_ptr; } } + call->is_ctor_call = 0; + EX(call) = call; if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; @@ -15577,9 +15383,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE USE_OPLINE zval *function_name; zend_class_entry *ce; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); if (IS_VAR == IS_CONST) { /* no function found. try a static method in class */ @@ -15593,24 +15399,24 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE } CACHE_PTR(opline->op1.literal->cache_slot, ce); } - EX(called_scope) = ce; + call->called_scope = ce; } else { ce = EX_T(opline->op1.var).class_entry; if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) { - EX(called_scope) = EG(called_scope); + call->called_scope = EG(called_scope); } else { - EX(called_scope) = ce; + call->called_scope = ce; } } if (IS_VAR == IS_CONST && IS_CONST == IS_CONST && CACHED_PTR(opline->op2.literal->cache_slot)) { - EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot); + call->fbc = CACHED_PTR(opline->op2.literal->cache_slot); } else if (IS_VAR != IS_CONST && IS_CONST == IS_CONST && - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) { + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) { /* do nothing */ } else if (IS_CONST != IS_UNUSED) { char *function_name_strval = NULL; @@ -15633,20 +15439,20 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE if (function_name_strval) { if (ce->get_static_method) { - EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + call->fbc = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); } else { - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_CONST == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + call->fbc = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_CONST == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); } - if (UNEXPECTED(EX(fbc) == NULL)) { + if (UNEXPECTED(call->fbc == NULL)) { zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval); } if (IS_CONST == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) { + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) { if (IS_VAR == IS_CONST) { - CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc)); + CACHE_PTR(opline->op2.literal->cache_slot, call->fbc); } else { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, EX(fbc)); + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, call->fbc); } } } @@ -15660,29 +15466,31 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name); } - EX(fbc) = ce->constructor; + call->fbc = ce->constructor; } - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; + if (call->fbc->common.fn_flags & ZEND_ACC_STATIC) { + call->object = NULL; } else { if (EG(This) && Z_OBJ_HT_P(EG(This))->get_class_entry && !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) { /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ - if (EX(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", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); + 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); } 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", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); + 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); } } - if ((EX(object) = EG(This))) { - Z_ADDREF_P(EX(object)); - EX(called_scope) = Z_OBJCE_P(EX(object)); + if ((call->object = EG(This))) { + Z_ADDREF_P(call->object); + call->called_scope = Z_OBJCE_P(call->object); } } + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -15698,7 +15506,7 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_A 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, EX_Ts(), &free_op1 TSRMLS_CC), + _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC), opline->op2.zv TSRMLS_CC); CHECK_EXCEPTION(); @@ -15805,7 +15613,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPC SAVE_OPLINE(); if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) { - zval **expr_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval **expr_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets"); @@ -15814,7 +15622,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPC expr_ptr = *expr_ptr_ptr; Z_ADDREF_P(expr_ptr); } else { - expr_ptr=_get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + expr_ptr=_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (0) { /* temporary variable */ zval *new_expr; @@ -15921,7 +15729,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND ZEND_VM_NEXT_OPCODE(); } - varname = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_COPY_VALUE(&tmp, varname); @@ -15982,7 +15790,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND ulong hval; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { SEPARATE_ZVAL_IF_NOT_REF(container); } @@ -16081,7 +15889,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); offset = opline->op2.zv; if (IS_VAR != IS_VAR || container) { @@ -16138,7 +15946,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPC } else { HashTable *target_symbol_table; zend_free_op free_op1; - zval tmp, *varname = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval tmp, *varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_COPY_VALUE(&tmp, varname); @@ -16210,7 +16018,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CONST( zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); offset = opline->op2.zv; @@ -16386,7 +16194,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ zend_error(E_NOTICE, "Only variable references should be yielded by reference"); - value = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); ALLOC_ZVAL(copy); INIT_PZVAL_COPY(copy, value); @@ -16397,7 +16205,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ generator->value = copy; } else { - zval **value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval **value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference"); @@ -16422,7 +16230,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } } else { - zval *value = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + 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 @@ -16495,8 +16303,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ generator->send_target = &EX_T(opline->result.var); /* Initialize the sent value to NULL */ - Z_ADDREF(EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).tmp_var = EG(uninitialized_zval); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ @@ -16516,8 +16323,8 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); fast_add_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -16531,8 +16338,8 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); fast_sub_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -16546,8 +16353,8 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); fast_mul_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -16561,8 +16368,8 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); fast_div_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -16576,8 +16383,8 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); fast_mod_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -16591,8 +16398,8 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); shift_left_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -16606,8 +16413,8 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); shift_right_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -16621,8 +16428,8 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A SAVE_OPLINE(); concat_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -16636,8 +16443,8 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN SAVE_OPLINE(); is_identical_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -16652,8 +16459,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE SAVE_OPLINE(); is_identical_function(result, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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_dtor(free_op2.var); @@ -16669,8 +16476,8 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER SAVE_OPLINE(); ZVAL_BOOL(result, fast_equal_function(result, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _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_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -16685,8 +16492,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN SAVE_OPLINE(); ZVAL_BOOL(result, fast_not_equal_function(result, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _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_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -16701,8 +16508,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_function(result, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _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_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -16717,8 +16524,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_TMP_HANDLER(ZEND_OPC SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _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_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -16732,8 +16539,8 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); bitwise_or_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -16747,8 +16554,8 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A SAVE_OPLINE(); bitwise_and_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -16762,8 +16569,8 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A SAVE_OPLINE(); bitwise_xor_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -16777,8 +16584,8 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER SAVE_OPLINE(); boolean_xor_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -16789,10 +16596,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(int (*bin { USE_OPLINE zend_free_op free_op1, free_op2, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval **object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zval *object; - zval *property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); - zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); + zval *property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); int have_get_ptr = 0; if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -16910,7 +16717,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_TMP(int (*binary_ return zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); break; case ZEND_ASSIGN_DIM: { - zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval **container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); @@ -16920,17 +16727,17 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_TMP(int (*binary_ } return zend_binary_assign_op_obj_helper_SPEC_VAR_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } else { - zval *dim = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *dim = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_TMP_VAR, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } } break; default: - value = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); /* do nothing */ break; } @@ -17053,8 +16860,8 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_TMP(incdec_t i int have_get_ptr = 0; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); retval = &EX_T(opline->result.var).var.ptr; if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -17157,8 +16964,8 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_TMP(incdec_t int have_get_ptr = 0; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); retval = &EX_T(opline->result.var).tmp_var; if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -17263,13 +17070,13 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND } if (IS_VAR == IS_TMP_VAR || IS_VAR == IS_CONST) { - zval *container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC); + zval *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);}; } else { - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC); + container = _get_zval_ptr_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);}; } @@ -17285,12 +17092,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { 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_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_W TSRMLS_CC); + zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_W TSRMLS_CC); zval_dtor(free_op2.var); if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -17319,12 +17126,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { 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_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_RW TSRMLS_CC); + zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_RW TSRMLS_CC); zval_dtor(free_op2.var); if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -17341,8 +17148,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_IS TSRMLS_CC); + container = _get_zval_ptr_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);}; CHECK_EXCEPTION(); @@ -17357,12 +17164,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCO SAVE_OPLINE(); - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) { + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { 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_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_W TSRMLS_CC); + zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_W TSRMLS_CC); if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } @@ -17370,8 +17177,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCO if (IS_TMP_VAR == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC); + container = _get_zval_ptr_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);}; @@ -17386,7 +17193,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_ zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_CV) { if (container != &EG(uninitialized_zval_ptr)) { @@ -17396,7 +17203,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_ if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { 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_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_UNSET TSRMLS_CC); + zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_UNSET TSRMLS_CC); zval_dtor(free_op2.var); if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -17404,6 +17211,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_ if (free_op1.var) {zval_ptr_dtor(&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(); } else { zend_free_op free_res; zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr; @@ -17428,8 +17236,8 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_TMP(ZE zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + 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 (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { @@ -17475,7 +17283,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); @@ -17485,7 +17293,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND if (1) { MAKE_REAL_ZVAL_PTR(property); } - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an object"); } @@ -17524,8 +17332,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (1) { MAKE_REAL_ZVAL_PTR(property); @@ -17556,8 +17364,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + 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 (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { @@ -17593,15 +17401,15 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCO { USE_OPLINE - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) { /* Behave like FETCH_OBJ_W */ zend_free_op free_op1, free_op2; zval *property; zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (1) { MAKE_REAL_ZVAL_PTR(property); @@ -17634,8 +17442,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_ zval *property; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_VAR == IS_CV) { if (container != &EG(uninitialized_zval_ptr)) { @@ -17677,8 +17485,8 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL zval *property_name; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - property_name = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + property_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (1) { MAKE_REAL_ZVAL_PTR(property_name); @@ -17686,7 +17494,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } - zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_OBJ, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); + zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); if (1) { zval_ptr_dtor(&property_name); } else { @@ -17706,19 +17514,19 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL zval **object_ptr; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } if (Z_TYPE_PP(object_ptr) == IS_OBJECT) { zend_free_op free_op2; - zval *property_name = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *property_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (1) { MAKE_REAL_ZVAL_PTR(property_name); } - zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_DIM, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); + zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); if (1) { zval_ptr_dtor(&property_name); } else { @@ -17727,14 +17535,14 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL } else { zend_free_op free_op2, free_op_data1, free_op_data2; zval *value; - zval *dim = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *dim = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); zval **variable_ptr_ptr; zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), object_ptr, dim, IS_TMP_VAR, BP_VAR_W TSRMLS_CC); zval_dtor(free_op2.var); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + 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); if (UNEXPECTED(variable_ptr_ptr == NULL)) { if (zend_assign_to_string_offset(&EX_T((opline+1)->op2.var), value, (opline+1)->op1_type TSRMLS_CC)) { if (RETURN_VALUE_USED(opline)) { @@ -17788,8 +17596,8 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_A zval **variable_ptr_ptr; SAVE_OPLINE(); - value = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); - variable_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + variable_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL)) { if (zend_assign_to_string_offset(&EX_T(opline->op1.var), value, IS_TMP_VAR TSRMLS_CC)) { @@ -17842,11 +17650,11 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE char *function_name_strval; int function_name_strlen; zend_free_op free_op1, free_op2; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); - function_name = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + function_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_TMP_VAR != IS_CONST && UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { @@ -17856,49 +17664,51 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE function_name_strval = Z_STRVAL_P(function_name); function_name_strlen = Z_STRLEN_P(function_name); - EX(object) = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + call->object = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - if (EXPECTED(EX(object) != NULL) && - EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) { - EX(called_scope) = Z_OBJCE_P(EX(object)); + if (EXPECTED(call->object != NULL) && + EXPECTED(Z_TYPE_P(call->object) == IS_OBJECT)) { + call->called_scope = Z_OBJCE_P(call->object); if (IS_TMP_VAR != IS_CONST || - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) { - zval *object = EX(object); + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope)) == NULL) { + zval *object = call->object; - if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) { + if (UNEXPECTED(Z_OBJ_HT_P(call->object)->get_method == NULL)) { zend_error_noreturn(E_ERROR, "Object does not support method calls"); } /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_TMP_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); - if (UNEXPECTED(EX(fbc) == NULL)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); + call->fbc = Z_OBJ_HT_P(call->object)->get_method(&call->object, function_name_strval, function_name_strlen, ((IS_TMP_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + if (UNEXPECTED(call->fbc == NULL)) { + zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(call->object), function_name_strval); } if (IS_TMP_VAR == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && - EXPECTED(EX(object) == object)) { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc)); + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && + EXPECTED(call->object == object)) { + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope, call->fbc); } } } else { zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); } - if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) { - EX(object) = NULL; + if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { + call->object = NULL; } else { - if (!PZVAL_IS_REF(EX(object))) { - Z_ADDREF_P(EX(object)); /* For $this pointer */ + if (!PZVAL_IS_REF(call->object)) { + Z_ADDREF_P(call->object); /* For $this pointer */ } else { zval *this_ptr; ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); + INIT_PZVAL_COPY(this_ptr, call->object); zval_copy_ctor(this_ptr); - EX(object) = this_ptr; + call->object = this_ptr; } } + call->is_ctor_call = 0; + EX(call) = call; zval_dtor(free_op2.var); if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; @@ -17912,9 +17722,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND USE_OPLINE zval *function_name; zend_class_entry *ce; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); if (IS_VAR == IS_CONST) { /* no function found. try a static method in class */ @@ -17928,24 +17738,24 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND } CACHE_PTR(opline->op1.literal->cache_slot, ce); } - EX(called_scope) = ce; + call->called_scope = ce; } else { ce = EX_T(opline->op1.var).class_entry; if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) { - EX(called_scope) = EG(called_scope); + call->called_scope = EG(called_scope); } else { - EX(called_scope) = ce; + call->called_scope = ce; } } if (IS_VAR == IS_CONST && IS_TMP_VAR == IS_CONST && CACHED_PTR(opline->op2.literal->cache_slot)) { - EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot); + call->fbc = CACHED_PTR(opline->op2.literal->cache_slot); } else if (IS_VAR != IS_CONST && IS_TMP_VAR == IS_CONST && - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) { + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) { /* do nothing */ } else if (IS_TMP_VAR != IS_UNUSED) { char *function_name_strval = NULL; @@ -17956,7 +17766,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND function_name_strval = Z_STRVAL_P(opline->op2.zv); function_name_strlen = Z_STRLEN_P(opline->op2.zv); } else { - function_name = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + function_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { zend_error_noreturn(E_ERROR, "Function name must be a string"); @@ -17968,20 +17778,20 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND if (function_name_strval) { if (ce->get_static_method) { - EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + call->fbc = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); } else { - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_TMP_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + call->fbc = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_TMP_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); } - if (UNEXPECTED(EX(fbc) == NULL)) { + if (UNEXPECTED(call->fbc == NULL)) { zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval); } if (IS_TMP_VAR == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) { + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) { if (IS_VAR == IS_CONST) { - CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc)); + CACHE_PTR(opline->op2.literal->cache_slot, call->fbc); } else { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, EX(fbc)); + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, call->fbc); } } } @@ -17995,29 +17805,31 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name); } - EX(fbc) = ce->constructor; + call->fbc = ce->constructor; } - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; + if (call->fbc->common.fn_flags & ZEND_ACC_STATIC) { + call->object = NULL; } else { if (EG(This) && Z_OBJ_HT_P(EG(This))->get_class_entry && !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) { /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ - if (EX(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", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); + 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); } 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", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); + 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); } } - if ((EX(object) = EG(This))) { - Z_ADDREF_P(EX(object)); - EX(called_scope) = Z_OBJCE_P(EX(object)); + if ((call->object = EG(This))) { + Z_ADDREF_P(call->object); + call->called_scope = Z_OBJCE_P(call->object); } } + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -18033,8 +17845,8 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG 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, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -18049,7 +17861,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCOD SAVE_OPLINE(); if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) { - zval **expr_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval **expr_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets"); @@ -18058,7 +17870,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCOD expr_ptr = *expr_ptr_ptr; Z_ADDREF_P(expr_ptr); } else { - expr_ptr=_get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + expr_ptr=_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (0) { /* temporary variable */ zval *new_expr; @@ -18079,7 +17891,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_TMP_HANDLER(ZEND_OPCOD if (IS_TMP_VAR != IS_UNUSED) { zend_free_op free_op2; - zval *offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); ulong hval; switch (Z_TYPE_P(offset)) { @@ -18150,11 +17962,11 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE ulong hval; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { SEPARATE_ZVAL_IF_NOT_REF(container); } - offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_VAR != IS_VAR || container) { switch (Z_TYPE_PP(container)) { @@ -18249,8 +18061,8 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + container = _get_zval_ptr_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 (IS_VAR != IS_VAR || container) { if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { @@ -18293,9 +18105,9 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(in zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) { HashTable *ht; @@ -18469,7 +18281,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR zend_error(E_NOTICE, "Only variable references should be yielded by reference"); - value = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); ALLOC_ZVAL(copy); INIT_PZVAL_COPY(copy, value); @@ -18480,7 +18292,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR generator->value = copy; } else { - zval **value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval **value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference"); @@ -18505,7 +18317,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } } else { - zval *value = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + 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 @@ -18538,7 +18350,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR /* Set the new yielded key */ if (IS_TMP_VAR != IS_UNUSED) { zend_free_op free_op2; - zval *key = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *key = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR @@ -18578,8 +18390,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR generator->send_target = &EX_T(opline->result.var); /* Initialize the sent value to NULL */ - Z_ADDREF(EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).tmp_var = EG(uninitialized_zval); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ @@ -18599,8 +18410,8 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); fast_add_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -18614,8 +18425,8 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); fast_sub_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -18629,8 +18440,8 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); fast_mul_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -18644,8 +18455,8 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); fast_div_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -18659,8 +18470,8 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); fast_mod_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -18674,8 +18485,8 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); shift_left_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -18689,8 +18500,8 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); shift_right_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -18704,8 +18515,8 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A SAVE_OPLINE(); concat_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -18719,8 +18530,8 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN SAVE_OPLINE(); is_identical_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -18735,8 +18546,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE SAVE_OPLINE(); is_identical_function(result, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; @@ -18752,8 +18563,8 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER SAVE_OPLINE(); ZVAL_BOOL(result, fast_equal_function(result, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _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);}; CHECK_EXCEPTION(); @@ -18768,8 +18579,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN SAVE_OPLINE(); ZVAL_BOOL(result, fast_not_equal_function(result, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _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);}; CHECK_EXCEPTION(); @@ -18784,8 +18595,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_function(result, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _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);}; CHECK_EXCEPTION(); @@ -18800,8 +18611,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_VAR_HANDLER(ZEND_OPC SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _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);}; CHECK_EXCEPTION(); @@ -18815,8 +18626,8 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); bitwise_or_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -18830,8 +18641,8 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A SAVE_OPLINE(); bitwise_and_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -18845,8 +18656,8 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A SAVE_OPLINE(); bitwise_xor_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -18860,8 +18671,8 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER SAVE_OPLINE(); boolean_xor_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -18872,10 +18683,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(int (*bin { USE_OPLINE zend_free_op free_op1, free_op2, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval **object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zval *object; - zval *property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); - zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); + zval *property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); int have_get_ptr = 0; if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -18993,7 +18804,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_VAR(int (*binary_ return zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); break; case ZEND_ASSIGN_DIM: { - zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval **container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); @@ -19003,17 +18814,17 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_VAR(int (*binary_ } return zend_binary_assign_op_obj_helper_SPEC_VAR_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } else { - zval *dim = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *dim = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_VAR, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } } break; default: - value = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); /* do nothing */ break; } @@ -19136,8 +18947,8 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_VAR(incdec_t i int have_get_ptr = 0; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); retval = &EX_T(opline->result.var).var.ptr; if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -19240,8 +19051,8 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_VAR(incdec_t int have_get_ptr = 0; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); retval = &EX_T(opline->result.var).tmp_var; if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -19342,7 +19153,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_VAR(int type, ZE ulong hash_value; SAVE_OPLINE(); - varname = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR != IS_CONST && UNEXPECTED(Z_TYPE_P(varname) != IS_STRING)) { ZVAL_COPY_VALUE(&tmp_varname, varname); @@ -19482,7 +19293,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_H { USE_OPLINE - return zend_fetch_var_address_helper_SPEC_VAR_VAR(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return zend_fetch_var_address_helper_SPEC_VAR_VAR(ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) @@ -19510,13 +19321,13 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAND } if (IS_VAR == IS_TMP_VAR || IS_VAR == IS_CONST) { - zval *container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC); + zval *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);}; } else { - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC); + container = _get_zval_ptr_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);}; } @@ -19532,12 +19343,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAND zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { 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, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_W TSRMLS_CC); + 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);}; if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -19566,12 +19377,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { 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, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_RW TSRMLS_CC); + 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);}; if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -19588,8 +19399,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_IS TSRMLS_CC); + container = _get_zval_ptr_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);}; CHECK_EXCEPTION(); @@ -19604,12 +19415,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCO SAVE_OPLINE(); - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) { + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { 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, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_W TSRMLS_CC); + 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 (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } @@ -19617,8 +19428,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCO if (IS_VAR == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC); + container = _get_zval_ptr_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);}; @@ -19633,7 +19444,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_ zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_CV) { if (container != &EG(uninitialized_zval_ptr)) { @@ -19643,7 +19454,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_ if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { 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, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_UNSET TSRMLS_CC); + 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);}; if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -19651,6 +19462,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_ if (free_op1.var) {zval_ptr_dtor(&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(); } else { zend_free_op free_res; zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr; @@ -19675,8 +19487,8 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_VAR(ZE zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + 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 (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { @@ -19722,7 +19534,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAND zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); @@ -19732,7 +19544,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAND if (0) { MAKE_REAL_ZVAL_PTR(property); } - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an object"); } @@ -19771,8 +19583,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (0) { MAKE_REAL_ZVAL_PTR(property); @@ -19803,8 +19615,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + 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 (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { @@ -19840,15 +19652,15 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCO { USE_OPLINE - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) { /* Behave like FETCH_OBJ_W */ zend_free_op free_op1, free_op2; zval *property; zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (0) { MAKE_REAL_ZVAL_PTR(property); @@ -19881,8 +19693,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_ zval *property; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_VAR == IS_CV) { if (container != &EG(uninitialized_zval_ptr)) { @@ -19924,8 +19736,8 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL zval *property_name; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - property_name = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (0) { MAKE_REAL_ZVAL_PTR(property_name); @@ -19933,7 +19745,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } - zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_OBJ, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); + zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); if (0) { zval_ptr_dtor(&property_name); } else { @@ -19953,19 +19765,19 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL zval **object_ptr; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } if (Z_TYPE_PP(object_ptr) == IS_OBJECT) { zend_free_op free_op2; - zval *property_name = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (0) { MAKE_REAL_ZVAL_PTR(property_name); } - zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_DIM, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); + zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); if (0) { zval_ptr_dtor(&property_name); } else { @@ -19974,14 +19786,14 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL } else { zend_free_op free_op2, free_op_data1, free_op_data2; zval *value; - zval *dim = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *dim = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); 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);}; - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + 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); if (UNEXPECTED(variable_ptr_ptr == NULL)) { if (zend_assign_to_string_offset(&EX_T((opline+1)->op2.var), value, (opline+1)->op1_type TSRMLS_CC)) { if (RETURN_VALUE_USED(opline)) { @@ -20035,8 +19847,8 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_A zval **variable_ptr_ptr; SAVE_OPLINE(); - value = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); - variable_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + variable_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL)) { if (zend_assign_to_string_offset(&EX_T(opline->op1.var), value, IS_VAR TSRMLS_CC)) { @@ -20091,7 +19903,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL zval **value_ptr_ptr; SAVE_OPLINE(); - value_ptr_ptr = _get_zval_ptr_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + value_ptr_ptr = _get_zval_ptr_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_VAR == IS_VAR && value_ptr_ptr && @@ -20114,7 +19926,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL zend_error_noreturn(E_ERROR, "Cannot assign by reference to overloaded object"); } - variable_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + variable_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if ((IS_VAR == IS_VAR && UNEXPECTED(value_ptr_ptr == NULL)) || (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL))) { zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects"); @@ -20144,11 +19956,11 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE char *function_name_strval; int function_name_strlen; zend_free_op free_op1, free_op2; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); - function_name = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + function_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_VAR != IS_CONST && UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { @@ -20158,49 +19970,51 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE function_name_strval = Z_STRVAL_P(function_name); function_name_strlen = Z_STRLEN_P(function_name); - EX(object) = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + call->object = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - if (EXPECTED(EX(object) != NULL) && - EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) { - EX(called_scope) = Z_OBJCE_P(EX(object)); + if (EXPECTED(call->object != NULL) && + EXPECTED(Z_TYPE_P(call->object) == IS_OBJECT)) { + call->called_scope = Z_OBJCE_P(call->object); if (IS_VAR != IS_CONST || - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) { - zval *object = EX(object); + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope)) == NULL) { + zval *object = call->object; - if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) { + if (UNEXPECTED(Z_OBJ_HT_P(call->object)->get_method == NULL)) { zend_error_noreturn(E_ERROR, "Object does not support method calls"); } /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); - if (UNEXPECTED(EX(fbc) == NULL)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); + call->fbc = Z_OBJ_HT_P(call->object)->get_method(&call->object, function_name_strval, function_name_strlen, ((IS_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + if (UNEXPECTED(call->fbc == NULL)) { + zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(call->object), function_name_strval); } if (IS_VAR == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && - EXPECTED(EX(object) == object)) { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc)); + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && + EXPECTED(call->object == object)) { + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope, call->fbc); } } } else { zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); } - if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) { - EX(object) = NULL; + if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { + call->object = NULL; } else { - if (!PZVAL_IS_REF(EX(object))) { - Z_ADDREF_P(EX(object)); /* For $this pointer */ + if (!PZVAL_IS_REF(call->object)) { + Z_ADDREF_P(call->object); /* For $this pointer */ } else { zval *this_ptr; ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); + INIT_PZVAL_COPY(this_ptr, call->object); zval_copy_ctor(this_ptr); - EX(object) = this_ptr; + call->object = this_ptr; } } + 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);}; @@ -20214,9 +20028,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND USE_OPLINE zval *function_name; zend_class_entry *ce; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); if (IS_VAR == IS_CONST) { /* no function found. try a static method in class */ @@ -20230,24 +20044,24 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND } CACHE_PTR(opline->op1.literal->cache_slot, ce); } - EX(called_scope) = ce; + call->called_scope = ce; } else { ce = EX_T(opline->op1.var).class_entry; if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) { - EX(called_scope) = EG(called_scope); + call->called_scope = EG(called_scope); } else { - EX(called_scope) = ce; + call->called_scope = ce; } } if (IS_VAR == IS_CONST && IS_VAR == IS_CONST && CACHED_PTR(opline->op2.literal->cache_slot)) { - EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot); + call->fbc = CACHED_PTR(opline->op2.literal->cache_slot); } else if (IS_VAR != IS_CONST && IS_VAR == IS_CONST && - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) { + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) { /* do nothing */ } else if (IS_VAR != IS_UNUSED) { char *function_name_strval = NULL; @@ -20258,7 +20072,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND function_name_strval = Z_STRVAL_P(opline->op2.zv); function_name_strlen = Z_STRLEN_P(opline->op2.zv); } else { - function_name = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + function_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { zend_error_noreturn(E_ERROR, "Function name must be a string"); @@ -20270,20 +20084,20 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND if (function_name_strval) { if (ce->get_static_method) { - EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + call->fbc = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); } else { - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + call->fbc = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); } - if (UNEXPECTED(EX(fbc) == NULL)) { + if (UNEXPECTED(call->fbc == NULL)) { zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval); } if (IS_VAR == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) { + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) { if (IS_VAR == IS_CONST) { - CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc)); + CACHE_PTR(opline->op2.literal->cache_slot, call->fbc); } else { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, EX(fbc)); + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, call->fbc); } } } @@ -20297,29 +20111,31 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name); } - EX(fbc) = ce->constructor; + call->fbc = ce->constructor; } - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; + if (call->fbc->common.fn_flags & ZEND_ACC_STATIC) { + call->object = NULL; } else { if (EG(This) && Z_OBJ_HT_P(EG(This))->get_class_entry && !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) { /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ - if (EX(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", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); + 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); } 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", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); + 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); } } - if ((EX(object) = EG(This))) { - Z_ADDREF_P(EX(object)); - EX(called_scope) = Z_OBJCE_P(EX(object)); + if ((call->object = EG(This))) { + Z_ADDREF_P(call->object); + call->called_scope = Z_OBJCE_P(call->object); } } + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -20335,8 +20151,8 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG 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, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -20351,7 +20167,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCOD SAVE_OPLINE(); if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) { - zval **expr_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval **expr_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets"); @@ -20360,7 +20176,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCOD expr_ptr = *expr_ptr_ptr; Z_ADDREF_P(expr_ptr); } else { - expr_ptr=_get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + expr_ptr=_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (0) { /* temporary variable */ zval *new_expr; @@ -20381,7 +20197,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_VAR_HANDLER(ZEND_OPCOD if (IS_VAR != IS_UNUSED) { zend_free_op free_op2; - zval *offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); ulong hval; switch (Z_TYPE_P(offset)) { @@ -20467,7 +20283,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE ZEND_VM_NEXT_OPCODE(); } - varname = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_COPY_VALUE(&tmp, varname); @@ -20528,11 +20344,11 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE ulong hval; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { SEPARATE_ZVAL_IF_NOT_REF(container); } - offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_VAR != IS_VAR || container) { switch (Z_TYPE_PP(container)) { @@ -20627,8 +20443,8 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + container = _get_zval_ptr_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 (IS_VAR != IS_VAR || container) { if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { @@ -20684,7 +20500,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCOD } else { HashTable *target_symbol_table; zend_free_op free_op1; - zval tmp, *varname = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval tmp, *varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_COPY_VALUE(&tmp, varname); @@ -20756,9 +20572,9 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(in zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) { HashTable *ht; @@ -20932,7 +20748,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR zend_error(E_NOTICE, "Only variable references should be yielded by reference"); - value = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); ALLOC_ZVAL(copy); INIT_PZVAL_COPY(copy, value); @@ -20943,7 +20759,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR generator->value = copy; } else { - zval **value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval **value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference"); @@ -20968,7 +20784,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } } else { - zval *value = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + 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 @@ -21001,7 +20817,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR /* Set the new yielded key */ if (IS_VAR != IS_UNUSED) { zend_free_op free_op2; - zval *key = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *key = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR @@ -21042,8 +20858,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR generator->send_target = &EX_T(opline->result.var); /* Initialize the sent value to NULL */ - Z_ADDREF(EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).tmp_var = EG(uninitialized_zval); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ @@ -21060,10 +20875,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(int (* { USE_OPLINE zend_free_op free_op1, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval **object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zval *object; zval *property = NULL; - zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); + zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); int have_get_ptr = 0; if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -21181,7 +20996,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_UNUSED(int (*bina return zend_binary_assign_op_obj_helper_SPEC_VAR_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); break; case ZEND_ASSIGN_DIM: { - zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval **container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); @@ -21194,14 +21009,14 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_UNUSED(int (*bina zval *dim = NULL; zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_UNUSED, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } } break; default: value = NULL; - var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); /* do nothing */ break; } @@ -21323,7 +21138,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_UNUSED(int type, ulong hash_value; SAVE_OPLINE(); - varname = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR != IS_CONST && UNEXPECTED(Z_TYPE_P(varname) != IS_STRING)) { ZVAL_COPY_VALUE(&tmp_varname, varname); @@ -21463,7 +21278,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCOD { USE_OPLINE - return zend_fetch_var_address_helper_SPEC_VAR_UNUSED(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return zend_fetch_var_address_helper_SPEC_VAR_UNUSED(ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) @@ -21483,7 +21298,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_H zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); @@ -21517,7 +21332,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_ zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); @@ -21540,8 +21355,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_O SAVE_OPLINE(); - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) { + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } @@ -21553,7 +21368,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_O if (IS_UNUSED == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_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); } @@ -21569,7 +21384,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HA zval **object_ptr; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); @@ -21581,7 +21396,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HA if (0) { MAKE_REAL_ZVAL_PTR(property_name); } - zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_DIM, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); + zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); if (0) { zval_ptr_dtor(&property_name); } else { @@ -21595,8 +21410,8 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HA zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), object_ptr, dim, IS_UNUSED, BP_VAR_W TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + 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); if (UNEXPECTED(variable_ptr_ptr == NULL)) { if (zend_assign_to_string_offset(&EX_T((opline+1)->op2.var), value, (opline+1)->op1_type TSRMLS_CC)) { if (RETURN_VALUE_USED(opline)) { @@ -21647,9 +21462,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z USE_OPLINE zval *function_name; zend_class_entry *ce; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); if (IS_VAR == IS_CONST) { /* no function found. try a static method in class */ @@ -21663,24 +21478,24 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z } CACHE_PTR(opline->op1.literal->cache_slot, ce); } - EX(called_scope) = ce; + call->called_scope = ce; } else { ce = EX_T(opline->op1.var).class_entry; if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) { - EX(called_scope) = EG(called_scope); + call->called_scope = EG(called_scope); } else { - EX(called_scope) = ce; + call->called_scope = ce; } } if (IS_VAR == IS_CONST && IS_UNUSED == IS_CONST && CACHED_PTR(opline->op2.literal->cache_slot)) { - EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot); + call->fbc = CACHED_PTR(opline->op2.literal->cache_slot); } else if (IS_VAR != IS_CONST && IS_UNUSED == IS_CONST && - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) { + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) { /* do nothing */ } else if (IS_UNUSED != IS_UNUSED) { char *function_name_strval = NULL; @@ -21703,20 +21518,20 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z if (function_name_strval) { if (ce->get_static_method) { - EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + call->fbc = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); } else { - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_UNUSED == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + call->fbc = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_UNUSED == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); } - if (UNEXPECTED(EX(fbc) == NULL)) { + if (UNEXPECTED(call->fbc == NULL)) { zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval); } if (IS_UNUSED == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) { + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) { if (IS_VAR == IS_CONST) { - CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc)); + CACHE_PTR(opline->op2.literal->cache_slot, call->fbc); } else { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, EX(fbc)); + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, call->fbc); } } } @@ -21730,29 +21545,31 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name); } - EX(fbc) = ce->constructor; + call->fbc = ce->constructor; } - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; + if (call->fbc->common.fn_flags & ZEND_ACC_STATIC) { + call->object = NULL; } else { if (EG(This) && Z_OBJ_HT_P(EG(This))->get_class_entry && !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) { /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ - if (EX(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", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); + 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); } 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", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); + 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); } } - if ((EX(object) = EG(This))) { - Z_ADDREF_P(EX(object)); - EX(called_scope) = Z_OBJCE_P(EX(object)); + if ((call->object = EG(This))) { + Z_ADDREF_P(call->object); + call->called_scope = Z_OBJCE_P(call->object); } } + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -21766,7 +21583,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OP SAVE_OPLINE(); if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) { - zval **expr_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval **expr_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets"); @@ -21775,7 +21592,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_UNUSED_HANDLER(ZEND_OP expr_ptr = *expr_ptr_ptr; Z_ADDREF_P(expr_ptr); } else { - expr_ptr=_get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + expr_ptr=_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (0) { /* temporary variable */ zval *new_expr; @@ -21882,7 +21699,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HAN ZEND_VM_NEXT_OPCODE(); } - varname = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_COPY_VALUE(&tmp, varname); @@ -21958,7 +21775,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OP } else { HashTable *target_symbol_table; zend_free_op free_op1; - zval tmp, *varname = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval tmp, *varname = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_COPY_VALUE(&tmp, varname); @@ -22073,7 +21890,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER zend_error(E_NOTICE, "Only variable references should be yielded by reference"); - value = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); ALLOC_ZVAL(copy); INIT_PZVAL_COPY(copy, value); @@ -22084,7 +21901,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER generator->value = copy; } else { - zval **value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval **value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference"); @@ -22109,7 +21926,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } } else { - zval *value = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + 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 @@ -22182,8 +21999,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER generator->send_target = &EX_T(opline->result.var); /* Initialize the sent value to NULL */ - Z_ADDREF(EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).tmp_var = EG(uninitialized_zval); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ @@ -22203,8 +22019,8 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); fast_add_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -22218,8 +22034,8 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); fast_sub_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -22233,8 +22049,8 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); fast_mul_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -22248,8 +22064,8 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); fast_div_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -22263,8 +22079,8 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); fast_mod_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -22278,8 +22094,8 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); shift_left_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -22293,8 +22109,8 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); shift_right_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -22308,8 +22124,8 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); concat_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -22323,8 +22139,8 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND SAVE_OPLINE(); is_identical_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -22339,8 +22155,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_ SAVE_OPLINE(); is_identical_function(result, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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);}; @@ -22356,8 +22172,8 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ SAVE_OPLINE(); ZVAL_BOOL(result, fast_equal_function(result, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC)); + _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);}; CHECK_EXCEPTION(); @@ -22372,8 +22188,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND SAVE_OPLINE(); ZVAL_BOOL(result, fast_not_equal_function(result, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC)); + _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);}; CHECK_EXCEPTION(); @@ -22388,8 +22204,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_function(result, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC)); + _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);}; CHECK_EXCEPTION(); @@ -22404,8 +22220,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_VAR_CV_HANDLER(ZEND_OPCO SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC)); + _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);}; CHECK_EXCEPTION(); @@ -22419,8 +22235,8 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); bitwise_or_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -22434,8 +22250,8 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); bitwise_and_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -22449,8 +22265,8 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); bitwise_xor_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -22464,8 +22280,8 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ SAVE_OPLINE(); boolean_xor_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -22476,10 +22292,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina { USE_OPLINE zend_free_op free_op1, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval **object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); zval *object; - zval *property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); - zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); + zval *property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); + zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); int have_get_ptr = 0; if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -22597,7 +22413,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CV(int (*binary_o return zend_binary_assign_op_obj_helper_SPEC_VAR_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); break; case ZEND_ASSIGN_DIM: { - zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval **container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); @@ -22607,17 +22423,17 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_VAR_CV(int (*binary_o } return zend_binary_assign_op_obj_helper_SPEC_VAR_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } else { - zval *dim = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + zval *dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_CV, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } } break; default: - value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); + var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); /* do nothing */ break; } @@ -22739,8 +22555,8 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t in int have_get_ptr = 0; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); retval = &EX_T(opline->result.var).var.ptr; if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -22843,8 +22659,8 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t i int have_get_ptr = 0; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); retval = &EX_T(opline->result.var).tmp_var; if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -22949,13 +22765,13 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL } if (IS_VAR == IS_TMP_VAR || IS_VAR == IS_CONST) { - zval *container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC); + zval *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);}; } else { - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC); + container = _get_zval_ptr_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);}; } @@ -22971,12 +22787,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { 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_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_W TSRMLS_CC); + zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_W TSRMLS_CC); if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -23005,12 +22821,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { 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_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_RW TSRMLS_CC); + zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_RW TSRMLS_CC); if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -23027,8 +22843,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_IS TSRMLS_CC); + container = _get_zval_ptr_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);}; CHECK_EXCEPTION(); @@ -23043,12 +22859,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCOD SAVE_OPLINE(); - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) { + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { 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_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_W TSRMLS_CC); + zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_W TSRMLS_CC); if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } @@ -23056,8 +22872,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCOD if (IS_CV == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC); + container = _get_zval_ptr_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);}; @@ -23072,7 +22888,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_H zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_CV) { if (container != &EG(uninitialized_zval_ptr)) { @@ -23082,7 +22898,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_H if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { 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_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_UNSET TSRMLS_CC); + zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_UNSET TSRMLS_CC); if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -23090,6 +22906,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_H if (free_op1.var) {zval_ptr_dtor(&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(); } else { zend_free_op free_res; zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr; @@ -23114,8 +22931,8 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_VAR_CV(ZEN zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + 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 (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { @@ -23161,7 +22978,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); @@ -23171,7 +22988,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL if (0) { MAKE_REAL_ZVAL_PTR(property); } - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an object"); } @@ -23210,8 +23027,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (0) { MAKE_REAL_ZVAL_PTR(property); @@ -23242,8 +23059,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + 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 (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { @@ -23279,15 +23096,15 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCOD { USE_OPLINE - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) { /* Behave like FETCH_OBJ_W */ zend_free_op free_op1; zval *property; zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (0) { MAKE_REAL_ZVAL_PTR(property); @@ -23320,8 +23137,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_H zval *property; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (IS_VAR == IS_CV) { if (container != &EG(uninitialized_zval_ptr)) { @@ -23363,8 +23180,8 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE zval *property_name; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - property_name = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); + property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (0) { MAKE_REAL_ZVAL_PTR(property_name); @@ -23372,7 +23189,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } - zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_OBJ, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); + zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); if (0) { zval_ptr_dtor(&property_name); } else { @@ -23392,19 +23209,19 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE zval **object_ptr; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(object_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } if (Z_TYPE_PP(object_ptr) == IS_OBJECT) { - zval *property_name = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + zval *property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (0) { MAKE_REAL_ZVAL_PTR(property_name); } - zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_DIM, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); + zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); if (0) { zval_ptr_dtor(&property_name); } else { @@ -23413,13 +23230,13 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE } else { zend_free_op free_op_data1, free_op_data2; zval *value; - zval *dim = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + zval *dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); zval **variable_ptr_ptr; zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), object_ptr, dim, IS_CV, BP_VAR_W TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + 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); if (UNEXPECTED(variable_ptr_ptr == NULL)) { if (zend_assign_to_string_offset(&EX_T((opline+1)->op2.var), value, (opline+1)->op1_type TSRMLS_CC)) { if (RETURN_VALUE_USED(opline)) { @@ -23473,8 +23290,8 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_AR zval **variable_ptr_ptr; SAVE_OPLINE(); - value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); - variable_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); + variable_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL)) { if (zend_assign_to_string_offset(&EX_T(opline->op1.var), value, IS_CV TSRMLS_CC)) { @@ -23528,7 +23345,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE zval **value_ptr_ptr; SAVE_OPLINE(); - value_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op2.var TSRMLS_CC); + value_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op2.var TSRMLS_CC); if (IS_CV == IS_VAR && value_ptr_ptr && @@ -23551,7 +23368,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE zend_error_noreturn(E_ERROR, "Cannot assign by reference to overloaded object"); } - variable_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + variable_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if ((IS_CV == IS_VAR && UNEXPECTED(value_ptr_ptr == NULL)) || (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL))) { zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects"); @@ -23580,11 +23397,11 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_ char *function_name_strval; int function_name_strlen; zend_free_op free_op1; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); - function_name = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (IS_CV != IS_CONST && UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { @@ -23594,49 +23411,51 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_ function_name_strval = Z_STRVAL_P(function_name); function_name_strlen = Z_STRLEN_P(function_name); - EX(object) = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + call->object = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - if (EXPECTED(EX(object) != NULL) && - EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) { - EX(called_scope) = Z_OBJCE_P(EX(object)); + if (EXPECTED(call->object != NULL) && + EXPECTED(Z_TYPE_P(call->object) == IS_OBJECT)) { + call->called_scope = Z_OBJCE_P(call->object); if (IS_CV != IS_CONST || - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) { - zval *object = EX(object); + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope)) == NULL) { + zval *object = call->object; - if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) { + if (UNEXPECTED(Z_OBJ_HT_P(call->object)->get_method == NULL)) { zend_error_noreturn(E_ERROR, "Object does not support method calls"); } /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_CV == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); - if (UNEXPECTED(EX(fbc) == NULL)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); + call->fbc = Z_OBJ_HT_P(call->object)->get_method(&call->object, function_name_strval, function_name_strlen, ((IS_CV == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + if (UNEXPECTED(call->fbc == NULL)) { + zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(call->object), function_name_strval); } if (IS_CV == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && - EXPECTED(EX(object) == object)) { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc)); + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && + EXPECTED(call->object == object)) { + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope, call->fbc); } } } else { zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); } - if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) { - EX(object) = NULL; + if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { + call->object = NULL; } else { - if (!PZVAL_IS_REF(EX(object))) { - Z_ADDREF_P(EX(object)); /* For $this pointer */ + if (!PZVAL_IS_REF(call->object)) { + Z_ADDREF_P(call->object); /* For $this pointer */ } else { zval *this_ptr; ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); + INIT_PZVAL_COPY(this_ptr, call->object); zval_copy_ctor(this_ptr); - EX(object) = this_ptr; + call->object = this_ptr; } } + call->is_ctor_call = 0; + EX(call) = call; if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; @@ -23649,9 +23468,9 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_ USE_OPLINE zval *function_name; zend_class_entry *ce; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); if (IS_VAR == IS_CONST) { /* no function found. try a static method in class */ @@ -23665,24 +23484,24 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_ } CACHE_PTR(opline->op1.literal->cache_slot, ce); } - EX(called_scope) = ce; + call->called_scope = ce; } else { ce = EX_T(opline->op1.var).class_entry; if (opline->extended_value == ZEND_FETCH_CLASS_PARENT || opline->extended_value == ZEND_FETCH_CLASS_SELF) { - EX(called_scope) = EG(called_scope); + call->called_scope = EG(called_scope); } else { - EX(called_scope) = ce; + call->called_scope = ce; } } if (IS_VAR == IS_CONST && IS_CV == IS_CONST && CACHED_PTR(opline->op2.literal->cache_slot)) { - EX(fbc) = CACHED_PTR(opline->op2.literal->cache_slot); + call->fbc = CACHED_PTR(opline->op2.literal->cache_slot); } else if (IS_VAR != IS_CONST && IS_CV == IS_CONST && - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) { + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce))) { /* do nothing */ } else if (IS_CV != IS_UNUSED) { char *function_name_strval = NULL; @@ -23693,7 +23512,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_ function_name_strval = Z_STRVAL_P(opline->op2.zv); function_name_strlen = Z_STRLEN_P(opline->op2.zv); } else { - function_name = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { zend_error_noreturn(E_ERROR, "Function name must be a string"); @@ -23705,20 +23524,20 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_ if (function_name_strval) { if (ce->get_static_method) { - EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); + call->fbc = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC); } else { - EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_CV == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + call->fbc = zend_std_get_static_method(ce, function_name_strval, function_name_strlen, ((IS_CV == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); } - if (UNEXPECTED(EX(fbc) == NULL)) { + if (UNEXPECTED(call->fbc == NULL)) { zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", ce->name, function_name_strval); } if (IS_CV == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) { + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0)) { if (IS_VAR == IS_CONST) { - CACHE_PTR(opline->op2.literal->cache_slot, EX(fbc)); + CACHE_PTR(opline->op2.literal->cache_slot, call->fbc); } else { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, EX(fbc)); + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce, call->fbc); } } } @@ -23732,29 +23551,31 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_ if (EG(This) && Z_OBJCE_P(EG(This)) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) { zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name); } - EX(fbc) = ce->constructor; + call->fbc = ce->constructor; } - if (EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) { - EX(object) = NULL; + if (call->fbc->common.fn_flags & ZEND_ACC_STATIC) { + call->object = NULL; } else { if (EG(This) && Z_OBJ_HT_P(EG(This))->get_class_entry && !instanceof_function(Z_OBJCE_P(EG(This)), ce TSRMLS_CC)) { /* We are calling method of the other (incompatible) class, but passing $this. This is done for compatibility with php-4. */ - if (EX(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", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); + 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); } 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", EX(fbc)->common.scope->name, EX(fbc)->common.function_name); + 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); } } - if ((EX(object) = EG(This))) { - Z_ADDREF_P(EX(object)); - EX(called_scope) = Z_OBJCE_P(EX(object)); + if ((call->object = EG(This))) { + Z_ADDREF_P(call->object); + call->called_scope = Z_OBJCE_P(call->object); } } + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -23770,8 +23591,8 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS 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, EX_Ts(), &free_op1 TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -23785,7 +23606,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE SAVE_OPLINE(); if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && opline->extended_value) { - zval **expr_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval **expr_ptr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets"); @@ -23794,7 +23615,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE expr_ptr = *expr_ptr_ptr; Z_ADDREF_P(expr_ptr); } else { - expr_ptr=_get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + expr_ptr=_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (0) { /* temporary variable */ zval *new_expr; @@ -23815,7 +23636,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CV_HANDLER(ZEND_OPCODE if (IS_CV != IS_UNUSED) { - zval *offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + zval *offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); ulong hval; switch (Z_TYPE_P(offset)) { @@ -23886,11 +23707,11 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER ulong hval; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { SEPARATE_ZVAL_IF_NOT_REF(container); } - offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (IS_VAR != IS_VAR || container) { switch (Z_TYPE_PP(container)) { @@ -23985,8 +23806,8 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); - offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + container = _get_zval_ptr_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 (IS_VAR != IS_VAR || container) { if (IS_VAR == IS_CV && container != &EG(uninitialized_zval_ptr)) { @@ -24029,9 +23850,9 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CV(int zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); - offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) { HashTable *ht; @@ -24205,7 +24026,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG zend_error(E_NOTICE, "Only variable references should be yielded by reference"); - value = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); ALLOC_ZVAL(copy); INIT_PZVAL_COPY(copy, value); @@ -24216,7 +24037,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG generator->value = copy; } else { - zval **value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval **value_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC); if (IS_VAR == IS_VAR && UNEXPECTED(value_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference"); @@ -24241,7 +24062,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } } else { - zval *value = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + 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 @@ -24274,7 +24095,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG /* Set the new yielded key */ if (IS_CV != IS_UNUSED) { - zval *key = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + zval *key = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR @@ -24314,8 +24135,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG generator->send_target = &EX_T(opline->result.var); /* Initialize the sent value to NULL */ - Z_ADDREF(EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).tmp_var = EG(uninitialized_zval); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ @@ -24420,7 +24240,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); zval *object; zval *property = opline->op2.zv; - zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); + zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); int have_get_ptr = 0; if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -24550,8 +24370,8 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_CONST(int (*bi zval *dim = opline->op2.zv; zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_CONST, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } } break; @@ -25045,7 +24865,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER(ZEND { USE_OPLINE - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) { /* Behave like FETCH_OBJ_W */ zend_free_op free_op1; zval *property; @@ -25137,7 +24957,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_ if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } - zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_OBJ, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); + zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); if (0) { zval_ptr_dtor(&property_name); } else { @@ -25203,9 +25023,9 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER(ZEND_O char *function_name_strval; int function_name_strlen; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); function_name = opline->op2.zv; @@ -25217,49 +25037,51 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER(ZEND_O function_name_strval = Z_STRVAL_P(function_name); function_name_strlen = Z_STRLEN_P(function_name); - EX(object) = _get_obj_zval_ptr_unused(TSRMLS_C); + call->object = _get_obj_zval_ptr_unused(TSRMLS_C); - if (EXPECTED(EX(object) != NULL) && - EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) { - EX(called_scope) = Z_OBJCE_P(EX(object)); + if (EXPECTED(call->object != NULL) && + EXPECTED(Z_TYPE_P(call->object) == IS_OBJECT)) { + call->called_scope = Z_OBJCE_P(call->object); if (IS_CONST != IS_CONST || - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) { - zval *object = EX(object); + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope)) == NULL) { + zval *object = call->object; - if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) { + if (UNEXPECTED(Z_OBJ_HT_P(call->object)->get_method == NULL)) { zend_error_noreturn(E_ERROR, "Object does not support method calls"); } /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_CONST == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); - if (UNEXPECTED(EX(fbc) == NULL)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); + call->fbc = Z_OBJ_HT_P(call->object)->get_method(&call->object, function_name_strval, function_name_strlen, ((IS_CONST == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + if (UNEXPECTED(call->fbc == NULL)) { + zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(call->object), function_name_strval); } if (IS_CONST == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && - EXPECTED(EX(object) == object)) { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc)); + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && + EXPECTED(call->object == object)) { + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope, call->fbc); } } } else { zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); } - if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) { - EX(object) = NULL; + if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { + call->object = NULL; } else { - if (!PZVAL_IS_REF(EX(object))) { - Z_ADDREF_P(EX(object)); /* For $this pointer */ + if (!PZVAL_IS_REF(call->object)) { + Z_ADDREF_P(call->object); /* For $this pointer */ } else { zval *this_ptr; ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); + INIT_PZVAL_COPY(this_ptr, call->object); zval_copy_ctor(this_ptr); - EX(object) = this_ptr; + call->object = this_ptr; } } + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); @@ -25803,8 +25625,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDL generator->send_target = &EX_T(opline->result.var); /* Initialize the sent value to NULL */ - Z_ADDREF(EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).tmp_var = EG(uninitialized_zval); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ @@ -25823,8 +25644,8 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (* zend_free_op free_op2, free_op_data1; zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); zval *object; - zval *property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); - zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); + zval *property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); int have_get_ptr = 0; if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -25951,16 +25772,16 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_TMP(int (*bina } return zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } else { - zval *dim = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *dim = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_TMP_VAR, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } } break; default: - value = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + value = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); var_ptr = NULL; /* do nothing */ break; @@ -26085,7 +25906,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(incdec_ SAVE_OPLINE(); object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); retval = &EX_T(opline->result.var).var.ptr; if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -26189,7 +26010,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_TMP(incdec SAVE_OPLINE(); object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); retval = &EX_T(opline->result.var).tmp_var; if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -26289,7 +26110,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_TMP SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(TSRMLS_C); - offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { @@ -26334,7 +26155,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_H zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_UNUSED == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); @@ -26382,7 +26203,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_ zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); if (1) { @@ -26415,7 +26236,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_ SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(TSRMLS_C); - offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { @@ -26450,14 +26271,14 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMP_HANDLER(ZEND_O { USE_OPLINE - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) { /* Behave like FETCH_OBJ_W */ zend_free_op free_op1, free_op2; zval *property; zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); if (1) { @@ -26492,7 +26313,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCO SAVE_OPLINE(); container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_UNUSED == IS_CV) { if (container != &EG(uninitialized_zval_ptr)) { @@ -26534,7 +26355,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HA SAVE_OPLINE(); object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - property_name = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + property_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (1) { MAKE_REAL_ZVAL_PTR(property_name); @@ -26542,7 +26363,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HA if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } - zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_OBJ, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); + zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); if (1) { zval_ptr_dtor(&property_name); } else { @@ -26565,7 +26386,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDL int use_copy = 0; SAVE_OPLINE(); - var = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + var = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_UNUSED == IS_UNUSED) { /* Initialize for erealloc in add_string_to_string */ @@ -26607,11 +26428,11 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPC char *function_name_strval; int function_name_strlen; zend_free_op free_op2; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); - function_name = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + function_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_TMP_VAR != IS_CONST && UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { @@ -26621,49 +26442,51 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPC function_name_strval = Z_STRVAL_P(function_name); function_name_strlen = Z_STRLEN_P(function_name); - EX(object) = _get_obj_zval_ptr_unused(TSRMLS_C); + call->object = _get_obj_zval_ptr_unused(TSRMLS_C); - if (EXPECTED(EX(object) != NULL) && - EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) { - EX(called_scope) = Z_OBJCE_P(EX(object)); + if (EXPECTED(call->object != NULL) && + EXPECTED(Z_TYPE_P(call->object) == IS_OBJECT)) { + call->called_scope = Z_OBJCE_P(call->object); if (IS_TMP_VAR != IS_CONST || - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) { - zval *object = EX(object); + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope)) == NULL) { + zval *object = call->object; - if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) { + if (UNEXPECTED(Z_OBJ_HT_P(call->object)->get_method == NULL)) { zend_error_noreturn(E_ERROR, "Object does not support method calls"); } /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_TMP_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); - if (UNEXPECTED(EX(fbc) == NULL)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); + call->fbc = Z_OBJ_HT_P(call->object)->get_method(&call->object, function_name_strval, function_name_strlen, ((IS_TMP_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + if (UNEXPECTED(call->fbc == NULL)) { + zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(call->object), function_name_strval); } if (IS_TMP_VAR == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && - EXPECTED(EX(object) == object)) { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc)); + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && + EXPECTED(call->object == object)) { + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope, call->fbc); } } } else { zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); } - if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) { - EX(object) = NULL; + if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { + call->object = NULL; } else { - if (!PZVAL_IS_REF(EX(object))) { - Z_ADDREF_P(EX(object)); /* For $this pointer */ + if (!PZVAL_IS_REF(call->object)) { + Z_ADDREF_P(call->object); /* For $this pointer */ } else { zval *this_ptr; ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); + INIT_PZVAL_COPY(this_ptr, call->object); zval_copy_ctor(this_ptr); - EX(object) = this_ptr; + call->object = this_ptr; } } + call->is_ctor_call = 0; + EX(call) = call; zval_dtor(free_op2.var); @@ -26698,7 +26521,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HAN if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { SEPARATE_ZVAL_IF_NOT_REF(container); } - offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_UNUSED != IS_VAR || container) { switch (Z_TYPE_PP(container)) { @@ -26793,7 +26616,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HAN SAVE_OPLINE(); container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_UNUSED != IS_VAR || container) { if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { @@ -26837,7 +26660,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_TMP SAVE_OPLINE(); container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) { HashTable *ht; @@ -27076,7 +26899,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER /* Set the new yielded key */ if (IS_TMP_VAR != IS_UNUSED) { zend_free_op free_op2; - zval *key = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *key = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR @@ -27116,8 +26939,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER generator->send_target = &EX_T(opline->result.var); /* Initialize the sent value to NULL */ - Z_ADDREF(EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).tmp_var = EG(uninitialized_zval); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ @@ -27136,8 +26958,8 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (* zend_free_op free_op2, free_op_data1; zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); zval *object; - zval *property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); - zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); + zval *property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); int have_get_ptr = 0; if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -27264,16 +27086,16 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_VAR(int (*bina } return zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } else { - zval *dim = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *dim = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_VAR, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } } break; default: - value = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + value = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); var_ptr = NULL; /* do nothing */ break; @@ -27398,7 +27220,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(incdec_ SAVE_OPLINE(); object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); retval = &EX_T(opline->result.var).var.ptr; if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -27502,7 +27324,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_VAR(incdec SAVE_OPLINE(); object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); retval = &EX_T(opline->result.var).tmp_var; if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -27602,7 +27424,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_VAR SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(TSRMLS_C); - offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { @@ -27647,7 +27469,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_H zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_UNUSED == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); @@ -27695,7 +27517,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_ zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); if (0) { @@ -27728,7 +27550,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_ SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(TSRMLS_C); - offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { @@ -27763,14 +27585,14 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_VAR_HANDLER(ZEND_O { USE_OPLINE - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) { /* Behave like FETCH_OBJ_W */ zend_free_op free_op1, free_op2; zval *property; zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); if (0) { @@ -27805,7 +27627,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCO SAVE_OPLINE(); container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_UNUSED == IS_CV) { if (container != &EG(uninitialized_zval_ptr)) { @@ -27847,7 +27669,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HA SAVE_OPLINE(); object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - property_name = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (0) { MAKE_REAL_ZVAL_PTR(property_name); @@ -27855,7 +27677,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HA if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } - zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_OBJ, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); + zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); if (0) { zval_ptr_dtor(&property_name); } else { @@ -27878,7 +27700,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDL int use_copy = 0; SAVE_OPLINE(); - var = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + var = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_UNUSED == IS_UNUSED) { /* Initialize for erealloc in add_string_to_string */ @@ -27920,11 +27742,11 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPC char *function_name_strval; int function_name_strlen; zend_free_op free_op2; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); - function_name = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + function_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_VAR != IS_CONST && UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { @@ -27934,49 +27756,51 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPC function_name_strval = Z_STRVAL_P(function_name); function_name_strlen = Z_STRLEN_P(function_name); - EX(object) = _get_obj_zval_ptr_unused(TSRMLS_C); + call->object = _get_obj_zval_ptr_unused(TSRMLS_C); - if (EXPECTED(EX(object) != NULL) && - EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) { - EX(called_scope) = Z_OBJCE_P(EX(object)); + if (EXPECTED(call->object != NULL) && + EXPECTED(Z_TYPE_P(call->object) == IS_OBJECT)) { + call->called_scope = Z_OBJCE_P(call->object); if (IS_VAR != IS_CONST || - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) { - zval *object = EX(object); + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope)) == NULL) { + zval *object = call->object; - if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) { + if (UNEXPECTED(Z_OBJ_HT_P(call->object)->get_method == NULL)) { zend_error_noreturn(E_ERROR, "Object does not support method calls"); } /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); - if (UNEXPECTED(EX(fbc) == NULL)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); + call->fbc = Z_OBJ_HT_P(call->object)->get_method(&call->object, function_name_strval, function_name_strlen, ((IS_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + if (UNEXPECTED(call->fbc == NULL)) { + zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(call->object), function_name_strval); } if (IS_VAR == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && - EXPECTED(EX(object) == object)) { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc)); + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && + EXPECTED(call->object == object)) { + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope, call->fbc); } } } else { zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); } - if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) { - EX(object) = NULL; + if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { + call->object = NULL; } else { - if (!PZVAL_IS_REF(EX(object))) { - Z_ADDREF_P(EX(object)); /* For $this pointer */ + if (!PZVAL_IS_REF(call->object)) { + Z_ADDREF_P(call->object); /* For $this pointer */ } else { zval *this_ptr; ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); + INIT_PZVAL_COPY(this_ptr, call->object); zval_copy_ctor(this_ptr); - EX(object) = this_ptr; + call->object = this_ptr; } } + call->is_ctor_call = 0; + EX(call) = call; if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; @@ -28011,7 +27835,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { SEPARATE_ZVAL_IF_NOT_REF(container); } - offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_UNUSED != IS_VAR || container) { switch (Z_TYPE_PP(container)) { @@ -28106,7 +27930,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN SAVE_OPLINE(); container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_UNUSED != IS_VAR || container) { if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { @@ -28150,7 +27974,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR SAVE_OPLINE(); container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) { HashTable *ht; @@ -28389,7 +28213,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER /* Set the new yielded key */ if (IS_VAR != IS_UNUSED) { zend_free_op free_op2; - zval *key = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *key = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR @@ -28430,8 +28254,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER generator->send_target = &EX_T(opline->result.var); /* Initialize the sent value to NULL */ - Z_ADDREF(EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).tmp_var = EG(uninitialized_zval); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ @@ -28451,7 +28274,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); zval *object; zval *property = NULL; - zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); + zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); int have_get_ptr = 0; if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -28581,8 +28404,8 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_UNUSED(int (*b zval *dim = NULL; zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_UNUSED, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } } break; @@ -28853,8 +28676,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HAND generator->send_target = &EX_T(opline->result.var); /* Initialize the sent value to NULL */ - Z_ADDREF(EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).tmp_var = EG(uninitialized_zval); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ @@ -28873,8 +28695,8 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*b zend_free_op free_op_data1; zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); zval *object; - zval *property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); - zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); + zval *property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); + zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); int have_get_ptr = 0; if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -29001,16 +28823,16 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_UNUSED_CV(int (*binar } return zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } else { - zval *dim = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + zval *dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_CV, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } } break; default: - value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); var_ptr = NULL; /* do nothing */ break; @@ -29134,7 +28956,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CV(incdec_t SAVE_OPLINE(); object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); retval = &EX_T(opline->result.var).var.ptr; if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -29238,7 +29060,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CV(incdec_ SAVE_OPLINE(); object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); retval = &EX_T(opline->result.var).tmp_var; if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -29338,7 +29160,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_UNUSED_CV( SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(TSRMLS_C); - offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { @@ -29383,7 +29205,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HA zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (IS_UNUSED == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); @@ -29431,7 +29253,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_H zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); if (0) { @@ -29464,7 +29286,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_H SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(TSRMLS_C); - offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { @@ -29499,14 +29321,14 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV_HANDLER(ZEND_OP { USE_OPLINE - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) { /* Behave like FETCH_OBJ_W */ zend_free_op free_op1; zval *property; zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); if (0) { @@ -29541,7 +29363,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV_HANDLER(ZEND_OPCOD SAVE_OPLINE(); container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (IS_UNUSED == IS_CV) { if (container != &EG(uninitialized_zval_ptr)) { @@ -29583,7 +29405,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAN SAVE_OPLINE(); object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - property_name = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (0) { MAKE_REAL_ZVAL_PTR(property_name); @@ -29591,7 +29413,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAN if (IS_UNUSED == IS_VAR && UNEXPECTED(object_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } - zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_OBJ, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); + zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); if (0) { zval_ptr_dtor(&property_name); } else { @@ -29614,7 +29436,7 @@ static int ZEND_FASTCALL ZEND_ADD_VAR_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLE int use_copy = 0; SAVE_OPLINE(); - var = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + var = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (IS_UNUSED == IS_UNUSED) { /* Initialize for erealloc in add_string_to_string */ @@ -29655,11 +29477,11 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCO char *function_name_strval; int function_name_strlen; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); - function_name = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (IS_CV != IS_CONST && UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { @@ -29669,49 +29491,51 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCO function_name_strval = Z_STRVAL_P(function_name); function_name_strlen = Z_STRLEN_P(function_name); - EX(object) = _get_obj_zval_ptr_unused(TSRMLS_C); + call->object = _get_obj_zval_ptr_unused(TSRMLS_C); - if (EXPECTED(EX(object) != NULL) && - EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) { - EX(called_scope) = Z_OBJCE_P(EX(object)); + if (EXPECTED(call->object != NULL) && + EXPECTED(Z_TYPE_P(call->object) == IS_OBJECT)) { + call->called_scope = Z_OBJCE_P(call->object); if (IS_CV != IS_CONST || - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) { - zval *object = EX(object); + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope)) == NULL) { + zval *object = call->object; - if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) { + if (UNEXPECTED(Z_OBJ_HT_P(call->object)->get_method == NULL)) { zend_error_noreturn(E_ERROR, "Object does not support method calls"); } /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_CV == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); - if (UNEXPECTED(EX(fbc) == NULL)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); + call->fbc = Z_OBJ_HT_P(call->object)->get_method(&call->object, function_name_strval, function_name_strlen, ((IS_CV == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + if (UNEXPECTED(call->fbc == NULL)) { + zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(call->object), function_name_strval); } if (IS_CV == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && - EXPECTED(EX(object) == object)) { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc)); + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && + EXPECTED(call->object == object)) { + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope, call->fbc); } } } else { zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); } - if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) { - EX(object) = NULL; + if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { + call->object = NULL; } else { - if (!PZVAL_IS_REF(EX(object))) { - Z_ADDREF_P(EX(object)); /* For $this pointer */ + if (!PZVAL_IS_REF(call->object)) { + Z_ADDREF_P(call->object); /* For $this pointer */ } else { zval *this_ptr; ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); + INIT_PZVAL_COPY(this_ptr, call->object); zval_copy_ctor(this_ptr); - EX(object) = this_ptr; + call->object = this_ptr; } } + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); @@ -29745,7 +29569,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { SEPARATE_ZVAL_IF_NOT_REF(container); } - offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (IS_UNUSED != IS_VAR || container) { switch (Z_TYPE_PP(container)) { @@ -29840,7 +29664,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND SAVE_OPLINE(); container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (IS_UNUSED != IS_VAR || container) { if (IS_UNUSED == IS_CV && container != &EG(uninitialized_zval_ptr)) { @@ -29884,7 +29708,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CV( SAVE_OPLINE(); container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C); - offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) { HashTable *ht; @@ -30123,7 +29947,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ /* Set the new yielded key */ if (IS_CV != IS_UNUSED) { - zval *key = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + zval *key = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR @@ -30163,8 +29987,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ generator->send_target = &EX_T(opline->result.var); /* Initialize the sent value to NULL */ - Z_ADDREF(EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).tmp_var = EG(uninitialized_zval); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ @@ -30184,7 +30007,7 @@ static int ZEND_FASTCALL ZEND_BW_NOT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); bitwise_not_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC) TSRMLS_CC); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -30197,7 +30020,7 @@ static int ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); boolean_not_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC) TSRMLS_CC); + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC) TSRMLS_CC); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -30210,7 +30033,7 @@ static int ZEND_FASTCALL ZEND_PRE_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zval **var_ptr; SAVE_OPLINE(); - var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); @@ -30256,7 +30079,7 @@ static int ZEND_FASTCALL ZEND_PRE_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zval **var_ptr; SAVE_OPLINE(); - var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); @@ -30302,7 +30125,7 @@ static int ZEND_FASTCALL ZEND_POST_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS zval **var_ptr, *retval; SAVE_OPLINE(); - var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); @@ -30344,7 +30167,7 @@ static int ZEND_FASTCALL ZEND_POST_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS zval **var_ptr, *retval; SAVE_OPLINE(); - var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(var_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); @@ -30387,7 +30210,7 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zval *z; SAVE_OPLINE(); - z = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + z = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV != IS_CONST && UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && @@ -30425,7 +30248,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) int ret; SAVE_OPLINE(); - val = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + val = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { ret = Z_LVAL_P(val); @@ -30455,7 +30278,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) int ret; SAVE_OPLINE(); - val = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + val = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { ret = Z_LVAL_P(val); @@ -30485,7 +30308,7 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) int retval; SAVE_OPLINE(); - val = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + val = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { retval = Z_LVAL_P(val); @@ -30519,7 +30342,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) int retval; SAVE_OPLINE(); - val = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + val = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { retval = Z_LVAL_P(val); @@ -30550,7 +30373,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS int retval; SAVE_OPLINE(); - val = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + val = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) { retval = Z_LVAL_P(val); @@ -30580,7 +30403,7 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); - retval_ptr = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + 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) { @@ -30620,10 +30443,7 @@ static int ZEND_FASTCALL ZEND_RETURN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) *EG(return_value_ptr_ptr) = ret; } - if (EXPECTED(!EX(op_array)->has_finally_block)) { - return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - return zend_finally_handler_leaving_SPEC(ZEND_RETURN, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) @@ -30644,7 +30464,7 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER /* 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_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + 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) { @@ -30666,7 +30486,7 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER break; } - retval_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + retval_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(retval_ptr_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot return string offsets by reference"); @@ -30694,10 +30514,7 @@ static int ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER } } while (0); - if (EXPECTED(!EX(op_array)->has_finally_block)) { - return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); - } - return zend_finally_handler_leaving_SPEC(ZEND_RETURN_BY_REF, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } static int ZEND_FASTCALL ZEND_THROW_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) @@ -30708,7 +30525,7 @@ static int ZEND_FASTCALL ZEND_THROW_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); - value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_CONST || UNEXPECTED(Z_TYPE_P(value) != IS_OBJECT)) { zend_error_noreturn(E_ERROR, "Can only throw objects"); @@ -30732,7 +30549,7 @@ static int ZEND_FASTCALL zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARG USE_OPLINE zval *varptr; - varptr = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + varptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (varptr == &EG(uninitialized_zval)) { ALLOC_ZVAL(varptr); @@ -30766,7 +30583,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) { return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } - } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) { + } else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) { return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } @@ -30777,7 +30594,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL varptr = EX_T(opline->op1.var).var.ptr; PZVAL_UNLOCK_EX(varptr, &free_op1, 0); } else { - varptr = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), 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) && @@ -30792,7 +30609,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ? !(opline->extended_value & ZEND_ARG_SEND_SILENT) : - !ARG_MAY_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) { + !ARG_MAY_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) { zend_error(E_STRICT, "Only variables should be passed by reference"); } ALLOC_ZVAL(valptr); @@ -30815,7 +30632,7 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS zval *varptr; SAVE_OPLINE(); - varptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + varptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(varptr_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Only variables can be passed by reference"); @@ -30828,7 +30645,7 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS ZEND_VM_NEXT_OPCODE(); } - if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) { + if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) { return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } @@ -30846,7 +30663,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS USE_OPLINE if ((opline->extended_value == ZEND_DO_FCALL_BY_NAME) - && ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.opline_num)) { + && ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.opline_num)) { return ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } SAVE_OPLINE(); @@ -30861,7 +30678,7 @@ static int ZEND_FASTCALL ZEND_BOOL_SPEC_CV_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_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC))); + ZVAL_BOOL(retval, i_zend_is_true(_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC))); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -30877,7 +30694,7 @@ static int ZEND_FASTCALL ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zend_object_clone_obj_t clone_call; SAVE_OPLINE(); - obj = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + obj = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_CONST || UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT)) { @@ -30938,7 +30755,7 @@ static int ZEND_FASTCALL ZEND_CAST_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zval *result = &EX_T(opline->result.var).tmp_var; SAVE_OPLINE(); - expr = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + expr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (opline->extended_value != IS_STRING) { ZVAL_COPY_VALUE(result, expr); @@ -30999,7 +30816,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL zend_bool failure_retval=0; SAVE_OPLINE(); - inc_filename = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + inc_filename = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (inc_filename->type!=IS_STRING) { MAKE_STD_ZVAL(tmp_inc_filename); @@ -31087,8 +30904,6 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL EG(return_value_ptr_ptr) = NULL; } - EX(current_object) = EX(object); - EX(function_state).function = (zend_function *) new_op_array; EX(object) = NULL; @@ -31096,14 +30911,13 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL zend_rebuild_symbol_table(TSRMLS_C); } - if (EXPECTED(zend_execute == execute)) { + if (EXPECTED(zend_execute_ex == execute_ex)) { ZEND_VM_ENTER(); } else { zend_execute(new_op_array TSRMLS_CC); } EX(function_state).function = (zend_function *) EX(op_array); - EX(object) = EX(current_object); EG(opline_ptr) = &EX(opline); EG(active_op_array) = EX(op_array); @@ -31113,15 +30927,6 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL if (UNEXPECTED(EG(exception) != NULL)) { zend_throw_exception_internal(NULL TSRMLS_CC); HANDLE_EXCEPTION(); - } else if (RETURN_VALUE_USED(opline)) { - if (!EX_T(opline->result.var).var.ptr) { /* there was no return statement */ - zval *retval; - - ALLOC_ZVAL(retval); - ZVAL_BOOL(retval, 1); - INIT_PZVAL(retval); - EX_T(opline->result.var).var.ptr = retval; - } } } else if (RETURN_VALUE_USED(opline)) { @@ -31149,7 +30954,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS if ((IS_CV == IS_CV || IS_CV == IS_VAR) && (opline->extended_value & ZEND_FE_RESET_VARIABLE)) { - array_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + array_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (array_ptr_ptr == NULL || array_ptr_ptr == &EG(uninitialized_zval_ptr)) { MAKE_STD_ZVAL(array_ptr); ZVAL_NULL(array_ptr); @@ -31176,7 +30981,7 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS Z_ADDREF_P(array_ptr); } } else { - array_ptr = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + array_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (0) { /* IS_TMP_VAR */ zval *tmp; @@ -31285,7 +31090,7 @@ static int ZEND_FASTCALL ZEND_EXIT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); if (IS_CV != IS_UNUSED) { - zval *ptr = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + zval *ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (Z_TYPE_P(ptr) == IS_LONG) { EG(exit_status) = Z_LVAL_P(ptr); @@ -31306,7 +31111,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) zval *value; SAVE_OPLINE(); - value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (i_zend_is_true(value)) { ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, value); @@ -31331,7 +31136,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_A zval *value, *ret; SAVE_OPLINE(); - value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (i_zend_is_true(value)) { if (IS_CV == IS_VAR || IS_CV == IS_CV) { @@ -31365,7 +31170,7 @@ static int ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG zval *value; SAVE_OPLINE(); - value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, value); if (!0) { @@ -31383,7 +31188,7 @@ static int ZEND_FASTCALL ZEND_QM_ASSIGN_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER zval *value, *ret; SAVE_OPLINE(); - value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR || IS_CV == IS_CV) { Z_ADDREF_P(value); @@ -31411,7 +31216,7 @@ static int ZEND_FASTCALL ZEND_INSTANCEOF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_AR zend_bool result; SAVE_OPLINE(); - expr = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + expr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->get_class_entry) { result = instanceof_function(Z_OBJCE_P(expr), EX_T(opline->op2.var).class_entry TSRMLS_CC); @@ -31431,7 +31236,7 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); fast_add_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), opline->op2.zv TSRMLS_CC); @@ -31446,7 +31251,7 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); fast_sub_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), opline->op2.zv TSRMLS_CC); @@ -31461,7 +31266,7 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); fast_mul_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), opline->op2.zv TSRMLS_CC); @@ -31476,7 +31281,7 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); fast_div_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), opline->op2.zv TSRMLS_CC); @@ -31491,7 +31296,7 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); fast_mod_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), opline->op2.zv TSRMLS_CC); @@ -31506,7 +31311,7 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); shift_left_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), opline->op2.zv TSRMLS_CC); @@ -31521,7 +31326,7 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); shift_right_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), opline->op2.zv TSRMLS_CC); @@ -31536,7 +31341,7 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ SAVE_OPLINE(); concat_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), opline->op2.zv TSRMLS_CC); @@ -31551,7 +31356,7 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HA SAVE_OPLINE(); is_identical_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), opline->op2.zv TSRMLS_CC); @@ -31567,7 +31372,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST_HANDLER(ZEND_OPCOD SAVE_OPLINE(); is_identical_function(result, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), opline->op2.zv TSRMLS_CC); Z_LVAL_P(result) = !Z_LVAL_P(result); @@ -31584,7 +31389,7 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLE SAVE_OPLINE(); ZVAL_BOOL(result, fast_equal_function(result, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), opline->op2.zv TSRMLS_CC)); @@ -31600,7 +31405,7 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HA SAVE_OPLINE(); ZVAL_BOOL(result, fast_not_equal_function(result, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), opline->op2.zv TSRMLS_CC)); @@ -31616,7 +31421,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAND SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_function(result, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), opline->op2.zv TSRMLS_CC)); @@ -31632,7 +31437,7 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OP SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), opline->op2.zv TSRMLS_CC)); @@ -31647,7 +31452,7 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_A SAVE_OPLINE(); bitwise_or_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), opline->op2.zv TSRMLS_CC); @@ -31662,7 +31467,7 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ SAVE_OPLINE(); bitwise_and_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), opline->op2.zv TSRMLS_CC); @@ -31677,7 +31482,7 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ SAVE_OPLINE(); bitwise_xor_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), opline->op2.zv TSRMLS_CC); @@ -31692,7 +31497,7 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLE SAVE_OPLINE(); boolean_xor_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), opline->op2.zv TSRMLS_CC); @@ -31704,10 +31509,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*bi { USE_OPLINE zend_free_op free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + zval **object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); zval *object; zval *property = opline->op2.zv; - zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); + zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); int have_get_ptr = 0; if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -31824,7 +31629,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_CONST(int (*binary return zend_binary_assign_op_obj_helper_SPEC_CV_CONST(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); break; case ZEND_ASSIGN_DIM: { - zval **container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + zval **container = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); @@ -31837,14 +31642,14 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_CONST(int (*binary zval *dim = opline->op2.zv; zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_CONST, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } } break; default: value = opline->op2.zv; - var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); /* do nothing */ break; } @@ -31966,7 +31771,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CONST(incdec_t int have_get_ptr = 0; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); property = opline->op2.zv; retval = &EX_T(opline->result.var).var.ptr; @@ -32070,7 +31875,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CONST(incdec_t int have_get_ptr = 0; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); property = opline->op2.zv; retval = &EX_T(opline->result.var).tmp_var; @@ -32172,7 +31977,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_CONST(int type, Z ulong hash_value; SAVE_OPLINE(); - varname = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + varname = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV != IS_CONST && UNEXPECTED(Z_TYPE_P(varname) != IS_STRING)) { ZVAL_COPY_VALUE(&tmp_varname, varname); @@ -32312,7 +32117,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_ { USE_OPLINE - return zend_fetch_var_address_helper_SPEC_CV_CONST(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return zend_fetch_var_address_helper_SPEC_CV_CONST(ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS) @@ -32340,12 +32145,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN } if (IS_CV == IS_TMP_VAR || IS_CV == IS_CONST) { - zval *container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + zval *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); } else { - container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_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); @@ -32362,7 +32167,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); @@ -32395,7 +32200,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HA zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); @@ -32417,7 +32222,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HA zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_IS(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_IS TSRMLS_CC); @@ -32433,8 +32238,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPC SAVE_OPLINE(); - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { - container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) { + container = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } @@ -32446,7 +32251,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPC if (IS_CONST == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_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); } @@ -32462,7 +32267,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_CV) { if (container != &EG(uninitialized_zval_ptr)) { @@ -32480,6 +32285,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE if (UNEXPECTED(EX_T(opline->result.var).var.ptr_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); + ZEND_VM_NEXT_OPCODE(); } else { zend_free_op free_res; zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr; @@ -32504,7 +32310,7 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_CONST(Z zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); offset = opline->op2.zv; if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || @@ -32560,7 +32366,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN if (0) { MAKE_REAL_ZVAL_PTR(property); } - container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an object"); } @@ -32599,7 +32405,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HA SAVE_OPLINE(); property = opline->op2.zv; - container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); if (0) { MAKE_REAL_ZVAL_PTR(property); @@ -32630,7 +32436,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HA zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC); offset = opline->op2.zv; if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || @@ -32666,7 +32472,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPC { USE_OPLINE - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) { /* Behave like FETCH_OBJ_W */ zend_free_op free_op1; zval *property; @@ -32674,7 +32480,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPC SAVE_OPLINE(); property = opline->op2.zv; - container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (0) { MAKE_REAL_ZVAL_PTR(property); @@ -32707,7 +32513,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE zval *property; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC); property = opline->op2.zv; if (IS_CV == IS_CV) { @@ -32749,7 +32555,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAND zval *property_name; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); property_name = opline->op2.zv; if (0) { @@ -32758,7 +32564,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAND if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } - zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_OBJ, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); + zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); if (0) { zval_ptr_dtor(&property_name); } else { @@ -32778,7 +32584,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAND zval **object_ptr; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); @@ -32790,7 +32596,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAND if (0) { MAKE_REAL_ZVAL_PTR(property_name); } - zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_DIM, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); + zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); if (0) { zval_ptr_dtor(&property_name); } else { @@ -32804,8 +32610,8 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAND zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), object_ptr, dim, IS_CONST, BP_VAR_W TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + 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); if (UNEXPECTED(variable_ptr_ptr == NULL)) { if (zend_assign_to_string_offset(&EX_T((opline+1)->op2.var), value, (opline+1)->op1_type TSRMLS_CC)) { if (RETURN_VALUE_USED(opline)) { @@ -32860,7 +32666,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ SAVE_OPLINE(); value = opline->op2.zv; - variable_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + variable_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL)) { if (zend_assign_to_string_offset(&EX_T(opline->op1.var), value, IS_CONST TSRMLS_CC)) { @@ -32911,9 +32717,9 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CONST_HANDLER(ZEND_OPCOD char *function_name_strval; int function_name_strlen; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); function_name = opline->op2.zv; @@ -32925,49 +32731,51 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CONST_HANDLER(ZEND_OPCOD function_name_strval = Z_STRVAL_P(function_name); function_name_strlen = Z_STRLEN_P(function_name); - EX(object) = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + call->object = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); - if (EXPECTED(EX(object) != NULL) && - EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) { - EX(called_scope) = Z_OBJCE_P(EX(object)); + if (EXPECTED(call->object != NULL) && + EXPECTED(Z_TYPE_P(call->object) == IS_OBJECT)) { + call->called_scope = Z_OBJCE_P(call->object); if (IS_CONST != IS_CONST || - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) { - zval *object = EX(object); + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope)) == NULL) { + zval *object = call->object; - if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) { + if (UNEXPECTED(Z_OBJ_HT_P(call->object)->get_method == NULL)) { zend_error_noreturn(E_ERROR, "Object does not support method calls"); } /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_CONST == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); - if (UNEXPECTED(EX(fbc) == NULL)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); + call->fbc = Z_OBJ_HT_P(call->object)->get_method(&call->object, function_name_strval, function_name_strlen, ((IS_CONST == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + if (UNEXPECTED(call->fbc == NULL)) { + zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(call->object), function_name_strval); } if (IS_CONST == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && - EXPECTED(EX(object) == object)) { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc)); + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && + EXPECTED(call->object == object)) { + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope, call->fbc); } } } else { zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); } - if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) { - EX(object) = NULL; + if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { + call->object = NULL; } else { - if (!PZVAL_IS_REF(EX(object))) { - Z_ADDREF_P(EX(object)); /* For $this pointer */ + if (!PZVAL_IS_REF(call->object)) { + Z_ADDREF_P(call->object); /* For $this pointer */ } else { zval *this_ptr; ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); + INIT_PZVAL_COPY(this_ptr, call->object); zval_copy_ctor(this_ptr); - EX(object) = this_ptr; + call->object = this_ptr; } } + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); @@ -32984,7 +32792,7 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR 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(EX_CVs(), opline->op1.var TSRMLS_CC), + _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC), opline->op2.zv TSRMLS_CC); CHECK_EXCEPTION(); @@ -32999,7 +32807,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCO SAVE_OPLINE(); if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) { - zval **expr_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + zval **expr_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets"); @@ -33008,7 +32816,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCO expr_ptr = *expr_ptr_ptr; Z_ADDREF_P(expr_ptr); } else { - expr_ptr=_get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + expr_ptr=_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (0) { /* temporary variable */ zval *new_expr; @@ -33115,7 +32923,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL ZEND_VM_NEXT_OPCODE(); } - varname = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + varname = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_COPY_VALUE(&tmp, varname); @@ -33176,7 +32984,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL ulong hval; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { SEPARATE_ZVAL_IF_NOT_REF(container); } @@ -33274,7 +33082,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC); offset = opline->op2.zv; if (IS_CV != IS_VAR || container) { @@ -33330,7 +33138,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCO } else { HashTable *target_symbol_table; - zval tmp, *varname = _get_zval_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC); + zval tmp, *varname = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_COPY_VALUE(&tmp, varname); @@ -33402,7 +33210,7 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CONST(i zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC); offset = opline->op2.zv; @@ -33576,7 +33384,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_A zend_error(E_NOTICE, "Only variable references should be yielded by reference"); - value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); ALLOC_ZVAL(copy); INIT_PZVAL_COPY(copy, value); @@ -33587,7 +33395,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_A generator->value = copy; } else { - zval **value_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + zval **value_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(value_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference"); @@ -33611,7 +33419,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_A } } else { - zval *value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + zval *value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR @@ -33683,8 +33491,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_A generator->send_target = &EX_T(opline->result.var); /* Initialize the sent value to NULL */ - Z_ADDREF(EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).tmp_var = EG(uninitialized_zval); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ @@ -33704,8 +33511,8 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); fast_add_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -33719,8 +33526,8 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); fast_sub_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -33734,8 +33541,8 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); fast_mul_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -33749,8 +33556,8 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); fast_div_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -33764,8 +33571,8 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); fast_mod_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -33779,8 +33586,8 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); shift_left_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -33794,8 +33601,8 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); shift_right_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -33809,8 +33616,8 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); concat_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -33824,8 +33631,8 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND SAVE_OPLINE(); is_identical_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -33840,8 +33647,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_ SAVE_OPLINE(); is_identical_function(result, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); Z_LVAL_P(result) = !Z_LVAL_P(result); zval_dtor(free_op2.var); @@ -33857,8 +33664,8 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ SAVE_OPLINE(); ZVAL_BOOL(result, fast_equal_function(result, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _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)); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -33873,8 +33680,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND SAVE_OPLINE(); ZVAL_BOOL(result, fast_not_equal_function(result, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _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)); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -33889,8 +33696,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLE SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_function(result, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _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)); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -33905,8 +33712,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_TMP_HANDLER(ZEND_OPCO SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _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)); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -33920,8 +33727,8 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); bitwise_or_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -33935,8 +33742,8 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); bitwise_and_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -33950,8 +33757,8 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); bitwise_xor_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -33965,8 +33772,8 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ SAVE_OPLINE(); boolean_xor_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -33977,10 +33784,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMP(int (*bina { USE_OPLINE zend_free_op free_op2, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + zval **object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); zval *object; - zval *property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); - zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); + zval *property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); int have_get_ptr = 0; if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -34097,7 +33904,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_TMP(int (*binary_o return zend_binary_assign_op_obj_helper_SPEC_CV_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); break; case ZEND_ASSIGN_DIM: { - zval **container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + zval **container = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); @@ -34107,17 +33914,17 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_TMP(int (*binary_o } return zend_binary_assign_op_obj_helper_SPEC_CV_TMP(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } else { - zval *dim = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *dim = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_TMP_VAR, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } } break; default: - value = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + value = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); /* do nothing */ break; } @@ -34240,8 +34047,8 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_TMP(incdec_t in int have_get_ptr = 0; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); - property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); + property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); retval = &EX_T(opline->result.var).var.ptr; if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -34344,8 +34151,8 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_TMP(incdec_t i int have_get_ptr = 0; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); - property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); + property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); retval = &EX_T(opline->result.var).tmp_var; if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -34450,13 +34257,13 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDL } if (IS_CV == IS_TMP_VAR || IS_CV == IS_CONST) { - zval *container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC); + zval *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); } else { - container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC); + container = _get_zval_ptr_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); } @@ -34472,12 +34279,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDL zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { 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_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_W TSRMLS_CC); + zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_W TSRMLS_CC); zval_dtor(free_op2.var); if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -34505,12 +34312,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { 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_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_RW TSRMLS_CC); + zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_RW TSRMLS_CC); zval_dtor(free_op2.var); if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -34527,8 +34334,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_IS TSRMLS_CC); + container = _get_zval_ptr_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_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_IS TSRMLS_CC); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -34543,12 +34350,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCOD SAVE_OPLINE(); - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { - container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) { + container = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { 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_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_W TSRMLS_CC); + zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_W TSRMLS_CC); if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } @@ -34556,8 +34363,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCOD if (IS_TMP_VAR == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC); + container = _get_zval_ptr_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); @@ -34572,7 +34379,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_H zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_CV) { if (container != &EG(uninitialized_zval_ptr)) { @@ -34582,7 +34389,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_H if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { 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_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_UNSET TSRMLS_CC); + zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_UNSET TSRMLS_CC); zval_dtor(free_op2.var); if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -34590,6 +34397,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_H if (UNEXPECTED(EX_T(opline->result.var).var.ptr_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); + ZEND_VM_NEXT_OPCODE(); } else { zend_free_op free_res; zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr; @@ -34614,8 +34422,8 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_TMP(ZEN zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); - offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); + offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { @@ -34660,7 +34468,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDL zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); @@ -34670,7 +34478,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDL if (1) { MAKE_REAL_ZVAL_PTR(property); } - container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an object"); } @@ -34708,8 +34516,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); - container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); if (1) { MAKE_REAL_ZVAL_PTR(property); @@ -34740,8 +34548,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC); - offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + 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 (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { @@ -34776,15 +34584,15 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCOD { USE_OPLINE - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) { /* Behave like FETCH_OBJ_W */ zend_free_op free_op1, free_op2; zval *property; zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); - container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (1) { MAKE_REAL_ZVAL_PTR(property); @@ -34817,8 +34625,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_H zval *property; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC); - property = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC); + property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_CV == IS_CV) { if (container != &EG(uninitialized_zval_ptr)) { @@ -34859,8 +34667,8 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLE zval *property_name; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); - property_name = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); + property_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (1) { MAKE_REAL_ZVAL_PTR(property_name); @@ -34868,7 +34676,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLE if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } - zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_OBJ, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); + zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); if (1) { zval_ptr_dtor(&property_name); } else { @@ -34888,19 +34696,19 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLE zval **object_ptr; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } if (Z_TYPE_PP(object_ptr) == IS_OBJECT) { zend_free_op free_op2; - zval *property_name = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *property_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (1) { MAKE_REAL_ZVAL_PTR(property_name); } - zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_DIM, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); + zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); if (1) { zval_ptr_dtor(&property_name); } else { @@ -34909,14 +34717,14 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLE } else { zend_free_op free_op2, free_op_data1, free_op_data2; zval *value; - zval *dim = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *dim = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); zval **variable_ptr_ptr; zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), object_ptr, dim, IS_TMP_VAR, BP_VAR_W TSRMLS_CC); zval_dtor(free_op2.var); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + 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); if (UNEXPECTED(variable_ptr_ptr == NULL)) { if (zend_assign_to_string_offset(&EX_T((opline+1)->op2.var), value, (opline+1)->op1_type TSRMLS_CC)) { if (RETURN_VALUE_USED(opline)) { @@ -34970,8 +34778,8 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_AR zval **variable_ptr_ptr; SAVE_OPLINE(); - value = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); - variable_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + value = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + variable_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL)) { if (zend_assign_to_string_offset(&EX_T(opline->op1.var), value, IS_TMP_VAR TSRMLS_CC)) { @@ -35022,11 +34830,11 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_ char *function_name_strval; int function_name_strlen; zend_free_op free_op2; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); - function_name = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + function_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_TMP_VAR != IS_CONST && UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { @@ -35036,49 +34844,51 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_ function_name_strval = Z_STRVAL_P(function_name); function_name_strlen = Z_STRLEN_P(function_name); - EX(object) = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + call->object = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); - if (EXPECTED(EX(object) != NULL) && - EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) { - EX(called_scope) = Z_OBJCE_P(EX(object)); + if (EXPECTED(call->object != NULL) && + EXPECTED(Z_TYPE_P(call->object) == IS_OBJECT)) { + call->called_scope = Z_OBJCE_P(call->object); if (IS_TMP_VAR != IS_CONST || - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) { - zval *object = EX(object); + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope)) == NULL) { + zval *object = call->object; - if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) { + if (UNEXPECTED(Z_OBJ_HT_P(call->object)->get_method == NULL)) { zend_error_noreturn(E_ERROR, "Object does not support method calls"); } /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_TMP_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); - if (UNEXPECTED(EX(fbc) == NULL)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); + call->fbc = Z_OBJ_HT_P(call->object)->get_method(&call->object, function_name_strval, function_name_strlen, ((IS_TMP_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + if (UNEXPECTED(call->fbc == NULL)) { + zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(call->object), function_name_strval); } if (IS_TMP_VAR == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && - EXPECTED(EX(object) == object)) { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc)); + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && + EXPECTED(call->object == object)) { + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope, call->fbc); } } } else { zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); } - if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) { - EX(object) = NULL; + if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { + call->object = NULL; } else { - if (!PZVAL_IS_REF(EX(object))) { - Z_ADDREF_P(EX(object)); /* For $this pointer */ + if (!PZVAL_IS_REF(call->object)) { + Z_ADDREF_P(call->object); /* For $this pointer */ } else { zval *this_ptr; ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); + INIT_PZVAL_COPY(this_ptr, call->object); zval_copy_ctor(this_ptr); - EX(object) = this_ptr; + call->object = this_ptr; } } + call->is_ctor_call = 0; + EX(call) = call; zval_dtor(free_op2.var); @@ -35096,8 +34906,8 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS 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(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); zval_dtor(free_op2.var); CHECK_EXCEPTION(); @@ -35112,7 +34922,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE SAVE_OPLINE(); if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) { - zval **expr_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + zval **expr_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets"); @@ -35121,7 +34931,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE expr_ptr = *expr_ptr_ptr; Z_ADDREF_P(expr_ptr); } else { - expr_ptr=_get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + expr_ptr=_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (0) { /* temporary variable */ zval *new_expr; @@ -35142,7 +34952,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_TMP_HANDLER(ZEND_OPCODE if (IS_TMP_VAR != IS_UNUSED) { zend_free_op free_op2; - zval *offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); ulong hval; switch (Z_TYPE_P(offset)) { @@ -35213,11 +35023,11 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER ulong hval; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { SEPARATE_ZVAL_IF_NOT_REF(container); } - offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_CV != IS_VAR || container) { switch (Z_TYPE_PP(container)) { @@ -35311,8 +35121,8 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC); - offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC); + offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_CV != IS_VAR || container) { if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { @@ -35354,9 +35164,9 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_TMP(int zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC); - offset = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) { HashTable *ht; @@ -35528,7 +35338,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG zend_error(E_NOTICE, "Only variable references should be yielded by reference"); - value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); ALLOC_ZVAL(copy); INIT_PZVAL_COPY(copy, value); @@ -35539,7 +35349,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG generator->value = copy; } else { - zval **value_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + zval **value_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(value_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference"); @@ -35563,7 +35373,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG } } else { - zval *value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + zval *value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR @@ -35595,7 +35405,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG /* Set the new yielded key */ if (IS_TMP_VAR != IS_UNUSED) { zend_free_op free_op2; - zval *key = _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *key = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR @@ -35635,8 +35445,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG generator->send_target = &EX_T(opline->result.var); /* Initialize the sent value to NULL */ - Z_ADDREF(EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).tmp_var = EG(uninitialized_zval); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ @@ -35656,8 +35465,8 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); fast_add_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -35671,8 +35480,8 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); fast_sub_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -35686,8 +35495,8 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); fast_mul_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -35701,8 +35510,8 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); fast_div_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -35716,8 +35525,8 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); fast_mod_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -35731,8 +35540,8 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); shift_left_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -35746,8 +35555,8 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); shift_right_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -35761,8 +35570,8 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); concat_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -35776,8 +35585,8 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND SAVE_OPLINE(); is_identical_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -35792,8 +35601,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_ SAVE_OPLINE(); is_identical_function(result, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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); Z_LVAL_P(result) = !Z_LVAL_P(result); if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; @@ -35809,8 +35618,8 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ SAVE_OPLINE(); ZVAL_BOOL(result, fast_equal_function(result, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _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);}; CHECK_EXCEPTION(); @@ -35825,8 +35634,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND SAVE_OPLINE(); ZVAL_BOOL(result, fast_not_equal_function(result, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _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);}; CHECK_EXCEPTION(); @@ -35841,8 +35650,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_function(result, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _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);}; CHECK_EXCEPTION(); @@ -35857,8 +35666,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_VAR_HANDLER(ZEND_OPCO SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC)); + _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);}; CHECK_EXCEPTION(); @@ -35872,8 +35681,8 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); bitwise_or_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -35887,8 +35696,8 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); bitwise_and_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -35902,8 +35711,8 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR SAVE_OPLINE(); bitwise_xor_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -35917,8 +35726,8 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ SAVE_OPLINE(); boolean_xor_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -35929,10 +35738,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_VAR(int (*bina { USE_OPLINE zend_free_op free_op2, free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + zval **object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); zval *object; - zval *property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); - zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); + zval *property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); int have_get_ptr = 0; if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -36049,7 +35858,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_VAR(int (*binary_o return zend_binary_assign_op_obj_helper_SPEC_CV_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); break; case ZEND_ASSIGN_DIM: { - zval **container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + zval **container = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); @@ -36059,17 +35868,17 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_VAR(int (*binary_o } return zend_binary_assign_op_obj_helper_SPEC_CV_VAR(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } else { - zval *dim = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *dim = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_VAR, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } } break; default: - value = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + value = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); /* do nothing */ break; } @@ -36192,8 +36001,8 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_VAR(incdec_t in int have_get_ptr = 0; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); - property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); retval = &EX_T(opline->result.var).var.ptr; if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -36296,8 +36105,8 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_VAR(incdec_t i int have_get_ptr = 0; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); - property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); retval = &EX_T(opline->result.var).tmp_var; if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -36398,7 +36207,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_VAR(int type, ZEN ulong hash_value; SAVE_OPLINE(); - varname = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + varname = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV != IS_CONST && UNEXPECTED(Z_TYPE_P(varname) != IS_STRING)) { ZVAL_COPY_VALUE(&tmp_varname, varname); @@ -36538,7 +36347,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HA { USE_OPLINE - return zend_fetch_var_address_helper_SPEC_CV_VAR(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return zend_fetch_var_address_helper_SPEC_CV_VAR(ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) @@ -36566,13 +36375,13 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDL } if (IS_CV == IS_TMP_VAR || IS_CV == IS_CONST) { - zval *container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC); + zval *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);}; } else { - container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC); + container = _get_zval_ptr_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);}; } @@ -36588,12 +36397,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDL zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { 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, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_W TSRMLS_CC); + 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);}; if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -36621,12 +36430,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { 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, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_RW TSRMLS_CC); + 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);}; if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -36643,8 +36452,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_IS TSRMLS_CC); + container = _get_zval_ptr_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);}; CHECK_EXCEPTION(); @@ -36659,12 +36468,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCOD SAVE_OPLINE(); - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { - container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) { + container = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { 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, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_W TSRMLS_CC); + 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 (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } @@ -36672,8 +36481,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCOD if (IS_VAR == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC); + container = _get_zval_ptr_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);}; @@ -36688,7 +36497,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_H zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_CV) { if (container != &EG(uninitialized_zval_ptr)) { @@ -36698,7 +36507,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_H if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { 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, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_UNSET TSRMLS_CC); + 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);}; if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -36706,6 +36515,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_H if (UNEXPECTED(EX_T(opline->result.var).var.ptr_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); + ZEND_VM_NEXT_OPCODE(); } else { zend_free_op free_res; zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr; @@ -36730,8 +36540,8 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_VAR(ZEN zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); - offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { @@ -36776,7 +36586,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDL zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); @@ -36786,7 +36596,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDL if (0) { MAKE_REAL_ZVAL_PTR(property); } - container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an object"); } @@ -36824,8 +36634,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); - container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); if (0) { MAKE_REAL_ZVAL_PTR(property); @@ -36856,8 +36666,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC); - offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + 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 (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { @@ -36892,15 +36702,15 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCOD { USE_OPLINE - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) { /* Behave like FETCH_OBJ_W */ zend_free_op free_op1, free_op2; zval *property; zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); - container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (0) { MAKE_REAL_ZVAL_PTR(property); @@ -36933,8 +36743,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_H zval *property; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC); - property = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC); + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_CV == IS_CV) { if (container != &EG(uninitialized_zval_ptr)) { @@ -36975,8 +36785,8 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE zval *property_name; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); - property_name = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); + property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (0) { MAKE_REAL_ZVAL_PTR(property_name); @@ -36984,7 +36794,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } - zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_OBJ, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); + zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); if (0) { zval_ptr_dtor(&property_name); } else { @@ -37004,19 +36814,19 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE zval **object_ptr; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } if (Z_TYPE_PP(object_ptr) == IS_OBJECT) { zend_free_op free_op2; - zval *property_name = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (0) { MAKE_REAL_ZVAL_PTR(property_name); } - zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_DIM, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); + zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); if (0) { zval_ptr_dtor(&property_name); } else { @@ -37025,14 +36835,14 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE } else { zend_free_op free_op2, free_op_data1, free_op_data2; zval *value; - zval *dim = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *dim = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); 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);}; - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + 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); if (UNEXPECTED(variable_ptr_ptr == NULL)) { if (zend_assign_to_string_offset(&EX_T((opline+1)->op2.var), value, (opline+1)->op1_type TSRMLS_CC)) { if (RETURN_VALUE_USED(opline)) { @@ -37086,8 +36896,8 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR zval **variable_ptr_ptr; SAVE_OPLINE(); - value = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); - variable_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + value = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); + variable_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL)) { if (zend_assign_to_string_offset(&EX_T(opline->op1.var), value, IS_VAR TSRMLS_CC)) { @@ -37140,7 +36950,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE zval **value_ptr_ptr; SAVE_OPLINE(); - value_ptr_ptr = _get_zval_ptr_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + value_ptr_ptr = _get_zval_ptr_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_VAR == IS_VAR && value_ptr_ptr && @@ -37163,7 +36973,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE zend_error_noreturn(E_ERROR, "Cannot assign by reference to overloaded object"); } - variable_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + variable_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if ((IS_VAR == IS_VAR && UNEXPECTED(value_ptr_ptr == NULL)) || (IS_CV == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL))) { zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects"); @@ -37192,11 +37002,11 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_ char *function_name_strval; int function_name_strlen; zend_free_op free_op2; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); - function_name = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + function_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_VAR != IS_CONST && UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { @@ -37206,49 +37016,51 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_ function_name_strval = Z_STRVAL_P(function_name); function_name_strlen = Z_STRLEN_P(function_name); - EX(object) = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + call->object = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); - if (EXPECTED(EX(object) != NULL) && - EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) { - EX(called_scope) = Z_OBJCE_P(EX(object)); + if (EXPECTED(call->object != NULL) && + EXPECTED(Z_TYPE_P(call->object) == IS_OBJECT)) { + call->called_scope = Z_OBJCE_P(call->object); if (IS_VAR != IS_CONST || - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) { - zval *object = EX(object); + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope)) == NULL) { + zval *object = call->object; - if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) { + if (UNEXPECTED(Z_OBJ_HT_P(call->object)->get_method == NULL)) { zend_error_noreturn(E_ERROR, "Object does not support method calls"); } /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); - if (UNEXPECTED(EX(fbc) == NULL)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); + call->fbc = Z_OBJ_HT_P(call->object)->get_method(&call->object, function_name_strval, function_name_strlen, ((IS_VAR == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + if (UNEXPECTED(call->fbc == NULL)) { + zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(call->object), function_name_strval); } if (IS_VAR == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && - EXPECTED(EX(object) == object)) { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc)); + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && + EXPECTED(call->object == object)) { + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope, call->fbc); } } } else { zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); } - if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) { - EX(object) = NULL; + if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { + call->object = NULL; } else { - if (!PZVAL_IS_REF(EX(object))) { - Z_ADDREF_P(EX(object)); /* For $this pointer */ + if (!PZVAL_IS_REF(call->object)) { + Z_ADDREF_P(call->object); /* For $this pointer */ } else { zval *this_ptr; ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); + INIT_PZVAL_COPY(this_ptr, call->object); zval_copy_ctor(this_ptr); - EX(object) = this_ptr; + call->object = this_ptr; } } + call->is_ctor_call = 0; + EX(call) = call; if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; @@ -37266,8 +37078,8 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS 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(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC) TSRMLS_CC); + _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);}; CHECK_EXCEPTION(); @@ -37282,7 +37094,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE SAVE_OPLINE(); if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) { - zval **expr_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + zval **expr_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets"); @@ -37291,7 +37103,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE expr_ptr = *expr_ptr_ptr; Z_ADDREF_P(expr_ptr); } else { - expr_ptr=_get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + expr_ptr=_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (0) { /* temporary variable */ zval *new_expr; @@ -37312,7 +37124,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_VAR_HANDLER(ZEND_OPCODE if (IS_VAR != IS_UNUSED) { zend_free_op free_op2; - zval *offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); ulong hval; switch (Z_TYPE_P(offset)) { @@ -37398,7 +37210,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER ZEND_VM_NEXT_OPCODE(); } - varname = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + varname = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_COPY_VALUE(&tmp, varname); @@ -37459,11 +37271,11 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER ulong hval; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { SEPARATE_ZVAL_IF_NOT_REF(container); } - offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_CV != IS_VAR || container) { switch (Z_TYPE_PP(container)) { @@ -37557,8 +37369,8 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC); - offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC); + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (IS_CV != IS_VAR || container) { if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { @@ -37613,7 +37425,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE } else { HashTable *target_symbol_table; - zval tmp, *varname = _get_zval_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC); + zval tmp, *varname = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_COPY_VALUE(&tmp, varname); @@ -37685,9 +37497,9 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(int zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC); - offset = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) { HashTable *ht; @@ -37859,7 +37671,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG zend_error(E_NOTICE, "Only variable references should be yielded by reference"); - value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); ALLOC_ZVAL(copy); INIT_PZVAL_COPY(copy, value); @@ -37870,7 +37682,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG generator->value = copy; } else { - zval **value_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + zval **value_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(value_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference"); @@ -37894,7 +37706,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG } } else { - zval *value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + zval *value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR @@ -37926,7 +37738,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG /* Set the new yielded key */ if (IS_VAR != IS_UNUSED) { zend_free_op free_op2; - zval *key = _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC); + zval *key = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR @@ -37967,8 +37779,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG generator->send_target = &EX_T(opline->result.var); /* Initialize the sent value to NULL */ - Z_ADDREF(EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).tmp_var = EG(uninitialized_zval); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ @@ -37985,10 +37796,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(int (*b { USE_OPLINE zend_free_op free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + zval **object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); zval *object; zval *property = NULL; - zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); + zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); int have_get_ptr = 0; if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -38105,7 +37916,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_UNUSED(int (*binar return zend_binary_assign_op_obj_helper_SPEC_CV_UNUSED(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); break; case ZEND_ASSIGN_DIM: { - zval **container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + zval **container = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); @@ -38118,14 +37929,14 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_UNUSED(int (*binar zval *dim = NULL; zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_UNUSED, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } } break; default: value = NULL; - var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); /* do nothing */ break; } @@ -38247,7 +38058,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_UNUSED(int type, ulong hash_value; SAVE_OPLINE(); - varname = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + varname = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV != IS_CONST && UNEXPECTED(Z_TYPE_P(varname) != IS_STRING)) { ZVAL_COPY_VALUE(&tmp_varname, varname); @@ -38387,7 +38198,7 @@ static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE { USE_OPLINE - return zend_fetch_var_address_helper_SPEC_CV_UNUSED(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); + return zend_fetch_var_address_helper_SPEC_CV_UNUSED(ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } static int ZEND_FASTCALL ZEND_FETCH_UNSET_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS) @@ -38407,7 +38218,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HA zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); @@ -38440,7 +38251,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_H zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); @@ -38463,8 +38274,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED_HANDLER(ZEND_OP SAVE_OPLINE(); - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { - container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) { + container = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } @@ -38476,7 +38287,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED_HANDLER(ZEND_OP if (IS_UNUSED == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, NULL, IS_UNUSED, BP_VAR_R TSRMLS_CC); } @@ -38492,7 +38303,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAN zval **object_ptr; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); @@ -38504,7 +38315,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAN if (0) { MAKE_REAL_ZVAL_PTR(property_name); } - zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_DIM, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); + zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_UNUSED == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); if (0) { zval_ptr_dtor(&property_name); } else { @@ -38518,8 +38329,8 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAN zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), object_ptr, dim, IS_UNUSED, BP_VAR_W TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + 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); if (UNEXPECTED(variable_ptr_ptr == NULL)) { if (zend_assign_to_string_offset(&EX_T((opline+1)->op2.var), value, (opline+1)->op1_type TSRMLS_CC)) { if (RETURN_VALUE_USED(opline)) { @@ -38573,7 +38384,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPC SAVE_OPLINE(); if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) { - zval **expr_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + zval **expr_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets"); @@ -38582,7 +38393,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPC expr_ptr = *expr_ptr_ptr; Z_ADDREF_P(expr_ptr); } else { - expr_ptr=_get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + expr_ptr=_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (0) { /* temporary variable */ zval *new_expr; @@ -38689,7 +38500,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAND ZEND_VM_NEXT_OPCODE(); } - varname = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + varname = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_COPY_VALUE(&tmp, varname); @@ -38765,7 +38576,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPC } else { HashTable *target_symbol_table; - zval tmp, *varname = _get_zval_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC); + zval tmp, *varname = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV != IS_CONST && Z_TYPE_P(varname) != IS_STRING) { ZVAL_COPY_VALUE(&tmp, varname); @@ -38859,7 +38670,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ zend_error(E_NOTICE, "Only variable references should be yielded by reference"); - value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); ALLOC_ZVAL(copy); INIT_PZVAL_COPY(copy, value); @@ -38870,7 +38681,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ generator->value = copy; } else { - zval **value_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + zval **value_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(value_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference"); @@ -38894,7 +38705,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ } } else { - zval *value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + zval *value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR @@ -38966,8 +38777,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ generator->send_target = &EX_T(opline->result.var); /* Initialize the sent value to NULL */ - Z_ADDREF(EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).tmp_var = EG(uninitialized_zval); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ @@ -38987,8 +38797,8 @@ static int ZEND_FASTCALL ZEND_ADD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); fast_add_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); CHECK_EXCEPTION(); @@ -39002,8 +38812,8 @@ static int ZEND_FASTCALL ZEND_SUB_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); fast_sub_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); CHECK_EXCEPTION(); @@ -39017,8 +38827,8 @@ static int ZEND_FASTCALL ZEND_MUL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); fast_mul_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); CHECK_EXCEPTION(); @@ -39032,8 +38842,8 @@ static int ZEND_FASTCALL ZEND_DIV_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); fast_div_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); CHECK_EXCEPTION(); @@ -39047,8 +38857,8 @@ static int ZEND_FASTCALL ZEND_MOD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); fast_mod_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); CHECK_EXCEPTION(); @@ -39062,8 +38872,8 @@ static int ZEND_FASTCALL ZEND_SL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); shift_left_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); CHECK_EXCEPTION(); @@ -39077,8 +38887,8 @@ static int ZEND_FASTCALL ZEND_SR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) SAVE_OPLINE(); shift_right_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); CHECK_EXCEPTION(); @@ -39092,8 +38902,8 @@ static int ZEND_FASTCALL ZEND_CONCAT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); concat_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); CHECK_EXCEPTION(); @@ -39107,8 +38917,8 @@ static int ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDL SAVE_OPLINE(); is_identical_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); CHECK_EXCEPTION(); @@ -39123,8 +38933,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_H SAVE_OPLINE(); is_identical_function(result, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); Z_LVAL_P(result) = !Z_LVAL_P(result); @@ -39140,8 +38950,8 @@ static int ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_A SAVE_OPLINE(); ZVAL_BOOL(result, fast_equal_function(result, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC)); + _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)); CHECK_EXCEPTION(); @@ -39156,8 +38966,8 @@ static int ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDL SAVE_OPLINE(); ZVAL_BOOL(result, fast_not_equal_function(result, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC)); + _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)); CHECK_EXCEPTION(); @@ -39172,8 +38982,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_function(result, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC)); + _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)); CHECK_EXCEPTION(); @@ -39188,8 +38998,8 @@ static int ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCOD SAVE_OPLINE(); ZVAL_BOOL(result, fast_is_smaller_or_equal_function(result, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC)); + _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)); CHECK_EXCEPTION(); @@ -39203,8 +39013,8 @@ static int ZEND_FASTCALL ZEND_BW_OR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS SAVE_OPLINE(); bitwise_or_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); CHECK_EXCEPTION(); @@ -39218,8 +39028,8 @@ static int ZEND_FASTCALL ZEND_BW_AND_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); bitwise_and_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); CHECK_EXCEPTION(); @@ -39233,8 +39043,8 @@ static int ZEND_FASTCALL ZEND_BW_XOR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG SAVE_OPLINE(); bitwise_xor_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); CHECK_EXCEPTION(); @@ -39248,8 +39058,8 @@ static int ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_A SAVE_OPLINE(); boolean_xor_function(&EX_T(opline->result.var).tmp_var, - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); CHECK_EXCEPTION(); @@ -39260,10 +39070,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binar { USE_OPLINE zend_free_op free_op_data1; - zval **object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + zval **object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); zval *object; - zval *property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); - zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); + zval *property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); + zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); int have_get_ptr = 0; if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -39380,7 +39190,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_CV(int (*binary_op return zend_binary_assign_op_obj_helper_SPEC_CV_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); break; case ZEND_ASSIGN_DIM: { - zval **container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + zval **container = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); @@ -39390,17 +39200,17 @@ static int ZEND_FASTCALL zend_binary_assign_op_helper_SPEC_CV_CV(int (*binary_op } return zend_binary_assign_op_obj_helper_SPEC_CV_CV(binary_op, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); } else { - zval *dim = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + zval *dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, IS_CV, BP_VAR_RW TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R); + var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC); } } break; default: - value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); - var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); + var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); /* do nothing */ break; } @@ -39522,8 +39332,8 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CV(incdec_t inc int have_get_ptr = 0; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); - property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); retval = &EX_T(opline->result.var).var.ptr; if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -39626,8 +39436,8 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CV(incdec_t in int have_get_ptr = 0; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); - property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); retval = &EX_T(opline->result.var).tmp_var; if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) { @@ -39732,13 +39542,13 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLE } if (IS_CV == IS_TMP_VAR || IS_CV == IS_CONST) { - zval *container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC); + zval *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); } else { - container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC); + container = _get_zval_ptr_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); } @@ -39754,12 +39564,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLE zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { 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_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_W TSRMLS_CC); + zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_W TSRMLS_CC); if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -39787,12 +39597,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDL zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { 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_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_RW TSRMLS_CC); + zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_RW TSRMLS_CC); if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -39809,8 +39619,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDL zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_IS TSRMLS_CC); + container = _get_zval_ptr_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_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_IS TSRMLS_CC); CHECK_EXCEPTION(); @@ -39825,12 +39635,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE SAVE_OPLINE(); - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { - container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) { + container = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { 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_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_W TSRMLS_CC); + zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_W TSRMLS_CC); if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } @@ -39838,8 +39648,8 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE if (IS_CV == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); - zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC); + container = _get_zval_ptr_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); } @@ -39854,7 +39664,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HA zval **container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_CV) { if (container != &EG(uninitialized_zval_ptr)) { @@ -39864,7 +39674,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HA if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { 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_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_UNSET TSRMLS_CC); + zend_fetch_dimension_address(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_UNSET TSRMLS_CC); if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); @@ -39872,6 +39682,7 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HA if (UNEXPECTED(EX_T(opline->result.var).var.ptr_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot unset string offsets"); + ZEND_VM_NEXT_OPCODE(); } else { zend_free_op free_res; zval **retval_ptr = EX_T(opline->result.var).var.ptr_ptr; @@ -39896,8 +39707,8 @@ static int ZEND_FASTCALL zend_fetch_property_address_read_helper_SPEC_CV_CV(ZEND zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); - offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { @@ -39942,7 +39753,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLE zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); @@ -39952,7 +39763,7 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLE if (0) { MAKE_REAL_ZVAL_PTR(property); } - container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an object"); } @@ -39990,8 +39801,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDL zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); - container = _get_zval_ptr_ptr_cv_BP_VAR_RW(EX_CVs(), opline->op1.var TSRMLS_CC); + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC); if (0) { MAKE_REAL_ZVAL_PTR(property); @@ -40022,8 +39833,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDL zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC); - offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + 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 (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) || UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) { @@ -40058,15 +39869,15 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE { USE_OPLINE - if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { + if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, (opline->extended_value & ZEND_FETCH_ARG_MASK))) { /* Behave like FETCH_OBJ_W */ zend_free_op free_op1; zval *property; zval **container; SAVE_OPLINE(); - property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); - container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (0) { MAKE_REAL_ZVAL_PTR(property); @@ -40099,8 +39910,8 @@ static int ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HA zval *property; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC); - property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC); + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (IS_CV == IS_CV) { if (container != &EG(uninitialized_zval_ptr)) { @@ -40141,8 +39952,8 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER zval *property_name; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); - property_name = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); + property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (0) { MAKE_REAL_ZVAL_PTR(property_name); @@ -40150,7 +39961,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } - zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_OBJ, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); + zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); if (0) { zval_ptr_dtor(&property_name); } else { @@ -40170,19 +39981,19 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER zval **object_ptr; SAVE_OPLINE(); - object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + object_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(object_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } if (Z_TYPE_PP(object_ptr) == IS_OBJECT) { - zval *property_name = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + zval *property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (0) { MAKE_REAL_ZVAL_PTR(property_name); } - zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_DIM, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); + zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC); if (0) { zval_ptr_dtor(&property_name); } else { @@ -40191,13 +40002,13 @@ static int ZEND_FASTCALL ZEND_ASSIGN_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER } else { zend_free_op free_op_data1, free_op_data2; zval *value; - zval *dim = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + zval *dim = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); zval **variable_ptr_ptr; zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), object_ptr, dim, IS_CV, BP_VAR_W TSRMLS_CC); - value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R); - variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC); + 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); if (UNEXPECTED(variable_ptr_ptr == NULL)) { if (zend_assign_to_string_offset(&EX_T((opline+1)->op2.var), value, (opline+1)->op1_type TSRMLS_CC)) { if (RETURN_VALUE_USED(opline)) { @@ -40251,8 +40062,8 @@ static int ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG zval **variable_ptr_ptr; SAVE_OPLINE(); - value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); - variable_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); + variable_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL)) { if (zend_assign_to_string_offset(&EX_T(opline->op1.var), value, IS_CV TSRMLS_CC)) { @@ -40304,7 +40115,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER zval **value_ptr_ptr; SAVE_OPLINE(); - value_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op2.var TSRMLS_CC); + value_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op2.var TSRMLS_CC); if (IS_CV == IS_VAR && value_ptr_ptr && @@ -40327,7 +40138,7 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER zend_error_noreturn(E_ERROR, "Cannot assign by reference to overloaded object"); } - variable_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + variable_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if ((IS_CV == IS_VAR && UNEXPECTED(value_ptr_ptr == NULL)) || (IS_CV == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL))) { zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects"); @@ -40355,11 +40166,11 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_H char *function_name_strval; int function_name_strlen; + call_slot *call = EX(call_slots) + opline->result.num; SAVE_OPLINE(); - zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope)); - function_name = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + function_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (IS_CV != IS_CONST && UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) { @@ -40369,49 +40180,51 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_H function_name_strval = Z_STRVAL_P(function_name); function_name_strlen = Z_STRLEN_P(function_name); - EX(object) = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + call->object = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); - if (EXPECTED(EX(object) != NULL) && - EXPECTED(Z_TYPE_P(EX(object)) == IS_OBJECT)) { - EX(called_scope) = Z_OBJCE_P(EX(object)); + if (EXPECTED(call->object != NULL) && + EXPECTED(Z_TYPE_P(call->object) == IS_OBJECT)) { + call->called_scope = Z_OBJCE_P(call->object); if (IS_CV != IS_CONST || - (EX(fbc) = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope))) == NULL) { - zval *object = EX(object); + (call->fbc = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope)) == NULL) { + zval *object = call->object; - if (UNEXPECTED(Z_OBJ_HT_P(EX(object))->get_method == NULL)) { + if (UNEXPECTED(Z_OBJ_HT_P(call->object)->get_method == NULL)) { zend_error_noreturn(E_ERROR, "Object does not support method calls"); } /* First, locate the function. */ - EX(fbc) = Z_OBJ_HT_P(EX(object))->get_method(&EX(object), function_name_strval, function_name_strlen, ((IS_CV == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); - if (UNEXPECTED(EX(fbc) == NULL)) { - zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), function_name_strval); + call->fbc = Z_OBJ_HT_P(call->object)->get_method(&call->object, function_name_strval, function_name_strlen, ((IS_CV == IS_CONST) ? (opline->op2.literal + 1) : NULL) TSRMLS_CC); + if (UNEXPECTED(call->fbc == NULL)) { + zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(call->object), function_name_strval); } if (IS_CV == IS_CONST && - EXPECTED(EX(fbc)->type <= ZEND_USER_FUNCTION) && - EXPECTED((EX(fbc)->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && - EXPECTED(EX(object) == object)) { - CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, EX(called_scope), EX(fbc)); + EXPECTED(call->fbc->type <= ZEND_USER_FUNCTION) && + EXPECTED((call->fbc->common.fn_flags & (ZEND_ACC_CALL_VIA_HANDLER|ZEND_ACC_NEVER_CACHE)) == 0) && + EXPECTED(call->object == object)) { + CACHE_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, call->called_scope, call->fbc); } } } else { zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); } - if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) { - EX(object) = NULL; + if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { + call->object = NULL; } else { - if (!PZVAL_IS_REF(EX(object))) { - Z_ADDREF_P(EX(object)); /* For $this pointer */ + if (!PZVAL_IS_REF(call->object)) { + Z_ADDREF_P(call->object); /* For $this pointer */ } else { zval *this_ptr; ALLOC_ZVAL(this_ptr); - INIT_PZVAL_COPY(this_ptr, EX(object)); + INIT_PZVAL_COPY(this_ptr, call->object); zval_copy_ctor(this_ptr); - EX(object) = this_ptr; + call->object = this_ptr; } } + call->is_ctor_call = 0; + EX(call) = call; CHECK_EXCEPTION(); @@ -40428,8 +40241,8 @@ static int ZEND_FASTCALL ZEND_CASE_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS) 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(EX_CVs(), opline->op1.var TSRMLS_CC), - _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC) TSRMLS_CC); + _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); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -40443,7 +40256,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_ SAVE_OPLINE(); if ((IS_CV == IS_VAR || IS_CV == IS_CV) && opline->extended_value) { - zval **expr_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + zval **expr_ptr_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(expr_ptr_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets"); @@ -40452,7 +40265,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_ expr_ptr = *expr_ptr_ptr; Z_ADDREF_P(expr_ptr); } else { - expr_ptr=_get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + expr_ptr=_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); if (0) { /* temporary variable */ zval *new_expr; @@ -40473,7 +40286,7 @@ static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_ if (IS_CV != IS_UNUSED) { - zval *offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + zval *offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); ulong hval; switch (Z_TYPE_P(offset)) { @@ -40544,11 +40357,11 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ ulong hval; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { SEPARATE_ZVAL_IF_NOT_REF(container); } - offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (IS_CV != IS_VAR || container) { switch (Z_TYPE_PP(container)) { @@ -40642,8 +40455,8 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(EX_CVs(), opline->op1.var TSRMLS_CC); - offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC); + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (IS_CV != IS_VAR || container) { if (IS_CV == IS_CV && container != &EG(uninitialized_zval_ptr)) { @@ -40685,9 +40498,9 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CV(int zval *offset; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC); - offset = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) { HashTable *ht; @@ -40859,7 +40672,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS zend_error(E_NOTICE, "Only variable references should be yielded by reference"); - value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); ALLOC_ZVAL(copy); INIT_PZVAL_COPY(copy, value); @@ -40870,7 +40683,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS generator->value = copy; } else { - zval **value_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + zval **value_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC); if (IS_CV == IS_VAR && UNEXPECTED(value_ptr == NULL)) { zend_error_noreturn(E_ERROR, "Cannot yield string offsets by reference"); @@ -40894,7 +40707,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS } } else { - zval *value = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + zval *value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR @@ -40926,7 +40739,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS /* Set the new yielded key */ if (IS_CV != IS_UNUSED) { - zval *key = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC); + zval *key = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC); /* Consts, temporary variables and references need copying */ if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR @@ -40966,8 +40779,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS generator->send_target = &EX_T(opline->result.var); /* Initialize the sent value to NULL */ - Z_ADDREF(EG(uninitialized_zval)); - AI_SET_PTR(&EX_T(opline->result.var), &EG(uninitialized_zval)); + EX_T(opline->result.var).tmp_var = EG(uninitialized_zval); /* We increment to the next op, so we are at the correct position when the * generator is resumed. */ @@ -40983,6 +40795,7 @@ static int ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS static int ZEND_FASTCALL ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { zend_error_noreturn(E_ERROR, "Invalid opcode %d/%d/%d.", OPLINE->opcode, OPLINE->op1_type, OPLINE->op2_type); + ZEND_VM_NEXT_OPCODE(); /* Never reached */ } @@ -44964,31 +44777,31 @@ void zend_init_opcodes_handlers(void) ZEND_JMP_SET_VAR_SPEC_CV_HANDLER, ZEND_JMP_SET_VAR_SPEC_CV_HANDLER, ZEND_JMP_SET_VAR_SPEC_CV_HANDLER, - ZEND_LEAVE_SPEC_HANDLER, - ZEND_LEAVE_SPEC_HANDLER, - ZEND_LEAVE_SPEC_HANDLER, - ZEND_LEAVE_SPEC_HANDLER, - ZEND_LEAVE_SPEC_HANDLER, - ZEND_LEAVE_SPEC_HANDLER, - ZEND_LEAVE_SPEC_HANDLER, - ZEND_LEAVE_SPEC_HANDLER, - ZEND_LEAVE_SPEC_HANDLER, - ZEND_LEAVE_SPEC_HANDLER, - ZEND_LEAVE_SPEC_HANDLER, - ZEND_LEAVE_SPEC_HANDLER, - ZEND_LEAVE_SPEC_HANDLER, - ZEND_LEAVE_SPEC_HANDLER, - ZEND_LEAVE_SPEC_HANDLER, - ZEND_LEAVE_SPEC_HANDLER, - ZEND_LEAVE_SPEC_HANDLER, - ZEND_LEAVE_SPEC_HANDLER, - ZEND_LEAVE_SPEC_HANDLER, - ZEND_LEAVE_SPEC_HANDLER, - ZEND_LEAVE_SPEC_HANDLER, - ZEND_LEAVE_SPEC_HANDLER, - ZEND_LEAVE_SPEC_HANDLER, - ZEND_LEAVE_SPEC_HANDLER, - ZEND_LEAVE_SPEC_HANDLER, + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, + ZEND_DISCARD_EXCEPTION_SPEC_HANDLER, ZEND_YIELD_SPEC_CONST_CONST_HANDLER, ZEND_YIELD_SPEC_CONST_TMP_HANDLER, ZEND_YIELD_SPEC_CONST_VAR_HANDLER, @@ -45039,6 +44852,56 @@ void zend_init_opcodes_handlers(void) ZEND_GENERATOR_RETURN_SPEC_HANDLER, ZEND_GENERATOR_RETURN_SPEC_HANDLER, ZEND_GENERATOR_RETURN_SPEC_HANDLER, + ZEND_FAST_CALL_SPEC_HANDLER, + ZEND_FAST_CALL_SPEC_HANDLER, + ZEND_FAST_CALL_SPEC_HANDLER, + ZEND_FAST_CALL_SPEC_HANDLER, + ZEND_FAST_CALL_SPEC_HANDLER, + ZEND_FAST_CALL_SPEC_HANDLER, + ZEND_FAST_CALL_SPEC_HANDLER, + ZEND_FAST_CALL_SPEC_HANDLER, + ZEND_FAST_CALL_SPEC_HANDLER, + ZEND_FAST_CALL_SPEC_HANDLER, + ZEND_FAST_CALL_SPEC_HANDLER, + ZEND_FAST_CALL_SPEC_HANDLER, + ZEND_FAST_CALL_SPEC_HANDLER, + ZEND_FAST_CALL_SPEC_HANDLER, + ZEND_FAST_CALL_SPEC_HANDLER, + ZEND_FAST_CALL_SPEC_HANDLER, + ZEND_FAST_CALL_SPEC_HANDLER, + ZEND_FAST_CALL_SPEC_HANDLER, + ZEND_FAST_CALL_SPEC_HANDLER, + ZEND_FAST_CALL_SPEC_HANDLER, + ZEND_FAST_CALL_SPEC_HANDLER, + ZEND_FAST_CALL_SPEC_HANDLER, + ZEND_FAST_CALL_SPEC_HANDLER, + ZEND_FAST_CALL_SPEC_HANDLER, + ZEND_FAST_CALL_SPEC_HANDLER, + ZEND_FAST_RET_SPEC_HANDLER, + ZEND_FAST_RET_SPEC_HANDLER, + ZEND_FAST_RET_SPEC_HANDLER, + ZEND_FAST_RET_SPEC_HANDLER, + ZEND_FAST_RET_SPEC_HANDLER, + ZEND_FAST_RET_SPEC_HANDLER, + ZEND_FAST_RET_SPEC_HANDLER, + ZEND_FAST_RET_SPEC_HANDLER, + ZEND_FAST_RET_SPEC_HANDLER, + ZEND_FAST_RET_SPEC_HANDLER, + ZEND_FAST_RET_SPEC_HANDLER, + ZEND_FAST_RET_SPEC_HANDLER, + ZEND_FAST_RET_SPEC_HANDLER, + ZEND_FAST_RET_SPEC_HANDLER, + ZEND_FAST_RET_SPEC_HANDLER, + ZEND_FAST_RET_SPEC_HANDLER, + ZEND_FAST_RET_SPEC_HANDLER, + ZEND_FAST_RET_SPEC_HANDLER, + ZEND_FAST_RET_SPEC_HANDLER, + ZEND_FAST_RET_SPEC_HANDLER, + ZEND_FAST_RET_SPEC_HANDLER, + ZEND_FAST_RET_SPEC_HANDLER, + ZEND_FAST_RET_SPEC_HANDLER, + ZEND_FAST_RET_SPEC_HANDLER, + ZEND_FAST_RET_SPEC_HANDLER, ZEND_NULL_HANDLER }; zend_opcode_handlers = (opcode_handler_t*)labels; diff --git a/Zend/zend_vm_execute.skl b/Zend/zend_vm_execute.skl index 2a6fd71ec..13fd88e2d 100644 --- a/Zend/zend_vm_execute.skl +++ b/Zend/zend_vm_execute.skl @@ -1,78 +1,5 @@ {%DEFINES%} -zend_execute_data *zend_create_execute_data_from_op_array(zend_op_array *op_array, zend_bool nested TSRMLS_DC) { - zend_execute_data *execute_data; - - /* - * When allocating the execute_data, memory for compiled variables and - * temporary variables is also allocated after the actual zend_execute_data - * struct. op_array->last_var specifies the number of compiled variables and - * op_array->T is the number of temporary variables. If there is no symbol - * table, then twice as much memory is allocated for compiled variables. - * In that case the first half contains zval**s and the second half the - * actual zval*s (which would otherwise be in the symbol table). - */ - size_t execute_data_size = ZEND_MM_ALIGNED_SIZE(sizeof(zend_execute_data)); - size_t CVs_size = ZEND_MM_ALIGNED_SIZE(sizeof(zval **) * op_array->last_var * (EG(active_symbol_table) ? 1 : 2)); - size_t Ts_size = ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * op_array->T; - size_t total_size = execute_data_size + CVs_size + Ts_size; - - /* - * Normally the execute_data is allocated on the VM stack (because it does - * not actually do any allocation and thus is faster). For generators - * though this behavior would be suboptimal, because the (rather large) - * structure would have to be copied back and forth every time execution is - * suspended or resumed. That's why for generators the execution context - * is allocated using emalloc, thus allowing to save and restore it simply - * by replacing a pointer. - */ - if (op_array->fn_flags & ZEND_ACC_GENERATOR) { - execute_data = emalloc(total_size); - } else { - execute_data = zend_vm_stack_alloc(total_size TSRMLS_CC); - } - - EX(CVs) = (zval ***) ((char *) execute_data + execute_data_size); - memset(EX(CVs), 0, sizeof(zval **) * op_array->last_var); - - EX(Ts) = (temp_variable *) ((char *) EX(CVs) + CVs_size); - - EX(fbc) = NULL; - EX(called_scope) = NULL; - EX(object) = NULL; - EX(old_error_reporting) = NULL; - EX(op_array) = op_array; - EX(symbol_table) = EG(active_symbol_table); - EX(prev_execute_data) = EG(current_execute_data); - EG(current_execute_data) = execute_data; - EX(nested) = nested; - EX(leaving) = 0; - - if (!op_array->run_time_cache && op_array->last_cache_slot) { - op_array->run_time_cache = ecalloc(op_array->last_cache_slot, sizeof(void*)); - } - - if (op_array->this_var != -1 && EG(This)) { - Z_ADDREF_P(EG(This)); /* For $this pointer */ - if (!EG(active_symbol_table)) { - EX(CVs)[op_array->this_var] = (zval **) EX(CVs) + op_array->last_var + op_array->this_var; - *EX(CVs)[op_array->this_var] = EG(This); - } else { - if (zend_hash_add(EG(active_symbol_table), "this", sizeof("this"), &EG(This), sizeof(zval *), (void **) &EX(CVs)[op_array->this_var])==FAILURE) { - Z_DELREF_P(EG(This)); - } - } - } - - EX(opline) = UNEXPECTED((op_array->fn_flags & ZEND_ACC_INTERACTIVE) != 0) && EG(start_op) ? EG(start_op) : op_array->opcodes; - EG(opline_ptr) = &EX(opline); - - EX(function_state).function = (zend_function *) op_array; - EX(function_state).arguments = NULL; - - return execute_data; -} - ZEND_API void {%EXECUTOR_NAME%}_ex(zend_execute_data *execute_data TSRMLS_DC) { DCL_OPLINE @@ -85,6 +12,11 @@ ZEND_API void {%EXECUTOR_NAME%}_ex(zend_execute_data *execute_data TSRMLS_DC) original_in_execution = EG(in_execution); EG(in_execution) = 1; + if (0) { +zend_vm_enter: + execute_data = i_create_execute_data_from_op_array(EG(active_op_array), 1 TSRMLS_CC); + } + LOAD_REGS(); LOAD_OPLINE(); @@ -104,12 +36,12 @@ ZEND_API void {%EXECUTOR_NAME%}_ex(zend_execute_data *execute_data TSRMLS_DC) zend_error_noreturn(E_ERROR, "Arrived at end of main loop which shouldn't happen"); } -ZEND_API void {%EXECUTOR_NAME%}(zend_op_array *op_array TSRMLS_DC) +ZEND_API void zend_{%EXECUTOR_NAME%}(zend_op_array *op_array TSRMLS_DC) { if (EG(exception)) { return; } - {%EXECUTOR_NAME%}_ex(zend_create_execute_data_from_op_array(op_array, 0 TSRMLS_CC) TSRMLS_CC); + zend_{%EXECUTOR_NAME%}_ex(i_create_execute_data_from_op_array(op_array, 0 TSRMLS_CC) TSRMLS_CC); } {%EXTERNAL_EXECUTOR%} diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php index bd5f2dede..63d0cf73f 100644 --- a/Zend/zend_vm_gen.php +++ b/Zend/zend_vm_gen.php @@ -3,7 +3,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -24,7 +24,7 @@ $header_text = <<< DATA +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -118,75 +118,75 @@ $op2_free = array( ); $op1_get_zval_ptr = array( - "ANY" => "get_zval_ptr(opline->op1_type, &opline->op1, EX_Ts(), &free_op1, \\1)", - "TMP" => "_get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC)", - "VAR" => "_get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC)", + "ANY" => "get_zval_ptr(opline->op1_type, &opline->op1, execute_data, &free_op1, \\1)", + "TMP" => "_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)", + "VAR" => "_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)", "CONST" => "opline->op1.zv", "UNUSED" => "NULL", - "CV" => "_get_zval_ptr_cv_\\1(EX_CVs(), opline->op1.var TSRMLS_CC)", + "CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op1.var TSRMLS_CC)", ); $op2_get_zval_ptr = array( - "ANY" => "get_zval_ptr(opline->op2_type, &opline->op2, EX_Ts(), &free_op2, \\1)", - "TMP" => "_get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC)", - "VAR" => "_get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC)", + "ANY" => "get_zval_ptr(opline->op2_type, &opline->op2, execute_data, &free_op2, \\1)", + "TMP" => "_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)", + "VAR" => "_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)", "CONST" => "opline->op2.zv", "UNUSED" => "NULL", - "CV" => "_get_zval_ptr_cv_\\1(EX_CVs(), opline->op2.var TSRMLS_CC)", + "CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op2.var TSRMLS_CC)", ); $op1_get_zval_ptr_ptr = array( - "ANY" => "get_zval_ptr_ptr(opline->op1_type, &opline->op1, EX_Ts(), &free_op1, \\1)", + "ANY" => "get_zval_ptr_ptr(opline->op1_type, &opline->op1, execute_data, &free_op1, \\1)", "TMP" => "NULL", - "VAR" => "_get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC)", + "VAR" => "_get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)", "CONST" => "NULL", "UNUSED" => "NULL", - "CV" => "_get_zval_ptr_ptr_cv_\\1(EX_CVs(), opline->op1.var TSRMLS_CC)", + "CV" => "_get_zval_ptr_ptr_cv_\\1(execute_data, opline->op1.var TSRMLS_CC)", ); $op2_get_zval_ptr_ptr = array( - "ANY" => "get_zval_ptr_ptr(opline->op2_type, &opline->op2, EX_Ts(), &free_op2, \\1)", + "ANY" => "get_zval_ptr_ptr(opline->op2_type, &opline->op2, execute_data, &free_op2, \\1)", "TMP" => "NULL", - "VAR" => "_get_zval_ptr_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC)", + "VAR" => "_get_zval_ptr_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)", "CONST" => "NULL", "UNUSED" => "NULL", - "CV" => "_get_zval_ptr_ptr_cv_\\1(EX_CVs(), opline->op2.var TSRMLS_CC)", + "CV" => "_get_zval_ptr_ptr_cv_\\1(execute_data, opline->op2.var TSRMLS_CC)", ); $op1_get_obj_zval_ptr = array( - "ANY" => "get_obj_zval_ptr(opline->op1_type, &opline->op1, EX_Ts(), &free_op1, \\1)", - "TMP" => "_get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC)", - "VAR" => "_get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC)", + "ANY" => "get_obj_zval_ptr(opline->op1_type, &opline->op1, execute_data, &free_op1, \\1)", + "TMP" => "_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)", + "VAR" => "_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)", "CONST" => "opline->op1.zv", "UNUSED" => "_get_obj_zval_ptr_unused(TSRMLS_C)", - "CV" => "_get_zval_ptr_cv_\\1(EX_CVs(), opline->op1.var TSRMLS_CC)", + "CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op1.var TSRMLS_CC)", ); $op2_get_obj_zval_ptr = array( - "ANY" => "get_obj_zval_ptr(opline->op2_type, &opline->op2, EX_Ts(), &free_op2, \\1)", - "TMP" => "_get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC)", - "VAR" => "_get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC)", + "ANY" => "get_obj_zval_ptr(opline->op2_type, &opline->op2, execute_data, &free_op2, \\1)", + "TMP" => "_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)", + "VAR" => "_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)", "CONST" => "opline->op2.zv", "UNUSED" => "_get_obj_zval_ptr_unused(TSRMLS_C)", - "CV" => "_get_zval_ptr_cv_\\1(EX_CVs(), opline->op2.var TSRMLS_CC)", + "CV" => "_get_zval_ptr_cv_\\1(execute_data, opline->op2.var TSRMLS_CC)", ); $op1_get_obj_zval_ptr_ptr = array( - "ANY" => "get_obj_zval_ptr_ptr(opline->op1_type, &opline->op1, EX_Ts(), &free_op1, \\1)", + "ANY" => "get_obj_zval_ptr_ptr(opline->op1_type, &opline->op1, execute_data, &free_op1, \\1)", "TMP" => "NULL", - "VAR" => "_get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC)", + "VAR" => "_get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)", "CONST" => "NULL", "UNUSED" => "_get_obj_zval_ptr_ptr_unused(TSRMLS_C)", - "CV" => "_get_zval_ptr_ptr_cv_\\1(EX_CVs(), opline->op1.var TSRMLS_CC)", + "CV" => "_get_zval_ptr_ptr_cv_\\1(execute_data, opline->op1.var TSRMLS_CC)", ); $op2_get_obj_zval_ptr_ptr = array( - "ANY" => "get_obj_zval_ptr_ptr(opline->op2_type, &opline->op2, EX_Ts(), &free_op2, \\1)", + "ANY" => "get_obj_zval_ptr_ptr(opline->op2_type, &opline->op2, execute_data, &free_op2, \\1)", "TMP" => "NULL", - "VAR" => "_get_zval_ptr_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC)", + "VAR" => "_get_zval_ptr_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)", "CONST" => "NULL", "UNUSED" => "_get_obj_zval_ptr_ptr_unused(TSRMLS_C)", - "CV" => "_get_zval_ptr_ptr_cv_\\1(EX_CVs(), opline->op2.var TSRMLS_CC)", + "CV" => "_get_zval_ptr_ptr_cv_\\1(execute_data, opline->op2.var TSRMLS_CC)", ); $op1_is_tmp_free = array( @@ -710,6 +710,7 @@ function gen_null_handler($f) { out($f,"static int ZEND_FASTCALL ZEND_NULL_HANDLER(ZEND_OPCODE_HANDLER_ARGS)\n"); out($f,"{\n"); out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", OPLINE->opcode, OPLINE->op1_type, OPLINE->op2_type);\n"); + out($f,"\tZEND_VM_NEXT_OPCODE(); /* Never reached */\n"); out($f,"}\n\n"); } } @@ -784,10 +785,12 @@ function gen_executor_code($f, $spec, $kind, $prolog) { case ZEND_VM_KIND_SWITCH: out($f,"default:\n"); out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", OPLINE->opcode, OPLINE->op1_type, OPLINE->op2_type);\n"); + out($f,"\tZEND_VM_NEXT_OPCODE(); /* Never reached */\n"); break; case ZEND_VM_KIND_GOTO: out($f,"ZEND_NULL_HANDLER:\n"); out($f,"\tzend_error_noreturn(E_ERROR, \"Invalid opcode %d/%d/%d.\", OPLINE->opcode, OPLINE->op1_type, OPLINE->op2_type);\n"); + out($f,"\tZEND_VM_NEXT_OPCODE(); /* Never reached */\n"); break; } } @@ -839,16 +842,6 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name, out($f,"#define ZEND_VM_LEAVE() return 3\n"); out($f,"#define ZEND_VM_DISPATCH(opcode, opline) return zend_vm_get_opcode_handler(opcode, opline)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n\n"); out($f,"#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data TSRMLS_CC\n"); - out($f,"#undef EX\n"); - out($f,"#define EX(element) execute_data->element\n\n"); - out($f,"#undef EX_CV\n"); - out($f,"#define EX_CV(var) EX(CVs)[var]\n"); - out($f,"#undef EX_CVs\n"); - out($f,"#define EX_CVs() EX(CVs)\n"); - out($f,"#undef EX_T\n"); - out($f,"#define EX_T(offset) (*(temp_variable *)((char *) EX(Ts) + offset))\n"); - out($f,"#undef EX_Ts\n"); - out($f,"#define EX_Ts() EX(Ts)\n\n"); break; case ZEND_VM_KIND_SWITCH: out($f,"\n"); @@ -868,23 +861,13 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name, out($f,"#define CHECK_EXCEPTION() LOAD_OPLINE()\n"); out($f,"#define HANDLE_EXCEPTION() LOAD_OPLINE(); ZEND_VM_CONTINUE()\n"); out($f,"#define HANDLE_EXCEPTION_LEAVE() LOAD_OPLINE(); ZEND_VM_LEAVE()\n"); - out($f,"#define LOAD_REGS() do {Ts = EX(Ts); CVs = EX(CVs);} while (0)\n"); + out($f,"#define LOAD_REGS()\n"); out($f,"#define ZEND_VM_CONTINUE() goto zend_vm_continue\n"); out($f,"#define ZEND_VM_RETURN() EG(in_execution) = original_in_execution; return\n"); - out($f,"#define ZEND_VM_ENTER() execute_data = zend_create_execute_data_from_op_array(EG(active_op_array), 1 TSRMLS_CC); LOAD_REGS(); LOAD_OPLINE(); ZEND_VM_CONTINUE()\n"); + out($f,"#define ZEND_VM_ENTER() goto zend_vm_enter\n"); out($f,"#define ZEND_VM_LEAVE() ZEND_VM_CONTINUE()\n"); out($f,"#define ZEND_VM_DISPATCH(opcode, opline) dispatch_handler = zend_vm_get_opcode_handler(opcode, opline); goto zend_vm_dispatch;\n\n"); out($f,"#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data TSRMLS_CC\n"); - out($f,"#undef EX\n"); - out($f,"#define EX(element) execute_data->element\n\n"); - out($f,"#undef EX_CV\n"); - out($f,"#define EX_CV(var) CVs[var]\n"); - out($f,"#undef EX_CVs\n"); - out($f,"#define EX_CVs() CVs\n"); - out($f,"#undef EX_T\n"); - out($f,"#define EX_T(offset) T(offset)\n"); - out($f,"#undef EX_Ts\n"); - out($f,"#define EX_Ts() Ts\n\n"); break; case ZEND_VM_KIND_GOTO: out($f,"\n"); @@ -904,23 +887,13 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name, out($f,"#define CHECK_EXCEPTION() if (UNEXPECTED(EG(exception) != NULL)) goto ZEND_HANDLE_EXCEPTION_SPEC_HANDLER\n"); out($f,"#define HANDLE_EXCEPTION() goto ZEND_HANDLE_EXCEPTION_SPEC_HANDLER\n"); out($f,"#define HANDLE_EXCEPTION_LEAVE() goto ZEND_HANDLE_EXCEPTION_SPEC_HANDLER\n"); - out($f,"#define LOAD_REGS() do {Ts = EX(Ts); CVs = EX(CVs);} while (0)\n"); + out($f,"#define LOAD_REGS()\n"); out($f,"#define ZEND_VM_CONTINUE() goto *(void**)(OPLINE->handler)\n"); out($f,"#define ZEND_VM_RETURN() EG(in_execution) = original_in_execution; return\n"); - out($f,"#define ZEND_VM_ENTER() execute_data = zend_create_execute_data_from_op_array(EG(active_op_array), 1 TSRMLS_CC); LOAD_REGS(); LOAD_OPLINE(); ZEND_VM_CONTINUE()\n"); + out($f,"#define ZEND_VM_ENTER() goto zend_vm_enter\n"); out($f,"#define ZEND_VM_LEAVE() ZEND_VM_CONTINUE()\n"); out($f,"#define ZEND_VM_DISPATCH(opcode, opline) goto *(void**)(zend_vm_get_opcode_handler(opcode, opline));\n\n"); out($f,"#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data TSRMLS_CC\n"); - out($f,"#undef EX\n"); - out($f,"#define EX(element) execute_data->element\n\n"); - out($f,"#undef EX_CV\n"); - out($f,"#define EX_CV(var) CVs[var]\n"); - out($f,"#undef EX_CVs\n"); - out($f,"#define EX_CVs() CVs\n"); - out($f,"#undef EX_T\n"); - out($f,"#define EX_T(offset) T(offset)\n\n"); - out($f,"#undef EX_Ts\n"); - out($f,"#define EX_Ts() Ts\n\n"); break; } break; @@ -929,8 +902,6 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name, break; case "HELPER_VARS": if ($kind != ZEND_VM_KIND_CALL) { - out($f,$m[1]."temp_variable *Ts;\n"); - out($f,$m[1]."zval ***CVs;\n"); if ($kind == ZEND_VM_KIND_SWITCH) { out($f,$m[1]."opcode_handler_t dispatch_handler;\n"); } @@ -991,7 +962,7 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name, $m[1]."\t\tEG(in_execution) = original_in_execution;\n". $m[1]."\t\treturn;\n". $m[1]."\tcase 2:\n" . - $m[1]."\t\texecute_data = zend_create_execute_data_from_op_array(EG(active_op_array), 1 TSRMLS_CC);\n". + $m[1]."\t\tgoto zend_vm_enter;\n". $m[1]."\t\tbreak;\n" . $m[1]."\tcase 3:\n" . $m[1]."\t\texecute_data = EG(current_execute_data);\n". @@ -1241,14 +1212,6 @@ function gen_vm($def, $skel) { // Generate un-specialized executor if (ZEND_VM_OLD_EXECUTOR) { out($f,"\n/* Old executor */\n\n"); - out($f,"#undef EX\n"); - out($f,"#define EX(element) execute_data.element\n\n"); - out($f,"#undef EX_CV\n"); - out($f,"#define EX_CV(var) EX(CVs)[var]\n"); - out($f,"#undef EX_CVs\n"); - out($f,"#define EX_CVs() EX(CVs)\n"); - out($f,"#undef EX_T\n"); - out($f,"#define EX_T(offset) (*(temp_variable *)((char *) EX(Ts) + offset))\n\n"); out($f,"#undef ZEND_VM_CONTINUE\n\n"); out($f,"#undef ZEND_VM_RETURN\n\n"); out($f,"#undef ZEND_VM_ENTER\n\n"); @@ -1321,14 +1284,6 @@ function gen_vm($def, $skel) { out($f,"#define CHECK_EXCEPTION() LOAD_OPLINE()\n"); out($f,"#define HANDLE_EXCEPTION() LOAD_OPLINE(); ZEND_VM_CONTINUE()\n"); out($f,"#define HANDLE_EXCEPTION_LEAVE() LOAD_OPLINE(); ZEND_VM_LEAVE()\n"); - out($f,"#undef EX\n"); - out($f,"#define EX(element) execute_data->element\n\n"); - out($f,"#undef EX_CV\n"); - out($f,"#define EX_CV(var) EX(CVs)[var]\n"); - out($f,"#undef EX_CVs\n"); - out($f,"#define EX_CVs() EX(CVs)\n"); - out($f,"#undef EX_T\n"); - out($f,"#define EX_T(offset) (*(temp_variable *)((char *) EX(Ts) + offset))\n\n"); out($f,"#undef ZEND_VM_CONTINUE\n"); out($f,"#undef ZEND_VM_RETURN\n"); out($f,"#undef ZEND_VM_ENTER\n"); diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h index 7f9434995..859258a44 100644 --- a/Zend/zend_vm_opcodes.h +++ b/Zend/zend_vm_opcodes.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) | + | 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 | @@ -159,6 +159,8 @@ #define ZEND_SEPARATE 156 #define ZEND_QM_ASSIGN_VAR 157 #define ZEND_JMP_SET_VAR 158 -#define ZEND_LEAVE 159 +#define ZEND_DISCARD_EXCEPTION 159 #define ZEND_YIELD 160 #define ZEND_GENERATOR_RETURN 161 +#define ZEND_FAST_CALL 162 +#define ZEND_FAST_RET 163 |