Commit b94d0288 authored by ishell@chromium.org's avatar ishell@chromium.org

Revert "v8::TryCatch now works correctly with ASAN's UseAfterReturn mode enabled."

This reverts commit r21273.

TBR=danno@chromium.org

Review URL: https://codereview.chromium.org/284493003

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21275 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 6e745789
...@@ -5076,8 +5076,6 @@ class V8_EXPORT TryCatch { ...@@ -5076,8 +5076,6 @@ class V8_EXPORT TryCatch {
void SetCaptureMessage(bool value); void SetCaptureMessage(bool value);
private: private:
TryCatch* DesanitizedThis();
// Make it hard to create heap-allocated TryCatch blocks. // Make it hard to create heap-allocated TryCatch blocks.
TryCatch(const TryCatch&); TryCatch(const TryCatch&);
void operator=(const TryCatch&); void operator=(const TryCatch&);
...@@ -5089,7 +5087,6 @@ class V8_EXPORT TryCatch { ...@@ -5089,7 +5087,6 @@ class V8_EXPORT TryCatch {
void* exception_; void* exception_;
void* message_obj_; void* message_obj_;
void* message_script_; void* message_script_;
void* asan_fake_stack_handle_;
int message_start_pos_; int message_start_pos_;
int message_end_pos_; int message_end_pos_;
bool is_verbose_ : 1; bool is_verbose_ : 1;
......
...@@ -6,9 +6,6 @@ ...@@ -6,9 +6,6 @@
#include <string.h> // For memcpy, strlen. #include <string.h> // For memcpy, strlen.
#include <cmath> // For isnan. #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-debug.h"
#include "../include/v8-profiler.h" #include "../include/v8-profiler.h"
#include "../include/v8-testing.h" #include "../include/v8-testing.h"
...@@ -1822,16 +1819,6 @@ v8::TryCatch::~TryCatch() { ...@@ -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 { bool v8::TryCatch::HasCaught() const {
return !reinterpret_cast<i::Object*>(exception_)->IsTheHole(); return !reinterpret_cast<i::Object*>(exception_)->IsTheHole();
} }
...@@ -1906,11 +1893,6 @@ void v8::TryCatch::Reset() { ...@@ -1906,11 +1893,6 @@ void v8::TryCatch::Reset() {
message_script_ = the_hole; message_script_ = the_hole;
message_start_pos_ = 0; message_start_pos_ = 0;
message_end_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
} }
......
...@@ -54,17 +54,15 @@ ...@@ -54,17 +54,15 @@
#define MUST_USE_RESULT V8_WARN_UNUSED_RESULT #define MUST_USE_RESULT V8_WARN_UNUSED_RESULT
// Define V8_USE_ADDRESS_SANITIZER macros. // Define DISABLE_ASAN macros.
#if defined(__has_feature) #if defined(__has_feature)
#if __has_feature(address_sanitizer) #if __has_feature(address_sanitizer)
#define V8_USE_ADDRESS_SANITIZER 1 #define DISABLE_ASAN __attribute__((no_sanitize_address))
#endif #endif
#endif #endif
// Define DISABLE_ASAN macros.
#ifdef V8_USE_ADDRESS_SANITIZER #ifndef DISABLE_ASAN
#define DISABLE_ASAN __attribute__((no_sanitize_address))
#else
#define DISABLE_ASAN #define DISABLE_ASAN
#endif #endif
......
...@@ -272,14 +272,13 @@ void Isolate::RegisterTryCatchHandler(v8::TryCatch* that) { ...@@ -272,14 +272,13 @@ void Isolate::RegisterTryCatchHandler(v8::TryCatch* that) {
// JS stack. When running without the simulator, the address // JS stack. When running without the simulator, the address
// returned will be the address of the C++ try catch handler itself. // returned will be the address of the C++ try catch handler itself.
Address address = reinterpret_cast<Address>( Address address = reinterpret_cast<Address>(
SimulatorStack::RegisterCTryCatch(reinterpret_cast<uintptr_t>( SimulatorStack::RegisterCTryCatch(reinterpret_cast<uintptr_t>(that)));
that->DesanitizedThis())));
thread_local_top()->set_try_catch_handler_address(address); thread_local_top()->set_try_catch_handler_address(address);
} }
void Isolate::UnregisterTryCatchHandler(v8::TryCatch* that) { 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( thread_local_top()->set_try_catch_handler_address(
reinterpret_cast<Address>(that->next_)); reinterpret_cast<Address>(that->next_));
thread_local_top()->catcher_ = NULL; thread_local_top()->catcher_ = NULL;
......
...@@ -15,6 +15,11 @@ ...@@ -15,6 +15,11 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
#if defined(__has_feature)
#if __has_feature(address_sanitizer)
#define V8_USE_ADDRESS_SANITIZER
#endif
#endif
class Segment; class Segment;
class Isolate; class Isolate;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment