Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
573cd35f
Commit
573cd35f
authored
Jun 01, 2020
by
Thomas Trummer
Browse files
Fix undefined behaviour when accessing empty std::vector
parent
323159d8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
platforms/cpu/src/CpuBondForce.cpp
platforms/cpu/src/CpuBondForce.cpp
+1
-1
No files found.
platforms/cpu/src/CpuBondForce.cpp
View file @
573cd35f
...
...
@@ -41,7 +41,7 @@ CpuBondForce::CpuBondForce() {
void
CpuBondForce
::
initialize
(
int
numAtoms
,
int
numBonds
,
int
numAtomsPerBond
,
vector
<
vector
<
int
>
>&
bondAtoms
,
ThreadPool
&
threads
)
{
this
->
numBonds
=
numBonds
;
this
->
numAtomsPerBond
=
numAtomsPerBond
;
this
->
bondAtoms
=
&
bondAtoms
[
0
]
;
this
->
bondAtoms
=
bondAtoms
.
empty
()
?
nullptr
:
bondAtoms
.
data
()
;
this
->
threads
=
&
threads
;
int
numThreads
=
threads
.
getNumThreads
();
int
targetBondsPerThread
=
numBonds
/
numThreads
;
...
...
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