mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: protect and comment test of illegal access (#1066)
This commit is contained in:
@ -103,8 +103,11 @@ int main(int argc, char *argv[])
|
|||||||
ldl[1].reserve(5); // should not decrease allocated size
|
ldl[1].reserve(5); // should not decrease allocated size
|
||||||
ldl[1](3) = 2; // allocates space and sets value
|
ldl[1](3) = 2; // allocates space and sets value
|
||||||
|
|
||||||
// this works without a segfault, but doesn't change the list size
|
#ifndef FULLDEBUG
|
||||||
|
// Accessing an out-of-bounds address, but writing into allocated memory.
|
||||||
|
// No segfault, doesn't change the list size. Nonetheless not a good idea.
|
||||||
ldl[0][4] = 4;
|
ldl[0][4] = 4;
|
||||||
|
#endif
|
||||||
|
|
||||||
ldl[1] = 3;
|
ldl[1] = 3;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user