From 796786cd0cc1ed71da65fe9f1760b390b189c5cd Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Tue, 12 May 2020 16:08:50 +0000 Subject: runtime: make maxOffAddr reflect the actual address space upper bound Currently maxOffAddr is defined in terms of the whole 64-bit address space, assuming that it's all supported, by using ^uintptr(0) as the maximal address in the offset space. In reality, the maximal address in the offset space is (1< Reviewed-by: Austin Clements Reviewed-by: Michael Pratt --- src/runtime/export_test.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/runtime/export_test.go') diff --git a/src/runtime/export_test.go b/src/runtime/export_test.go index 37271e473a..5ab03f3f99 100644 --- a/src/runtime/export_test.go +++ b/src/runtime/export_test.go @@ -876,13 +876,9 @@ func FreePageAlloc(pp *PageAlloc) { // 64 bit and 32 bit platforms, allowing the tests to share code // between the two. // -// On AIX, the arenaBaseOffset is 0x0a00000000000000. However, this -// constant can't be used here because it is negative and will cause -// a constant overflow. -// // This should not be higher than 0x100*pallocChunkBytes to support // mips and mipsle, which only have 31-bit address spaces. -var BaseChunkIdx = ChunkIdx(chunkIndex(((0xc000*pageAlloc64Bit + 0x100*pageAlloc32Bit) * pallocChunkBytes) + 0x0a00000000000000*sys.GoosAix)) +var BaseChunkIdx = ChunkIdx(chunkIndex(((0xc000*pageAlloc64Bit + 0x100*pageAlloc32Bit) * pallocChunkBytes) + arenaBaseOffset*sys.GoosAix)) // PageBase returns an address given a chunk index and a page index // relative to that chunk. -- cgit v1.3-5-g45d5