src: fix pointer alignment · nodejs/node@4f832b1 · GitHub
Skip to content

Commit 4f832b1

Browse files
jhofsteeaduh95
authored andcommitted
src: fix pointer alignment
The NgLibMemoryManager::ReallocImpl method prefixes the allocated memory with its size, and returns a pointer to the region after it. This pointer can however no longer be suitably aligned. On Arm 32bits this resulted in unaligned accesses, since the NEON vst1.64 instruction was used with a not properly aligned addresses. A reproducer is available at [1]. Correct this by allocating the maximum of the the size of the size_t and the max alignment. [1] victronenergy/venus#1559. PR-URL: #61336 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
1 parent 42110af commit 4f832b1

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

src/node_mem-inl.h

Lines changed: 9 additions & 8 deletions

0 commit comments

Comments
 (0)