Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Lukas Weber
load_leveller
Commits
0d51d8fd
Commit
0d51d8fd
authored
Apr 25, 2019
by
Lukas Weber
Browse files
fix an out of bounds access
parent
40f77727
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/observable.cpp
View file @
0d51d8fd
...
...
@@ -30,8 +30,13 @@ void observable::checkpoint_write(const iodump::group &dump_file) const {
}
void
observable
::
measurement_write
(
const
iodump
::
group
&
meas_file
)
{
std
::
vector
<
double
>
current_bin_value
(
samples_
.
end
()
-
vector_length_
,
samples_
.
end
());
samples_
.
resize
(
current_bin_
*
vector_length_
);
std
::
vector
<
double
>
current_bin_value
;
// if there is not even one bin…
if
(
samples_
.
size
()
>
vector_length_
)
{
current_bin_value
.
assign
(
samples_
.
end
()
-
vector_length_
,
samples_
.
end
());
samples_
.
resize
(
current_bin_
*
vector_length_
);
}
meas_file
.
write
(
"vector_length"
,
vector_length_
);
meas_file
.
write
(
"bin_length"
,
bin_length_
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment