mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-13 15:11:39 +00:00
Duncan is nervous about undefinedness of % with negatives. I'm
not thrilled about 64-bit % in general, so rewrite to use * instead. llvm-svn: 62047
This commit is contained in:
parent
d1e5994f90
commit
da5c0c85dc
@ -7710,7 +7710,7 @@ static bool FindElementAtOffset(const Type *Ty, int64_t Offset,
|
|||||||
int64_t FirstIdx = 0;
|
int64_t FirstIdx = 0;
|
||||||
if (int64_t TySize = TD->getABITypeSize(Ty)) {
|
if (int64_t TySize = TD->getABITypeSize(Ty)) {
|
||||||
FirstIdx = Offset/TySize;
|
FirstIdx = Offset/TySize;
|
||||||
Offset %= TySize;
|
Offset -= FirstIdx*TySize;
|
||||||
|
|
||||||
// Handle hosts where % returns negative instead of values [0..TySize).
|
// Handle hosts where % returns negative instead of values [0..TySize).
|
||||||
if (Offset < 0) {
|
if (Offset < 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user