diff options
| author | Veronica Radu <veronicaradu@google.com> | 2019-09-11 18:20:17 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2019-09-23 15:33:19 +0200 |
| commit | bf7e28925b8894ca13f803f66d16cf2b0ae12430 (patch) | |
| tree | 5e25e384f1b97ff2f3fda580dd2ac2fe6fb43d91 /prog/size.go | |
| parent | d96e88f3207d7ac7ad65e13b896f702ad04c46f7 (diff) | |
prog: use type size when generating/mutating ints
Update #1381
Diffstat (limited to 'prog/size.go')
| -rw-r--r-- | prog/size.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/prog/size.go b/prog/size.go index a134f0d10..c465a9171 100644 --- a/prog/size.go +++ b/prog/size.go @@ -181,9 +181,9 @@ func (r *randGen) mutateSize(arg *ConstArg, parent []Arg) bool { if r.bin() { // Small adjustment to trigger missed size checks. if arg.Val != 0 && r.bin() { - arg.Val = r.randRangeInt(0, arg.Val-1) + arg.Val = r.randRangeInt(0, arg.Val-1, arg.Type().TypeBitSize()) } else { - arg.Val = r.randRangeInt(arg.Val+1, arg.Val+1000) + arg.Val = r.randRangeInt(arg.Val+1, arg.Val+1000, arg.Type().TypeBitSize()) } return true } |
