From: Rodrigo Alejandro Melo Date: Sat, 1 Feb 2020 20:03:56 +0000 (-0300) Subject: Fixed a bug in the new feature of $readmem[hb] when an empty string is provided X-Git-Tag: working-ls180~803^2~10 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b4c30cfc8d49c9028b67f7ba5710ed959f6f8f57;p=yosys.git Fixed a bug in the new feature of $readmem[hb] when an empty string is provided Signed-off-by: Rodrigo Alejandro Melo --- diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index 4f105eed6..310f6fc32 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -2894,7 +2894,7 @@ AstNode *AstNode::readmem(bool is_readmemh, std::string mem_filename, AstNode *m } else { yosys_input_files.insert(mem_filename); } - if (f.fail()) + if (f.fail() || strlen(mem_filename.c_str()) == 0) log_file_error(filename, linenum, "Can not open file `%s` for %s.\n", mem_filename.c_str(), str.c_str()); log_assert(GetSize(memory->children) == 2 && memory->children[1]->type == AST_RANGE && memory->children[1]->range_valid);