Skip to content

Commit ae46d52

Browse files
committed
IRGen: Fix undefined behavior virtual class without virtual destructor
1 parent 03c1259 commit ae46d52

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/IRGen/SwitchBuilder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ class SwitchBuilder {
5252
}
5353

5454
public:
55-
#ifndef NDEBUG
5655
virtual ~SwitchBuilder() {
56+
#ifndef NDEBUG
5757
assert(CasesToAdd == 0 && "Did not add enough cases");
58-
}
5958
#endif
59+
}
6060

6161
// Create a SwitchBuilder instance for a switch that will have the given
6262
// number of cases.

0 commit comments

Comments
 (0)