Skip to content

Commit

Permalink
chore: fix build on mac m1 (pingcap#6560)
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleFall authored and JaySon-Huang committed Jan 4, 2023
1 parent 4b54aef commit c9ba35c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dbms/src/Common/OptimizedRegularExpression.inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ void OptimizedRegularExpressionImpl<thread_safe>::replaceAllImpl(const char * su
if (!success)
break;

auto skipped_byte_size = reinterpret_cast<Int64>(matched_str.data() - (subject + prior_offset));
auto skipped_byte_size = static_cast<Int64>(matched_str.data() - (subject + prior_offset));
res_data.resize(res_data.size() + skipped_byte_size);
memcpy(&res_data[res_offset], subject + prior_offset, skipped_byte_size); // copy the skipped bytes
res_offset += skipped_byte_size;
Expand Down Expand Up @@ -658,7 +658,7 @@ void OptimizedRegularExpressionImpl<thread_safe>::replaceOneImpl(const char * su
--occur;
}

auto prefix_byte_size = reinterpret_cast<Int64>(matched_str.data() - subject);
auto prefix_byte_size = static_cast<Int64>(matched_str.data() - subject);
res_data.resize(res_data.size() + prefix_byte_size);
memcpy(&res_data[res_offset], subject, prefix_byte_size); // Copy prefix string
res_offset += prefix_byte_size;
Expand Down

0 comments on commit c9ba35c

Please sign in to comment.