From 6574553189fb6ccb5d00a0c043671a625672b3d3 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 17 Jan 2023 12:58:08 +0100 Subject: Fixes for some of clang scan-build detected issues --- frontends/ast/ast.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'frontends/ast/ast.cc') diff --git a/frontends/ast/ast.cc b/frontends/ast/ast.cc index 6097f02f5..982943d1b 100644 --- a/frontends/ast/ast.cc +++ b/frontends/ast/ast.cc @@ -1649,7 +1649,7 @@ RTLIL::IdString AstModule::derive(RTLIL::Design *design, const dicthas(modname)) { + if (!design->has(modname) && new_ast) { new_ast->str = modname; process_module(design, new_ast, false, NULL, quiet); design->module(modname)->check(); @@ -1699,6 +1699,7 @@ std::string AST::derived_module_name(std::string stripped_name, const std::vecto std::string AstModule::derive_common(RTLIL::Design *design, const dict ¶meters, AstNode **new_ast_out, bool quiet) { std::string stripped_name = name.str(); + (*new_ast_out) = nullptr; if (stripped_name.compare(0, 9, "$abstract") == 0) stripped_name = stripped_name.substr(9); -- cgit v1.2.3