From 6f3471d5fb095c2981ec443d365a970f2682b52e Mon Sep 17 00:00:00 2001 From: Mark Olesen <Mark.Olesen@esi-group.com> Date: Thu, 8 Nov 2018 14:46:35 +0100 Subject: [PATCH] STYLE: protect and comment test of illegal access (#1066) --- applications/test/DynamicList/Test-DynamicList.C | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/applications/test/DynamicList/Test-DynamicList.C b/applications/test/DynamicList/Test-DynamicList.C index 8ca36068cec..e4b9fe87517 100644 --- a/applications/test/DynamicList/Test-DynamicList.C +++ b/applications/test/DynamicList/Test-DynamicList.C @@ -103,8 +103,11 @@ int main(int argc, char *argv[]) ldl[1].reserve(5); // should not decrease allocated size 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; + #endif ldl[1] = 3; -- GitLab