Use static to define CheckStackTrace on non-GNU (#429)
for `&CheckStackAddress`, VisualStudio emits address of a trampoline like PLT, not the actual address of `CheckStackTrace`. We need address of `CheckStackTrace` to guess the address range of the function. `static` function seems to return the actual address of the function. Fixes #421
This commit is contained in:
parent
7f91846ca1
commit
64041397b3
@ -180,6 +180,15 @@ static void ATTRIBUTE_NOINLINE CheckStackTrace1(int i) {
|
||||
CheckStackTrace2(j);
|
||||
DECLARE_ADDRESS_LABEL(end);
|
||||
}
|
||||
#ifndef __GNUC__
|
||||
// On non-GNU environment, we use the address of `CheckStackTrace` to
|
||||
// guess the address range of this function. This guess is wrong for
|
||||
// non-static function on Windows. This is probably because
|
||||
// `&CheckStackTrace` returns the address of a trampoline like PLT,
|
||||
// not the actual address of `CheckStackTrace`.
|
||||
// See https://github.com/google/glog/issues/421 for the detail.
|
||||
static
|
||||
#endif
|
||||
void ATTRIBUTE_NOINLINE CheckStackTrace(int i) {
|
||||
INIT_ADDRESS_RANGE(CheckStackTrace, start, end, &expected_range[5]);
|
||||
DECLARE_ADDRESS_LABEL(start);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user