Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
6f3471d5
Commit
6f3471d5
authored
Nov 08, 2018
by
Mark Olesen
Browse files
STYLE: protect and comment test of illegal access (
#1066
)
parent
d7fc5f6f
Changes
1
Hide whitespace changes
Inline
Side-by-side
applications/test/DynamicList/Test-DynamicList.C
View file @
6f3471d5
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment