From 3acd63c120467eff7492f24cee521e3f0aaa66a2 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Thu, 19 Jan 2023 14:57:47 -0800 Subject: [PATCH] Add default value for ExplicitModuleInfo isFramework If the json file doesn't contain a value for this, this was never set, which results in UB. Unfortunately clang doesn't warn about this but gcc does https://godbolt.org/z/M3sdE73zs --- include/swift/Frontend/ModuleInterfaceLoader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/swift/Frontend/ModuleInterfaceLoader.h b/include/swift/Frontend/ModuleInterfaceLoader.h index 1f477a4c68773..a4ec781c10b03 100644 --- a/include/swift/Frontend/ModuleInterfaceLoader.h +++ b/include/swift/Frontend/ModuleInterfaceLoader.h @@ -182,7 +182,7 @@ struct ExplicitModuleInfo { // Path of the .swiftsourceinfo file. std::string moduleSourceInfoPath; // A flag that indicates whether this module is a framework - bool isFramework; + bool isFramework = false; // A flag that indicates whether this module is a system module // Set the default to be false. bool isSystem = false;