diff --git a/net_func_eval.cc b/net_func_eval.cc index bc8ebb5ee..8c0a751be 100644 --- a/net_func_eval.cc +++ b/net_func_eval.cc @@ -372,7 +372,7 @@ bool NetAssign::eval_func_lval_(const LineInfo&loc, if (op_) { for (unsigned idx = 0 ; idx < lpart.len() ; idx += 1) { long ldx = base + idx; - if (ldx >= 0 && ldx < lval_v.len()) + if (ldx >= 0 && (unsigned long)ldx < lval_v.len()) lpart.set(idx, lval_v[ldx]); } eval_func_lval_op_(loc, lpart, rval_v); @@ -381,7 +381,7 @@ bool NetAssign::eval_func_lval_(const LineInfo&loc, } for (unsigned idx = 0 ; idx < lpart.len() ; idx += 1) { long ldx = base + idx; - if (ldx >= 0 && ldx < lval_v.len()) + if (ldx >= 0 && (unsigned long)ldx < lval_v.len()) lval_v.set(idx+base, lpart[idx]); } @@ -1071,7 +1071,7 @@ NetExpr* NetESelect::evaluate_function(const LineInfo&loc, verinum res (verinum::Vx, expr_width()); for (unsigned idx = 0 ; idx < res.len() ; idx += 1) { long sdx = base + idx; - if (sdx >= 0 && sdx < sub.len()) + if (sdx >= 0 && (unsigned long)sdx < sub.len()) res.set(idx, sub[sdx]); } diff --git a/netenum.cc b/netenum.cc index b7ceff55b..be25c2c5c 100644 --- a/netenum.cc +++ b/netenum.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 2010-2024 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -65,7 +65,8 @@ bool netenum_t::insert_name(size_t name_idx, perm_string name, const verinum&val { std::pair::iterator, bool> res; - assert(val.has_len() && val.len() == packed_width()); + assert(val.has_len() && packed_width() >= 0 && + val.len() == (unsigned long)packed_width()); // Insert a map of the name to the value. This also gets a // flag that returns true if the name is unique, or false diff --git a/netlist.cc b/netlist.cc index 80a2fd096..6a1a7b417 100644 --- a/netlist.cc +++ b/netlist.cc @@ -2318,7 +2318,8 @@ NetEConst::NetEConst(ivl_type_t type, const verinum&val) : NetExpr(type), value_(val) { ivl_assert(*this, type->packed()); - ivl_assert(*this, type->packed_width() == val.len()); + ivl_assert(*this, type->packed_width() >= 0 && + (unsigned long)type->packed_width() == val.len()); ivl_assert(*this, type->get_signed() == val.has_sign()); } diff --git a/vpi_modules.cc b/vpi_modules.cc index 26ccd395f..fad45600d 100644 --- a/vpi_modules.cc +++ b/vpi_modules.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021 Martin Whitaker (icarus@martin-whitaker.me.uk) + * Copyright (c) 2019-2024 Martin Whitaker (icarus@martin-whitaker.me.uk) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -220,6 +220,7 @@ vpip_routines_s vpi_routines = { .chk_error = vpi_chk_error, .compare_objects = vpi_compare_objects, .free_object = vpi_free_object, + .release_handle = vpi_release_handle, .get_vlog_info = vpi_get_vlog_info, .vcontrol = vpi_vcontrol, .fopen = vpi_fopen,