Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(399)

Unified Diff: src/lexer/experimental-scanner.h

Issue 90993004: Fix scanning of escape codes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lexer/experimental-scanner.h
diff --git a/src/lexer/experimental-scanner.h b/src/lexer/experimental-scanner.h
index 20f0adbe2c200741cb79a2b90e9e1353fc8629c0..0fb3868bce47112653ed8241391131b38ac87699 100644
--- a/src/lexer/experimental-scanner.h
+++ b/src/lexer/experimental-scanner.h
@@ -562,14 +562,14 @@ const Char* ExperimentalScanner<Char>::ScanEscape(
case 'r' : c = '\r'; break;
case 't' : c = '\t'; break;
case 'u' : {
- if (end > cursor + 4) return NULL;
+ ASSERT(cursor + 4 <= end);
cursor = ScanHexNumber(cursor, cursor + 4, &c);
if (cursor == NULL) return NULL;
break;
}
case 'v' : c = '\v'; break;
case 'x' : {
- if (end > cursor + 2) return NULL ;
+ ASSERT(cursor + 2 <= end);
cursor = ScanHexNumber(cursor, cursor + 2, &c);
if (cursor == NULL) return NULL;
break;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698