• vogelheim@chromium.org's avatar
    Prevent calls to ReturnValue::Set with pointer-valued types. · 6b1f7426
    vogelheim@chromium.org authored
    Currently, this code will compile:
      SomePointer* p = ...;
      ReturnValue r = ...;
      r.Set(p);
    
    What happens is that ReturnValue::Set has no pointer-ish overloads, but
    a bool one, and hence C++ will convert the pointer to a bool and use
    the Set(bool) overload. In other words, the example above is equivalent
    to: r.Set(p ? true : false); Which probably isn't what the author had
    in mind. This change adds a Set(void*) overload whose body forces a
    compile error, to prevent this from happening inadvertently. The only
    use of this indeed turned out to be an error.
    
    (Wait for issue 364025 before submitting.)
    
    BUG=
    R=dcarney@chromium.org
    
    Review URL: https://codereview.chromium.org/240013004
    
    git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21217 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
    6b1f7426
Name
Last commit
Last update
benchmarks Loading commit data...
build Loading commit data...
include Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
tools Loading commit data...
.DEPS.git Loading commit data...
.clang-format Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
Makefile Loading commit data...
Makefile.android Loading commit data...
Makefile.nacl Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...