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
b37e55be
Unverified
Commit
b37e55be
authored
Jun 01, 2020
by
peastman
Committed by
GitHub
Jun 01, 2020
Browse files
Merge pull request #2714 from thtrummer/master
Fix undefined behaviour when accessing empty std::vector
parents
323159d8
573cd35f
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 @
b37e55be
...
@@ -41,7 +41,7 @@ CpuBondForce::CpuBondForce() {
...
@@ -41,7 +41,7 @@ CpuBondForce::CpuBondForce() {
void
CpuBondForce
::
initialize
(
int
numAtoms
,
int
numBonds
,
int
numAtomsPerBond
,
vector
<
vector
<
int
>
>&
bondAtoms
,
ThreadPool
&
threads
)
{
void
CpuBondForce
::
initialize
(
int
numAtoms
,
int
numBonds
,
int
numAtomsPerBond
,
vector
<
vector
<
int
>
>&
bondAtoms
,
ThreadPool
&
threads
)
{
this
->
numBonds
=
numBonds
;
this
->
numBonds
=
numBonds
;
this
->
numAtomsPerBond
=
numAtomsPerBond
;
this
->
numAtomsPerBond
=
numAtomsPerBond
;
this
->
bondAtoms
=
&
bondAtoms
[
0
]
;
this
->
bondAtoms
=
bondAtoms
.
empty
()
?
nullptr
:
bondAtoms
.
data
()
;
this
->
threads
=
&
threads
;
this
->
threads
=
&
threads
;
int
numThreads
=
threads
.
getNumThreads
();
int
numThreads
=
threads
.
getNumThreads
();
int
targetBondsPerThread
=
numBonds
/
numThreads
;
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