Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-istl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
Core Modules
dune-istl
Commits
54cc8b27
Commit
54cc8b27
authored
11 years ago
by
Oliver Sander
Committed by
Markus Blatt
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Do not crash in find() if array is empty
This fixes FS 1292, but with my own slightly different patch.
parent
fe444d37
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/istl/basearray.hh
+8
-2
8 additions, 2 deletions
dune/istl/basearray.hh
with
8 additions
and
2 deletions
dune/istl/basearray.hh
+
8
−
2
View file @
54cc8b27
...
...
@@ -716,6 +716,9 @@ namespace Dune {
//! random access returning iterator (end if not contained)
iterator
find
(
size_type
i
)
{
if
(
n
==
0
)
return
end
();
size_type
l
=
0
,
r
=
n
-
1
;
while
(
l
<
r
)
{
...
...
@@ -724,7 +727,7 @@ namespace Dune {
else
l
=
q
+
1
;
}
if
(
n
&&
i
==
j
[
l
])
if
(
i
==
j
[
l
])
return
iterator
(
p
,
j
,
l
);
else
return
iterator
(
p
,
j
,
n
);
...
...
@@ -762,6 +765,9 @@ namespace Dune {
//! random access returning iterator (end if not contained)
const_iterator
find
(
size_type
i
)
const
{
if
(
n
==
0
)
return
end
();
size_type
l
=
0
,
r
=
n
-
1
;
while
(
l
<
r
)
{
...
...
@@ -770,7 +776,7 @@ namespace Dune {
else
l
=
q
+
1
;
}
if
(
n
&&
i
==
j
[
l
])
if
(
i
==
j
[
l
])
return
const_iterator
(
p
,
j
,
l
);
else
return
const_iterator
(
p
,
j
,
n
);
...
...
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