parent
cb7537418a
commit
6a37c36ee8
|
@ -576,13 +576,13 @@ void CheckOther::checkSizeofForPointerSize()
|
|||
// Also ensure the variables are pointers
|
||||
// Only keep variables which are pointers
|
||||
const Variable *var = symbolDatabase->getVariableFromVarId(variable->varId());
|
||||
if (!var || !var->isPointer()) {
|
||||
if (!var || !var->isPointer() || var->isArray()) {
|
||||
variable = 0;
|
||||
}
|
||||
|
||||
if (variable2) {
|
||||
var = symbolDatabase->getVariableFromVarId(variable2->varId());
|
||||
if (!var || !var->isPointer()) {
|
||||
if (!var || !var->isPointer() || var->isArray()) {
|
||||
variable2 = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9278,7 +9278,7 @@ void Tokenizer::simplifyBorland()
|
|||
while (tok2->next() && !Token::Match(tok2->next(), "{|;"))
|
||||
tok2->deleteNext();
|
||||
tok2->deleteThis();
|
||||
if (tok2 && tok2->str() == "{") {
|
||||
if (tok2->str() == "{") {
|
||||
Token::eraseTokens(tok2, tok2->link());
|
||||
tok2->deleteNext();
|
||||
tok2->deleteThis();
|
||||
|
|
|
@ -4314,6 +4314,11 @@ private:
|
|||
"memset(x, 0, sizeof(x));");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check(
|
||||
"char* x[10];\n"
|
||||
"memset(x, 0, sizeof(x));");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check(
|
||||
"char x[10];\n"
|
||||
"memset(x, 0, sizeof x);");
|
||||
|
|
Loading…
Reference in New Issue