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

Unified Diff: include/v8.h

Issue 282783004: Reland of "v8::TryCatch now works correctly with ASAN's UseAfterReturn mode enabled." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remake Created 6 years, 7 months 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 | « no previous file | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index e089b41818f12d2109f4fde96647806d16045d12..dedf19eb370e4452e67b55a2bfc51b6a3deb000f 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -5075,6 +5075,22 @@ class V8_EXPORT TryCatch {
*/
void SetCaptureMessage(bool value);
+ /**
+ * There are cases when the raw address of C++ TryCatch object cannot be
+ * used for comparisons with addresses into the JS stack. The cases are:
+ * 1) ARM, ARM64 and MIPS simulators which have separate JS stack.
+ * 2) Address sanitizer allocates local C++ object in the heap when
+ * UseAfterReturn mode is enabled.
+ * This method returns address that can be used for comparisons with
+ * addresses into the JS stack. When neither simulator nor ASAN's
+ * UseAfterReturn is enabled, then the address returned will be the address
+ * of the C++ try catch handler itself.
+ */
+ static void* JSStackComparableAddress(v8::TryCatch* handler) {
+ if (handler == NULL) return NULL;
+ return handler->js_stack_comparable_address_;
+ }
+
private:
// Make it hard to create heap-allocated TryCatch blocks.
TryCatch(const TryCatch&);
@@ -5083,10 +5099,11 @@ class V8_EXPORT TryCatch {
void operator delete(void*, size_t);
v8::internal::Isolate* isolate_;
- void* next_;
+ v8::TryCatch* next_;
void* exception_;
void* message_obj_;
void* message_script_;
+ void* js_stack_comparable_address_;
int message_start_pos_;
int message_end_pos_;
bool is_verbose_ : 1;
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698