[Webkit-unassigned] [Bug 49576] jsc does not ignore shebang

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Nov 15 20:55:41 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=49576





--- Comment #1 from John Tantalo <john.tantalo at gmail.com>  2010-11-15 20:55:41 PST ---
Created an attachment (id=73957)
 --> (https://bugs.webkit.org/attachment.cgi?id=73957&action=review)
svn diff JavaScriptCore/parser/Lexer.cpp

I added a new character type for a hash, i.e., #, ASCII 35.

When this character was previously encountered, it would have immediately triggered a lexical error.

My change is to first check if this character is at the start of the line. If not, it is an error.

Next, I check if the next character is a bang, i.e,. !, ASCII 33. If it is, then the rest of the line is treated as a comment. If not, then it is an error.

Since the hash character was previously illegal, the only potential danger of this patch is that source which previously failed to lex may now be executed

This patch does not enforce that the shebang occurs on the first line of the source. Any occurrence of a hash other than the first character of the source should be illegal. I don't know how to do this, so I will submit my current patch as a viable solution to the bug.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list