-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When FLAG_PROPAGATE_PHP_EXCEPTIONS is set, check for unwind or gracef…
…ul exit before propagate
- Loading branch information
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--TEST-- | ||
Test V8::executeString() : Issue #497 (segmentation fault calling PHP exit inside object function) | ||
--SKIPIF-- | ||
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> | ||
--FILE-- | ||
<?php | ||
class Foo { | ||
function __destruct() { | ||
var_dump('Foo __destruct'); | ||
} | ||
|
||
function somecall() { | ||
var_dump('Foo somecall'); | ||
} | ||
|
||
function bar() { | ||
global $v8; | ||
var_dump('Foo bar'); | ||
exit; | ||
} | ||
} | ||
|
||
$v8 = new \V8Js(); | ||
$v8->foo = new Foo(); | ||
|
||
$JS = <<< EOT | ||
PHP.foo.somecall(); | ||
PHP.foo.bar(); | ||
EOT; | ||
|
||
$v8->executeString($JS, '', \V8JS::FLAG_PROPAGATE_PHP_EXCEPTIONS); | ||
echo 'Not here!!'; | ||
?> | ||
--EXPECTF-- | ||
string(12) "Foo somecall" | ||
string(7) "Foo bar" | ||
string(14) "Foo __destruct" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters