KindDragon / vld

Visual Leak Detector for Visual C++ 2008-2015
https://kinddragon.github.io/vld/
GNU Lesser General Public License v2.1
1.02k stars 314 forks source link

Fix false positive for string initialization in header with initterm in callstack #63

Open mattdurak opened 5 years ago

mattdurak commented 5 years ago

This fixes false positives if a c++ string is initialized in a header. Currently, VLD is not ignoring the call stack in this case, though it has the "initterm" function in the call stack.

This change adds a check for "initterm" to CallStack::isCrtStartupFunction.

There is also a very basic test added to demonstrate the issue. It does not use GTEST in order to avoid false positives from the test suite init code.

Tested in VS 2017

Fixes #62