You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We observed that CBMC does not recognize pointers that are initialized within a C file but outside a function.
It marks these pointers as INVALID-X where X is an integer.
For example, in the code below
#definePACKETBUF_SIZE 128
staticuint32_tpacketbuf_aligned[(PACKETBUF_SIZE+3) / 4];
// Initializing a pointer outside a function causes CBMC to misbehaveuint8_t*packetbuf= (uint8_t*)packetbuf_aligned;
voidharness() {
uint16_tchannelId;
uint8_t*data=packetbuf;
memcpy(&channelId, data, 2);
}
packetbuf is initialized to point to the statically allocated packetbuf_aligned array.
However, when data is defined to point to packetbuf, CBMC sees the packetbuf pointer as invalid and subsequently, makes data invalid.
As a result, an error is reported in the memcpy line where data is accessed.
We tested this with CBMC v6.3.1
The text was updated successfully, but these errors were encountered:
We observed that CBMC does not recognize pointers that are initialized within a C file but outside a function.
It marks these pointers as INVALID-X where X is an integer.
For example, in the code below
packetbuf
is initialized to point to the statically allocatedpacketbuf_aligned
array.However, when
data
is defined to point topacketbuf
, CBMC sees thepacketbuf
pointer as invalid and subsequently, makesdata
invalid.As a result, an error is reported in the memcpy line where
data
is accessed.We tested this with CBMC v6.3.1
The text was updated successfully, but these errors were encountered: