Skip to content

Commit 3388c5a

Browse files
committed
[clang][Interp][NFC] Add missing assertion to Block ctor
We have this assertion in all the other constructors.
1 parent a44d740 commit 3388c5a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

clang/lib/AST/Interp/InterpBlock.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,15 @@ class Block final {
125125
void dump() const { dump(llvm::errs()); }
126126
void dump(llvm::raw_ostream &OS) const;
127127

128-
protected:
128+
private:
129129
friend class Pointer;
130130
friend class DeadBlock;
131131
friend class InterpState;
132132

133133
Block(const Descriptor *Desc, bool IsExtern, bool IsStatic, bool IsDead)
134-
: IsStatic(IsStatic), IsExtern(IsExtern), IsDead(true), Desc(Desc) {}
134+
: IsStatic(IsStatic), IsExtern(IsExtern), IsDead(true), Desc(Desc) {
135+
assert(Desc);
136+
}
135137

136138
/// Deletes a dead block at the end of its lifetime.
137139
void cleanup();

0 commit comments

Comments
 (0)