You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/05/31 17:36:09 UTC

[GitHub] [arrow] bkietz commented on a diff in pull request #13215: ARROW-16633: [C++] Fix incorrect Decimal literal conversion in `ir_consumer.cc`

bkietz commented on code in PR #13215:
URL: https://github.com/apache/arrow/pull/13215#discussion_r885918531


##########
cpp/src/arrow/compute/exec/ir_consumer.cc:
##########
@@ -152,14 +152,14 @@ struct ConvertLiteralImpl {
     switch (t.id()) {
       case Type::DECIMAL128: {
         std::array<uint64_t, 2> little_endian;
-        std::memcpy(little_endian.data(), lit->value(), lit->value()->size());
+        std::memcpy(little_endian.data(), lit->value()->data(), lit->value()->size());

Review Comment:
   The size of the literal string is asserted to be equal to the decimal's byte_width above, so every byte of `little_endian` should be safely overwritten



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org