From 17bab9f64f3bda409bae97780a57928237731d79 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Wed, 19 Apr 2017 22:53:05 -0700 Subject: [PATCH] updated afterProgramPage computation --- libs/core/core.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/core/core.cpp b/libs/core/core.cpp index 1dabda5f..a4d083da 100644 --- a/libs/core/core.cpp +++ b/libs/core/core.cpp @@ -224,7 +224,8 @@ namespace pxt { uint32_t afterProgramPage() { uint32_t ptr = (uint32_t)&bytecode[0]; ptr += programSize(); - ptr = (ptr + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1); + if (ptr % PAGE_SIZE != 0) + ptr = (ptr & ~(PAGE_SIZE-1)) + PAGE_SIZE; return ptr; } }