This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Use templated builtins to avoid assumptions on SCUDO_WORDSIZE
ClosedPublic

Authored by ddcc on Mar 16 2022, 2:09 PM.

Details

Summary

Platforms may define uintptr_t differently, so just use template overrides to select the appropriate builtin

Diff Detail

Event Timeline

ddcc created this revision.Mar 16 2022, 2:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 16 2022, 2:09 PM
ddcc requested review of this revision.Mar 16 2022, 2:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 16 2022, 2:09 PM
vitalybuka added inline comments.Mar 24 2022, 12:55 PM
compiler-rt/lib/scudo/standalone/wrappers_c_checks.h
50

Looks like not it's going to accept even signed or float types, but will not optimize unsigned long long
maybe just cast in existing implementation?
_builtin_umull_overflow(Size, N, reinterpret_cast<unsigned long*>Product);

ddcc updated this revision to Diff 418353.Mar 25 2022, 4:06 PM

Use cast instead of template

vitalybuka accepted this revision.Mar 26 2022, 1:26 AM
vitalybuka added inline comments.
compiler-rt/lib/scudo/standalone/wrappers_c_checks.h
50–51

same here?

This revision is now accepted and ready to land.Mar 26 2022, 1:26 AM
This revision was landed with ongoing or failed builds.Mar 28 2022, 4:36 PM
This revision was automatically updated to reflect the committed changes.