Skip to content

Commit 275a09d

Browse files
committed
Fix out of bounds issue in VHDL processing
1 parent 15c390f commit 275a09d

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

src/vhdldocgen.cpp

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -858,8 +858,11 @@ void VhdlDocGen::writeInlineClassLink(const ClassDef* cd ,OutputList& ol)
858858
else if (ii==VhdlDocGen::ARCHITECTURE)
859859
{
860860
StringVector qlist=split(nn.str(),"-");
861-
nn=qlist[1];
862-
cd=VhdlDocGen::getClass(nn.data());
861+
if (qlist.size()>1)
862+
{
863+
nn=qlist[1];
864+
cd=VhdlDocGen::getClass(nn.data());
865+
}
863866
}
864867

865868
QCString opp;
@@ -869,14 +872,17 @@ void VhdlDocGen::writeInlineClassLink(const ClassDef* cd ,OutputList& ol)
869872
for (const auto &s : ql)
870873
{
871874
StringVector qlist=split(s.str(),"-");
872-
QCString s1=qlist[0];
873-
QCString s2=qlist[1];
874-
s1.stripPrefix("_");
875-
if (ql.size()==1) s1.resize(0);
876-
ClassDef *cc = getClass(s);
877-
if (cc)
875+
if (qlist.size()>2)
878876
{
879-
VhdlDocGen::writeVhdlLink(cc,ol,type,s2,s1);
877+
QCString s1=qlist[0];
878+
QCString s2=qlist[1];
879+
s1.stripPrefix("_");
880+
if (ql.size()==1) s1.resize(0);
881+
ClassDef *cc = getClass(s);
882+
if (cc)
883+
{
884+
VhdlDocGen::writeVhdlLink(cc,ol,type,s2,s1);
885+
}
880886
}
881887
}
882888
}
@@ -919,7 +925,7 @@ const ClassDef* VhdlDocGen::findArchitecture(const ClassDef *cd)
919925
StringVector ql=split(jj.str(),":");
920926
if (ql.size()>1)
921927
{
922-
if (ql[0]==nn )
928+
if (ql[0]==nn)
923929
{
924930
return citer.get();
925931
}

0 commit comments

Comments
 (0)