Commit b75063be authored by ulan@chromium.org's avatar ulan@chromium.org

Do not call reinterpret_cast when converting from NULL.

If NULL is a nullptr (such as on my FreeBSD system), it is not possible to
use reinterpret_cast to convert it to another pointer. Plus, just using NULL
directly achieves the same effect.

R=ulan@chromium.org

Review URL: https://chromiumcodereview.appspot.com/19388005

Patch from Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15705 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 4465c831
...@@ -7350,7 +7350,7 @@ void HeapIterator::reset() { ...@@ -7350,7 +7350,7 @@ void HeapIterator::reset() {
#ifdef DEBUG #ifdef DEBUG
Object* const PathTracer::kAnyGlobalObject = reinterpret_cast<Object*>(NULL); Object* const PathTracer::kAnyGlobalObject = NULL;
class PathTracer::MarkVisitor: public ObjectVisitor { class PathTracer::MarkVisitor: public ObjectVisitor {
public: public:
......
...@@ -1539,7 +1539,7 @@ Handle<Code> StubCompiler::GetCodeWithFlags(Code::Flags flags, ...@@ -1539,7 +1539,7 @@ Handle<Code> StubCompiler::GetCodeWithFlags(Code::Flags flags,
Handle<Name> name) { Handle<Name> name) {
return (FLAG_print_code_stubs && !name.is_null() && name->IsString()) return (FLAG_print_code_stubs && !name.is_null() && name->IsString())
? GetCodeWithFlags(flags, *Handle<String>::cast(name)->ToCString()) ? GetCodeWithFlags(flags, *Handle<String>::cast(name)->ToCString())
: GetCodeWithFlags(flags, reinterpret_cast<char*>(NULL)); : GetCodeWithFlags(flags, NULL);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment