越界写。 存在溢出错误。
> #define FLOORSNUMBER 128
> #define ILAFLOORSNUMBER 40
> #else
> #define ILAFLOORSNUMBER 40
>
> uint8 downCallSide[ILAFLOORSNUMBER]; extern uint16
> callLightTimerAside[FLOORSNUMBER]; extern uint16
> callLightTimerBside[FLOORSNUMBER];
for(i = 0;i <= FLOORSNUMBER;i++)
{
**CID 18019 (#1 of 3): Out-of-bounds write (OVERRUN)
overrun-local: Overrunning array ilaByPass.downCallSide of 40 bytes at byte offset 128 using index i (which evaluates to 128)**
ilaByPass.downCallSide[i] = OFFSTATE;
#ifndef NA
**CID 17746 (#1 of 3): Out-of-bounds write (OVERRUN)**
**overrun-local: Overrunning array callLightTimerAside of 128 2-byte elements at element index 128 (byte offset 257) using index i (which evaluates to 128).**
callLightTimerAside[i] = OFFSTATE;
我知道当我们尝试 downcallside[i] 时存在溢出,因为 i 的值上升到 128,而 downcallside 的大小仅为 40。我该如何解决?
和
对于 callLightTimerAside[i],大小似乎与 floornumber 相同,但仍有超限。