diff --git a/infer/tests/codetoanalyze/cpp/errors/generic_models/generic_model_test.cpp b/infer/tests/codetoanalyze/cpp/errors/generic_models/generic_model_test.cpp index 421679463..e7f6bf533 100644 --- a/infer/tests/codetoanalyze/cpp/errors/generic_models/generic_model_test.cpp +++ b/infer/tests/codetoanalyze/cpp/errors/generic_models/generic_model_test.cpp @@ -15,11 +15,17 @@ "generic_model.cpp". If generic model is truly generic, then infer will pick up specs for those and use them */ -int genericModelNPE() { - GenericModelClass x; - auto ptr = x.get(); - return *ptr; -} +/* FIXME(t17253769): flaky because OnDemand doesn't know that + * `genericModelFunction()` and `genericModelFunction()` are + * meant to be the same function. These two procedures have the same specs + * filename, so depending on which gets analyzed first the spec may already be + * there or not, but if it's the latter then OnDemand will not know to schedule + * the analysis of `genericModelFunction()` */ +// int genericModelNPE() { +// GenericModelClass x; +// auto ptr = x.get(); +// return *ptr; +// } int nonGenericModelNoNPE() { NonGenericModelClass x; @@ -27,11 +33,13 @@ int nonGenericModelNoNPE() { return *ptr; } -int genericModelFunctionNPE() { - auto ptr = genericModelFunction(); - return *ptr; -} -int nonGenericModelFunctionNPE() { +/* FIXME(t17253769) commented out for flakiness (see above) */ +// int genericModelFunctionNPE() { +// auto ptr = genericModelFunction(); +// return *ptr; +// } + +int nonGenericModelFunctionNoNPE() { auto ptr = nonGenericModelFunction(); // this will be skip function return *ptr; } diff --git a/infer/tests/codetoanalyze/cpp/errors/issues.exp b/infer/tests/codetoanalyze/cpp/errors/issues.exp index 645f30fe0..8f1d6f958 100644 --- a/infer/tests/codetoanalyze/cpp/errors/issues.exp +++ b/infer/tests/codetoanalyze/cpp/errors/issues.exp @@ -7,8 +7,6 @@ codetoanalyze/cpp/errors/c_tests/c_bugs.cpp, malloc_memory_leak_is_reported, 0, codetoanalyze/cpp/errors/c_tests/c_bugs.cpp, memcpy_spec_is_found, 3, NULL_DEREFERENCE, [start of procedure memcpy_spec_is_found()] codetoanalyze/cpp/errors/c_tests/c_bugs.cpp, resource_leak_is_reported, 0, RESOURCE_LEAK, [start of procedure resource_leak_is_reported()] codetoanalyze/cpp/errors/c_tests/c_bugs.cpp, resource_leak_is_reported, 0, RETURN_VALUE_IGNORED, [start of procedure resource_leak_is_reported()] -codetoanalyze/cpp/errors/generic_models/generic_model_test.cpp, genericModelFunctionNPE, 2, NULL_DEREFERENCE, [start of procedure genericModelFunctionNPE(),start of procedure genericModelFunction(),return from a call to genericModelFunction] -codetoanalyze/cpp/errors/generic_models/generic_model_test.cpp, genericModelNPE, 3, NULL_DEREFERENCE, [start of procedure genericModelNPE(),start of procedure GenericModelClass,return from a call to GenericModelClass_GenericModelClass,start of procedure get,return from a call to GenericModelClass_get] codetoanalyze/cpp/errors/include_header/header.h, header::A_div0, 0, DIVIDE_BY_ZERO, [start of procedure div0] codetoanalyze/cpp/errors/include_header/header.h, header::div0_fun, 0, DIVIDE_BY_ZERO, [start of procedure header::div0_fun()] codetoanalyze/cpp/errors/include_header/header2.h, header2::B_div0, 0, DIVIDE_BY_ZERO, [start of procedure div0]