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

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

Issue 2654433003: [regexp] Fix StringCharacterPosition for ThinStrings (Closed)
Patch Set: Created 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/regexp/regexp-macro-assembler.cc
diff --git a/src/regexp/regexp-macro-assembler.cc b/src/regexp/regexp-macro-assembler.cc
index 73797e4416b8b198e3c13df50b56587bd6c04fa3..2e3a8a2f76877eb90bac9dd699ae03ba1e86a505 100644
--- a/src/regexp/regexp-macro-assembler.cc
+++ b/src/regexp/regexp-macro-assembler.cc
@@ -133,7 +133,8 @@ const byte* NativeRegExpMacroAssembler::StringCharacterPosition(
} else if (subject->IsSlicedString()) {
start_index += SlicedString::cast(subject)->offset();
subject = SlicedString::cast(subject)->parent();
- } else if (subject->IsThinString()) {
+ }
+ if (subject->IsThinString()) {
subject = ThinString::cast(subject)->actual();
}
DCHECK(start_index >= 0);
@@ -148,6 +149,7 @@ const byte* NativeRegExpMacroAssembler::StringCharacterPosition(
return reinterpret_cast<const byte*>(
ExternalOneByteString::cast(subject)->GetChars() + start_index);
} else {
+ DCHECK(subject->IsExternalTwoByteString());
return reinterpret_cast<const byte*>(
ExternalTwoByteString::cast(subject)->GetChars() + start_index);
}
« 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