projects
/
openpower-isa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d0acac4
)
power_insn: forbid zero for non-zero operands
author
Dmitry Selyutin
<ghostmansd@gmail.com>
Sun, 30 Apr 2023 18:50:19 +0000
(21:50 +0300)
committer
Dmitry Selyutin
<ghostmansd@gmail.com>
Sun, 30 Apr 2023 18:50:19 +0000
(21:50 +0300)
src/openpower/decoder/power_insn.py
patch
|
blob
|
history
diff --git
a/src/openpower/decoder/power_insn.py
b/src/openpower/decoder/power_insn.py
index 486d1d655198d44eba8cc4e01df7a2fb1a441934..b9d92508a7654fd563e42c5b0392986b89002902 100644
(file)
--- a/
src/openpower/decoder/power_insn.py
+++ b/
src/openpower/decoder/power_insn.py
@@
-1148,6
+1148,8
@@
class NonZeroOperand(DynamicOperand):
value = int(value, 0)
if not isinstance(value, int):
raise ValueError("non-integer operand")
+ if value == 0:
+ raise ValueError("non-zero operand")
value -= 1
return super().assemble(value=value, insn=insn)