aboutsummaryrefslogtreecommitdiffstats
path: root/sys/syz-sysgen
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-08-19 09:46:43 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-08-19 10:16:23 +0200
commit838e336594e410898667fa06b15f1116a3b586fd (patch)
tree1520155493fabef45ab3b5d59f396c42f7968713 /sys/syz-sysgen
parent33b9e777cbaf25d5ac727783aedddb382c97338f (diff)
sys, prog: switch values to to uint64
We currently use uintptr for all values. This won't work for 32-bit archs. Moreover in some cases we use uintptr but assume that it is always 64-bits (e.g. in encodingexec). Switch everything to uint64. Update #324
Diffstat (limited to 'sys/syz-sysgen')
-rw-r--r--sys/syz-sysgen/sysgen.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/syz-sysgen/sysgen.go b/sys/syz-sysgen/sysgen.go
index a778e4819..59ca684b8 100644
--- a/sys/syz-sysgen/sysgen.go
+++ b/sys/syz-sysgen/sysgen.go
@@ -463,7 +463,7 @@ func generateResources(desc *Description, consts map[string]uint64, out io.Write
}
fmt.Fprintf(out, "\"%v\"", k)
}
- fmt.Fprintf(out, "}, Values: []uintptr{")
+ fmt.Fprintf(out, "}, Values: []uint64{")
if len(values) == 0 {
values = append(values, "0")
}
@@ -779,7 +779,7 @@ func generateArg(
if len(vals) == 0 {
fmt.Fprintf(out, "&IntType{%v}", intCommon(size, bigEndian, bitfieldLen))
} else {
- fmt.Fprintf(out, "&FlagsType{%v, Vals: []uintptr{%v}}", intCommon(size, bigEndian, bitfieldLen), strings.Join(vals, ","))
+ fmt.Fprintf(out, "&FlagsType{%v, Vals: []uint64{%v}}", intCommon(size, bigEndian, bitfieldLen), strings.Join(vals, ","))
}
case "const":
canBeArg = true
@@ -805,7 +805,7 @@ func generateArg(
val = "0"
skipSyscall(fmt.Sprintf("missing const %v", a[0]))
}
- fmt.Fprintf(out, "&ConstType{%v, Val: uintptr(%v)}", intCommon(size, bigEndian, bitfieldLen), val)
+ fmt.Fprintf(out, "&ConstType{%v, Val: uint64(%v)}", intCommon(size, bigEndian, bitfieldLen), val)
case "proc":
canBeArg = true
size := uint64(ptrSize)