Skip to content

Commit 43eeaa1

Browse files
committed
OutputStream - fix static analyzer warnings. NFCI.
- uninitialized variables - make getBufferCapacity() const
1 parent c9021d7 commit 43eeaa1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/include/llvm/Demangle/Utility.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ DEMANGLE_NAMESPACE_BEGIN
2525
// Stream that AST nodes write their string representation into after the AST
2626
// has been parsed.
2727
class OutputStream {
28-
char *Buffer;
29-
size_t CurrentPosition;
30-
size_t BufferCapacity;
28+
char *Buffer = nullptr;
29+
size_t CurrentPosition = 0;
30+
size_t BufferCapacity = 0;
3131

3232
// Ensure there is at least n more positions in buffer.
3333
void grow(size_t N) {
@@ -137,7 +137,7 @@ class OutputStream {
137137

138138
char *getBuffer() { return Buffer; }
139139
char *getBufferEnd() { return Buffer + CurrentPosition - 1; }
140-
size_t getBufferCapacity() { return BufferCapacity; }
140+
size_t getBufferCapacity() const { return BufferCapacity; }
141141
};
142142

143143
template <class T> class SwapAndRestore {

0 commit comments

Comments
 (0)