Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac2fb3de authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

Specify type when calling ConsumeIntegralInRange

This fixes the following build error on git_master-without-vendor:

LatencyTrackerFuzzer.cpp:43:27: error: no matching member function for call to 'ConsumeIntegralInRange'
        return tokens[fdp.ConsumeIntegralInRange(0ul, tokens.size() - 1)];
                      ~~~~^~~~~~~~~~~~~~~~~~~~~~
prebuilts/clang/host/linux-x86/clang-r416183b1/lib64/clang/12.0.7/include/fuzzer/FuzzedDataProvider.h:203:23: note: candidate template ignored: deduced conflicting types for paramete
r 'T' ('unsigned long' vs. 'unsigned int')
T FuzzedDataProvider::ConsumeIntegralInRange(T min, T max) {
                      ^
1 error generated.

The issue can be reproduced on git_master by lunching to aosp_x86-eng
build target.

Test: lunch aosp_x86-eng && m inputflinger_latencytracker_fuzzer
Bug: none
Bug: 205715187
Change-Id: I185438c8440b6d547222a3c9872d33a71c9ac2c7
Merged-In: I185438c8440b6d547222a3c9872d33a71c9ac2c7
parent 4c6ec526
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -40,7 +40,7 @@ static sp<IBinder> getConnectionToken(FuzzedDataProvider& fdp,
                                      std::array<sp<IBinder>, 10>& tokens) {
                                      std::array<sp<IBinder>, 10>& tokens) {
    const bool useExistingToken = fdp.ConsumeBool();
    const bool useExistingToken = fdp.ConsumeBool();
    if (useExistingToken) {
    if (useExistingToken) {
        return tokens[fdp.ConsumeIntegralInRange(0ul, tokens.size() - 1)];
        return tokens[fdp.ConsumeIntegralInRange<size_t>(0ul, tokens.size() - 1)];
    }
    }
    return new BBinder();
    return new BBinder();
}
}