projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2c33ef5
)
[flang] fix bug noticed by Jean
author
peter klausler
<pklausler@nvidia.com>
Fri, 14 Dec 2018 19:07:12 +0000
(11:07 -0800)
committer
peter klausler
<pklausler@nvidia.com>
Fri, 14 Dec 2018 21:19:12 +0000
(13:19 -0800)
Original-commit: flang-compiler/f18@
9acbff7585fbc113391066e5e79c1059c0e22d54
Reviewed-on: https://github.com/flang-compiler/f18/pull/244
flang/lib/evaluate/integer.h
patch
|
blob
|
history
diff --git
a/flang/lib/evaluate/integer.h
b/flang/lib/evaluate/integer.h
index
0c97be3
..
75d41e4
100644
(file)
--- a/
flang/lib/evaluate/integer.h
+++ b/
flang/lib/evaluate/integer.h
@@
-160,15
+160,15
@@
public:
}
} else {
INT signExtension{-(n < 0)};
+ static_assert(nBits >= partBits);
if constexpr (nBits > partBits) {
- signExtension <<= partBits;
+ signExtension <<=
nBits -
partBits;
for (int j{0}; j < parts; ++j) {
SetLEPart(j, static_cast<Part>(n));
n >>= partBits;
n |= signExtension;
}
} else {
- static_assert(nBits == partBits);
SetLEPart(0, static_cast<Part>(n));
for (int j{1}; j < parts; ++j) {
SetLEPart(j, static_cast<Part>(signExtension));