c99
int f(int k){
int a[k];
a[2] = 9;
return a[2];
}
int main(int argc, char *argv[])
{
f(3);
return 0;
}
main.o: 文件格式 elf32-i386
Disassembly of section .text:
00000000 <_Z1fi>:
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 53 push %ebx
4: 83 ec 14 sub $0x14,%esp
7: 65 a1 14 00 00 00 mov %gs:0x14,%eax
d: 89 45 f4 mov %eax,-0xc(%ebp)
10: 31 c0 xor %eax,%eax
12: 89 e0 mov %esp,%eax
14: 89 c1 mov %eax,%ecx
16: 8b 45 08 mov 0x8(%ebp),%eax
19: 83 e8 01 sub $0x1,%eax
1c: 89 45 ec mov %eax,-0x14(%ebp)
1f: 83 c0 01 add $0x1,%eax
22: c1 e0 02 shl $0x2,%eax
25: 8d 50 03 lea 0x3(%eax),%edx
28: b8 10 00 00 00 mov $0x10,%eax
2d: 83 e8 01 sub $0x1,%eax
30: 01 d0 add %edx,%eax
32: bb 10 00 00 00 mov $0x10,%ebx
37: ba 00 00 00 00 mov $0x0,%edx
3c: f7 f3 div %ebx
3e: 6b c0 10 imul $0x10,%eax,%eax
41: 29 c4 sub %eax,%esp
43: 89 e0 mov %esp,%eax
45: 83 c0 03 add $0x3,%eax
48: c1 e8 02 shr $0x2,%eax
4b: c1 e0 02 shl $0x2,%eax
4e: 89 45 f0 mov %eax,-0x10(%ebp)
51: 8b 45 f0 mov -0x10(%ebp),%eax
54: c7 40 08 09 00 00 00 movl $0x9,0x8(%eax)
5b: 8b 45 f0 mov -0x10(%ebp),%eax
5e: 8b 40 08 mov 0x8(%eax),%eax
61: 89 cc mov %ecx,%esp
63: 8b 5d f4 mov -0xc(%ebp),%ebx
66: 65 33 1d 14 00 00 00 xor %gs:0x14,%ebx
6d: 74 05 je 74 <_Z1fi+0x74>
6f: e8 fc ff ff ff call 70 <_Z1fi+0x70>
74: 8b 5d fc mov -0x4(%ebp),%ebx
77: c9 leave
78: c3 ret
00000079 <main>:
79: 8d 4c 24 04 lea 0x4(%esp),%ecx
7d: 83 e4 f0 and $0xfffffff0,%esp
80: ff 71 fc pushl -0x4(%ecx)
83: 55 push %ebp
84: 89 e5 mov %esp,%ebp
86: 51 push %ecx
87: 83 ec 04 sub $0x4,%esp
8a: 83 ec 0c sub $0xc,%esp
8d: 6a 03 push $0x3
8f: e8 fc ff ff ff call 90 <main+0x17>
94: 83 c4 10 add $0x10,%esp
97: b8 00 00 00 00 mov $0x0,%eax
9c: 8b 4d fc mov -0x4(%ebp),%ecx
9f: c9 leave
a0: 8d 61 fc lea -0x4(%ecx),%esp
a3: c3 ret