Skip to content

Commit 9dfef14

Browse files
Update valueflow.cpp
1 parent d250490 commit 9dfef14

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/valueflow.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6897,10 +6897,7 @@ static void valueFlowDynamicBufferSize(const TokenList& tokenlist, const SymbolD
68976897
if (!typeTok || !typeTok->varId())
68986898
typeTok = newTok->astParent()->previous(); // hack for "int** z = ..."
68996899
if (typeTok && typeTok->valueType()) {
6900-
ValueType vt = *typeTok->valueType();
6901-
if (vt.pointer > 0)
6902-
--vt.pointer;
6903-
const size_t typeSize = vt.getSizeOf(settings, ValueType::Accuracy::ExactOrZero, ValueType::SizeOf::Pointer);
6900+
const size_t typeSize = typeTok->valueType()->getSizeOf(settings, ValueType::Accuracy::ExactOrZero, ValueType::SizeOf::Pointee);
69046901
if (typeSize > 0 || numElem == 0)
69056902
sizeValue = numElem * typeSize;
69066903
}

0 commit comments

Comments
 (0)