Skip to content

Commit cd38b78

Browse files
committed
[swift-settings] Provide a default nullptr for a variable.
Just noticed it as I was reading some code. Even though it cannot happen today, with code being added, we could allow for undefined behavior. Better to program defensively than aggressively.
1 parent 90340a0 commit cd38b78

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/AST/Module.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4345,7 +4345,7 @@ SwiftSettingsWalker::getSwiftSettingArgDecl(Argument arg) {
43454345
return {};
43464346

43474347
// Now lookup our swiftSettingDecl.
4348-
NominalTypeDecl *swiftSettingsDecl;
4348+
NominalTypeDecl *swiftSettingsDecl = nullptr;
43494349
{
43504350
SmallVector<ValueDecl *, 1> decls;
43514351
ctx.lookupInSwiftModule("SwiftSetting", decls);

0 commit comments

Comments
 (0)