Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GLUTEN_8475][VL] Fix C-style casts to C++-style #8474

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jkhaliqi
Copy link

@jkhaliqi jkhaliqi commented Jan 8, 2025

What changes were proposed in this pull request?

False positives for Do not Cast
cpp/velox/compute/WholeStageResultIterator.cc:461
cpp/velox/compute/WholeStageResultIterator.cc:463](http://wholestageresultiterator.cc:463/)
cpp/velox/shuffle/VeloxSortShuffleWriter.cc:219
cpp/velox/tests/FunctionTest.cc:157
cpp/velox/shuffle/VeloxShuffleReader.cc:437
cpp/velox/shuffle/VeloxSortShuffleWriter.cc:347
cpp/velox/substrait/SubstraitToVeloxPlan.cc:1049
cpp/velox/substrait/SubstraitToVeloxPlan.cc:1040
cpp/velox/substrait/SubstraitToVeloxPlan.cc:1102
cpp/velox/substrait/SubstraitToVeloxPlan.cc:1095

(Please fill in changes proposed in this fix)

(Fixes: #8475)

@github-actions github-actions bot added the VELOX label Jan 8, 2025
Copy link

github-actions bot commented Jan 8, 2025

Thanks for opening a pull request!

Could you open an issue for this pull request on Github Issues?

https://github.com/apache/incubator-gluten/issues

Then could you also rename commit message and pull request title in the following format?

[GLUTEN-${ISSUES_ID}][COMPONENT]feat/fix: ${detailed message}

See also:

@jkhaliqi jkhaliqi changed the title [VL] Change C-style casts to C++-style [GLUTEN_8475][VL] Change C-style casts to C++-style Jan 8, 2025
@jkhaliqi jkhaliqi changed the title [GLUTEN_8475][VL] Change C-style casts to C++-style [GLUTEN_8475][VL] Fix C-style casts to C++-style Jan 8, 2025
@@ -161,7 +161,7 @@ bool StdMemoryAllocator::reallocateAligned(void* p, uint64_t alignment, int64_t
return false;
}
if (newSize <= size) {
auto aligned = ROUND_TO_LINE(newSize, alignment);
auto aligned = ROUND_TO_LINE(static_cast<uint64_t> newSize, alignment);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a typo?

Copy link
Author

@jkhaliqi jkhaliqi Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont Use Cast@cpp/core/memory/MemoryAllocator.cc:164
looks like newSize is int64_t and alignment is uint64_t so i'm assuming there is some sort of casting that goes on when calling this function. With that I figured they should both go in with the same type. With the above line showing if (newSize <= 0) {return false;} im assuming newSize will be positive if it gets to here so I just casted it to be uint64_t like the alignment variable

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry I did forget the parenthesis around newSize, updating!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks.

It seems GitHub CI service is encountering issues so the CI is not triggering BTW.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[VL] Security Voliations Do Not Cast
2 participants