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

Unified Diff: src/ast/ast-value-factory.cc

Issue 2156513002: AstValueFactory: Add paranoid null checks for debugging. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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/ast/ast-value-factory.cc
diff --git a/src/ast/ast-value-factory.cc b/src/ast/ast-value-factory.cc
index 92322a0ed32e5d76b0ea2a3127dcbee035800582..63b40d2286a82cbe1ff7a939eaf89b731c3870ff 100644
--- a/src/ast/ast-value-factory.cc
+++ b/src/ast/ast-value-factory.cc
@@ -249,6 +249,7 @@ const AstConsString* AstValueFactory::NewConsString(
// This Vector will be valid as long as the Collector is alive (meaning that
// the AstRawString will not be moved).
AstConsString* new_string = new (zone_) AstConsString(left, right);
+ CHECK(new_string != nullptr);
strings_.Add(new_string);
if (isolate_) {
new_string->Internalize(isolate_);
@@ -276,7 +277,7 @@ void AstValueFactory::Internalize(Isolate* isolate) {
const AstValue* AstValueFactory::NewString(const AstRawString* string) {
AstValue* value = new (zone_) AstValue(string);
- DCHECK(string != NULL);
+ CHECK(string != nullptr);
if (isolate_) {
value->Internalize(isolate_);
}
@@ -368,6 +369,7 @@ AstRawString* AstValueFactory::GetString(uint32_t hash, bool is_one_byte,
memcpy(new_literal_bytes, literal_bytes.start(), length);
AstRawString* new_string = new (zone_) AstRawString(
is_one_byte, Vector<const byte>(new_literal_bytes, length), hash);
+ CHECK(new_string != nullptr);
entry->key = new_string;
strings_.Add(new_string);
if (isolate_) {
« 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