Merge pull request #435 from antmicro/signed-wire

systemverilog: Fix signed wire handling
diff --git a/systemverilog-plugin/UhdmAst.cc b/systemverilog-plugin/UhdmAst.cc
index 0a1b626..ee19809 100644
--- a/systemverilog-plugin/UhdmAst.cc
+++ b/systemverilog-plugin/UhdmAst.cc
@@ -1409,7 +1409,7 @@
                 if (child->type == AST::AST_MEMORY)
                     child->type = AST::AST_WIRE;
             }
-            child->is_signed = (*it)->is_signed;
+            child->is_signed = child->is_signed || (*it)->is_signed;
             if (!(*it)->children.empty() && child->children.empty()) {
                 // This is a bit ugly, but if the child we're replacing has children and
                 // our node doesn't, we copy its children to not lose any information
@@ -3993,7 +3993,7 @@
                     current_node->children = std::move(node->children);
                 }
             }
-            current_node->is_signed = node->is_signed;
+            current_node->is_signed = current_node->is_signed || node->is_signed;
             delete node;
         }
     });