From:             [EMAIL PROTECTED]
Operating system: linux
PHP version:      5.3CVS-2008-06-27 (CVS)
PHP Bug Type:     Scripting Engine problem
Bug description:  hash# check in new re2c parser breaks code

Description:
------------
single line file:

<?php if (1) { ?>#<?php }  ?>

produces a parse error:

get's caught with this rule from the re2c scanner.
<INITIAL>"#".+ {NEWLINE} {
        if ((YYCTYPE*)yytext == SCNG(yy_start)) {
                /* ignore first line when it's started with a # */
                goto restart;
        } else {
                goto inline_char_handler;
        }
}


basically the scanner runs off the end, and eats everything after the #

I've fixed it by changing the above to something like:
} else {
        /* shunt back to just return the # on it's own..   */
        YYCURSOR = YYMARKER;
          yyleng = 1;
        goto inline_char_handler;
}








-- 
Edit bug report at http://bugs.php.net/?id=45372&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=45372&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=45372&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=45372&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=45372&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=45372&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=45372&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=45372&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=45372&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=45372&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=45372&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=45372&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=45372&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=45372&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=45372&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=45372&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=45372&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=45372&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=45372&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=45372&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=45372&r=mysqlcfg

Reply via email to