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

Unified Diff: src/codegen.cc

Issue 996663002: In PrintCode, keep the debug_name string alive for all uses. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codegen.cc
diff --git a/src/codegen.cc b/src/codegen.cc
index ba32aceface87f8b71e180134da40eade6ffdf5a..796e39a50c8d2d9fc5f51ddfdd5a5e6859c0d578 100644
--- a/src/codegen.cc
+++ b/src/codegen.cc
@@ -183,12 +183,14 @@ void CodeGenerator::PrintCode(Handle<Code> code, CompilationInfo* info) {
(info->IsOptimizing() && FLAG_print_opt_code));
if (print_code) {
const char* debug_name;
+ SmartArrayPointer<char> debug_name_holder;
if (info->IsStub()) {
CodeStub::Major major_key = info->code_stub()->MajorKey();
debug_name = CodeStub::MajorName(major_key, false);
} else {
- debug_name =
- info->parse_info()->function()->debug_name()->ToCString().get();
+ debug_name_holder =
+ info->parse_info()->function()->debug_name()->ToCString();
+ debug_name = debug_name_holder.get();
}
CodeTracer::Scope tracing_scope(info->isolate()->GetCodeTracer());
« 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