Skip to content

Commit 830584c

Browse files
jBarzrvagg
authored andcommitted
deps: define missing operator delete functions
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: #10356 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
1 parent c130b31 commit 830584c

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

deps/v8/src/api.cc

+25
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,11 @@ HandleScope::~HandleScope() {
598598
}
599599

600600

601+
void HandleScope::operator delete(void*, size_t) {
602+
base::OS::Abort();
603+
}
604+
605+
601606
int HandleScope::NumberOfHandles(Isolate* isolate) {
602607
return i::HandleScope::NumberOfHandles(
603608
reinterpret_cast<i::Isolate*>(isolate));
@@ -623,6 +628,11 @@ EscapableHandleScope::EscapableHandleScope(Isolate* v8_isolate) {
623628
}
624629

625630

631+
void EscapableHandleScope::operator delete(void*, size_t) {
632+
base::OS::Abort();
633+
}
634+
635+
626636
i::Object** EscapableHandleScope::Escape(i::Object** escape_value) {
627637
i::Heap* heap = reinterpret_cast<i::Isolate*>(GetIsolate())->heap();
628638
Utils::ApiCheck(*escape_slot_ == heap->the_hole_value(),
@@ -658,6 +668,11 @@ SealHandleScope::~SealHandleScope() {
658668
}
659669

660670

671+
void SealHandleScope::operator delete(void*, size_t) {
672+
base::OS::Abort();
673+
}
674+
675+
661676
void Context::Enter() {
662677
i::Handle<i::Context> env = Utils::OpenHandle(this);
663678
i::Isolate* isolate = env->GetIsolate();
@@ -1884,6 +1899,11 @@ v8::TryCatch::~TryCatch() {
18841899
}
18851900

18861901

1902+
void v8::TryCatch::operator delete(void*, size_t) {
1903+
base::OS::Abort();
1904+
}
1905+
1906+
18871907
bool v8::TryCatch::HasCaught() const {
18881908
return !reinterpret_cast<i::Object*>(exception_)->IsTheHole();
18891909
}
@@ -6449,6 +6469,11 @@ void Isolate::RemoveGCEpilogueCallback(GCEpilogueCallback callback) {
64496469
}
64506470

64516471

6472+
void Isolate::operator delete(void*, size_t) {
6473+
base::OS::Abort();
6474+
}
6475+
6476+
64526477
void V8::AddGCPrologueCallback(GCPrologueCallback callback, GCType gc_type) {
64536478
i::Isolate* isolate = i::Isolate::Current();
64546479
isolate->heap()->AddGCPrologueCallback(

deps/v8/src/version.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#define MAJOR_VERSION 3
3636
#define MINOR_VERSION 28
3737
#define BUILD_NUMBER 71
38-
#define PATCH_LEVEL 19
38+
#define PATCH_LEVEL 20
3939
// Use 1 for candidates and 0 otherwise.
4040
// (Boolean macro values are not supported by all preprocessors.)
4141
#define IS_CANDIDATE_VERSION 0

0 commit comments

Comments
 (0)