@@ -28,26 +28,25 @@ intrinsics! {
28
28
pub unsafe extern "C" fn _alloca( ) {
29
29
// __chkstk and _alloca are the same function
30
30
core:: arch:: naked_asm!(
31
- "push % ecx" ,
32
- "cmp $0x1000,% eax" ,
33
- "lea 8(%esp),% ecx" , // esp before calling this routine -> ecx
31
+ "push ecx" ,
32
+ "cmp eax, 0x1000 " ,
33
+ "lea ecx, [esp + 8] " , // esp before calling this routine -> ecx
34
34
"jb 1f" ,
35
35
"2:" ,
36
- "sub $0x1000,% ecx" ,
37
- "test % ecx,(% ecx) " ,
38
- "sub $0x1000,% eax" ,
39
- "cmp $0x1000,% eax" ,
36
+ "sub ecx, 0x1000 " ,
37
+ "test [ ecx], ecx" ,
38
+ "sub eax, 0x1000 " ,
39
+ "cmp eax, 0x1000 " ,
40
40
"ja 2b" ,
41
41
"1:" ,
42
- "sub %eax,% ecx" ,
43
- "test % ecx,(% ecx) " ,
44
- "lea 4(%esp),% eax" , // load pointer to the return address into eax
45
- "mov %ecx,% esp" , // install the new top of stack pointer into esp
46
- "mov -4(%eax),%ecx " , // restore ecx
47
- "push (% eax) " , // push return address onto the stack
48
- "sub %esp,% eax" , // restore the original value in eax
42
+ "sub ecx, eax " ,
43
+ "test [ ecx], ecx" ,
44
+ "lea eax, [esp + 4] " , // load pointer to the return address into eax
45
+ "mov esp, ecx " , // install the new top of stack pointer into esp
46
+ "mov ecx, [eax - 4] " , // restore ecx
47
+ "push [ eax] " , // push return address onto the stack
48
+ "sub eax, esp " , // restore the original value in eax
49
49
"ret" ,
50
- options( att_syntax)
51
50
) ;
52
51
}
53
52
}
0 commit comments