updated afterProgramPage computation

This commit is contained in:
Peli de Halleux 2017-04-19 22:53:05 -07:00
parent 1169547999
commit 17bab9f64f

View File

@ -224,7 +224,8 @@ namespace pxt {
uint32_t afterProgramPage() { uint32_t afterProgramPage() {
uint32_t ptr = (uint32_t)&bytecode[0]; uint32_t ptr = (uint32_t)&bytecode[0];
ptr += programSize(); ptr += programSize();
ptr = (ptr + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1); if (ptr % PAGE_SIZE != 0)
ptr = (ptr & ~(PAGE_SIZE-1)) + PAGE_SIZE;
return ptr; return ptr;
} }
} }