diff --git a/src/mzscheme/sgc/collect.inc b/src/mzscheme/sgc/collect.inc index 81acafdf25..e4ee61f0c6 100644 --- a/src/mzscheme/sgc/collect.inc +++ b/src/mzscheme/sgc/collect.inc @@ -164,7 +164,7 @@ static void COLLECT(OFFSET_ARG) if ((p >= bstart) && (p < block->top)) { int size = block->size; int pos = block->positions[(p - bstart) >> LOG_PTR_SIZE]; - int start = bstart + pos * size; + unsigned long start = bstart + pos * size; MARK_STATISTIC(num_blockallocs_stat++); diff --git a/src/mzscheme/sgc/sgc.c b/src/mzscheme/sgc/sgc.c index 426fe87842..f4566a9298 100644 --- a/src/mzscheme/sgc/sgc.c +++ b/src/mzscheme/sgc/sgc.c @@ -822,7 +822,7 @@ static void *malloc_plain_sector(int count); inline static SectorPage **create_sector_pagetables(unsigned long p) { unsigned long pos; SectorPage ***sector_pagetabless, **sector_pagetables; - pos = (unsigned long)p >> 48; + pos = ((unsigned long)p >> 48) & ((1 << 16) - 1); sector_pagetabless = sector_pagetablesss[pos]; if (!sector_pagetabless) { int c = (sizeof(SectorPage **) << 16) >> LOG_SECTOR_SEGMENT_SIZE; @@ -848,7 +848,7 @@ inline static SectorPage **create_sector_pagetables(unsigned long p) { inline static SectorPage **get_sector_pagetables(unsigned long p) { unsigned long pos; SectorPage ***sector_pagetabless; - pos = (unsigned long)p >> 48; + pos = ((unsigned long)p >> 48) & ((1 << 16) - 1); sector_pagetabless = sector_pagetablesss[pos]; if (!sector_pagetabless) return NULL;