Handle signedness of struct members

struct members are currently always treated as unsigned. This leads to
incorrect behavior in contexts where the sign makes a difference. E.g.

```
struct packed {
  int x;
} s;

s.x = -1;
if (s.x > 0) $display("FAILED");
```

Query the signedness of the struct member form the type of the member.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
Lars-Peter Clausen 2022-01-01 09:36:52 +01:00
parent 2477f79f52
commit 662e82c013
1 changed files with 2 additions and 2 deletions

View File

@ -34,8 +34,8 @@ class netstruct_t : public LineInfo, public ivl_type_s {
ivl_type_t net_type;
inline ivl_variable_type_t data_type() const
{ return net_type->base_type(); };
// We need to keep the individual element sign information.
bool get_signed() const { return false; };
bool get_signed() const
{ return net_type->get_signed(); }
};
public: