diff options
| author | thenewone <[email protected]> | 2025-11-05 19:47:10 +0300 |
|---|---|---|
| committer | thenewone <[email protected]> | 2025-11-05 20:12:59 +0300 |
| commit | ac47e675dbca5166949aa4f8e9a5d4fd5a1d2e93 (patch) | |
| tree | 975170a3b3248495ff66fabdf69d18b92c576d69 /contrib/libs/python/Include/pythonrun.h | |
| parent | 306a88f22d643438a20fb6426de2d4187c059833 (diff) | |
Preserve meta of an yson struct during assignment
When lite yson struct is assigned to another, we shoud not change
its meta. More generally, we should not change its type, which
is described by its vptr (preserved by compiler) and ysong struct
meta pointer (must be carefully implemented in assignment operator).
In terms of example:
// TDerived inherited from TBase which inherited from TYsonStructLite.
TDerived derived;
TBase base;
TBase& ref = derived;
ref = base; // derived should remain of type TDerived.
This patch fixes such an asignment, but still it remains dangerous
as it would be dangerous in case of simple structs. Since yson
struct has additional hidden members, like LocalUnrecognized\_, they
are still simply assigned, which could lead to inconsistent state,
just like any other partial assignment.
This patch does not fix copy/move constructors which are still
broken. Perhaps they should be prohibited, but it's used now and
at least some code must be rewritten.
commit_hash:8767e0d9e87277ebf9951733c108a49d8d4e4f4f
Diffstat (limited to 'contrib/libs/python/Include/pythonrun.h')
0 files changed, 0 insertions, 0 deletions
