Index: src/compiler/graph-visualizer.cc |
diff --git a/src/compiler/graph-visualizer.cc b/src/compiler/graph-visualizer.cc |
index f431ab5d4d1a68b016045c61d1182363939c74f1..1dc38df0d965c89d50a5ffa3e8db5453295e9845 100644 |
--- a/src/compiler/graph-visualizer.cc |
+++ b/src/compiler/graph-visualizer.cc |
@@ -25,9 +25,8 @@ namespace v8 { |
namespace internal { |
namespace compiler { |
- |
-FILE* OpenVisualizerLogFile(CompilationInfo* info, const char* phase, |
- const char* suffix, const char* mode) { |
+base::SmartArrayPointer<const char> GetVisualizerLogFileName( |
+ CompilationInfo* info, const char* phase, const char* suffix) { |
EmbeddedVector<char, 256> filename(0); |
base::SmartArrayPointer<char> debug_name = info->GetDebugName(); |
if (strlen(debug_name.get()) > 0) { |
@@ -46,7 +45,11 @@ FILE* OpenVisualizerLogFile(CompilationInfo* info, const char* phase, |
} else { |
SNPrintF(full_filename, "%s-%s.%s", filename.start(), phase, suffix); |
} |
- return base::OS::FOpen(full_filename.start(), mode); |
+ |
+ char* buffer = new char[full_filename.length() + 1]; |
+ memcpy(buffer, full_filename.start(), full_filename.length()); |
+ buffer[full_filename.length()] = '\0'; |
+ return base::SmartArrayPointer<const char>(buffer); |
} |