From 0d651979dc96d0a9a60c89744d94e6d833501ef2 Mon Sep 17 00:00:00 2001 From: "Mr. Metric" Date: Wed, 7 Feb 2024 19:44:15 -0800 Subject: [PATCH] Fix invalid parameter section generation for function pointers and function prototypes (#2304) --- scripts/reflib.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/reflib.py b/scripts/reflib.py index 36db7590d..488d4c993 100644 --- a/scripts/reflib.py +++ b/scripts/reflib.py @@ -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.