Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Unified Diff: src/api.cc

Issue 2588433002: abort in delete operators that shouldn't be called (Closed)
Patch Set: call abort to satisfy windows compiler Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/v8.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 04e7c894d4584e3d4cce1ad50b73b22885acfff4..43cbf387c71e31cc9e7a549ba7f4692717215bc1 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -978,6 +978,12 @@ HandleScope::~HandleScope() {
i::HandleScope::CloseScope(isolate_, prev_next_, prev_limit_);
}
+V8_NORETURN void* HandleScope::operator new(size_t) {
+ base::OS::Abort();
+ abort();
+}
+
+void HandleScope::operator delete(void*, size_t) { base::OS::Abort(); }
int HandleScope::NumberOfHandles(Isolate* isolate) {
return i::HandleScope::NumberOfHandles(
@@ -1016,6 +1022,13 @@ i::Object** EscapableHandleScope::Escape(i::Object** escape_value) {
return escape_slot_;
}
+V8_NORETURN void* EscapableHandleScope::operator new(size_t) {
+ base::OS::Abort();
+ abort();
+}
+
+void EscapableHandleScope::operator delete(void*, size_t) { base::OS::Abort(); }
+
SealHandleScope::SealHandleScope(Isolate* isolate)
: isolate_(reinterpret_cast<i::Isolate*>(isolate)) {
i::HandleScopeData* current = isolate_->handle_scope_data();
@@ -1034,6 +1047,12 @@ SealHandleScope::~SealHandleScope() {
current->sealed_level = prev_sealed_level_;
}
+V8_NORETURN void* SealHandleScope::operator new(size_t) {
+ base::OS::Abort();
+ abort();
+}
+
+void SealHandleScope::operator delete(void*, size_t) { base::OS::Abort(); }
void Context::Enter() {
i::Handle<i::Context> env = Utils::OpenHandle(this);
@@ -2514,6 +2533,12 @@ v8::TryCatch::~TryCatch() {
}
}
+V8_NORETURN void* v8::TryCatch::operator new(size_t) {
+ base::OS::Abort();
+ abort();
+}
+
+void v8::TryCatch::operator delete(void*, size_t) { base::OS::Abort(); }
bool v8::TryCatch::HasCaught() const {
return !reinterpret_cast<i::Object*>(exception_)->IsTheHole(isolate_);
« no previous file with comments | « include/v8.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698