Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
6f3471d5
Commit
6f3471d5
authored
6 years ago
by
Mark OLESEN
Browse files
Options
Downloads
Patches
Plain Diff
STYLE: protect and comment test of illegal access (
#1066
)
parent
d7fc5f6f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
applications/test/DynamicList/Test-DynamicList.C
+4
-1
4 additions, 1 deletion
applications/test/DynamicList/Test-DynamicList.C
with
4 additions
and
1 deletion
applications/test/DynamicList/Test-DynamicList.C
+
4
−
1
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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment