Reject -R value that is not a power of 2, or less than 4K.
Fixes #62660.
Change-Id: I3fa33c23c25311a93c0accc9acbd1e465789b8c9
Reviewed-on: https://go-review.googlesource.com/c/go/+/528715
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Exitf("dynamic linking required on %s; -d flag cannot be used", buildcfg.GOOS)
}
+ isPowerOfTwo := func(n int64) bool {
+ return n > 0 && n&(n-1) == 0
+ }
+ if *FlagRound != -1 && (*FlagRound < 4096 || !isPowerOfTwo(*FlagRound)) {
+ Exitf("invalid -R value 0x%x", *FlagRound)
+ }
+
checkStrictDups = *FlagStrictDups
switch flagW {