Skip to content

Commit

Permalink
deps: backport 75e43a6 from v8 upstream
Browse files Browse the repository at this point in the history
Note: chunk in test-heap.cc:1989 discarded as related code missing
from current version in node.

Original commit message:

  Use static_cast<> for NULL (clang 3.7)

  The following errors come up when compiling v8
   with clang 3.7 on FreeBSD/amd64:

  src/runtime/runtime-i18n.cc:629:37: error: reinterpret_cast from
  'nullptr_t' to 'v8::internal::Smi *' is not allowed
    local_object->SetInternalField(1, reinterpret_cast<Smi*>(NULL));
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

  test/cctest/test-heap.cc:131:20: error: reinterpret_cast from
        'nullptr_t' to 'v8::internal::Object *' is not allowed
    Handle<Object> n(reinterpret_cast<Object*>(NULL), isolate);
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  test/cctest/test-heap.cc:1989:18: error: reinterpret_cast from
        'nullptr_t' to 'Address' (aka 'unsigned char *') is not
        allowed
    Address base = reinterpret_cast<Address>(NULL);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  +add myself to the AUTHORS file.

  BUG=

  Review URL: https://codereview.chromium.org/1277353002

  Cr-Commit-Position: refs/heads/master@{#30103}

PR-URL: #2636
Reviewed-By: thefourtheye - Sakthipriyan Vairamani <[email protected]>
Reviewed-By: bnoordhuis - Ben Noordhuis <[email protected]>
  • Loading branch information
saper authored and thefourtheye committed Sep 2, 2015
1 parent a06e11d commit 37fcd0b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions deps/v8/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Kang-Hao (Kenny) Lu <[email protected]>
Luis Reis <[email protected]>
Luke Zarko <[email protected]>
Maciej Małecki <[email protected]>
Marcin Cieślak <[email protected]>
Mathias Bynens <[email protected]>
Matt Hanselman <[email protected]>
Matthew Sporleder <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/runtime/runtime-i18n.cc
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ RUNTIME_FUNCTION(Runtime_CreateBreakIterator) {

local_object->SetInternalField(0, reinterpret_cast<Smi*>(break_iterator));
// Make sure that the pointer to adopted text is NULL.
local_object->SetInternalField(1, reinterpret_cast<Smi*>(NULL));
local_object->SetInternalField(1, static_cast<Smi*>(nullptr));

Factory* factory = isolate->factory();
Handle<String> key = factory->NewStringFromStaticChars("breakIterator");
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/test/cctest/test-heap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ TEST(HandleNull) {
Isolate* isolate = CcTest::i_isolate();
HandleScope outer_scope(isolate);
LocalContext context;
Handle<Object> n(reinterpret_cast<Object*>(NULL), isolate);
Handle<Object> n(static_cast<Object*>(nullptr), isolate);
CHECK(!n.is_null());
}

Expand Down

0 comments on commit 37fcd0b

Please sign in to comment.