
BUG OF THE MONTH | Using memset to clear memory
Continue readingBUG OF THE MONTH | Missed semicolon
PVS-Studio warning: V504 It is highly probable that the semicolon ‘;’ is missing after ‘return’ keyword. AdvancedSettings.cpp:1476
void CAdvancedSettings::SetExtraArtwork(const TiXmlElement* arttypes, std::vector& artworkMap) { if (!arttypes) return artworkMap.clear(); const TiXmlNode* arttype = arttypes->FirstChild("arttype"); .... }
The code formatting suggests the following execution logic:
But the missing ‘;’ character breaks it all, and the actual execution logic is as follows:
To cut a long story short, this situation does look like a bug. After all, you hardly expect anyone to write expressions like return artworkMap.clear(); :).
Please click here to see more bugs from this project.