Chromium Code Reviews| Index: src/api.cc |
| diff --git a/src/api.cc b/src/api.cc |
| index 7f1276dee8e634fb9fafc6ef093596f9fc18e389..3079a79d34ee17a674df0df323e9bcc46e259055 100644 |
| --- a/src/api.cc |
| +++ b/src/api.cc |
| @@ -6,6 +6,9 @@ |
| #include <string.h> // For memcpy, strlen. |
| #include <cmath> // For isnan. |
| +#ifdef ASAN_BUILD |
| +#include <sanitizer/asan_interface.h> |
| +#endif // ASAN_BUILD |
| #include "../include/v8-debug.h" |
| #include "../include/v8-profiler.h" |
| #include "../include/v8-testing.h" |
| @@ -1819,6 +1822,16 @@ v8::TryCatch::~TryCatch() { |
| } |
| +v8::TryCatch* v8::TryCatch::DesanitizedThis() { |
| +#ifdef ASAN_BUILD |
| + 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(); |
| } |
| @@ -1893,6 +1906,11 @@ void v8::TryCatch::Reset() { |
| message_script_ = the_hole; |
| message_start_pos_ = 0; |
| message_end_pos_ = 0; |
| +#ifdef ASAN_BUILD |
| + asan_fake_stack_handle_ = __asan_get_current_fake_stack(); |
| +#else |
| + asan_fake_stack_handle_ = 0; |
|
Jakob Kummerow
2014/05/12 16:57:01
nit: I'd prefer s/0/NULL/ for pointers.
Igor Sheludko
2014/05/12 17:09:52
Done.
|
| +#endif |
| } |