You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix 10570: Improve check; condition then pointer dereference, different pointers (#4216)
* Try to use after assign in loop
* Update valueflow forward to handle init tokens
* Fix tests
* Make test TODO
* Format
* Add tests
* Format
* Fix ubsan error
* Use simpleMatch
Copy file name to clipboardExpand all lines: test/teststl.cpp
+5-2Lines changed: 5 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2518,13 +2518,16 @@ class TestStl : public TestFixture {
2518
2518
" {\n"
2519
2519
" if (a) {\n"
2520
2520
" if (b)\n"
2521
-
" foo.erase(it);\n"
2521
+
" foo.erase(it);\n"// <- TODO: erase shound't cause inconclusive valueflow
2522
2522
" else\n"
2523
2523
" *it = 0;\n"
2524
2524
" }\n"
2525
2525
" }\n"
2526
2526
"}");
2527
-
ASSERT_EQUALS("[test.cpp:5] -> [test.cpp:7] -> [test.cpp:8] -> [test.cpp:8] -> [test.cpp:7] -> [test.cpp:5] -> [test.cpp:9] -> [test.cpp:3] -> [test.cpp:5]: (error) Using iterator to local container 'foo' that may be invalid.\n", errout.str());
2527
+
TODO_ASSERT_EQUALS(
2528
+
"[test.cpp:5] -> [test.cpp:7] -> [test.cpp:8] -> [test.cpp:8] -> [test.cpp:7] -> [test.cpp:5] -> [test.cpp:9] -> [test.cpp:3] -> [test.cpp:5]: (error) Using iterator to local container 'foo' that may be invalid.\n",
2529
+
"[test.cpp:5] -> [test.cpp:7] -> [test.cpp:8] -> [test.cpp:8] -> [test.cpp:7] -> [test.cpp:5] -> [test.cpp:9] -> [test.cpp:3] -> [test.cpp:5]: (error, inconclusive) Using iterator to local container 'foo' that may be invalid.\n",
0 commit comments