@@ -3,7 +3,7 @@ use core::ffi::c_void;
3
3
use std:: ptr;
4
4
use std:: thread;
5
5
6
- fn get_actual_fn_pointer ( fp : usize ) -> usize {
6
+ fn get_actual_fn_pointer ( fp : * mut c_void ) -> * mut c_void {
7
7
// On AIX, the function name references a function descriptor.
8
8
// A function descriptor consists of (See https://reviews.llvm.org/D62532)
9
9
// * The address of the entry point of the function.
@@ -16,17 +16,18 @@ fn get_actual_fn_pointer(fp: usize) -> usize {
16
16
// https://www.ibm.com/docs/en/aix/7.2?topic=program-understanding-programming-toc
17
17
if cfg ! ( target_os = "aix" ) {
18
18
unsafe {
19
- let actual_fn_entry = * ( fp as * const usize ) ;
19
+ let actual_fn_entry = * ( fp as * const * mut c_void ) ;
20
20
actual_fn_entry
21
21
}
22
22
} else {
23
- fp
23
+ fp as * mut c_void
24
24
}
25
25
}
26
26
27
27
#[ test]
28
28
// FIXME: shouldn't ignore this test on i686-msvc, unsure why it's failing
29
29
#[ cfg_attr( all( target_arch = "x86" , target_env = "msvc" ) , ignore) ]
30
+ #[ inline( never) ]
30
31
#[ rustfmt:: skip] // we care about line numbers here
31
32
fn smoke_test_frames ( ) {
32
33
frame_1 ( line ! ( ) ) ;
@@ -43,10 +44,10 @@ fn smoke_test_frames() {
43
44
// Various platforms have various bits of weirdness about their
44
45
// backtraces. To find a good starting spot let's search through the
45
46
// frames
46
- let target = get_actual_fn_pointer ( frame_4 as usize ) ;
47
+ let target = get_actual_fn_pointer ( frame_4 as * mut c_void ) ;
47
48
let offset = v
48
49
. iter ( )
49
- . map ( |frame| frame. symbol_address ( ) as usize )
50
+ . map ( |frame| frame. symbol_address ( ) )
50
51
. enumerate ( )
51
52
. filter_map ( |( i, sym) | {
52
53
if sym >= target {
@@ -62,39 +63,39 @@ fn smoke_test_frames() {
62
63
63
64
assert_frame (
64
65
frames. next ( ) . unwrap ( ) ,
65
- get_actual_fn_pointer ( frame_4 as usize ) ,
66
+ get_actual_fn_pointer ( frame_4 as * mut c_void ) as usize ,
66
67
"frame_4" ,
67
68
"tests/smoke.rs" ,
68
69
start_line + 6 ,
69
70
9 ,
70
71
) ;
71
72
assert_frame (
72
73
frames. next ( ) . unwrap ( ) ,
73
- get_actual_fn_pointer ( frame_3 as usize ) ,
74
+ get_actual_fn_pointer ( frame_3 as * mut c_void ) as usize ,
74
75
"frame_3" ,
75
76
"tests/smoke.rs" ,
76
77
start_line + 3 ,
77
78
52 ,
78
79
) ;
79
80
assert_frame (
80
81
frames. next ( ) . unwrap ( ) ,
81
- get_actual_fn_pointer ( frame_2 as usize ) ,
82
+ get_actual_fn_pointer ( frame_2 as * mut c_void ) as usize ,
82
83
"frame_2" ,
83
84
"tests/smoke.rs" ,
84
85
start_line + 2 ,
85
86
52 ,
86
87
) ;
87
88
assert_frame (
88
89
frames. next ( ) . unwrap ( ) ,
89
- get_actual_fn_pointer ( frame_1 as usize ) ,
90
+ get_actual_fn_pointer ( frame_1 as * mut c_void ) as usize ,
90
91
"frame_1" ,
91
92
"tests/smoke.rs" ,
92
93
start_line + 1 ,
93
94
52 ,
94
95
) ;
95
96
assert_frame (
96
97
frames. next ( ) . unwrap ( ) ,
97
- get_actual_fn_pointer ( smoke_test_frames as usize ) ,
98
+ get_actual_fn_pointer ( smoke_test_frames as * mut c_void ) as usize ,
98
99
"smoke_test_frames" ,
99
100
"" ,
100
101
0 ,
0 commit comments