diff options
author | Clifford Wolf <clifford@clifford.at> | 2019-05-06 15:34:19 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2019-05-06 15:34:19 +0200 |
commit | b37c31e2cb82343e363d39e4b35ebdb82f4f69a3 (patch) | |
tree | fc52c0bd809a61c0a71252b2be038fb3cc7e8003 /passes/pmgen | |
parent | 3333e002b1c6a05e73bdc94844cbe74288771dd0 (diff) | |
download | yosys-b37c31e2cb82343e363d39e4b35ebdb82f4f69a3.tar.gz yosys-b37c31e2cb82343e363d39e4b35ebdb82f4f69a3.tar.bz2 yosys-b37c31e2cb82343e363d39e4b35ebdb82f4f69a3.zip |
Bugfix in peepopt_shiftmul.pmg
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'passes/pmgen')
-rw-r--r-- | passes/pmgen/peepopt_shiftmul.pmg | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/passes/pmgen/peepopt_shiftmul.pmg b/passes/pmgen/peepopt_shiftmul.pmg index 1f9b3c2b9..fe861b728 100644 --- a/passes/pmgen/peepopt_shiftmul.pmg +++ b/passes/pmgen/peepopt_shiftmul.pmg @@ -8,9 +8,13 @@ endmatch code shamt shamt = port(shift, \B); + if (shamt.empty()) + reject; if (shamt[GetSize(shamt)-1] == State::S0) { do { shamt.remove(GetSize(shamt)-1); + if (shamt.empty()) + reject; } while (shamt[GetSize(shamt)-1] == State::S0); } else if (shift->type.in($shift, $shiftx) && param(shift, \B_SIGNED).as_bool()) { |