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

Unified Diff: src/accessors.cc

Issue 1958043002: Don't crash when load eval origin of a call site. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixing regression test Created 4 years, 7 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-crbug-610207.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/accessors.cc
diff --git a/src/accessors.cc b/src/accessors.cc
index 37404837adeb1892c2d8d5a0e82a7fe8d4c63c23..665c2a9de15c3070652637d1b2b95d7713f14e90 100644
--- a/src/accessors.cc
+++ b/src/accessors.cc
@@ -680,14 +680,16 @@ void Accessors::ScriptEvalFromFunctionNameGetter(
Handle<Object> object = Utils::OpenHandle(*info.This());
Handle<Script> script(
Script::cast(Handle<JSValue>::cast(object)->value()), isolate);
- Handle<Object> result;
- Handle<SharedFunctionInfo> shared(
- SharedFunctionInfo::cast(script->eval_from_shared()));
- // Find the name of the function calling eval.
- if (!shared->name()->IsUndefined()) {
- result = Handle<Object>(shared->name(), isolate);
- } else {
- result = Handle<Object>(shared->inferred_name(), isolate);
+ Handle<Object> result = isolate->factory()->undefined_value();
+ if (!script->eval_from_shared()->IsUndefined()) {
+ Handle<SharedFunctionInfo> shared(
+ SharedFunctionInfo::cast(script->eval_from_shared()));
+ // Find the name of the function calling eval.
+ if (!shared->name()->IsUndefined()) {
+ result = Handle<Object>(shared->name(), isolate);
+ } else {
+ result = Handle<Object>(shared->inferred_name(), isolate);
+ }
}
info.GetReturnValue().Set(Utils::ToLocal(result));
}
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-610207.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698