Chromium Code Reviews| Index: src/objects.cc |
| diff --git a/src/objects.cc b/src/objects.cc |
| index 5262ed65671afa93c941173f9124813ab82c56ab..7900ef3bcb35d2e5c405add63c43809b2c5ee27a 100644 |
| --- a/src/objects.cc |
| +++ b/src/objects.cc |
| @@ -9283,6 +9283,20 @@ uint32_t StringHasher::ComputeUtf8Hash(Vector<const char> chars, |
| } |
| +void IteratingStringHasher::VisitConsString(ConsString* cons_string) { |
| + int length = cons_string->length(); |
| + uint16_t* buffer = cons_string->GetIsolate()->cons_string_hashing_buffer(); |
| + if (cons_string->HasOnlyOneByteChars()) { |
| + uint8_t* one_byte_buffer = reinterpret_cast<uint8_t*>(buffer); |
| + String::WriteToFlat(cons_string, one_byte_buffer, 0, length); |
|
Yang
2014/11/26 10:46:15
Wouldn't this cause OOB writes for large strings?
|
| + AddCharacters(one_byte_buffer, length); |
| + } else { |
| + String::WriteToFlat(cons_string, buffer, 0, length); |
| + AddCharacters(buffer, length); |
| + } |
| +} |
| + |
| + |
| void String::PrintOn(FILE* file) { |
| int length = this->length(); |
| for (int i = 0; i < length; i++) { |