diff options
| author | puneeth_aditya_5656 <myakampuneeth@gmail.com> | 2026-01-31 21:04:53 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-31 16:34:53 +0100 |
| commit | 5c213a9000233fa54c03e532c14f0b08f7c6967a (patch) | |
| tree | 19f72e9bbe22f5c21a6f289fa4bce0df950bf441 /llvm/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp | |
| parent | 09c404631c70ace74feaebe6ef439d15a1998c6b (diff) | |
| download | llvm-main.zip llvm-main.tar.gz llvm-main.tar.bz2 | |
## Summary
Fix assertion failure when evaluating
`__builtin_align_up`/`__builtin_align_down`/`__builtin_is_aligned` with
one-past-end pointers like `&array[size]`.
## Root Cause
`getIndex()` calls `getOffset()` which asserts when `Offset ==
PastEndMark`. This happens for one-past-end element pointers.
## Fix
Check `isElementPastEnd()` before calling `getIndex()`. For past-end
pointers, use `getNumElems()` instead which gives the correct index
value.
## Test
Added test cases in `builtin-align-cxx.cpp` for one-past-end pointer
alignment.
Fixes #178647
Diffstat (limited to 'llvm/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp')
0 files changed, 0 insertions, 0 deletions
