[Lldb-commits] [PATCH] D80150: [lldb/DataFormatter] Check for overflow when finding NSDate epoch
Vedant Kumar via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue May 19 16:34:47 PDT 2020
vsk marked 3 inline comments as done.
vsk added a comment.
@labath Agreed on all points, I've addressed the feedback in 82dbf4aca84 <https://reviews.llvm.org/rG82dbf4aca84ec889d0dc390674ff44e30441bcfd> by moving "DataFormatters/Mock.h" to "Plugins/Language/ObjC/Utilities.h", and adding a separate LanguageObjCTests unit test.
================
Comment at: lldb/unittests/DataFormatter/MockTests.cpp:30
+ // Can't convert the date_value to a time_t.
+ EXPECT_EQ(formatDateValue(std::numeric_limits<time_t>::max() + 1),
+ llvm::None);
----------------
labath wrote:
> Isn't this actually `std::numeric_limits<time_t>::min()` (and UB due to singed wraparound) ? Did you want to convert to double before doing the `+1` ?
Yes, thank you! It looks like Eric caught this before I did.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80150/new/
https://reviews.llvm.org/D80150
More information about the lldb-commits
mailing list