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

c_api return null on null layer #4865

Merged
merged 1 commit into from
Jul 18, 2023
Merged

Conversation

Mek101
Copy link
Contributor

@Mek101 Mek101 commented Jul 17, 2023

Adds a check to ncnn_layer_create_by_typeindex and ncnn_layer_create_by_type to return null if the index or name don't match any known layer.

This is mostly to move segmentation faults deriving from a wrong typeindex/name near the source callsite.

@codecov-commenter
Copy link

codecov-commenter commented Jul 17, 2023

Codecov Report

Merging #4865 (99ec5cf) into master (411a098) will decrease coverage by 0.20%.
The diff coverage is 37.50%.

@@            Coverage Diff             @@
##           master    #4865      +/-   ##
==========================================
- Coverage   94.89%   94.69%   -0.20%     
==========================================
  Files         779      779              
  Lines      223188   223182       -6     
==========================================
- Hits       211795   211344     -451     
- Misses      11393    11838     +445     
Impacted Files Coverage Δ
src/c_api.cpp 40.40% <37.50%> (-0.07%) ⬇️

... and 23 files with indirect coverage changes

@Mek101
Copy link
Contributor Author

Mek101 commented Jul 17, 2023

Seems like an error in the build system?

@nihui nihui merged commit 9f29a17 into Tencent:master Jul 18, 2023
93 checks passed
@nihui
Copy link
Member

nihui commented Jul 18, 2023

Thanks for your contribution !

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.

3 participants