Reviewers: marja,

Message:
Committed patchset #1 manually as r18102 (presubmit successful).

Description:
Fix scanning of escape codes.

[email protected]

Committed: https://code.google.com/p/v8/source/detail?r=18102

Please review this at https://codereview.chromium.org/90993004/

SVN Base: https://v8.googlecode.com/svn/branches/experimental/parser

Affected files (+2, -2 lines):
  M src/lexer/experimental-scanner.h


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;


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to