Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions include/clstepcore/STEPaggregate.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ class SC_CORE_EXPORT STEPnode : public SingleLinkNode {
protected:
int _null;

/// nodes must start out null; several StrToVal/STEPread paths leave
/// _null untouched on failure and would otherwise read uninitialised.
STEPnode() : _null( 1 ) {
}

public:
int is_null() {
return _null;
Expand Down
6 changes: 6 additions & 0 deletions src/clstepcore/STEPaggrEntity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,17 @@ Severity EntityNode::StrToVal( const char * s, ErrorDescriptor * err,
ErrorDescriptor error;
if( EntityValidLevel( se, elem_type, &error ) == SEVERITY_NULL ) {
node = se;
_null = 0;
} else {
node = S_ENTITY_NULL;
err->AppendToDetailMsg( error.DetailMsg() );
err->AppendToUserMsg( error.UserMsg() );
err->GreaterSeverity( error.severity() );
_null = 1;
}
} else {
node = S_ENTITY_NULL;
_null = 1;
}
return err->severity();
}
Expand All @@ -203,14 +206,17 @@ Severity EntityNode::STEPread( istream & in, ErrorDescriptor * err,
ErrorDescriptor error;
if( EntityValidLevel( se, elem_type, &error ) == SEVERITY_NULL ) {
node = se;
_null = 0;
} else {
node = S_ENTITY_NULL;
err->AppendToDetailMsg( error.DetailMsg() );
err->AppendToUserMsg( error.UserMsg() );
err->GreaterSeverity( error.severity() );
_null = 1;
}
} else {
node = S_ENTITY_NULL;
_null = 1;
}
return err->severity();
}
Expand Down
2 changes: 2 additions & 0 deletions src/clstepcore/typeDescriptor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
TypeDescriptor::TypeDescriptor( )
: _name( 0 ), altNames( 0 ), _fundamentalType( UNKNOWN_TYPE ),
_originatingSchema( 0 ), _referentType( 0 ), _description( 0 ), _where_rules( 0 ) {
_altname[0] = '\0';
}

TypeDescriptor::TypeDescriptor
Expand All @@ -11,6 +12,7 @@ TypeDescriptor::TypeDescriptor
: _name( nm ), altNames( 0 ), _fundamentalType( ft ),
_originatingSchema( origSchema ), _referentType( 0 ), _description( d ),
_where_rules( 0 ) {
_altname[0] = '\0';
}

TypeDescriptor::~TypeDescriptor() {
Expand Down
Loading