some more safety tests

This commit is contained in:
Torsten Ruger
2018-04-05 12:22:40 +03:00
parent ee0a1ca823
commit 5bb3ad03cc
5 changed files with 7 additions and 1 deletions

View File

@ -14,6 +14,8 @@ module Risc
raise "unsuported operator :#{operator}:" unless [:+, :-, :>>, :<<, :*, :&, :|, :==].include?(operator)
@left = left
@right = right
raise "Not register #{left}" unless RiscValue.look_like_reg(left)
raise "Not register #{right}" unless RiscValue.look_like_reg(right)
end
attr_reader :operator, :left , :right