File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -2,9 +2,13 @@ use core::intrinsics;
2
2
3
3
// NOTE These functions are implemented using assembly because they using a custom
4
4
// calling convention which can't be implemented using a normal Rust function
5
+
6
+ // NOTE These functions are never mangled as they are not tested against compiler-rt
7
+ // and mangling ___chkstk would break the `jmp ___chkstk` instruction in __alloca
8
+
5
9
#[ cfg( windows) ]
6
10
#[ naked]
7
- #[ cfg_attr ( not ( test ) , no_mangle) ]
11
+ #[ no_mangle]
8
12
pub unsafe fn ___chkstk_ms ( ) {
9
13
asm ! ( "push %rcx
10
14
push %rax
@@ -28,7 +32,7 @@ pub unsafe fn ___chkstk_ms() {
28
32
29
33
#[ cfg( windows) ]
30
34
#[ naked]
31
- #[ cfg_attr ( not ( test ) , no_mangle) ]
35
+ #[ no_mangle]
32
36
pub unsafe fn __alloca ( ) {
33
37
asm ! ( "mov %rcx,%rax // x64 _alloca is a normal function with parameter in rcx
34
38
jmp ___chkstk // Jump to ___chkstk since fallthrough may be unreliable" ) ;
@@ -37,7 +41,7 @@ pub unsafe fn __alloca() {
37
41
38
42
#[ cfg( windows) ]
39
43
#[ naked]
40
- #[ cfg_attr ( not ( test ) , no_mangle) ]
44
+ #[ no_mangle]
41
45
pub unsafe fn ___chkstk ( ) {
42
46
asm ! ( "push %rcx
43
47
cmp $$0x1000,%rax
You can’t perform that action at this time.
0 commit comments