Keep gcc from complaining about uninitialized variables
authorLarry Doolittle <ldoolitt@recycle.lbl.gov>
Fri, 14 Aug 2015 20:22:17 +0000 (13:22 -0700)
committerClifford Wolf <clifford@clifford.at>
Fri, 14 Aug 2015 21:26:49 +0000 (23:26 +0200)
frontends/ast/simplify.cc
passes/memory/memory_unpack.cc

index cc9bbd237d825c4accf2c76689d7763a330acc61..5eb173c9a190f5e421b3d02183e1df4b8ff56c17 100644 (file)
@@ -2102,9 +2102,9 @@ AstNode *AstNode::readmem(bool is_readmemh, std::string mem_filename, AstNode *m
        AstNode *block = new AstNode(AST_BLOCK);
 
        AstNode *meminit = nullptr;
-       int next_meminit_cursor;
+       int next_meminit_cursor=0;
        vector<State> meminit_bits;
-       int meminit_size;
+       int meminit_size=0;
 
        std::ifstream f;
        f.open(mem_filename.c_str());
index 07ec4564c590ee18d44d28517a224f496aa2ddb8..a497362bf8e9246a839cb5dbb790c23cac5c619e 100644 (file)
@@ -79,7 +79,7 @@ void handle_memory(RTLIL::Module *module, RTLIL::Cell *memory)
        Const initval = memory->parameters.at("\\INIT");
        RTLIL::Cell *last_init_cell = nullptr;
        SigSpec last_init_data;
-       int last_init_addr;
+       int last_init_addr=0;
 
        for (int i = 0; i < GetSize(initval) && i/mem->width < (1 << abits); i += mem->width) {
                Const val = initval.extract(i, mem->width, State::Sx);