I am porting the packer to JS for #9. While doing so I noticed that it does an unaligned write to a double. The issue is that AstMemory simply returns a pointer and bumps the current position in the arena. Many of the sizes it allocates are not multiples of 8, so DoubleNode, which stores a double, can get misaligned.
Am I missing something here?
I'll make it just allocate a number of bytes that is a multiple of 8 for now. A better option might be separate arenas, etc.
I am porting the packer to JS for #9. While doing so I noticed that it does an unaligned write to a double. The issue is that
AstMemory
simply returns a pointer and bumps the current position in the arena. Many of the sizes it allocates are not multiples of 8, soDoubleNode
, which stores a double, can get misaligned.Am I missing something here?
I'll make it just allocate a number of bytes that is a multiple of 8 for now. A better option might be separate arenas, etc.