Commit 8e7375d3 authored by Sean McBride's avatar Sean McBride
Browse files

Prevent writing of non-0/1 values into bool

When running the test 'vtkCommonCoreTcl-TestSetGet',
clang's -fsanitize=bool complained:

runtime error: load of value 37, which is not a valid value for type 'bool'

The code called resize() on an stl vector which ended up using the default
constructor (which didn't initialize any ivars) and then subsequent new items
(I think) were copied from this one prototype by
IVFDataSetInfo::IVFDataSetInfo(const IVFDataSetInfo &ivfci)
which then copied the randomly-initialized bool into another bool,
and thus the error.  Fixed by zeroing everything in the default ctor.

Change-Id: Icd1a8c1b6a6eb84b525048b0177910f2a7d2f855
parent 17f232ee
......@@ -39,7 +39,16 @@ vtkStandardNewMacro(vtkCachingInterpolatedVelocityField);
const double IVFDataSetInfo::TOLERANCE_SCALE = 1.0E-8;
IVFDataSetInfo::IVFDataSetInfo() {}
this->VelocityFloat = NULL;
this->VelocityDouble = NULL;
this->DataSet = NULL;
this->Cell = NULL;
this->BSPTree = NULL;
this->Tolerance = 0.0;
this->StaticDataSet = false;
void IVFDataSetInfo::SetDataSet(vtkDataSet *data, char *velocity, bool staticdataset, vtkAbstractCellLocator *locator)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment