Skip to content

Commit

Permalink
Avoid use after move (#2278)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed May 11, 2021
1 parent 0036a1d commit 02896da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/fmt/format-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -541,9 +541,9 @@ class bigint {
}

void square() {
basic_memory_buffer<bigit, bigits_capacity> n(std::move(bigits_));
int num_bigits = static_cast<int>(bigits_.size());
int num_result_bigits = 2 * num_bigits;
basic_memory_buffer<bigit, bigits_capacity> n(std::move(bigits_));
bigits_.resize(to_unsigned(num_result_bigits));
using accumulator_t = conditional_t<FMT_USE_INT128, uint128_t, accumulator>;
auto sum = accumulator_t();
Expand Down

0 comments on commit 02896da

Please sign in to comment.