aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-11-20 19:35:24 +0100
committerDmitry Vyukov <dvyukov@google.com>2020-11-21 08:46:20 +0100
commit6c1496ae75762575108ba042f555f009d3777046 (patch)
tree1e37dd00a7d127badd592eebad175efdabfdbfef /pkg
parent418476ecb925e5d58ba9c22928a4e37dc30909df (diff)
pkg/ifuzz/iset: make Mode and Type unsigned
Presumably with older Go versions we are getting: pkg/ifuzz/x86/decode.go:100:19: invalid operation: 1 << mode (shift count type int, must be unsigned integer) Fix that and maybe some future similar errors by making these types unsigned.
Diffstat (limited to 'pkg')
-rw-r--r--pkg/ifuzz/iset/iset.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/ifuzz/iset/iset.go b/pkg/ifuzz/iset/iset.go
index 46c42537d..d6c3518dc 100644
--- a/pkg/ifuzz/iset/iset.go
+++ b/pkg/ifuzz/iset/iset.go
@@ -16,8 +16,8 @@ const (
var Arches = make(map[string]InsnSet)
type (
- Mode int
- Type int
+ Mode uint
+ Type uint
)
type Insn interface {
@@ -86,7 +86,7 @@ func (modeInsns *ModeInsns) Add(insn Insn) {
func (cfg *Config) IsCompatible(insn Insn) bool {
_, mode, pseudo, priv := insn.Info()
- if cfg.Mode < 0 || cfg.Mode >= ModeLast {
+ if cfg.Mode >= ModeLast {
panic("bad mode")
}
if priv && !cfg.Priv {