mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
Duncan is nervous about undefinedness of % with negatives. I'm
not thrilled about 64-bit % in general, so rewrite to use * instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62047 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1c412d9ce4
commit
31a69cb9ae
@ -7710,7 +7710,7 @@ static bool FindElementAtOffset(const Type *Ty, int64_t Offset,
|
||||
int64_t FirstIdx = 0;
|
||||
if (int64_t TySize = TD->getABITypeSize(Ty)) {
|
||||
FirstIdx = Offset/TySize;
|
||||
Offset %= TySize;
|
||||
Offset -= FirstIdx*TySize;
|
||||
|
||||
// Handle hosts where % returns negative instead of values [0..TySize).
|
||||
if (Offset < 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user