aboutsummaryrefslogtreecommitdiffstats
path: root/dictionary.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dictionary.cpp')
-rw-r--r--dictionary.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/dictionary.cpp b/dictionary.cpp
index 2ba6f88..de10303 100644
--- a/dictionary.cpp
+++ b/dictionary.cpp
@@ -34,8 +34,9 @@ void Dictionary::add(Cell value)
Addr Dictionary::aligned(Addr addr) const noexcept
{
- if (addr & (sizeof(Cell) - sizeof(uint8_t)))
- addr = (addr + sizeof(Cell)) & ~(sizeof(Cell) - sizeof(uint8_t));
+ auto unaligned = addr & (sizeof(Cell) - sizeof(uint8_t));
+ if (unaligned)
+ addr += sizeof(Cell) - unaligned;
return addr;
}