Reviewers: danno,
Message:
Committed patchset #1 manually as r21275 (tree was closed).
Description:
Revert "v8::TryCatch now works correctly with ASAN's UseAfterReturn mode
enabled."
This reverts commit r21273.
[email protected]
Committed: https://code.google.com/p/v8/source/detail?r=21275
Please review this at https://codereview.chromium.org/284493003/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+11, -30 lines):
M include/v8.h
M src/api.cc
M src/base/macros.h
M src/isolate.cc
M src/zone.h
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index
e56e42be957b75d459b63fa387d539c89dffcec4..e089b41818f12d2109f4fde96647806d16045d12
100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -5076,8 +5076,6 @@ class V8_EXPORT TryCatch {
void SetCaptureMessage(bool value);
private:
- TryCatch* DesanitizedThis();
-
// Make it hard to create heap-allocated TryCatch blocks.
TryCatch(const TryCatch&);
void operator=(const TryCatch&);
@@ -5089,7 +5087,6 @@ class V8_EXPORT TryCatch {
void* exception_;
void* message_obj_;
void* message_script_;
- void* asan_fake_stack_handle_;
int message_start_pos_;
int message_end_pos_;
bool is_verbose_ : 1;
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index
493c71ce47f8987c4fcc65d5b54b53e68dfd826e..7f1276dee8e634fb9fafc6ef093596f9fc18e389
100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -6,9 +6,6 @@
#include <string.h> // For memcpy, strlen.
#include <cmath> // For isnan.
-#ifdef V8_USE_ADDRESS_SANITIZER
-#include <sanitizer/asan_interface.h>
-#endif // V8_USE_ADDRESS_SANITIZER
#include "../include/v8-debug.h"
#include "../include/v8-profiler.h"
#include "../include/v8-testing.h"
@@ -1822,16 +1819,6 @@ v8::TryCatch::~TryCatch() {
}
-v8::TryCatch* v8::TryCatch::DesanitizedThis() {
-#ifdef V8_USE_ADDRESS_SANITIZER
- return TRY_CATCH_FROM_ADDRESS(
- __asan_addr_is_in_fake_stack(asan_fake_stack_handle_, this, NULL,
NULL));
-#else
- return this;
-#endif
-}
-
-
bool v8::TryCatch::HasCaught() const {
return !reinterpret_cast<i::Object*>(exception_)->IsTheHole();
}
@@ -1906,11 +1893,6 @@ void v8::TryCatch::Reset() {
message_script_ = the_hole;
message_start_pos_ = 0;
message_end_pos_ = 0;
-#ifdef V8_USE_ADDRESS_SANITIZER
- asan_fake_stack_handle_ = __asan_get_current_fake_stack();
-#else
- asan_fake_stack_handle_ = NULL;
-#endif
}
Index: src/base/macros.h
diff --git a/src/base/macros.h b/src/base/macros.h
index
fa522fb94531c26f4eb7e95b0b3ed910ea43ad93..b99f01b230c52db6c11e90a49c608919ae6ccfab
100644
--- a/src/base/macros.h
+++ b/src/base/macros.h
@@ -54,17 +54,15 @@
#define MUST_USE_RESULT V8_WARN_UNUSED_RESULT
-// Define V8_USE_ADDRESS_SANITIZER macros.
+// Define DISABLE_ASAN macros.
#if defined(__has_feature)
#if __has_feature(address_sanitizer)
-#define V8_USE_ADDRESS_SANITIZER 1
+#define DISABLE_ASAN __attribute__((no_sanitize_address))
#endif
#endif
-// Define DISABLE_ASAN macros.
-#ifdef V8_USE_ADDRESS_SANITIZER
-#define DISABLE_ASAN __attribute__((no_sanitize_address))
-#else
+
+#ifndef DISABLE_ASAN
#define DISABLE_ASAN
#endif
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index
898f43c166fa11a1907e4fabef6c64823fe3dbf5..06df1f67c25bc380097c2cc8ca471105ec65b071
100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -272,14 +272,13 @@ void Isolate::RegisterTryCatchHandler(v8::TryCatch*
that) {
// JS stack. When running without the simulator, the address
// returned will be the address of the C++ try catch handler itself.
Address address = reinterpret_cast<Address>(
- SimulatorStack::RegisterCTryCatch(reinterpret_cast<uintptr_t>(
- that->DesanitizedThis())));
+
SimulatorStack::RegisterCTryCatch(reinterpret_cast<uintptr_t>(that)));
thread_local_top()->set_try_catch_handler_address(address);
}
void Isolate::UnregisterTryCatchHandler(v8::TryCatch* that) {
- ASSERT(thread_local_top()->TryCatchHandler() == that->DesanitizedThis());
+ ASSERT(thread_local_top()->TryCatchHandler() == that);
thread_local_top()->set_try_catch_handler_address(
reinterpret_cast<Address>(that->next_));
thread_local_top()->catcher_ = NULL;
Index: src/zone.h
diff --git a/src/zone.h b/src/zone.h
index
d3a1b578ac1b44e3b5f3d17562d58e23cb2efead..573e13e1d4af82fb89e41b90135865071285f8d7
100644
--- a/src/zone.h
+++ b/src/zone.h
@@ -15,6 +15,11 @@
namespace v8 {
namespace internal {
+#if defined(__has_feature)
+ #if __has_feature(address_sanitizer)
+ #define V8_USE_ADDRESS_SANITIZER
+ #endif
+#endif
class Segment;
class Isolate;
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.