liberty seg fault when missing template and axis values
Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
parent
9c24e1a757
commit
117e8dcce8
|
|
@ -4658,9 +4658,9 @@ LibertyReader::makeTable(LibertyAttr *attr,
|
|||
float scale)
|
||||
{
|
||||
if (attr->isComplex()) {
|
||||
makeTableAxis(0);
|
||||
makeTableAxis(1);
|
||||
makeTableAxis(2);
|
||||
makeTableAxis(0, attr);
|
||||
makeTableAxis(1, attr);
|
||||
makeTableAxis(2, attr);
|
||||
if (axis_[0] && axis_[1] && axis_[2]) {
|
||||
// 3D table
|
||||
// Column index1*size(index2) + index2
|
||||
|
|
@ -4685,7 +4685,7 @@ LibertyReader::makeTable(LibertyAttr *attr,
|
|||
delete table;
|
||||
table_ = make_shared<Table1>(values, axis_[0]);
|
||||
}
|
||||
else {
|
||||
else if (axis_[0] == nullptr && axis_[1] == nullptr && axis_[2] == nullptr) {
|
||||
// scalar
|
||||
FloatTable *table = makeFloatTable(attr, 1, 1, scale);
|
||||
float value = (*(*table)[0])[0];
|
||||
|
|
@ -4747,7 +4747,8 @@ LibertyReader::makeFloatTable(LibertyAttr *attr,
|
|||
}
|
||||
|
||||
void
|
||||
LibertyReader::makeTableAxis(int index)
|
||||
LibertyReader::makeTableAxis(int index,
|
||||
LibertyAttr *attr)
|
||||
{
|
||||
if (axis_values_[index]) {
|
||||
TableAxisVariable var = axis_[index]->variable();
|
||||
|
|
@ -4757,6 +4758,11 @@ LibertyReader::makeTableAxis(int index)
|
|||
scaleFloats(values, scale);
|
||||
axis_[index] = make_shared<TableAxis>(var, values);
|
||||
}
|
||||
else if (axis_[index] && axis_[index]->values() == nullptr) {
|
||||
libWarn(1344, attr, "Table axis and template missing values.");
|
||||
axis_[index] = nullptr;
|
||||
axis_values_[index] = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -524,7 +524,8 @@ protected:
|
|||
LibraryAttrVisitor visitor);
|
||||
void parseNames(const char *name_str);
|
||||
void clearAxisValues();
|
||||
void makeTableAxis(int index);
|
||||
void makeTableAxis(int index,
|
||||
LibertyAttr *attr);
|
||||
|
||||
StringSeq *parseNameList(const char *name_list);
|
||||
StdStringSeq parseTokenList(const char *token_str,
|
||||
|
|
|
|||
Loading…
Reference in New Issue