Commit afe2a59e authored by Bruce Dawson's avatar Bruce Dawson Committed by Commit Bot

Disable code folding in RenderAccessibilityManager::FatalError

Simple functions like RenderAccessibilityManager::FatalError tend to
generate code which is identical to other similar functions, and the
linker helpfully "folds" them all together in order to save space. When
displaying call stacks the debugger or other tools just choose one of
the function names, without even mentioning that this is just a random
guess, and great confusion ensues.

In this case about a dozen different functions are all folded together
and this is leading to a misleading and possibly inconsistent crash
signature. base::debug::Alias is a reasonably reliable way of making the
function unique so that it won't be folded.

AX-Relnotes: N/A

Bug: 1094848
Change-Id: I4814b718a11fcd18fd1414f1e1349d1cb18d31fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2432760
Auto-Submit: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: default avatarAaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810941}
parent 546380b7
......@@ -7,6 +7,7 @@
#include <utility>
#include "base/bind.h"
#include "base/debug/alias.h"
#include "content/renderer/accessibility/render_accessibility_impl.h"
#include "content/renderer/render_frame_impl.h"
......@@ -65,6 +66,9 @@ void RenderAccessibilityManager::SetMode(uint32_t ax_mode) {
}
void RenderAccessibilityManager::FatalError() {
// Prevent code folding.
const int line_number = __LINE__;
base::debug::Alias(&line_number);
CHECK(false) << "Invalid accessibility tree.";
}
......
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