fix segfault
Don't assume we are in a function.
Esse commit está contido em:
@@ -400,7 +400,9 @@ void Parser::onCall(Token &out, bool dynamic, Token &name, Token ¶ms,
|
||||
} else {
|
||||
const string &s = name.text();
|
||||
if (s == "func_num_args" || s == "func_get_args" || s == "func_get_arg") {
|
||||
m_hasCallToGetArgs.back() = true;
|
||||
if (m_hasCallToGetArgs.size() > 0) {
|
||||
m_hasCallToGetArgs.back() = true;
|
||||
}
|
||||
}
|
||||
|
||||
SimpleFunctionCallPtr call
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
var_dump(func_get_arg(1,2,3));
|
||||
var_dump(func_get_arg(1));
|
||||
var_dump(func_get_arg());
|
||||
|
||||
function bar() {
|
||||
var_dump(func_get_arg(1));
|
||||
}
|
||||
|
||||
function foo() {
|
||||
bar(func_get_arg(1));
|
||||
}
|
||||
|
||||
foo(1,2);
|
||||
|
||||
echo "Done\n";
|
||||
?>
|
||||
@@ -0,0 +1,9 @@
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
HipHop Warning: %a
|
||||
NULL
|
||||
HipHop Warning: %a
|
||||
bool(false)
|
||||
Done
|
||||
@@ -35,7 +35,6 @@ no_import = (
|
||||
'/tests/run-test/test010.phpt',
|
||||
|
||||
# segfaults
|
||||
'/Zend/tests/020.phpt',
|
||||
'/Zend/tests/bug35239.phpt',
|
||||
'/Zend/tests/bug54265.phpt',
|
||||
'/Zend/tests/bug55705.phpt',
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário