Reverted f088588c
fix for #6187 that fixes infinite loop, the fix cause a use-after-free regression.
This commit is contained in:
parent
ab6178f739
commit
ecd17d84fb
|
@ -9091,7 +9091,8 @@ void Tokenizer::simplifyWhile0()
|
||||||
if (Token::simpleMatch(tok->next()->link(), ") {")) {
|
if (Token::simpleMatch(tok->next()->link(), ") {")) {
|
||||||
Token *end = tok->next()->link();
|
Token *end = tok->next()->link();
|
||||||
end = end->next()->link();
|
end = end->next()->link();
|
||||||
eraseDeadCode(tok->previous(), end->next());
|
tok = tok->previous();
|
||||||
|
eraseDeadCode(tok, end->next());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2375,16 +2375,6 @@ private:
|
||||||
|
|
||||||
ASSERT_EQUALS("void foo ( ) { exit ( 0 ) ; }",
|
ASSERT_EQUALS("void foo ( ) { exit ( 0 ) ; }",
|
||||||
tokWithStdLib("void foo() { do { exit(0); } while (true); }"));
|
tokWithStdLib("void foo() { do { exit(0); } while (true); }"));
|
||||||
|
|
||||||
// #6187
|
|
||||||
tokWithStdLib("void foo() {\n"
|
|
||||||
" goto label;\n"
|
|
||||||
" for (int i = 0; i < 0; ++i) {\n"
|
|
||||||
" ;\n"
|
|
||||||
"label:\n"
|
|
||||||
" ;\n"
|
|
||||||
" }\n"
|
|
||||||
"}");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void strcat1() {
|
void strcat1() {
|
||||||
|
|
Loading…
Reference in New Issue