GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix crashes in z3 · Ken-Patrick/cppcheck@172cd2d

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • checkstl.cpp
  • test
    • teststl.cpp
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/checkstl.cpp‎

Copy file name to clipboardExpand all lines: lib/checkstl.cpp
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2036,6 +2036,8 @@ static const Token *singleMemberCallInScope(const Token *start, nonneg int varid
20362036
if (!Token::findmatch(dotTok->tokAt(2), "%varid%", endStatement, varid))
20372037
return nullptr;
20382038
input = Token::Match(start->next(), "%var% . %name% ( %varid% )", varid);
2039+
if (!dotTok->astOperand1()) // incomplete code
2040+
return nullptr;
20392041
if (isVariableChanged(dotTok->next(), endStatement, dotTok->astOperand1()->varId(), false, nullptr, true))
20402042
return nullptr;
20412043
return dotTok;
Collapse file

‎test/teststl.cpp‎

Copy file name to clipboardExpand all lines: test/teststl.cpp
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3241,6 +3241,20 @@ class TestStl : public TestFixture {
32413241
" void shift() { EffectivityRangeData<int>::iterator it; } \n"
32423242
"};\n");
32433243
ASSERT_EQUALS("", errout.str());
3244+
3245+
// test for crash in z3
3246+
check("struct explain::imp {\n"
3247+
" solver &m_solver;\n"
3248+
"\n"
3249+
" void project(var x, unsigned num, literal const *ls,\n"
3250+
" const scoped_literal_vector &result) {\n"
3251+
" DEBUG_CODE(TRACE(\"nlsat\",\n"
3252+
" for (literal l\n"
3253+
" : result) { m_solver.display(tout << \" \", l); });\n"
3254+
" );\n"
3255+
" }\n"
3256+
"};");
3257+
ASSERT_EQUALS("", errout.str());
32443258
}
32453259

32463260
void dereferenceInvalidIterator() {

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.