pitrou commented on code in PR #13215:
URL: https://github.com/apache/arrow/pull/13215#discussion_r884302822
##########
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:
This still seems incorrect. `little_endian` is default-initialized but, as
the `std::array` docs
[note](https://en.cppreference.com/w/cpp/container/array),
> default initialization may result in indeterminate values for non-class T
... meaning that unless `lit->value->size()` is large enough, some decimal
data may still be incorrect.
@bkietz Am I wrong?
##########
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:
This still seems incorrect. `little_endian` is default-initialized but, as
the `std::array` docs
[note](https://en.cppreference.com/w/cpp/container/array),
> default initialization may result in indeterminate values for non-class T
... meaning that unless `lit->value->size()` is large enough, some decimal
data may still be undefined.
@bkietz Am I wrong?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]