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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 1266893002: CFI: Add a new debug URL, chrome://badcast. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index f6a4baca9e17bc55960516e1d1c75490a0f6129f..8e061484c83e404bc77837998a3d7a095da10e4a 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -312,6 +312,19 @@ NOINLINE void CrashIntentionally() {
*zero = 0;
}
+NOINLINE void BadCastIntentionally() {
Avi (use Gerrit) 2015/07/30 21:36:49 BadCastCrashIntentionally Our crash triage folks
pcc1 2015/07/30 23:43:01 Done.
+ class A {
+ virtual void f() {}
+ };
+
+ class B {
+ virtual void f() {}
+ };
+
+ A a;
+ (void)(B*)&a;
+}
+
#if defined(ADDRESS_SANITIZER) || defined(SYZYASAN)
NOINLINE void MaybeTriggerAsanError(const GURL& url) {
// NOTE(rogerm): We intentionally perform an invalid heap access here in
@@ -351,7 +364,9 @@ NOINLINE void MaybeTriggerAsanError(const GURL& url) {
void MaybeHandleDebugURL(const GURL& url) {
if (!url.SchemeIs(kChromeUIScheme))
return;
- if (url == GURL(kChromeUICrashURL)) {
+ if (url == GURL(kChromeUIBadCastURL)) {
+ BadCastIntentionally();
+ } else if (url == GURL(kChromeUICrashURL)) {
CrashIntentionally();
} else if (url == GURL(kChromeUIDumpURL)) {
// This URL will only correctly create a crash dump file if content is
« content/public/common/url_constants.cc ('K') | « content/public/common/url_constants.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698