Skip to content

[pull] swiftwasm-release/5.8 from release/5.8 #5206

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

Merged
merged 9 commits into from
Jan 20, 2023

Conversation

pull[bot]
Copy link

@pull pull bot commented Jan 19, 2023

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

ahoppen and others added 5 commits January 19, 2023 18:50
…ebug-scope-trampoline

Disable rdar74087329-debug-scope-trampoline-blocks.swift
…ldOptional`

In cases like:

```
if (...) {
  <body>
} else if (...) {
  <body>
} else if (...) {
  <body>
}
```

Each branch should end with `buildOptional` wrapping `buildEither`
because there is no covering unconditional `else` in the sequence:

```
var $__builder: <<Type>>

if (...) {
  $__builder = buildOptional(.some(buildEither(...)))
} else {
  if (...) {
    $__builder = buildOptional(.some(buildEither(...)))
  } else {
    if (...) {
      $__builder = buildOptional(.some(buildEither(...)))
    } else {
      $__builder = buildOptional(.none)
    }
  }
}
```

Resolves: rdar://104345754
(cherry picked from commit 43d83bb)
…backDeploy`.

The following program crashed when compiled with the Swift 5.7 and 5.8 compilers:

```
@available(macOS 12, *)
@_backDeploy(before: macOS 99)
public func foo<T>(_ t: __owned T) {
  print("foo")
}

class C {
  deinit {
    print("deinit")
  }
}

foo(C())
print("done")
```

```
> ./test
foo
deinit
[1]    49162 segmentation fault  ./test
```

The root cause is that generated SIL for the back deployment thunk for `foo(_:)` included its own `destroy_addr` instruction for the value of `t`, but didn't copy the parameter before passing it to the real function implementation which also destroys the value. The fix is to forward ownership of the parameter values to the called function, which causes cleanup generation to be skipped.

Resolves rdar://104436515
ktoso and others added 4 commits January 20, 2023 09:04
Disable TaskGroup neverConsumingTasks test while we work on fix
…sequences-5.8

[5.8][BuilderTransform] All `if` sequences without `else` should call `buildOptional`
…ree-5.8

[5.8] SILGen: Fix double-free of `__owned` parameters of functions with `@_backDeploy`
@kateinoigakukun kateinoigakukun merged commit f2c5a4c into swiftwasm-release/5.8 Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants