Bug 686283 - Properly handle EOF in TokenStream::getAtSourceMappingURL on platforms with unsigned chars. r=luke,a=blassey
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 11 Oct 2011 08:41:47 +0200
changeset 79084 3ea3354a2d60ed2d61930c22ada85824e216d79a
parent 79083 9c11492b53104726f3c57c883ad371224625d7f3
child 79085 7f5f7f9bc6e0fcec48f86073a7b17a60e23c2f08
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke, blassey
bugs686283
milestone9.0a2
Bug 686283 - Properly handle EOF in TokenStream::getAtSourceMappingURL on platforms with unsigned chars. r=luke,a=blassey
js/src/jsscan.cpp
--- a/js/src/jsscan.cpp
+++ b/js/src/jsscan.cpp
@@ -1219,18 +1219,17 @@ TokenStream::getAtSourceMappingURL()
 
     /* Match comments of the form @sourceMappingURL=<url> */
     if (peekChars(18, peeked) && CharsMatch(peeked, "@sourceMappingURL=")) {
         skipChars(18);
         tokenbuf.clear();
 
         jschar c;
         while (!IsSpaceOrBOM2((c = getChar())) &&
-               ((char) c) != '\0' &&
-               ((char) c) != EOF)
+               c && c != jschar(EOF))
             tokenbuf.append(c);
 
         if (tokenbuf.empty())
             /* The source map's URL was missing, but not quite an exception that
              * we should stop and drop everything for, though. */
             return true;
 
         int len = tokenbuf.length();