Prevent a NULL deref.

Patch by Rachel Blum <groby@chromium.org>

R=mnaganov@chromium.org

Review URL: http://codereview.chromium.org/7218036

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8384 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
mikhail.naganov@gmail.com 2011-06-22 20:41:02 +00:00
parent 0a12f5dcf8
commit 0416b2edc4

View File

@ -396,9 +396,11 @@ class Logger::NameMap {
void Remove(Address code_address) { void Remove(Address code_address) {
HashMap::Entry* entry = FindEntry(code_address); HashMap::Entry* entry = FindEntry(code_address);
if (entry != NULL) DeleteArray(static_cast<const char*>(entry->value)); if (entry != NULL) {
DeleteArray(static_cast<char*>(entry->value));
RemoveEntry(entry); RemoveEntry(entry);
} }
}
void Move(Address from, Address to) { void Move(Address from, Address to) {
if (from == to) return; if (from == to) return;