From fef51fffa57db5683c9a03f6ba176f8fceb4f38e Mon Sep 17 00:00:00 2001 From: saper Date: Tue, 11 Aug 2015 00:48:49 -0700 Subject: [PATCH] deps: backport 75e43a6 from v8 upstream 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(NULL)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ test/cctest/test-heap.cc:131:20: error: reinterpret_cast from 'nullptr_t' to 'v8::internal::Object *' is not allowed Handle n(reinterpret_cast(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
(NULL); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +add myself to the AUTHORS file. BUG= Review URL: https://codereview.chromium.org/1277353002 Cr-Commit-Position: refs/heads/master@{#30103} --- deps/v8/AUTHORS | 1 + deps/v8/src/runtime/runtime-i18n.cc | 2 +- deps/v8/test/cctest/test-heap.cc | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS index b0a9765b4436a5..4f853c275bc249 100644 --- a/deps/v8/AUTHORS +++ b/deps/v8/AUTHORS @@ -69,6 +69,7 @@ Kang-Hao (Kenny) Lu Luis Reis Luke Zarko Maciej Małecki +Marcin Cieślak Mathias Bynens Matt Hanselman Matthew Sporleder diff --git a/deps/v8/src/runtime/runtime-i18n.cc b/deps/v8/src/runtime/runtime-i18n.cc index 5e016515448d6a..346e773f86e305 100644 --- a/deps/v8/src/runtime/runtime-i18n.cc +++ b/deps/v8/src/runtime/runtime-i18n.cc @@ -627,7 +627,7 @@ RUNTIME_FUNCTION(Runtime_CreateBreakIterator) { local_object->SetInternalField(0, reinterpret_cast(break_iterator)); // Make sure that the pointer to adopted text is NULL. - local_object->SetInternalField(1, reinterpret_cast(NULL)); + local_object->SetInternalField(1, static_cast(nullptr)); Factory* factory = isolate->factory(); Handle key = factory->NewStringFromStaticChars("breakIterator"); diff --git a/deps/v8/test/cctest/test-heap.cc b/deps/v8/test/cctest/test-heap.cc index cb08fb4c04ee78..f0a6ad5d269bc3 100644 --- a/deps/v8/test/cctest/test-heap.cc +++ b/deps/v8/test/cctest/test-heap.cc @@ -126,7 +126,7 @@ TEST(HandleNull) { Isolate* isolate = CcTest::i_isolate(); HandleScope outer_scope(isolate); LocalContext context; - Handle n(reinterpret_cast(NULL), isolate); + Handle n(static_cast(nullptr), isolate); CHECK(!n.is_null()); }