Skip to content

LifetimeDependenceInsertion: fix dependence on store_borrow. #78629

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 1 commit into from
Jan 14, 2025

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Jan 14, 2025

For a lifetime dependent call that depends on a temporary store_borrow, the generated mark_dependendence should be on the stored value, not the stack location.

%temp = alloc_stack $AnyObject
%sb = store_borrow %arg to %temp
apply %10(%out, %sb)
mark_dependence [unresolved] %out on %arg
end_borrow %sb

Fixes rdar://142847915 (Crash during lifetime checking while building new swift standard library Span-related features)

For a lifetime dependent call that depends on a temporary store_borrow, the
generated mark_dependendence should be on the stored value, not the stack
location.

  %temp = alloc_stack $AnyObject
  %sb = store_borrow %arg to %temp
  apply %10(%out, %sb)
  mark_dependence [unresolved] %out on %arg
  end_borrow %sb

Fixes rdar://142847915 (Crash during lifetime checking while
building new swift standard library `Span`-related features)
@atrick atrick requested a review from meg-gupta January 14, 2025 08:12
@atrick atrick requested a review from eeckstein as a code owner January 14, 2025 08:12
@atrick
Copy link
Contributor Author

atrick commented Jan 14, 2025

@swift-ci test

@atrick
Copy link
Contributor Author

atrick commented Jan 14, 2025

SwiftPM tests failed on linux but there's no failure message

  File "/home/build-user/swiftpm/Utilities/bootstrap", line 888, in <module>
    main()
  File "/home/build-user/swiftpm/Utilities/bootstrap", line 92, in main
    args.func(args)
  File "/home/build-user/swiftpm/Utilities/bootstrap", line 416, in test
    call_swiftpm(args, cmd)
  File "/home/build-user/swiftpm/Utilities/bootstrap", line 746, in call_swiftpm
    call_output(full_cmd, cwd=cwd, stderr=True, verbose=True)
  File "/home/build-user/swiftpm/Utilities/helpers.py", line 56, in call_output
    raise cpe
  File "/home/build-user/swiftpm/Utilities/helpers.py", line 52, in call_output
    return subprocess.check_output(cmd, cwd=cwd, stderr=stderr, universal_newlines=True).strip()
  File "/usr/lib/python3.8/subprocess.py", line 415, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,

@atrick
Copy link
Contributor Author

atrick commented Jan 14, 2025

@swift-ci smoke test linux

@atrick atrick enabled auto-merge January 14, 2025 17:09
@atrick atrick merged commit 9f1d727 into swiftlang:main Jan 14, 2025
4 of 5 checks passed
@atrick atrick deleted the fix-borrow-depend branch January 14, 2025 20:46
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