Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid runtime crashes by removing undefined behavior. #1560

Merged
merged 4 commits into from
Jun 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CoreFoundation/Base.subproj/CFRuntime.c
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ extern void __CFNumberInitialize(void);
extern void __CFCharacterSetInitialize(void);
extern void __CFPFactoryInitialize(void);
extern void __CFPlugInInitialize(void);
#if (DEPLOYMENT_TARGET_LINUX || DEPLOYMENT_TARGET_MACOSX) && DEPLOYMENT_RUNTIME_SWIFT
#if DEPLOYMENT_TARGET_LINUX || (DEPLOYMENT_TARGET_MACOSX && DEPLOYMENT_RUNTIME_SWIFT)
CF_PRIVATE void __CFTSDInitialize(void);
#endif
#if DEPLOYMENT_TARGET_WINDOWS
Expand Down Expand Up @@ -1076,7 +1076,7 @@ void __CFInitialize(void) {
#if DEPLOYMENT_TARGET_WINDOWS
// Must not call any CF functions
__CFTSDWindowsInitialize();
#elif (DEPLOYMENT_TARGET_LINUX || DEPLOYMENT_TARGET_MACOSX) && DEPLOYMENT_RUNTIME_SWIFT
#elif DEPLOYMENT_TARGET_LINUX || (DEPLOYMENT_TARGET_MACOSX && DEPLOYMENT_RUNTIME_SWIFT)
__CFTSDInitialize();
#endif
__CFProphylacticAutofsAccess = true;
Expand Down
2 changes: 1 addition & 1 deletion CoreFoundation/Base.subproj/CFUtilities.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ static void _CFShowToFile(FILE *file, Boolean flush, const void *obj) {
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI
fprintf_l(file, NULL, "\n");
#else
fprintf(file, NULL, "\n");
fprintf(file, "\n");
#endif
if (flush) fflush(file);
}
Expand Down