Skip to content

Commit 5c4a630

Browse files
committed
[LLD][ELF] Silence warning when building with latest MSVC
This fixes: ``` [193/3517] Building CXX object tools\lld\ELF\CMakeFiles\lldELF.dir\Arch\LoongArch.cpp.obj C:\git\llvm-project\lld\ELF\Arch\LoongArch.cpp(683): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended? ```
1 parent 567d304 commit 5c4a630

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lld/ELF/Arch/LoongArch.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,8 +679,8 @@ static bool relax(InputSection &sec) {
679679
case R_LARCH_ALIGN: {
680680
const uint64_t addend =
681681
r.sym->isUndefined() ? Log2_64(r.addend) + 1 : r.addend;
682-
const uint64_t allBytes = (1 << (addend & 0xff)) - 4;
683-
const uint64_t align = 1 << (addend & 0xff);
682+
const uint64_t allBytes = (1ULL << (addend & 0xff)) - 4;
683+
const uint64_t align = 1ULL << (addend & 0xff);
684684
const uint64_t maxBytes = addend >> 8;
685685
const uint64_t off = loc & (align - 1);
686686
const uint64_t curBytes = off == 0 ? 0 : align - off;

0 commit comments

Comments
 (0)