[SERVER-33437] Decorable::declareDecorationWithOwner passes wrong owner pointer to its decorations Created: 22/Feb/18 Updated: 29/Oct/23 Resolved: 02/Mar/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | 3.7.2 |
| Fix Version/s: | 3.6.4 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kaloian Manassiev | Assignee: | ADAM Martin (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Sprint: | Platforms 2018-02-26, Platforms 2018-03-12 | ||||||||
| Participants: | |||||||||
| Description |
|
The Decorable::declareDecorationWithOwner call instantiates a constructor function, which passes the owner pointer given to the decorations container here. However, since Decorable is a super class of the class it is enhancing, the this pointer points to where the super class starts, not where the actual decorated class is. Because of this, decorations with owner receive the wrong owner pointer here. |
| Comments |
| Comment by Githook User [ 02/Mar/18 ] |
|
Author: {'email': 'adam.martin@10gen.com', 'name': 'ADAM David Alan Martin', 'username': 'adamlsd'}Message: The current Decorable system type-erases the most derived (Decorated) This also removes the "with-owner" forms of declaring a decoration, |
| Comment by Githook User [ 02/Mar/18 ] |
|
Author: {'email': 'adam.martin@10gen.com', 'name': 'ADAM David Alan Martin', 'username': 'adamlsd'}Message: This is necessitated by the changes made to `Decorable<T>` which |