From b4c30cfc8d49c9028b67f7ba5710ed959f6f8f57 Mon Sep 17 00:00:00 2001 From: Rodrigo Alejandro Melo Date: Sat, 1 Feb 2020 17:03:56 -0300 Subject: Fixed a bug in the new feature of $readmem[hb] when an empty string is provided Signed-off-by: Rodrigo Alejandro Melo --- frontends/ast/simplify.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'frontends') 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); -- cgit v1.2.3