c整形数组汇编解释
c整形数组汇编解释
初始化 (定义时赋值后才会初始化)
int example[2][5]={};
movq $0x0,-0x30(%rbp)
movq $0x0,-0x28(%rbp)
movq $0x0,-0x20(%rbp)
movq $0x0,-0x18(%rbp)
movq $0x0,-0x10(%rbp)
赋值
int example[2][5]={1,2,3,4,5,6,7}
movl $0x1,-0x30(%rbp)
movl $0x2,-0x2c(%rbp)
movl $0x3,-0x28(%rbp)
movl $0x4,-0x24(%rbp)
movl $0x5,-0x20(%rbp)
movl $0x6,-0x1c(%rbp)
movl $0x7,-0x18(%rbp)
改写
*example[0]=6
movl $0x6,-0x30(%rbp)
注意:
数组越界:当数组越界改写时,可能会引起
- 主调函数的变量更改。
- 后续指针随机访问。

浙公网安备 33010602011771号