Skip to content

Commit

Permalink
sigh.
Browse files Browse the repository at this point in the history
I helpfully decided it'd be good if the copy constructor for the
intValues case initialized shortValues to all 0s to aid in debugging.

This forgets, of course, that shortValues is a union with intValues,
and so what we're really doing is stomping on the pointers of the
vector we just allocated and populated. Oops.
  • Loading branch information
cldellow committed Nov 30, 2023
1 parent 7a7c46c commit 77514e0
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions include/attribute_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,6 @@ struct AttributeSet {
if (useVector) {
new (&intValues) std::vector<uint32_t>;
intValues = a.intValues;
for (int i = 0; i < sizeof(shortValues)/sizeof(shortValues[0]); i++)
shortValues[i] = 0;
} else {
for (int i = 0; i < sizeof(shortValues)/sizeof(shortValues[0]); i++)
shortValues[i] = a.shortValues[i];
Expand Down

0 comments on commit 77514e0

Please sign in to comment.