Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Apr 22, 2024
1 parent cdc3603 commit 1cce5c4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/checkother.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3905,6 +3905,14 @@ static bool getBufAndOffset(const Token *expr, const Token *&buf, MathLib::bigin
} else if (expr->valueType() && expr->valueType()->pointer > 0) {
buf = expr;
*offset = 0;
auto vt = *expr->valueType();
--vt.pointer;
elementSize = ValueFlow::getSizeOf(vt, settings);
if (elementSize > 0) {
*offset *= elementSize;
if (sizeValue)
*sizeValue *= elementSize;
}
return true;
} else {
return false;
Expand Down

0 comments on commit 1cce5c4

Please sign in to comment.