felipe Mon, 12 Jul 2010 20:11:35 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=301215
Log:
- Fixed SIGSEGV when E_PARSE occurred in zend_eval_stringl
Changed paths:
U php/php-src/branches/LEMON/Zend/zend_compile.c
U php/php-src/branches/LEMON/Zend/zend_language_parser.y
U php/php-src/branches/LEMON/Zend/zend_language_scanner_defs.h
Modified: php/php-src/branches/LEMON/Zend/zend_compile.c
===================================================================
--- php/php-src/branches/LEMON/Zend/zend_compile.c 2010-07-12 19:14:26 UTC
(rev 301214)
+++ php/php-src/branches/LEMON/Zend/zend_compile.c 2010-07-12 20:11:35 UTC
(rev 301215)
@@ -6109,7 +6109,7 @@
int zendparse(TSRMLS_D) /* {{{ */
{
- int token, lineno = 0, halting = 0;
+ int token, lineno = 0, halting = 0, old_exit_status;
void *pParser;
if ((pParser = zend_lang_parseAlloc(malloc)) == NULL) {
@@ -6117,6 +6117,8 @@
return 1;
}
+ old_exit_status = EG(exit_status);
+ EG(exit_status) = 0;
lineno = CG(zend_lineno);
while (1) {
@@ -6164,15 +6166,25 @@
}
zend_lang_parse(pParser, token, zendlval TSRMLS_CC);
CG(zend_lineno) = lineno;
+
if (token == 0) {
break;
- } else if (halting == 1 && token == T_SEMICOLON) {
+ } else if (EG(exit_status) == 255 || (halting == 1 && token ==
T_SEMICOLON)) {
+ /* Handles E_PARSE and __HALT_COMPILER(); */
zend_lang_parse(pParser, 0, zendlval TSRMLS_CC);
+ if (EG(exit_status) == 255) {
+ goto end_parse;
+ }
break;
}
}
+end_parse:
zend_lang_parseFree(pParser, free);
-
+ if (EG(exit_status) == 255) {
+ /* We got an E_PARSE */
+ return 1;
+ }
+ EG(exit_status) = old_exit_status;
return 0;
}
/* }}} */
Modified: php/php-src/branches/LEMON/Zend/zend_language_parser.y
===================================================================
--- php/php-src/branches/LEMON/Zend/zend_language_parser.y 2010-07-12
19:14:26 UTC (rev 301214)
+++ php/php-src/branches/LEMON/Zend/zend_language_parser.y 2010-07-12
20:11:35 UTC (rev 301215)
@@ -37,7 +37,6 @@
%syntax_error {
zend_error(E_PARSE, "syntax error, unexpected '%.*s'", LANG_SCNG(yy_leng),
LANG_SCNG(yy_text));
- zend_bailout();
}
%stack_overflow {
Modified: php/php-src/branches/LEMON/Zend/zend_language_scanner_defs.h
===================================================================
--- php/php-src/branches/LEMON/Zend/zend_language_scanner_defs.h
2010-07-12 19:14:26 UTC (rev 301214)
+++ php/php-src/branches/LEMON/Zend/zend_language_scanner_defs.h
2010-07-12 20:11:35 UTC (rev 301215)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Mon Jul 12 14:03:13 2010 */
+/* Generated by re2c 0.13.5 on Mon Jul 12 16:24:11 2010 */
#line 3 "Zend/zend_language_scanner_defs.h"
enum YYCONDTYPE {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php