diff options
| author | Ehud Katz <ehudkatz@gmail.com> | 2019-12-04 11:57:38 +0200 |
|---|---|---|
| committer | Ehud Katz <ehudkatz@gmail.com> | 2019-12-04 12:02:04 +0200 |
| commit | 2b6b8cb10c870d64f7cc29d21fc27cef3c7e0056 (patch) | |
| tree | 1b70dcf6b8d367eb44137170e94107a0b6d9f910 /lldb/source/Utility/Stream.cpp | |
| parent | 1351672eedbf9716def4fc789d9046c481c7cd25 (diff) | |
| download | bcm5719-llvm-2b6b8cb10c870d64f7cc29d21fc27cef3c7e0056.tar.gz bcm5719-llvm-2b6b8cb10c870d64f7cc29d21fc27cef3c7e0056.zip | |
[APFloat] Prevent construction of APFloat with Semantics and FP value
Constructor invocations such as `APFloat(APFloat::IEEEdouble(), 0.0)`
may seem like they accept a FP (floating point) value, but the overload
they reach is actually the `integerPart` one, not a `float` or `double`
overload (which only exists when `fltSemantics` isn't passed).
This may lead to possible loss of data, by the conversion from `float`
or `double` to `integerPart`.
To prevent future mistakes, a new constructor overload, which accepts
any FP value and marked with `delete`, to prevent its usage.
Fixes PR34095.
Differential Revision: https://reviews.llvm.org/D70425
Diffstat (limited to 'lldb/source/Utility/Stream.cpp')
0 files changed, 0 insertions, 0 deletions

