Skip to content

Commit 335b9be

Browse files
committed
MPTTester::operator() parameter should be std::int64_t
- Originally defined as uint64_t, but the testIssuerLoan() test called it with a negative number, causing an overflow to a very large number that in some circumstances could be silently cast back to an int64_t, but might not be. I believe this is UB, and we don't want to rely on that.
1 parent 8e4be94 commit 335b9be

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/test/jtx/impl/mpt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ MPTTester::operator[](std::string const& name) const
644644
}
645645

646646
PrettyAmount
647-
MPTTester::operator()(std::uint64_t amount) const
647+
MPTTester::operator()(std::int64_t amount) const
648648
{
649649
return MPT("", issuanceID())(amount);
650650
}

src/test/jtx/mpt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ class MPTTester
272272
operator[](std::string const& name) const;
273273

274274
PrettyAmount
275-
operator()(std::uint64_t amount) const;
275+
operator()(std::int64_t amount) const;
276276

277277
operator Asset() const;
278278

0 commit comments

Comments
 (0)