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

Unified Diff: src/regexp/regexp-macro-assembler.h

Issue 1601653006: [regexp] back refs must not start/end in the middle of a surrogate pair (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@unicodeclass
Patch Set: rebase and addressed comments Created 4 years, 11 months 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 | « src/regexp/jsregexp.cc ('k') | src/regexp/regexp-macro-assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/regexp/regexp-macro-assembler.h
diff --git a/src/regexp/regexp-macro-assembler.h b/src/regexp/regexp-macro-assembler.h
index ea4237653684941cadb1fd6890167bf1c0751117..7915f1aa638489105a3456c14b754163f67e6c47 100644
--- a/src/regexp/regexp-macro-assembler.h
+++ b/src/regexp/regexp-macro-assembler.h
@@ -11,6 +11,13 @@
namespace v8 {
namespace internal {
+static const uc32 kLeadSurrogateStart = 0xd800;
+static const uc32 kLeadSurrogateEnd = 0xdbff;
+static const uc32 kTrailSurrogateStart = 0xdc00;
+static const uc32 kTrailSurrogateEnd = 0xdfff;
+static const uc32 kNonBmpStart = 0x10000;
+static const uc32 kNonBmpEnd = 0x10ffff;
+
struct DisjunctDecisionRow {
RegExpCharacterClass cc;
Label* on_match;
@@ -152,6 +159,9 @@ class RegExpMacroAssembler {
Address byte_offset2,
size_t byte_length, Isolate* isolate);
+ // Check that we are not in the middle of a surrogate pair.
+ void CheckNotInSurrogatePair(int cp_offset, Label* on_failure);
+
// Controls the generation of large inlined constants in the code.
void set_slow_safe(bool ssc) { slow_safe_compiler_ = ssc; }
bool slow_safe() { return slow_safe_compiler_; }
« no previous file with comments | « src/regexp/jsregexp.cc ('k') | src/regexp/regexp-macro-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698