klayout
klayout copied to clipboard
undefined behavior when `fast_copy` does misaligned reads and writes
In tlStream.cc fast_copy does
while (n >= sizeof (unsigned long)) {
*tl++ = *sl++;
and there's no guarantee that tl and sl are correctly aligned. This is undefined behavior in C and C++.
Why didn't you just use memcpy here?