Skip to content

Commit 296a684

Browse files
[formatv][FmtAlign] Use fill count of type size_t instead of uint32_t (#78459)
FmtAlign::fill() accepts a uint32_t variable while the usages operate on size_t values. On some platform / compiler combinations, this ends up being a narrowing conversion. Fix this by changing the function's signature. This was first seen on MSVC x86. Co-authored-by: Orest Chura <[email protected]>
1 parent 33287e3 commit 296a684

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/include/llvm/Support/FormatCommon.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ struct FmtAlign {
6666
}
6767

6868
private:
69-
void fill(llvm::raw_ostream &S, uint32_t Count) {
70-
for (uint32_t I = 0; I < Count; ++I)
69+
void fill(llvm::raw_ostream &S, size_t Count) {
70+
for (size_t I = 0; I < Count; ++I)
7171
S << Fill;
7272
}
7373
};

0 commit comments

Comments
 (0)