Skip to content

Conversation

jrose-apple
Copy link
Contributor

  • Explanation: We broke __attribute__((swift_error(zero_result))) by making a part of its implementation assume it would only be used with boolean values (it also supports integers); this resulted in assertion failures in debug builds of the compiler and incorrect run-time behavior (failing to identify errors) in release builds. The breakage was part of a general change to better handle boolean values in SIL, but this part of it wasn't fully correct and turned out to not be necessary. Revert back to the older way of doing things when dealing with imported throwing functions.
  • Scope: Affects imported throwing functions that use integer or boolean results to specify whether they succeeded or failed.
  • Issue: rdar://problem/27985744
  • Reviewed by: @slavapestov
  • Risk: Low; the "new" code is from previous betas, where this feature was working correctly.
  • Testing: Added compiler regression tests, verified that the originally reported case now works.

…iftlang#4681)

Actually bridging ObjCBool to Bool is overkill for this, but moreover
it caused problems for non-boolean types that took this code
path. Just go back to the previous logic of unwrapping multiple levels
of struct; this way we can also handle wrappers around integer types
(if we ever have any).

rdar://problem/27985744
(cherry picked from commit a335ebc)
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@tkremenek tkremenek merged commit 457055d into swiftlang:swift-3.0-branch Sep 11, 2016
@jrose-apple jrose-apple deleted the swift-3-swift_error-zero_result branch September 12, 2016 17:41
aaditya-chandrasekhar pushed a commit to val-verde/swift that referenced this pull request Sep 30, 2022
[pull] swiftwasm-release/5.7 from release/5.7
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.

2 participants