Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid accessing uninitialized settings in own init (#11117)
The default value for the setting was evaluated by calling a method on the object _being currently constructed_, so we were using it before all fields were initialized. This has been fixed by making the called method static, and not using the previously used fields at all. But functionality hasn't changed! The fields were usually always zero (by chance?) anyway, meaning the conditional path was always taken. Thus the current logic has been kept, the code simplified, and UB removed. This was found with the helper of UBSan.
- Loading branch information