Skip to content

Commit

Permalink
Merge pull request hyrise#261 from bastih/feature/add_test_bcv
Browse files Browse the repository at this point in the history
Add test to prevent insertion of values larger than what can be represented
  • Loading branch information
bastih committed Nov 19, 2013
2 parents 085fe8a + a9860e3 commit a0fcca9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/storage/BitCompressedVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ class BitCompressedVector : public BaseAttributeVector<T> {

void set(size_t column, size_t row, T value) {
checkAccess(column, row);

#ifdef EXPENSIVE_ASSERTIONS
if (value >= (1 << _bits[column])) throw std::out_of_range("trying to insert value larger than can be stored");
#endif
auto offset = _blockOffset(row);
auto colOffset = _offsetForColumn(column);
auto block = _blockPosition(row) + (offset + colOffset) / _bit_width;
Expand Down

0 comments on commit a0fcca9

Please sign in to comment.