From 9ffaae91ffd4c0c062ec794899c05be5f64768de Mon Sep 17 00:00:00 2001 From: Aki Van Ness Date: Wed, 24 Aug 2022 11:28:51 -0400 Subject: [PATCH] frontend: rtlil: imposed a hard limit for wire width of 2^24 (closes #1206) --- frontends/rtlil/rtlil_parser.y | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontends/rtlil/rtlil_parser.y b/frontends/rtlil/rtlil_parser.y index 7d99b2c42..98f18db91 100644 --- a/frontends/rtlil/rtlil_parser.y +++ b/frontends/rtlil/rtlil_parser.y @@ -187,7 +187,11 @@ wire_stmt: wire_options: wire_options TOK_WIDTH TOK_INT { - current_wire->width = $3; + if ($3 > 0x1000000) { + rtlil_frontend_yyerror("RTLIL error: invalid wire width, must be less than 2^24"); + } else { + current_wire->width = $3; + } } | wire_options TOK_WIDTH TOK_INVALID { rtlil_frontend_yyerror("RTLIL error: invalid wire width");