In Scalar::operator=(long long) the size of the result was calculated using sizeof(long) instead of sizeof(long long). On Windows sizeof(long)==4 but sizeof(long long)==8.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Unit Tests
Event Timeline
Comment Actions
The fix looks obviously correct, but could you please also add a unit test for this. I guess this would manifest itself as the inability to roundtrip e.g. std::numeric_limits<long long>::max() to a Scalar and back.
It's not required, but if you're interested, it would be nice to change all of these assignment operators to do return *this = Scalar(v);. That would remove this class of bugs (constructor/operator= inconsistencies) completely.
Comment Actions
Could you add a unit test for this? See the`ScalarTest.cpp` for the other Scalar tests.
Beside that this LGTM.
clang-format not found in user's PATH; not linting file.