[SERVER-33521] Change `Decorable::declareDecorationWithOwner` to allow for finding link-time accidents. Created: 27/Feb/18  Updated: 27/Oct/23  Resolved: 05/Mar/18

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: ADAM Martin (Inactive) Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

Because a pointer to the uninitialized most-derived class is passed to the ctor for whatever decoration is registered with `Decorable::declareDecorationWithOwner`, there is a risk that the ctor can use that pointer in such a way which is illegal but has "expected" behavior some of the time. This can be in a link dependent way.

We'd like to change this such that the ctor for a decoration with owner accepts a "handle" (perhaps a functor) to the actual most derived class to allow for runtime detection of misuse.


Generated at Thu Feb 08 04:33:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.