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

Change 'unsafeDowncast' to 'as!' #495

Merged
merged 1 commit into from
Jul 25, 2024
Merged

Conversation

glbrntt
Copy link
Contributor

@glbrntt glbrntt commented Jul 25, 2024

Motivation:

The 'unsafeDowncast' can cause a miscompile leading to unexpected runtime behaviour.

Modifications:

  • Use 'as!' instead

Result:

No miscompiles on 5.10

Motivation:

The 'unsafeDowncast' can cause a miscompile leading to unexpected runtime behaviour.

Modifications:

- Use 'as!' instead

Result:

No miscompiles on 5.10
Copy link

codecov bot commented Jul 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.28%. Comparing base (200a94a) to head (60ad8b3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #495   +/-   ##
=======================================
  Coverage   55.27%   55.28%           
=======================================
  Files         127      127           
  Lines       10161    10162    +1     
=======================================
+ Hits         5617     5618    +1     
  Misses       4544     4544           
Files Coverage Δ
Sources/ConnectionPoolModule/NIOLock.swift 70.37% <100.00%> (+0.37%) ⬆️

@fabianfett fabianfett merged commit d18b137 into vapor:main Jul 25, 2024
9 of 11 checks passed
@fabianfett fabianfett added the semver-patch No public API change. label Jul 25, 2024
@glbrntt glbrntt deleted the unsafe-downcast branch July 25, 2024 09:20
fabianfett pushed a commit that referenced this pull request Jul 25, 2024
Motivation:

The 'unsafeDowncast' can cause a miscompile leading to unexpected runtime behaviour.

Modifications:

- Use 'as!' instead

Result:

No miscompiles on 5.10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants