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

Unified Diff: src/log.cc

Issue 2843023: Avoid a potential null dereference wrt the CPU profiler.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 6 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/log.cc
===================================================================
--- src/log.cc (revision 4944)
+++ src/log.cc (working copy)
@@ -309,10 +309,10 @@
void Profiler::Run() {
zarko 2010/06/24 23:13:21 Would it be helpful to ASSERT(Logger::profiler_ ==
TickSample sample;
- bool overflow = Logger::profiler_->Remove(&sample);
+ bool overflow = Remove(&sample);
while (running_) {
LOG(TickEvent(&sample, overflow));
- overflow = Logger::profiler_->Remove(&sample);
+ overflow = Remove(&sample);
}
}
@@ -1150,7 +1150,7 @@
int Logger::GetActiveProfilerModules() {
int result = PROFILER_MODULE_NONE;
- if (!profiler_->paused()) {
+ if (profiler_ != NULL && !profiler_->paused()) {
result |= PROFILER_MODULE_CPU;
}
if (FLAG_log_gc) {
@@ -1162,7 +1162,7 @@
void Logger::PauseProfiler(int flags, int tag) {
if (!Log::IsEnabled()) return;
- if (flags & PROFILER_MODULE_CPU) {
+ if (profiler_ != NULL && (flags & PROFILER_MODULE_CPU)) {
// It is OK to have negative nesting.
if (--cpu_profiler_nesting_ == 0) {
profiler_->pause();
@@ -1193,7 +1193,7 @@
if (tag != 0) {
UncheckedIntEvent("open-tag", tag);
}
- if (flags & PROFILER_MODULE_CPU) {
+ if (profiler_ != NULL && (flags & PROFILER_MODULE_CPU)) {
if (cpu_profiler_nesting_++ == 0) {
++logging_nesting_;
if (FLAG_prof_lazy) {
« 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