Ticket #821 (new planned)
placement-New: verify sane buffer size
| Reported by: | ichthyo | Owned by: | |
|---|---|---|---|
| Priority: | grave | Milestone: | 1alpha |
| Component: | lumiera | Keywords: | QA sanity |
| Cc: | Blocked By: | ||
| Blocking: |
Description (last modified by ichthyo) (diff)
Check that buffers used to place objects inline are of sufficient size. Preferably use STATIC_ASSERT
Explanation: we use the technique of storing an object into a local buffer quite frequently. Usually the rationale is to avoid heap storage, or to combine value semantics with polymorphism or type erasure. Since placing an object this way means to circumvent the sanity checks of the compiler, we might end up placing an object too large to fit into the buffer, overwriting memory locations behind.
So the TODO is: visit for all usages of this placement-New technique and ensure that a suitable ASSERTION is in place. Preferably use a static assertion, which kind of reinstates the compiler sanity checks.

might be a concern for all usages of the PolymorphicValue template, the Singleton factory and the various Opaque holders. I've just now added two or three STATIC_ASSERTS and this already caught an error. Cough.