-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generator: Wrap
_as_c_str()
getter for possibly-pointers in Option
(
#860) While this function is already marked `unsafe` to represent cases where an invalid pointer might be dereferenced, it should at least be obvious to the caller that there is a real chance for `NULL` pointers in these `CStr` getters, which will now be returned as `None`. This function won't be used in `Debug` now as the dereference operation is still `unsafe`. The `_as_c_str()` getters for static arrays is left untouched, as the data is read directly from the known-valid struct here.
- Loading branch information
Showing
2 changed files
with
95 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters