Fixed #9476 (Tokenizer: report unknown macro)
This commit is contained in:
parent
2fa837c716
commit
3876b601d5
|
@ -9488,6 +9488,13 @@ void Tokenizer::reportUnknownMacros()
|
||||||
continue;
|
continue;
|
||||||
unknownMacroError(tok->next());
|
unknownMacroError(tok->next());
|
||||||
}
|
}
|
||||||
|
if (Token::Match(tok, "[(,] %name% (") && Token::Match(tok->linkAt(2), ") %name% %name%|,|)")) {
|
||||||
|
if (tok->linkAt(2)->next()->isKeyword())
|
||||||
|
continue;
|
||||||
|
if (cAlternativeTokens.count(tok->linkAt(2)->next()->str()) > 0)
|
||||||
|
continue;
|
||||||
|
unknownMacroError(tok->next());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8146,6 +8146,9 @@ private:
|
||||||
|
|
||||||
const char code6[] = "void foo() { dostuff(a, .x=0); }";
|
const char code6[] = "void foo() { dostuff(a, .x=0); }";
|
||||||
ASSERT_THROW(tokenizeAndStringify(code6), InternalError);
|
ASSERT_THROW(tokenizeAndStringify(code6), InternalError);
|
||||||
|
|
||||||
|
const char code7[] = "void foo() { dostuff(ZEND_NUM_ARGS() TSRMLS_CC, x, y); }"; // #9476
|
||||||
|
ASSERT_THROW(tokenizeAndStringify(code7), InternalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
void findGarbageCode() { // Test Tokenizer::findGarbageCode()
|
void findGarbageCode() { // Test Tokenizer::findGarbageCode()
|
||||||
|
|
Loading…
Reference in New Issue