summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Barboza <jbarboza@ca.ibm.com>2016-12-07 15:44:14 -0500
committerRod Vagg <rod@vagg.org>2016-12-21 23:07:24 +1100
commit830584ca594f3d6c9284df0062aa31334e3fc06b (patch)
tree1aad6bd5555dc827c081cc4c0323faccd2b82936
parentc130b31cba9e536925c4f9cbebaed91931750b70 (diff)
downloadnode-new-v0.12-staging.tar.gz
deps: define missing operator delete functionsv0.12-staging
Section 3.2 of the C++ standard states that destructor definitions implicitly "use" operator delete functions. Therefore, these operator delete functions must be defined even if they are never called by user code explicitly. http://www.open-std.org/JTC1/SC22/WG21/docs/cwg_defects.html#261 gcc allows them to remain as empty definitions. However, not all compilers allow this. This pull request creates definitions which if ever called, result in an abort. PR-URL: https://github.com/nodejs/node/pull/10356 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rod Vagg <rod@vagg.org>
-rw-r--r--deps/v8/src/api.cc25
-rw-r--r--deps/v8/src/version.cc2
2 files changed, 26 insertions, 1 deletions
diff --git a/deps/v8/src/api.cc b/deps/v8/src/api.cc
index 9aa877cf44..3ff34f9b6f 100644
--- a/deps/v8/src/api.cc
+++ b/deps/v8/src/api.cc
@@ -598,6 +598,11 @@ HandleScope::~HandleScope() {
}
+void HandleScope::operator delete(void*, size_t) {
+ base::OS::Abort();
+}
+
+
int HandleScope::NumberOfHandles(Isolate* isolate) {
return i::HandleScope::NumberOfHandles(
reinterpret_cast<i::Isolate*>(isolate));
@@ -623,6 +628,11 @@ EscapableHandleScope::EscapableHandleScope(Isolate* v8_isolate) {
}
+void EscapableHandleScope::operator delete(void*, size_t) {
+ base::OS::Abort();
+}
+
+
i::Object** EscapableHandleScope::Escape(i::Object** escape_value) {
i::Heap* heap = reinterpret_cast<i::Isolate*>(GetIsolate())->heap();
Utils::ApiCheck(*escape_slot_ == heap->the_hole_value(),
@@ -658,6 +668,11 @@ SealHandleScope::~SealHandleScope() {
}
+void SealHandleScope::operator delete(void*, size_t) {
+ base::OS::Abort();
+}
+
+
void Context::Enter() {
i::Handle<i::Context> env = Utils::OpenHandle(this);
i::Isolate* isolate = env->GetIsolate();
@@ -1884,6 +1899,11 @@ v8::TryCatch::~TryCatch() {
}
+void v8::TryCatch::operator delete(void*, size_t) {
+ base::OS::Abort();
+}
+
+
bool v8::TryCatch::HasCaught() const {
return !reinterpret_cast<i::Object*>(exception_)->IsTheHole();
}
@@ -6449,6 +6469,11 @@ void Isolate::RemoveGCEpilogueCallback(GCEpilogueCallback callback) {
}
+void Isolate::operator delete(void*, size_t) {
+ base::OS::Abort();
+}
+
+
void V8::AddGCPrologueCallback(GCPrologueCallback callback, GCType gc_type) {
i::Isolate* isolate = i::Isolate::Current();
isolate->heap()->AddGCPrologueCallback(
diff --git a/deps/v8/src/version.cc b/deps/v8/src/version.cc
index 28b9de3a7a..3da364cf9c 100644
--- a/deps/v8/src/version.cc
+++ b/deps/v8/src/version.cc
@@ -35,7 +35,7 @@
#define MAJOR_VERSION 3
#define MINOR_VERSION 28
#define BUILD_NUMBER 71
-#define PATCH_LEVEL 19
+#define PATCH_LEVEL 20
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
#define IS_CANDIDATE_VERSION 0