Fix crash in C# bindings generator with bad enum documentation XML #108262
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I had a bad
[enum ...]in my documentation XML. This was crashing the C# bindings generator, because the code was runningp_target_itype->is_intentionally_ignoredwithout checking ifp_target_itypeis null or not.Note that these functions have code paths for dealing with a null
p_target_itype, so it seems to not be a case where we can simply have guard clauses. In most of the functions callingis_intentionally_ignoredthe code already checked for a nullp_target_itypeand used a different code path, but this was missing only for the error case of enums.I've marked this as cherrypick for 4.3 and 4.4. The bug seems to also exist in 4.2 and earlier but the code is a bit different so the cherrypick can't be done automatically, and I don't know if it's worth the effort for such an old branch.