Avoid COMDAT folding between InvalidParameter and PureCall
While investigating crbug.com/882670 I noticed that the CRT __purecall
function was calling the InvalidParameter function instead of the
PureCall function. That is happening because the two functions have
identical implementations and generate identical code and therefore the
linker folds the two functions together. This happens despite compiler
optimizations being disabled.
This is harmless but causes mild confusion. This CL changes the return
code of one of the functions so that the two functions are no longer
identical.
This change was tested by defining these classes, creating a variable of
type Derived, and then checking what call stack appears for the crash
in a release build:
struct Base {
Base() { Middle(); }
void Middle() { DerivedFunc(); }
virtual void DerivedFunc() = 0;
};
struct Derived : public Base {
void DerivedFunc() override {}
};
I manually confirmed that this fix has the desired effect.
Change-Id: I37446600e00a3ee95b009190c471e938ec85e5c0
Reviewed-on: https://chromium-review.googlesource.com/1237539
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Robert Liao <robliao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593317}Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .