Fix allocation/initialization bug in messages with varsize arrays
authorPhil Miller <mille121@illinois.edu>
Fri, 7 Jan 2011 20:43:36 +0000 (14:43 -0600)
committerPhil Miller <mille121@illinois.edu>
Fri, 28 Jan 2011 23:19:30 +0000 (17:19 -0600)
commit5d1a75ed740aaefe35d2902c7b70276e7abcd5ef
tree034cef66a8610ce1b4f9a0d7b0ce112a9ea02e5c
parent8188a784ccea6c06affe55bc31807f5cad36cb3b
Fix allocation/initialization bug in messages with varsize arrays

Store the offsets computed during message allocation and assign the
pointers to later in the buffer during the constructor of the
message's generated base class. This saves us from cases where the
compiler overwrites the buffer's contents between allocation and
construction.

This patch does not address the cases in which
 - The compiler generates code in the user's constructor that
   overwrites these pointers
 - Alignment is screwed up by the compiler padding the allocation at
   the beginning rather than the end.
We don't currently know of instances in which either of these errors
occurs.
src/ck-core/charm++.h
src/ck-core/init.C
src/ck-core/msgalloc.C
src/xlat-i/xi-symbol.C
tests/charm++/megatest/Make.depends
tests/charm++/megatest/Makefile
tests/charm++/megatest/varsizetest2.C [new file with mode: 0644]
tests/charm++/megatest/varsizetest2.ci [new file with mode: 0644]
tests/charm++/megatest/varsizetest2.h [new file with mode: 0644]