Commit f09eb6cc authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Alias 4KB at the beginning of JSONParser::ConsumeDictionary() to help diagnose issue 791487.

R=siggi@chromium.org

Bug: 791487
Change-Id: I4535df5a52167f2f5b10424a07e035e1c46e8cfb
Reviewed-on: https://chromium-review.googlesource.com/850722
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: default avatarSigurður Ásgeirsson <siggi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#527154}
parent b9d63eb9
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "base/debug/alias.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
...@@ -327,6 +328,16 @@ Optional<Value> JSONParser::ParseToken(Token token) { ...@@ -327,6 +328,16 @@ Optional<Value> JSONParser::ParseToken(Token token) {
} }
Optional<Value> JSONParser::ConsumeDictionary() { Optional<Value> JSONParser::ConsumeDictionary() {
// Attempt to alias 4KB of the buffer about to be read. Need to alias multiple
// sites as the crashpad heuristics only grab a few hundred bytes in
// front/behind heap pointers on the stack.
// TODO(gab): Remove this after diagnosis of https://crbug.com/791487 is
// complete.
const char* initial_pos[16];
for (size_t i = 0; i < arraysize(initial_pos); ++i)
initial_pos[i] = pos_ + i * 256;
debug::Alias(&initial_pos);
if (*pos_ != '{') { if (*pos_ != '{') {
ReportError(JSONReader::JSON_UNEXPECTED_TOKEN, 1); ReportError(JSONReader::JSON_UNEXPECTED_TOKEN, 1);
return nullopt; return nullopt;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment