Skip to content

Commit

Permalink
Internals: Fix uninitialized m_alhs
Browse files Browse the repository at this point in the history
  • Loading branch information
wsnyder committed May 9, 2012
1 parent ac61548 commit b31a7cd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/V3AstNodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ void AstVar::combineType(AstVarType type) {
// These flags get combined with the existing settings of the flags.
if (type==AstVarType::INPUT || type==AstVarType::INOUT)
m_input = true;
if (type==AstVarType::OUTPUT || type==AstVarType::INOUT)
if (type==AstVarType::OUTPUT || type==AstVarType::INOUT) {
m_output = true;
m_declOutput = true;
}
if (type==AstVarType::INOUT || type==AstVarType::TRIWIRE
|| type==AstVarType::TRI0 || type==AstVarType::TRI1)
m_tristate = true;
Expand Down
4 changes: 3 additions & 1 deletion src/V3AstNodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,7 @@ struct AstVar : public AstNode {
bool m_input:1; // Input or inout
bool m_output:1; // Output or inout
bool m_tristate:1; // Inout or triwire or trireg
bool m_declOutput:1; // Inout or output before tristate resolution
bool m_primaryIO:1; // In/out to top level (or directly assigned from same)
bool m_sc:1; // SystemC variable
bool m_scClocked:1; // SystemC sc_clk<> needed
Expand All @@ -734,7 +735,7 @@ struct AstVar : public AstNode {
bool m_trace:1; // Trace this variable

void init() {
m_input=false; m_output=false; m_tristate=false;
m_input=false; m_output=false; m_tristate=false; m_declOutput=false;
m_primaryIO=false;
m_sc=false; m_scClocked=false; m_scSensitive=false;
m_usedClock=false; m_usedParam=false; m_usedLoopIdx=false;
Expand Down Expand Up @@ -840,6 +841,7 @@ struct AstVar : public AstNode {
bool isOutOnly() const { return m_output && !m_input; }
bool isInout() const { return m_input && m_output; }
bool isTristate() const { return m_tristate; }
bool isDeclOutput() const { return m_declOutput; }
bool isPrimaryIO() const { return m_primaryIO; }
bool isPrimaryIn() const { return isPrimaryIO() && isInput(); }
bool isIO() const { return (m_input||m_output); }
Expand Down
5 changes: 3 additions & 2 deletions src/V3Tristate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -858,9 +858,10 @@ class TristateVisitor : public TristateBaseVisitor {
public:
// CONSTUCTORS
TristateVisitor(AstNode* nodep) {
m_unique = 0;
m_cellp = NULL;
m_modp = NULL;
m_cellp = NULL;
m_unique = 0;
m_alhs = false;
nodep->accept(*this);
}
virtual ~TristateVisitor() {
Expand Down

0 comments on commit b31a7cd

Please sign in to comment.