Skip to content

IRGen: Differentiate between Swift.Bool and ObjCBool #4173

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

Conversation

slavapestov
Copy link
Contributor

Same fix as #4171, but for master.

@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov slavapestov force-pushed the bool-is-a-giant-mess-on-darwin-platforms branch from a4d8920 to 7c464e7 Compare August 10, 2016 01:17
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

1 similar comment
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test os x

@slavapestov
Copy link
Contributor Author

@swift-ci Please test os x

SIL already does this where necessary, except with foreign throwing
functions; this patch changes Sema and the ClangImporter to give
them an ObjCBool foreign error result type explicitly.

This fixes a problem where calls to functions taking and returning
the C99 _Bool type were miscompiled on Mac OS X x86-64, because
IRGen was conflating the Objective-C BOOL type (which is a signed
char on some platforms) and C99 _Bool (which lowers as the LLVM
i1 type).

Fixes <rdar://problem/26506458> and <rdar://problem/27365520>.
@slavapestov slavapestov force-pushed the bool-is-a-giant-mess-on-darwin-platforms branch from 7c464e7 to a21c748 Compare August 10, 2016 17:35
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test OS X

@slavapestov slavapestov merged commit 52f16f0 into swiftlang:master Aug 10, 2016
@slavapestov slavapestov deleted the bool-is-a-giant-mess-on-darwin-platforms branch August 19, 2016 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant