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

Unified Diff: src/json-stringifier.h

Issue 12599003: Insert missing type cast in JSON.stringify. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 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 | test/mjsunit/regress/regress-2570.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/json-stringifier.h
diff --git a/src/json-stringifier.h b/src/json-stringifier.h
index 5b41ef54b6b7b43ec4f79baff551919e11dab566..ad9ef3ddb71e86b17a9aa39caacecf94ebcaad81 100644
--- a/src/json-stringifier.h
+++ b/src/json-stringifier.h
@@ -682,7 +682,8 @@ void BasicJsonStringifier::SerializeStringUnchecked_(const SrcChar* src,
if (DoNotEscape(c)) {
*(dest++) = static_cast<DestChar>(c);
} else {
- const char* chars = &JsonEscapeTable[c * kJsonEscapeTableEntrySize];
+ const uint8_t* chars = reinterpret_cast<const uint8_t*>(
+ &JsonEscapeTable[c * kJsonEscapeTableEntrySize]);
while (*chars != '\0') *(dest++) = *(chars++);
}
}
@@ -722,9 +723,8 @@ void BasicJsonStringifier::SerializeString_(Handle<String> string) {
if (DoNotEscape(c)) {
Append_<is_ascii, Char>(c);
} else {
- Append_<is_ascii, uint8_t>(
- reinterpret_cast<const uint8_t*>(
- &JsonEscapeTable[c * kJsonEscapeTableEntrySize]));
+ Append_<is_ascii, uint8_t>(reinterpret_cast<const uint8_t*>(
+ &JsonEscapeTable[c * kJsonEscapeTableEntrySize]));
}
// If GC moved the string, we need to refresh the vector.
if (*string != string_location) {
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-2570.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698