Skip to content

Crashes on Windows #7705

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Crashes on Windows #7705

wants to merge 1 commit into from

Conversation

mrjoel
Copy link
Contributor

@mrjoel mrjoel commented Jul 25, 2025

(I'm working through impediments with issue tracking access, creating here for sharing information).

The 2.18.0 release crashes when running on some internal project code. When running in Debug, the assert at https://github.com/danmar/cppcheck/blob/2.18.0/lib/astutils.cpp#L778 is hit. When running in Release, it continues past and gets an invalid access two lines later.

I've so far distilled it down to the following reproducer.

struct Thing
{
  int thing;
  // Uncommenting this unneeded padding variable avoids crash.
  //int other;
};

template<typename T>
class Wrapper
{
public:
  Wrapper(){}

  Wrapper(int val1, int* val2)
  {
    mItem = new T(val1, val2);
  }

private:
  T mItem;
};

class ThingWrapper
{

  Wrapper<Thing*> mThing;

  //int foo = 5;
  //Wrapper<Thing*> mThing{4, &foo};
};

Copy link

@mrjoel mrjoel changed the title 2.18.0 crashes on Windows Crashes on Windows Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant