Commit 35a59f5c authored by Keith Randall's avatar Keith Randall

runtime: fix build, divide by constant 0 is a compile-time error

Change-Id: Iee319c9f5375c172fb599da77234c10ccb0fd314
Reviewed-on: https://go-review.googlesource.com/6020Reviewed-by: 's avatarKeith Randall <khr@golang.org>
parent 972f3645
...@@ -67,7 +67,8 @@ func sysAlloc(n uintptr, stat *uint64) unsafe.Pointer { ...@@ -67,7 +67,8 @@ func sysAlloc(n uintptr, stat *uint64) unsafe.Pointer {
} }
func sysUnused(v unsafe.Pointer, n uintptr) { func sysUnused(v unsafe.Pointer, n uintptr) {
if hugePageSize != 0 && (uintptr(v)%hugePageSize != 0 || n%hugePageSize != 0) { var s uintptr = hugePageSize // division by constant 0 is a compile-time error :(
if s != 0 && (uintptr(v)%s != 0 || n%s != 0) {
// See issue 8832 // See issue 8832
// Linux kernel bug: https://bugzilla.kernel.org/show_bug.cgi?id=93111 // Linux kernel bug: https://bugzilla.kernel.org/show_bug.cgi?id=93111
// Mark the region as NOHUGEPAGE so the kernel's khugepaged // Mark the region as NOHUGEPAGE so the kernel's khugepaged
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment