aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/ilang
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-12-06 23:22:52 -0800
committerEddie Hung <eddie@fpgeh.com>2019-12-06 23:22:52 -0800
commita46a7e8a678a410292bbab061d1b96254fa7701d (patch)
tree07ed33e9e84c10c415165f05f1d2001fad7ddfc9 /frontends/ilang
parentab667d3d47ceb07a41b571517b4effb0f4a4bf0b (diff)
parentecb0c68f0751b3bd97f8da94e7bd2258987d58e1 (diff)
downloadyosys-a46a7e8a678a410292bbab061d1b96254fa7701d.tar.gz
yosys-a46a7e8a678a410292bbab061d1b96254fa7701d.tar.bz2
yosys-a46a7e8a678a410292bbab061d1b96254fa7701d.zip
Merge remote-tracking branch 'origin/master' into xaig_dff
Diffstat (limited to 'frontends/ilang')
-rw-r--r--frontends/ilang/ilang_parser.y4
1 files changed, 4 insertions, 0 deletions
diff --git a/frontends/ilang/ilang_parser.y b/frontends/ilang/ilang_parser.y
index b4b9693da..4e0b62edd 100644
--- a/frontends/ilang/ilang_parser.y
+++ b/frontends/ilang/ilang_parser.y
@@ -430,10 +430,14 @@ sigspec:
free($1);
} |
sigspec '[' TOK_INT ']' {
+ if ($3 >= $1->size() || $3 < 0)
+ rtlil_frontend_ilang_yyerror("bit index out of range");
$$ = new RTLIL::SigSpec($1->extract($3));
delete $1;
} |
sigspec '[' TOK_INT ':' TOK_INT ']' {
+ if ($3 >= $1->size() || $3 < 0 || $3 < $5)
+ rtlil_frontend_ilang_yyerror("invalid slice");
$$ = new RTLIL::SigSpec($1->extract($5, $3 - $5 + 1));
delete $1;
} |