cvs: ZendEngine2 / zend_builtin_functions.c /tests bug48693.phpt
felipe Sun Jun 28 01:14:28 2009 UTC
Added files:
/ZendEngine2/tests bug48693.phpt
Modified files:
/ZendEngine2 zend_builtin_functions.c
Log:
- Fixed bug #48693 (Double declaration of __lambda_func when lambda wrongly formatted)
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_builtin_functions.c?r1=1.408&r2=1.409&diff_format=u
Index: ZendEngine2/zend_builtin_functions.c
diff -u ZendEngine2/zend_builtin_functions.c:1.408 ZendEngine2/zend_builtin_functions.c:1.409
--- ZendEngine2/zend_builtin_functions.c:1.408 Mon Jun 8 11:42:56 2009
+++ ZendEngine2/zend_builtin_functions.c Sun Jun 28 01:14:28 2009
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_builtin_functions.c,v 1.408 2009/06/08 11:42:56 tony2001 Exp $ */
+/* $Id: zend_builtin_functions.c,v 1.409 2009/06/28 01:14:28 felipe Exp $ */
#include "zend.h"
#include "zend_API.h"
@@ -1794,6 +1794,7 @@
zend_hash_del(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME));
RETURN_ASCII_STRINGL(function_name, function_name_length, 0);
} else {
+ zend_hash_del(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME));
RETURN_FALSE;
}
}
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug48693.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/bug48693.phpt
+++ ZendEngine2/tests/bug48693.phpt
--TEST--
Bug #48693 (Double declaration of __lambda_func when lambda wrongly formatted)
--FILE--
<?php
$x = create_function('', 'return 1; }');
$y = create_function('', 'function a() { }; return 2;');
$z = create_function('', '{');
$w = create_function('', 'return 3;');
var_dump(
$x,
$y(),
$z,
$w(),
$y != $z
);
?>
--EXPECTF--
Parse error: syntax error, unexpected '}' in %s(%d) : runtime-created function on line 1
Parse error: syntax error, unexpected $end in %s(%d) : runtime-created function on line 1
bool(false)
int(2)
bool(false)
int(3)
bool(true)
Thread (1 message)
- Felipe Pena