Fix segfault parsing varargs with -doxygen

Closes #1643
This commit is contained in:
William S Fulton 2020-01-16 19:12:10 +00:00
commit 6e240e8fba
2 changed files with 10 additions and 6 deletions

View file

@ -7,6 +7,10 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
Version 4.0.2 (in progress)
===========================
2020-01-16: mcfarljm
#1643 #1654 When using -doxygen, fix segfault when nameless parameters or vararg parameters
are used.
2020-01-16: mcfarljm
#1632 #1659 Fix newline handling for doxygen "///" comments.

View file

@ -449,12 +449,12 @@ std::string PyDocConverter::getParamValue(std::string param) {
ParmList *plist = CopyParmList(Getattr(currentNode, "parms"));
for (Parm *p = plist; p; p = nextSibling(p)) {
String *pname = Getattr(p, "name");
if (Char(pname) != param)
continue;
String *pval = Getattr(p, "value");
if (pval) value = Char(pval);
break;
if (pname && Char(pname) == param) {
String *pval = Getattr(p, "value");
if (pval)
value = Char(pval);
break;
}
}
Delete(plist);
return value;