Skip to content

Commit

Permalink
Fix invalid parameter section generation for function pointers and fu…
Browse files Browse the repository at this point in the history
…nction prototypes (#2304)
  • Loading branch information
MrMetric authored Feb 8, 2024
1 parent 8c4e3f2 commit 0d65197
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scripts/reflib.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,16 @@ def fixupRefs(pageMap, specFile, file):
pi.param = clampToBlock(pi.param, pi.include, pi.end)
pi.body = clampToBlock(pi.body, pi.param, pi.end)

if pi.type in ['funcpointers', 'protos']:
# It is possible for the inferred parameter section to be invalid,
# such as for the type PFN_vkVoidFunction, which has no parameters.
# Since the parameter section is always a bullet-point list, we know
# the section is invalid if its text does not start with a list item.
# Note: This also deletes parameter sections that are simply empty.
if pi.param is not None and not file[pi.param].startswith(' * '):
pi.body = pi.param
pi.param = None

# We can get to this point with .include, .param, and .validity
# all being None, indicating those sections were not found.

Expand Down

0 comments on commit 0d65197

Please sign in to comment.