Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix constexpr issues
Browse files Browse the repository at this point in the history
pauldreik committed Jun 9, 2019
1 parent cc5fc03 commit 5e230d6
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion test/fuzzing/named_arg.cpp
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@

template <typename Item1>
void invoke_fmt(const uint8_t* Data, std::size_t Size, int argsize) {
const auto N1 = sizeof(Item1);
constexpr auto N1 = sizeof(Item1);
if (Size <= N1) {
return;
}
4 changes: 2 additions & 2 deletions test/fuzzing/one_arg.cpp
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@

template <typename Item>
void invoke_fmt(const uint8_t* Data, std::size_t Size) {
const auto N = sizeof(Item);
constexpr auto N = sizeof(Item);
if (Size <= N) {
return;
}
@@ -44,7 +44,7 @@ void invoke_fmt(const uint8_t* Data, std::size_t Size) {

void invoke_fmt_time(const uint8_t* Data, std::size_t Size) {
using Item = std::time_t;
const auto N = sizeof(Item);
constexpr auto N = sizeof(Item);
if (Size <= N) {
return;
}
4 changes: 2 additions & 2 deletions test/fuzzing/sprintf.cpp
Original file line number Diff line number Diff line change
@@ -20,8 +20,8 @@ template <> bool assignFromBuf<bool>(const uint8_t* Data, std::size_t Size) {

template <typename Item1, typename Item2>
void invoke_fmt(const uint8_t* Data, std::size_t Size) {
const auto N1 = sizeof(Item1);
const auto N2 = sizeof(Item2);
constexpr auto N1 = sizeof(Item1);
constexpr auto N2 = sizeof(Item2);
static_assert(N1 <= Nmax, "size1 exceeded");
static_assert(N2 <= Nmax, "size2 exceeded");
if (Size <= Nmax + Nmax) {
4 changes: 2 additions & 2 deletions test/fuzzing/two_args.cpp
Original file line number Diff line number Diff line change
@@ -9,8 +9,8 @@ constexpr auto Nmax = std::max(sizeof(long double), sizeof(std::intmax_t));

template <typename Item1, typename Item2>
void invoke_fmt(const uint8_t* Data, std::size_t Size) {
const auto N1 = sizeof(Item1);
const auto N2 = sizeof(Item2);
constexpr auto N1 = sizeof(Item1);
constexpr auto N2 = sizeof(Item2);
static_assert(N1 <= Nmax, "size1 exceeded");
static_assert(N2 <= Nmax, "size2 exceeded");
if (Size <= Nmax + Nmax) {

0 comments on commit 5e230d6

Please sign in to comment.