From 50535a1894f87b81bca7937e9268d11906c50920 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sun, 5 Apr 2020 18:30:46 -0400 Subject: [PATCH] Internals: cppcheck 1.90 fixes. No functional change intended. --- include/verilated.cpp | 12 +++++----- include/verilated_heavy.h | 4 +++- include/verilated_threads.cpp | 1 + include/verilated_vpi.cpp | 9 ++++---- src/V3AstNodes.h | 12 +++++++++- src/V3Broken.cpp | 1 + src/V3CUse.cpp | 2 +- src/V3EmitC.cpp | 15 +++++++------ src/V3File.cpp | 2 ++ src/V3FileLine.cpp | 5 +++++ src/V3FileLine.h | 42 +++++++++++++++++------------------ src/V3Global.h | 27 +++++++++++----------- src/V3LinkLValue.cpp | 1 - src/V3Localize.cpp | 1 + src/V3Number.cpp | 12 +++++----- src/V3Options.cpp | 3 +++ src/V3Param.cpp | 10 ++++----- src/V3Simulate.h | 4 ++-- src/V3SplitVar.cpp | 10 ++++----- src/V3SymTable.h | 8 +++---- src/V3Task.cpp | 17 +++++++------- src/V3Width.cpp | 8 +++---- src/VlcBucket.h | 3 ++- 23 files changed, 116 insertions(+), 93 deletions(-) diff --git a/include/verilated.cpp b/include/verilated.cpp index 7620d76a6..13af6f3b4 100644 --- a/include/verilated.cpp +++ b/include/verilated.cpp @@ -857,9 +857,12 @@ void _vl_vsformat(std::string& output, const char* formatp, va_list ap) VL_MT_SA } } -static inline bool _vl_vsss_eof(FILE* fp, int& floc) VL_MT_SAFE { - if (fp) return feof(fp) ? 1 : 0; // 1:0 to prevent MSVC++ warning - else return (floc<0); +static inline bool _vl_vsss_eof(FILE* fp, int floc) VL_MT_SAFE { + if (fp) { + return feof(fp) ? 1 : 0; // 1:0 to prevent MSVC++ warning + } else { + return floc < 0; + } } static inline void _vl_vsss_advance(FILE* fp, int& floc) VL_MT_SAFE { if (fp) fgetc(fp); @@ -1689,7 +1692,6 @@ bool VlReadMem::get(QData& addrr, std::string& valuer) { if (c == '_') continue; // Ignore _ e.g. inside a number if (indata && !isxdigit(c) && c != 'x' && c != 'X') { // printf("Got data @%lx = %s\n", m_addr, valuer.c_str()); - indata = false; ungetc(c, m_fp); addrr = m_addr; ++m_addr; @@ -1860,8 +1862,6 @@ void VL_READMEM_N(bool hex, // Hex format, else binary ) VL_MT_SAFE { QData addr_max = array_lsb + depth - 1; if (start < static_cast(array_lsb)) start = array_lsb; - QData addr_end = end; - if (addr_end > addr_max) addr_end = addr_max; VlReadMem rmem(hex, bits, filename, start, end); if (VL_UNLIKELY(!rmem.isOpen())) return; diff --git a/include/verilated_heavy.h b/include/verilated_heavy.h index 8f8d9d383..557ad45f3 100644 --- a/include/verilated_heavy.h +++ b/include/verilated_heavy.h @@ -85,7 +85,9 @@ template class VlWide { WData m_storage[T_Words]; public: - // Default constructor/destructor/copy are fine + // cppcheck-suppress uninitVar + VlWide() {} + ~VlWide() {} const WData& at(size_t index) const { return m_storage[index]; } WData& at(size_t index) { return m_storage[index]; } WData* data() { return &m_storage[0]; } diff --git a/include/verilated_threads.cpp b/include/verilated_threads.cpp index 77d19b700..f4f23149f 100644 --- a/include/verilated_threads.cpp +++ b/include/verilated_threads.cpp @@ -142,6 +142,7 @@ void VlThreadPool::profileDump(const char* filenamep, vluint64_t ticksElapsed) { FILE* fp = fopen(filenamep, "w"); if (VL_UNLIKELY(!fp)) { VL_FATAL_MT(filenamep, 0, "", "+prof+threads+file file not writable"); + // cppcheck-suppress resourceLeak // bug, doesn't realize fp is nullptr return; } diff --git a/include/verilated_vpi.cpp b/include/verilated_vpi.cpp index 3d5cd6651..11d6ae561 100644 --- a/include/verilated_vpi.cpp +++ b/include/verilated_vpi.cpp @@ -930,15 +930,14 @@ const char* VerilatedVpiError::strFromVpiProp(PLI_INT32 vpiVal) VL_MT_SAFE { #define CHECK_RESULT_CSTR(got, exp) \ if (strcmp((got), (exp))) { \ - std::string msg = std::string("%Error: ") \ - + "GOT = '"+((got)?(got):"")+"'" \ - + " EXP = '"+((exp)?(exp):"")+"'"; \ - VL_FATAL_MT(__FILE__, __LINE__, "", msg.c_str()); \ + std::string msg \ + = std::string("%Error: ") + "GOT = '" + got + "'" + " EXP = '" + exp + "'"; \ + VL_FATAL_MT(__FILE__, __LINE__, "", msg.c_str()); \ } #define CHECK_ENUM_STR(fn, enum) \ do { \ - const char* strVal = VerilatedVpiError::fn(enum); \ + const char* strVal = VerilatedVpiError::fn(enum); \ CHECK_RESULT_CSTR(strVal, #enum); \ } while (0) diff --git a/src/V3AstNodes.h b/src/V3AstNodes.h index 9741eba32..5343bf1ad 100644 --- a/src/V3AstNodes.h +++ b/src/V3AstNodes.h @@ -255,7 +255,8 @@ class AstClassPackage : public AstNodeModule { AstClass* m_classp; // Class package this is under (weak pointer, hard link is other way) public: AstClassPackage(FileLine* fl, const string& name) - : ASTGEN_SUPER(fl, name) {} + : ASTGEN_SUPER(fl, name) + , m_classp(NULL) {} ASTNODE_NODE_FUNCS(ClassPackage) virtual string verilogKwd() const { return "/*class*/package"; } virtual const char* broken() const; @@ -948,8 +949,11 @@ public: virtual void virtRefDTypep(AstNodeDType* nodep) { refDTypep(nodep); } // METHODS virtual AstBasicDType* basicp() const { return NULL; } + // cppcheck-suppress csyleCast virtual AstNodeDType* skipRefp() const { return (AstNodeDType*)this; } + // cppcheck-suppress csyleCast virtual AstNodeDType* skipRefToConstp() const { return (AstNodeDType*)this; } + // cppcheck-suppress csyleCast virtual AstNodeDType* skipRefToEnump() const { return (AstNodeDType*)this; } virtual int widthAlignBytes() const { return subDTypep()->widthAlignBytes(); } virtual int widthTotalBytes() const { return subDTypep()->widthTotalBytes(); } @@ -1111,8 +1115,11 @@ public: virtual void virtRefDTypep(AstNodeDType* nodep) { } virtual bool similarDType(AstNodeDType* samep) const { return this==samep; } virtual AstBasicDType* basicp() const { return NULL; } + // cppcheck-suppress csyleCast virtual AstNodeDType* skipRefp() const { return (AstNodeDType*)this; } + // cppcheck-suppress csyleCast virtual AstNodeDType* skipRefToConstp() const { return (AstNodeDType*)this; } + // cppcheck-suppress csyleCast virtual AstNodeDType* skipRefToEnump() const { return (AstNodeDType*)this; } virtual int widthAlignBytes() const { return 1; } virtual int widthTotalBytes() const { return 1; } @@ -1207,6 +1214,7 @@ public: virtual AstBasicDType* basicp() const { return subDTypep()->basicp(); } // (Slow) recurse down to find basic data type virtual AstNodeDType* skipRefp() const { return subDTypep()->skipRefp(); } virtual AstNodeDType* skipRefToConstp() const { return subDTypep()->skipRefToConstp(); } + // cppcheck-suppress csyleCast virtual AstNodeDType* skipRefToEnump() const { return (AstNodeDType*)this; } virtual int widthAlignBytes() const { return subDTypep()->widthAlignBytes(); } virtual int widthTotalBytes() const { return subDTypep()->widthTotalBytes(); } @@ -1225,7 +1233,9 @@ public: virtual bool similarDType(AstNodeDType* samep) const { return this==samep; } virtual AstBasicDType* basicp() const { return NULL; } virtual AstNodeDType* skipRefp() const { return NULL; } + // cppcheck-suppress csyleCast virtual AstNodeDType* skipRefToConstp() const { return (AstNodeDType*)this; } + // cppcheck-suppress csyleCast virtual AstNodeDType* skipRefToEnump() const { return (AstNodeDType*)this; } virtual int widthAlignBytes() const { return 0; } virtual int widthTotalBytes() const { return 0; } diff --git a/src/V3Broken.cpp b/src/V3Broken.cpp index e76cc351e..b27dc4b04 100644 --- a/src/V3Broken.cpp +++ b/src/V3Broken.cpp @@ -87,6 +87,7 @@ public: } static void addInTree(AstNode* nodep, bool linkable) { #ifndef VL_LEAK_CHECKS + // cppcheck-suppress knownConditionTrueFalse if (!linkable) return; // save some time, else the map will get huge! #endif NodeMap::iterator iter = s_nodes.find(nodep); diff --git a/src/V3CUse.cpp b/src/V3CUse.cpp index e0539d773..fe1f6f073 100644 --- a/src/V3CUse.cpp +++ b/src/V3CUse.cpp @@ -178,7 +178,7 @@ class CUseVisitor : public AstNVisitor { if (nodep->extendsp() && nodep->extendsp()->classp()->user1()) { string stmt = "out += \""; if (!comma.empty()) stmt += "\", \"+ "; - comma = ", "; + // comma = ", "; // Nothing further so not needed stmt += nodep->extendsp()->dtypep()->nameProtect(); stmt += "::to_string_middle();\n"; nodep->user1(true); // So what we extend dumps this diff --git a/src/V3EmitC.cpp b/src/V3EmitC.cpp index 9c8b0ba97..17030feae 100644 --- a/src/V3EmitC.cpp +++ b/src/V3EmitC.cpp @@ -1878,9 +1878,8 @@ void EmitCStmts::displayEmit(AstNode* nodep, bool isScan) { putbs(","); iterate(dispp->lhsp()); putbs(","); - } else if (const AstSFormatF* dispp = VN_CAST(nodep, SFormatF)) { + } else if (VN_IS(nodep, SFormatF)) { isStmt = false; - if (dispp) {} puts("VL_SFORMATF_NX("); } else { nodep->v3fatalSrc("Unknown displayEmit node type"); @@ -2916,11 +2915,13 @@ void EmitCImp::emitInt(AstNodeModule* modp) { puts("\n// INTERNAL METHODS\n"); if (modp->isTop()) { ofp()->putsPrivate(true); // private: - puts("static void "+protect("_eval_initial_loop") - +"("+EmitCBaseVisitor::symClassVar()+");\n"); - if (v3Global.needTraceDumper() && !optSystemC()) puts("void _traceDump();"); - if (v3Global.needTraceDumper()) puts("void _traceDumpOpen();"); - if (v3Global.needTraceDumper()) puts("void _traceDumpClose();"); + puts("static void " + protect("_eval_initial_loop") + "(" + EmitCBaseVisitor::symClassVar() + + ");\n"); + if (v3Global.needTraceDumper()) { + if (!optSystemC()) puts("void _traceDump();"); + puts("void _traceDumpOpen();"); + puts("void _traceDumpClose();"); + } } if (!VN_IS(modp, Class)) { diff --git a/src/V3File.cpp b/src/V3File.cpp index 8a0ae3e08..dee1298f2 100644 --- a/src/V3File.cpp +++ b/src/V3File.cpp @@ -116,6 +116,7 @@ public: // ACCESSOR METHODS void addSrcDepend(const string& filename) { if (m_filenameSet.find(filename) == m_filenameSet.end()) { + // cppcheck-suppress stlFindInsert // cppcheck 1.90 bug m_filenameSet.insert(filename); DependFile df (filename, false); df.loadStats(); // Get size now, in case changes during the run @@ -124,6 +125,7 @@ public: } void addTgtDepend(const string& filename) { if (m_filenameSet.find(filename) == m_filenameSet.end()) { + // cppcheck-suppress stlFindInsert // cppcheck 1.90 bug m_filenameSet.insert(filename); m_filenameList.insert(DependFile(filename, true)); } diff --git a/src/V3FileLine.cpp b/src/V3FileLine.cpp index 60984003b..85324f015 100644 --- a/src/V3FileLine.cpp +++ b/src/V3FileLine.cpp @@ -155,6 +155,11 @@ FileLine::FileLine(FileLine::EmptySecret) { } } +void FileLine::newContent() { + m_contentp = new VFileContent; + m_contentLineno = 1; +} + const string FileLine::xmlDetailedLocation() const { return "loc=\"" + cvtToStr(filenameLetters()) + "," + diff --git a/src/V3FileLine.h b/src/V3FileLine.h index 09953ef14..de09fc0f1 100644 --- a/src/V3FileLine.h +++ b/src/V3FileLine.h @@ -115,26 +115,26 @@ private: return *defFilelinep; } public: - explicit FileLine(const string& filename) { - m_lastLineno = m_firstLineno = 0; - m_lastColumn = m_firstColumn = 0; - m_filenameno = singleton().nameToNumber(filename); - m_contentLineno = 0; - m_contentp = NULL; - m_parent = NULL; - m_warnOn = defaultFileLine().m_warnOn; - } - explicit FileLine(FileLine* fromp) { - m_firstLineno = fromp->m_firstLineno; - m_firstColumn = fromp->m_firstColumn; - m_lastLineno = fromp->m_lastLineno; - m_lastColumn = fromp->m_lastColumn; - m_filenameno = fromp->m_filenameno; - m_contentLineno = fromp->m_contentLineno; - m_contentp = fromp->m_contentp; - m_parent = fromp->m_parent; - m_warnOn = fromp->m_warnOn; - } + explicit FileLine(const string& filename) + : m_firstLineno(0) + , m_firstColumn(0) + , m_lastLineno(0) + , m_lastColumn(0) + , m_filenameno(singleton().nameToNumber(filename)) + , m_contentLineno(0) + , m_contentp(NULL) + , m_parent(NULL) + , m_warnOn(defaultFileLine().m_warnOn) {} + explicit FileLine(FileLine* fromp) + : m_firstLineno(fromp->m_firstLineno) + , m_firstColumn(fromp->m_firstColumn) + , m_lastLineno(fromp->m_lastLineno) + , m_lastColumn(fromp->m_lastColumn) + , m_filenameno(fromp->m_filenameno) + , m_contentLineno(fromp->m_contentLineno) + , m_contentp(fromp->m_contentp) + , m_parent(fromp->m_parent) + , m_warnOn(fromp->m_warnOn) {} struct EmptySecret {}; // Constructor selection explicit FileLine(EmptySecret); FileLine* copyOrSameFileLine(); @@ -144,8 +144,8 @@ public: static void* operator new(size_t size); static void operator delete(void* obj, size_t size); #endif - void newContent() { m_contentp = new VFileContent; m_contentLineno = 1; } // METHODS + void newContent(); void lineno(int num) { m_firstLineno = num; m_lastLineno = num; m_firstColumn = m_lastColumn = 1; } void language(V3LangCode lang) { singleton().numberToLang(m_filenameno, lang); } diff --git a/src/V3Global.h b/src/V3Global.h index 5c9503032..5ae33fbf9 100644 --- a/src/V3Global.h +++ b/src/V3Global.h @@ -83,22 +83,21 @@ public: // Options V3Options opt; // All options; let user see them directly - public: +public: // CONSTRUCTORS - V3Global() { - m_debugFileNumber = 0; - m_widthMinUsage = VWidthMinUsage::LINT_WIDTH; - m_assertDTypesResolved = false; - m_constRemoveXs = false; - m_needC11 = false; - m_needHInlines = false; - m_needHeavy = false; - m_needTraceDumper = false; - m_dpi = false; - m_rootp = NULL; // created by makeInitNetlist() so static constructors run first - } + V3Global() + : m_rootp(NULL) // created by makeInitNetlist() so static constructors run first + , m_widthMinUsage(VWidthMinUsage::LINT_WIDTH) + , m_debugFileNumber(0) + , m_assertDTypesResolved(false) + , m_constRemoveXs(false) + , m_needC11(false) + , m_needHInlines(false) + , m_needHeavy(false) + , m_needTraceDumper(false) + , m_dpi(false) {} AstNetlist* makeNetlist(); - void boot() { UASSERT(!m_rootp,"call once"); m_rootp = makeNetlist(); } + void boot() { UASSERT(!m_rootp, "call once"); m_rootp = makeNetlist(); } void clear(); // ACCESSORS (general) AstNetlist* rootp() const { return m_rootp; } diff --git a/src/V3LinkLValue.cpp b/src/V3LinkLValue.cpp index 6788e1d9b..4a6e32d92 100644 --- a/src/V3LinkLValue.cpp +++ b/src/V3LinkLValue.cpp @@ -108,7 +108,6 @@ private: m_setRefLvalue = true; iterateAndNextNull(nodep->filep()); iterateAndNextNull(nodep->strp()); - m_setRefLvalue = false; } m_setRefLvalue = last_setRefLvalue; } diff --git a/src/V3Localize.cpp b/src/V3Localize.cpp index 25667dc9e..870c1f3fa 100644 --- a/src/V3Localize.cpp +++ b/src/V3Localize.cpp @@ -74,6 +74,7 @@ private: // METHODS virtual void visit(AstVarRef* nodep) VL_OVERRIDE { + // cppcheck-suppress unreadVariable // cppcheck 1.90 bug VarFlags flags (nodep->varp()); if (flags.m_done) { nodep->hiername(""); // Remove this-> diff --git a/src/V3Number.cpp b/src/V3Number.cpp index 4a4a757ac..72d6a61e6 100644 --- a/src/V3Number.cpp +++ b/src/V3Number.cpp @@ -457,14 +457,14 @@ string V3Number::ascii(bool prefixed, bool cleanVerilog) const { ); //out<<"-"<modp(), Iface)) - || (nonIf==1 && !VN_IS(nodep->modp(), Iface))) { + AstCell* cellp = *it; + if ((nonIf==0 && VN_IS(cellp->modp(), Iface)) + || (nonIf==1 && !VN_IS(cellp->modp(), Iface))) { string fullName (m_modp->hierName()); - if (string* genHierNamep = (string *) nodep->user5p()) { + if (string* genHierNamep = (string *) cellp->user5p()) { fullName += *genHierNamep; } - visitCell(nodep, fullName); + visitCell(cellp, fullName); } } } diff --git a/src/V3Simulate.h b/src/V3Simulate.h index ca09d8615..c48ee7907 100644 --- a/src/V3Simulate.h +++ b/src/V3Simulate.h @@ -273,11 +273,11 @@ private: } public: AstNode* fetchValueNull(AstNode* nodep) { - return (AstNode*)(nodep->user3p()); + return nodep->user3p(); } private: AstNode* fetchOutValueNull(AstNode* nodep) { - return (AstNode*)(nodep->user2p()); + return nodep->user2p(); } AstConst* fetchConstNull(AstNode* nodep) { return VN_CAST(fetchValueNull(nodep), Const); diff --git a/src/V3SplitVar.cpp b/src/V3SplitVar.cpp index 5289d2047..729daca0f 100644 --- a/src/V3SplitVar.cpp +++ b/src/V3SplitVar.cpp @@ -732,19 +732,19 @@ class SplitUnpackedVarVisitor : public AstNVisitor, public SplitVarImpl { sit->lvalue()); } else { AstVarRef* refp = VN_CAST(sit->nodep(), VarRef); - AstUnpackArrayDType* dtypep; + AstUnpackArrayDType* adtypep; int lsb = 0; if (refp) { - dtypep = VN_CAST(refp->dtypep()->skipRefp(), UnpackArrayDType); + adtypep = VN_CAST(refp->dtypep()->skipRefp(), UnpackArrayDType); } else { AstSliceSel* selp = VN_CAST(sit->nodep(), SliceSel); UASSERT_OBJ(selp, sit->nodep(), "Unexpected op is registered"); refp = VN_CAST(selp->fromp(), VarRef); UASSERT_OBJ(refp, selp, "Unexpected op is registered"); - dtypep = VN_CAST(selp->dtypep()->skipRefp(), UnpackArrayDType); - lsb = dtypep->lsb(); + adtypep = VN_CAST(selp->dtypep()->skipRefp(), UnpackArrayDType); + lsb = adtypep->lsb(); } - AstVarRef* newrefp = createTempVar(sit->context(), refp, dtypep, varp->name(), + AstVarRef* newrefp = createTempVar(sit->context(), refp, adtypep, varp->name(), vars, lsb, refp->lvalue(), sit->ftask()); newp = newrefp; refp->varp()->addNextHere(newrefp->varp()); diff --git a/src/V3SymTable.h b/src/V3SymTable.h index f935f1e46..afbd4a9d1 100644 --- a/src/V3SymTable.h +++ b/src/V3SymTable.h @@ -97,10 +97,10 @@ public: ~VSymEnt() { // Change links so we coredump if used #ifdef VL_DEBUG - m_nodep = (AstNode*)1; - m_fallbackp = (VSymEnt*)1; - m_parentp = (VSymEnt*)1; - m_packagep = (AstPackage*)1; + m_nodep = reinterpret_cast(1); + m_fallbackp = reinterpret_cast(1); + m_parentp = reinterpret_cast(1); + m_packagep = reinterpret_cast(1); #endif } #if defined(VL_DEBUG) && !defined(VL_LEAK_CHECKS) diff --git a/src/V3Task.cpp b/src/V3Task.cpp index 3ea7d97f6..ffe18e221 100644 --- a/src/V3Task.cpp +++ b/src/V3Task.cpp @@ -526,14 +526,15 @@ private: // Even if it's referencing a varref, we still make a temporary // Else task(x,x,x) might produce incorrect results - AstVarScope* outvscp - = createVarScope(portp, namePrefix+"__"+portp->shortName()); - portp->user2p(outvscp); - pinp->replaceWith(new AstVarRef(outvscp->fileline(), outvscp, true)); - AstAssign* assp = new AstAssign(pinp->fileline(), - pinp, - new AstVarRef(outvscp->fileline(), outvscp, false)); - assp->fileline()->modifyWarnOff(V3ErrorCode::BLKSEQ, true); // Ok if in <= block + AstVarScope* newvscp + = createVarScope(portp, namePrefix + "__" + portp->shortName()); + portp->user2p(newvscp); + pinp->replaceWith(new AstVarRef(newvscp->fileline(), newvscp, true)); + AstAssign* assp + = new AstAssign(pinp->fileline(), pinp, + new AstVarRef(newvscp->fileline(), newvscp, false)); + assp->fileline()->modifyWarnOff(V3ErrorCode::BLKSEQ, + true); // Ok if in <= block // Put assignment BEHIND of all other statements beginp->addNext(assp); } diff --git a/src/V3Width.cpp b/src/V3Width.cpp index c71102b12..36e454514 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -1142,9 +1142,9 @@ private: default: nodep->v3error("Unhandled attribute type"); } } else { - std::pair dimp + std::pair dimpair = nodep->fromp()->dtypep()->skipRefp()->dimensions(true); - uint32_t msbdim = dimp.first + dimp.second; + uint32_t msbdim = dimpair.first + dimpair.second; if (!nodep->dimp() || msbdim < 1) { int dim = 1; AstConst* newp = dimensionValue(nodep->fileline(), nodep->fromp()->dtypep(), @@ -2457,7 +2457,6 @@ private: if (nodep->didWidthAndSet()) return; AstDynArrayDType* adtypep = VN_CAST(m_vup->dtypeNullp(), DynArrayDType); if (!adtypep) { // e.g. int a = new; - if (adtypep) UINFO(1, "Got adtypep " << adtypep << endl); nodep->v3error("dynamic new() not expected in this context (data type must be dynamic array)"); return; } @@ -4698,11 +4697,10 @@ private: declRange = VNumRange(); // ranged() set false if (AstNodeArrayDType* adtypep = VN_CAST(dtypep, NodeArrayDType)) { declRange = adtypep->declRange(); - if (isubDTypep()->skipRefp(); + if (i < dim) dtypep = adtypep->subDTypep()->skipRefp(); continue; } else if (AstNodeUOrStructDType* adtypep = VN_CAST(dtypep, NodeUOrStructDType)) { declRange = adtypep->declRange(); - if (adtypep) {} // UNUSED break; // Sub elements don't look like arrays and can't iterate into } else if (AstBasicDType* adtypep = VN_CAST(dtypep, BasicDType)) { if (adtypep->isRanged()) declRange = adtypep->declRange(); diff --git a/src/VlcBucket.h b/src/VlcBucket.h index 24c23d1f1..5e09e82d9 100644 --- a/src/VlcBucket.h +++ b/src/VlcBucket.h @@ -40,8 +40,9 @@ private: if (m_dataSize < point) m_dataSize = (point + 64) & ~63ULL; // Keep power of two m_dataSize *= 2; // UINFO(9, "Realloc "<(realloc(m_datap, allocSize())); if (!newp) { + // cppcheck-suppress doubleFree // cppcheck 1.90 bug - realloc doesn't free on fail free(m_datap); v3fatal("Out of memory increasing buckets"); }