File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -635,7 +635,8 @@ static void setTokenValue(Token* tok,
635635 });
636636 // Ensure that the comma isn't a function call
637637 if (!callParent || (!Token::Match (callParent->previous (), " %name%|> (" ) && !Token::simpleMatch (callParent, " {" ) &&
638- (!Token::Match (callParent, " ( %name%" ) || settings->library .isNotLibraryFunction (callParent->next ())))) {
638+ (!Token::Match (callParent, " ( %name%" ) || settings->library .isNotLibraryFunction (callParent->next ())) &&
639+ !(callParent->str () == " (" && Token::simpleMatch (callParent->astOperand1 (), " *" )))) {
639640 setTokenValue (parent, std::move (value), settings);
640641 return ;
641642 }
Original file line number Diff line number Diff line change @@ -5129,6 +5129,13 @@ class TestValueFlow : public TestFixture {
51295129 value = valueOfTok (code, " 1" );
51305130 ASSERT_EQUALS (1 , value.intvalue );
51315131 ASSERT_EQUALS (false , value.isKnown ());
5132+
5133+ code = " void f(char c, struct T* t) {\n " // #11894
5134+ " (*t->func)(&c, 1, t->ptr);\n "
5135+ " }\n " ;
5136+ value = valueOfTok (code, " , 1" );
5137+ ASSERT_EQUALS (0 , value.intvalue );
5138+ ASSERT_EQUALS (false , value.isKnown ());
51325139 }
51335140
51345141 void valueFlowSizeofForwardDeclaredEnum () {
You can’t perform that action at this time.
0 commit comments