Skip to content

Commit 469bccf

Browse files
sdamghanvaughnbetz
authored andcommitted
[ODIN]: Neglecting concatenation case for signedness
Signed-off-by: Seyed Alireza Damghani <[email protected]>
1 parent 5c3206f commit 469bccf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ODIN_II/SRC/ast_elaborate.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1813,8 +1813,11 @@ ast_node_t* reduce_expressions(ast_node_t* node, sc_hierarchy* local_ref, long*
18131813

18141814
vtr::free(max_size);
18151815

1816-
/* cast to unsigned if necessary */
1817-
if (node_is_constant(node->children[1])) {
1816+
/*
1817+
* cast to unsigned if necessary
1818+
* Concatenate results are unsigned, regardless of the operands. IEEE.1364-2005 pp.65
1819+
*/
1820+
if (node->children[0]->type != CONCATENATE && node_is_constant(node->children[1])) {
18181821
char* id = NULL;
18191822
if (node->children[0]->type == IDENTIFIERS) {
18201823
id = node->children[0]->types.identifier;

0 commit comments

Comments
 (0)