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

Add support for detecting unreachable code #81

Merged
merged 2 commits into from
Jan 7, 2024
Merged

Conversation

amyspark
Copy link
Collaborator

@amyspark amyspark commented Jan 7, 2024

👋

This is a PR to add a little feature, marking code at a certain point to be unreachable (and if so, trigger UBSan or abort).

E:\subprojects\substrate\impl\socket.cxx(174) : warning C4715:
'substrate::socket::typeToFamily': not all control paths return a value
E:\subprojects\substrate\impl\socket.cxx(200) : warning C4715:
'substrate::socket::protocolToType': not all control paths return a
value
E:\subprojects\substrate\impl\socket.cxx(187) : warning C4715:
'substrate::socket::protocolToHints': not all control paths return a
value

and another one in clangd because the flag didn't get applied.
@dragonmux dragonmux added bug Something isn't working enhancement New feature or request labels Jan 7, 2024
Copy link

codecov bot commented Jan 7, 2024

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (2e09985) 89.70% compared to head (29962af) 89.57%.

Files Patch % Lines
substrate/utility 0.00% 5 Missing ⚠️
impl/socket.cxx 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #81      +/-   ##
==========================================
- Coverage   89.70%   89.57%   -0.14%     
==========================================
  Files          47       47              
  Lines        3419     3424       +5     
  Branches      659      662       +3     
==========================================
  Hits         3067     3067              
- Misses        314      321       +7     
+ Partials       38       36       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@dragonmux dragonmux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've a couple of queries, but this looks fantastic and we'll be happy to merge once they're answered. Thank you for the contribution!

substrate/utility Show resolved Hide resolved
substrate/utility Show resolved Hide resolved
Copy link
Member

@dragonmux dragonmux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All LGTM, all review queries are answered - we'll merge this once the builds complete.

@dragonmux dragonmux closed this Jan 7, 2024
@dragonmux dragonmux merged commit 29962af into main Jan 7, 2024
165 of 169 checks passed
@dragonmux dragonmux deleted the amyspark/unreachable branch January 7, 2024 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants