Skip to content

Commit

Permalink
fix(used-after-moved): insignificant pointer reused
Browse files Browse the repository at this point in the history
Signed-off-by: pengyu <[email protected]>
  • Loading branch information
py023 committed Dec 29, 2023
1 parent 48db20e commit 6bde018
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions be/src/vec/columns/column_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ ColumnArray::ColumnArray(MutableColumnPtr&& nested_column, MutableColumnPtr&& of
LOG(FATAL) << "offsets_column must be a ColumnUInt64";
}

if (!offsets_concrete->empty() && nested_column) {
if (!offsets_concrete->empty() && data) {
auto last_offset = offsets_concrete->get_data().back();

/// This will also prevent possible overflow in offset.
if (nested_column->size() != last_offset) {
if (data->size() != last_offset) {
LOG(FATAL) << "offsets_column has data inconsistent with nested_column";
}
}
Expand Down
2 changes: 1 addition & 1 deletion be/src/vec/columns/column_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ColumnMap::ColumnMap(MutableColumnPtr&& keys, MutableColumnPtr&& values, Mutable
LOG(FATAL) << "offsets_column must be a ColumnUInt64";
}

if (!offsets_concrete->empty() && keys && values) {
if (!offsets_concrete->empty() && keys_column && values_column) {
auto last_offset = offsets_concrete->get_data().back();

/// This will also prevent possible overflow in offset.
Expand Down

0 comments on commit 6bde018

Please sign in to comment.