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

Unified Diff: src/debug.cc

Issue 269003: Fix a crash in Logger::LogCompiledFunctions due to a presence of scripts with disposed source. (Closed)
Patch Set: Fixed comments Created 11 years, 2 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 | src/log.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.cc
diff --git a/src/debug.cc b/src/debug.cc
index ec658d68f06844f7ca1a93697b763b7311be58ff..4f89f92e97c9c23edd775089a61f7d6fff7d7230 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -1677,22 +1677,6 @@ void Debug::ClearMirrorCache() {
}
-// If an object given is an external string, check that the underlying
-// resource is accessible. For other kinds of objects, always return true.
-static bool IsExternalStringValid(Object* str) {
- if (!str->IsString() || !StringShape(String::cast(str)).IsExternal()) {
- return true;
- }
- if (String::cast(str)->IsAsciiRepresentation()) {
- return ExternalAsciiString::cast(str)->resource() != NULL;
- } else if (String::cast(str)->IsTwoByteRepresentation()) {
- return ExternalTwoByteString::cast(str)->resource() != NULL;
- } else {
- return true;
- }
-}
-
-
void Debug::CreateScriptCache() {
HandleScope scope;
@@ -1711,7 +1695,7 @@ void Debug::CreateScriptCache() {
while (iterator.has_next()) {
HeapObject* obj = iterator.next();
ASSERT(obj != NULL);
- if (obj->IsScript() && IsExternalStringValid(Script::cast(obj)->source())) {
+ if (obj->IsScript() && Script::cast(obj)->HasValidSource()) {
script_cache_->Add(Handle<Script>(Script::cast(obj)));
count++;
}
« no previous file with comments | « no previous file | src/log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698