From 72de3f8d20fe8c140f56f3f459f5989e6c4fb444 Mon Sep 17 00:00:00 2001 From: Sungkeun Cho Date: Mon, 30 Oct 2023 03:39:20 -0700 Subject: [PATCH] [clang] Upgrade to clang-17.0.1 Summary: This diff upgrades clang to 17.0.1. To make the builds successful, this diff did: * Updated the line numbers of the patches, * Revised the cmake options for clang to align with the latest documentation, * Updated test results, esp. about coroutine. Reviewed By: martintrojer Differential Revision: D50736398 fbshipit-source-id: 20d8258910183b0ab1c308a01c0d62083d486be6 --- facebook-clang-plugins/clang/setup.sh | 4 +- .../clang/src/err_ret_local_block.patch | 2 +- .../clang/src/mangle_suppress_errors.patch | 16 +++---- .../clang/src/prepare_clang_src.sh | 4 +- .../libtooling/ASTExporter.h | 15 +++++-- .../available_expression.m.exp | 10 ++--- .../tests/BiniouASTExporter/lambda.cpp.exp | 6 +-- .../tests/JsonASTExporter/lambda.cpp.exp | 42 +++++++++---------- .../available_expression.m.exp | 10 ++--- .../tests/YojsonASTExporter/lambda.cpp.exp | 42 +++++++++---------- infer/src/clang/ClangCommand.ml | 2 +- infer/src/clang/cTrans.ml | 1 + .../clang_translation/src/main.cpp.dot | 2 +- .../src/main_default_root.cpp.dot | 2 +- .../src/main_default_symlink.cpp.dot | 2 +- .../src/main_symlink.cpp.dot | 2 +- .../codetoanalyze/cpp/liveness-20/coro.cpp | 10 ++--- .../cpp/performance-11/cost-issues.exp | 28 ++++++------- .../cpp/performance/cost-issues.exp | 28 ++++++------- .../tests/codetoanalyze/cpp/pulse-20/coro.cpp | 14 +++---- .../codetoanalyze/cpp/pulse/call_lambdas.cpp | 1 + .../tests/codetoanalyze/cpp/pulse/issues.exp | 26 ++++++------ .../codetoanalyze/cpp/pulse/issues.exp-11 | 34 +++++++-------- .../cpp/shared/methods/byvals.cpp.dot | 28 ++++++------- 24 files changed, 171 insertions(+), 160 deletions(-) diff --git a/facebook-clang-plugins/clang/setup.sh b/facebook-clang-plugins/clang/setup.sh index f952bed6e09..765fb4078c4 100755 --- a/facebook-clang-plugins/clang/setup.sh +++ b/facebook-clang-plugins/clang/setup.sh @@ -204,8 +204,8 @@ if [[ "$PLATFORM" = "Linux" ]] && [[ -n "${PLATFORM_ENV}" ]] ; then ) else CMAKE_ARGS+=( - -DLLVM_ENABLE_PROJECTS="clang" - -DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;openmp" + -DLLVM_ENABLE_PROJECTS="clang;openmp" + -DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi" ) fi diff --git a/facebook-clang-plugins/clang/src/err_ret_local_block.patch b/facebook-clang-plugins/clang/src/err_ret_local_block.patch index d929758968e..ace64e8c4e9 100644 --- a/facebook-clang-plugins/clang/src/err_ret_local_block.patch +++ b/facebook-clang-plugins/clang/src/err_ret_local_block.patch @@ -1,6 +1,6 @@ --- a/llvm-project/clang/lib/Sema/SemaInit.cpp +++ b/llvm-project/clang/lib/Sema/SemaInit.cpp -@@ -7147,7 +7147,9 @@ void Sema::checkInitializerLifetime(const InitializedEntity &Entity, +@@ -8258,7 +8258,9 @@ void Sema::checkInitializerLifetime(cons << Entity.getType()->isReferenceType() << DRE->getDecl() << isa(DRE->getDecl()) << DiagRange; } else if (isa(L)) { diff --git a/facebook-clang-plugins/clang/src/mangle_suppress_errors.patch b/facebook-clang-plugins/clang/src/mangle_suppress_errors.patch index 1e751fc49e8..251cc16a822 100644 --- a/facebook-clang-plugins/clang/src/mangle_suppress_errors.patch +++ b/facebook-clang-plugins/clang/src/mangle_suppress_errors.patch @@ -1,6 +1,6 @@ --- a/llvm-project/clang/lib/AST/ItaniumMangle.cpp +++ b/llvm-project/clang/lib/AST/ItaniumMangle.cpp -@@ -1064,10 +1064,7 @@ void CXXNameMangler::mangleFloatLiteral(QualType T, const llvm::APFloat &V) { +@@ -1192,10 +1192,7 @@ void CXXNameMangler::mangleFloatLiteral( } void CXXNameMangler::mangleFixedPointLiteral() { @@ -12,7 +12,7 @@ } void CXXNameMangler::mangleNullPointer(QualType T) { -@@ -3270,11 +3267,7 @@ void CXXNameMangler::mangleNeonVectorType(const VectorType *T) { +@@ -3635,11 +3632,7 @@ void CXXNameMangler::mangleNeonVectorTyp } void CXXNameMangler::mangleNeonVectorType(const DependentVectorType *T) { @@ -25,7 +25,7 @@ } static StringRef mangleAArch64VectorBase(const BuiltinType *EltType) { -@@ -3347,11 +3340,7 @@ void CXXNameMangler::mangleAArch64NeonVectorType(const VectorType *T) { +@@ -3712,11 +3705,7 @@ void CXXNameMangler::mangleAArch64NeonVe Out << TypeName.length() << TypeName; } void CXXNameMangler::mangleAArch64NeonVectorType(const DependentVectorType *T) { @@ -38,7 +38,7 @@ } // The AArch64 ACLE specifies that fixed-length SVE vector and predicate types -@@ -3444,11 +3433,7 @@ void CXXNameMangler::mangleAArch64FixedSveVectorType(const VectorType *T) { +@@ -3809,11 +3798,7 @@ void CXXNameMangler::mangleAArch64FixedS void CXXNameMangler::mangleAArch64FixedSveVectorType( const DependentVectorType *T) { @@ -50,8 +50,8 @@ + Out << "__unhandled_AArch64FixedSveVectorType"; } - // GNU extension: vector types -@@ -4040,12 +4025,7 @@ recurse: + void CXXNameMangler::mangleRISCVFixedRVVVectorType(const VectorType *T) { +@@ -4487,12 +4472,7 @@ recurse: { NotPrimaryExpr(); if (!NullOut) { @@ -65,7 +65,7 @@ return; } break; -@@ -4081,12 +4061,7 @@ recurse: +@@ -4528,12 +4508,7 @@ recurse: // Even gcc-4.5 doesn't mangle this. case Expr::BinaryConditionalOperatorClass: { NotPrimaryExpr(); @@ -79,7 +79,7 @@ return; } -@@ -4425,18 +4400,11 @@ recurse: +@@ -4872,18 +4847,11 @@ recurse: MangleAlignofSizeofArg(); break; case UETT_VecStep: { diff --git a/facebook-clang-plugins/clang/src/prepare_clang_src.sh b/facebook-clang-plugins/clang/src/prepare_clang_src.sh index bb73d94ce8c..12b1ccc0bed 100755 --- a/facebook-clang-plugins/clang/src/prepare_clang_src.sh +++ b/facebook-clang-plugins/clang/src/prepare_clang_src.sh @@ -13,9 +13,9 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" SHASUM=${SHASUM:-shasum -a 256} PATCH=${PATCH:-patch} -LLVM_VER="16.0.0" +LLVM_VER="17.0.1" LLVM_URL="https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VER}/llvm-project-${LLVM_VER}.src.tar.xz" -LLVM_SHA="9a56d906a2c81f16f06efc493a646d497c53c2f4f28f0cb1f3c8da7f74350254" +LLVM_SHA="b0e42aafc01ece2ca2b42e3526f54bebc4b1f1dc8de6e34f46a0446a13e882b9" LLVM_FILE="llvm-project.src.tar.xz" CLANG_PREBUILD_PATCHES=( "$SCRIPT_DIR/err_ret_local_block.patch" diff --git a/facebook-clang-plugins/libtooling/ASTExporter.h b/facebook-clang-plugins/libtooling/ASTExporter.h index a9f9e9703c9..bc74b6fca4c 100644 --- a/facebook-clang-plugins/libtooling/ASTExporter.h +++ b/facebook-clang-plugins/libtooling/ASTExporter.h @@ -4980,6 +4980,7 @@ int ASTExporter::BuiltinTypeTupleSize() { IsSigned, \ IsFP, \ IsBF) //@atd | Id +#define SVE_OPAQUE_TYPE(Name, MangledName, Id, SingletonId) //@atd | Id #include //@atd ] template @@ -5004,6 +5005,11 @@ void ASTExporter::VisitBuiltinType(const BuiltinType *T) { type_name = #Id; \ break; \ } +#define SVE_OPAQUE_TYPE(Name, MangledName, Id, SingletonId) \ + case BuiltinType::Id: { \ + type_name = #Id; \ + break; \ + } #include #define IMAGE_TYPE(ImgType, ID, SingletonId, Access, Suffix) \ case BuiltinType::ID: @@ -5014,6 +5020,9 @@ void ASTExporter::VisitBuiltinType(const BuiltinType *T) { #include #define RVV_TYPE(Name, Id, SingletonId) case BuiltinType::Id: #include +#define WASM_REF_TYPE(Name, MangledNameBase, Id, SingletonId, AS) \ + case BuiltinType::Id: +#include llvm_unreachable("Unsupported types"); break; } @@ -5267,9 +5276,9 @@ void ASTExporter::VisitAttr(const Attr *A) { //@atd } template void ASTExporter::dumpVersionTuple(const VersionTuple &VT) { - Optional minor = VT.getMinor(); - Optional subminor = VT.getSubminor(); - Optional build = VT.getBuild(); + std::optional minor = VT.getMinor(); + std::optional subminor = VT.getSubminor(); + std::optional build = VT.getBuild(); ObjectScope Scope( OF, 1 + minor.has_value() + subminor.has_value() + build.has_value()); OF.emitTag("major"); diff --git a/facebook-clang-plugins/libtooling/tests/BiniouASTExporter/available_expression.m.exp b/facebook-clang-plugins/libtooling/tests/BiniouASTExporter/available_expression.m.exp index e98b734cf22..dd308dddc0e 100644 --- a/facebook-clang-plugins/libtooling/tests/BiniouASTExporter/available_expression.m.exp +++ b/facebook-clang-plugins/libtooling/tests/BiniouASTExporter/available_expression.m.exp @@ -1,10 +1,10 @@ tests/available_expression.m:8:12: warning: class 'NSObject' defined without specifying a base class [-Wobjc-root-class] -@interface NSObject - ^ + 8 | @interface NSObject + | ^ tests/available_expression.m:8:20: note: add a super class to fix this problem -@interface NSObject - ^ - : NSObject + 8 | @interface NSObject + | ^ + | : NSObject 1 warning generated. <#032016ff: ({ #d121c0bd: 1, #21793419: ({ }, { }) }, diff --git a/facebook-clang-plugins/libtooling/tests/BiniouASTExporter/lambda.cpp.exp b/facebook-clang-plugins/libtooling/tests/BiniouASTExporter/lambda.cpp.exp index 47f96e2f12a..07f9ee07b7d 100644 --- a/facebook-clang-plugins/libtooling/tests/BiniouASTExporter/lambda.cpp.exp +++ b/facebook-clang-plugins/libtooling/tests/BiniouASTExporter/lambda.cpp.exp @@ -5664,9 +5664,9 @@ { #f9c96be9: { #c1127ea9: 12, #298a4a8d: true } }, { })>, <#d3d219f7: ({ #d121c0bd: 191 }, { #c1127ea9: 187, #298a4a8d: true })>, + <#d80cb60b: ({ #d121c0bd: 22 }, 23)>, <#26796f6a: ({ #d121c0bd: 192 }, { #f9c96be9: { #c1127ea9: 193 } }, { })>, - <#d80cb60b: ({ #d121c0bd: 22 }, 23)>, <#f3f3711a: ({ #d121c0bd: 194 })>, <#f3f3711a: ({ #d121c0bd: 195 })>, <#09e09de9: ({ #d121c0bd: 196, #26f32be5: 195 })>, @@ -5733,12 +5733,12 @@ ({ #d121c0bd: 37 }, { #f9c96be9: { #c1127ea9: 121 } }, { #08ec7593: [ { #c1127ea9: 39 } ] })>, + <#d80cb60b: ({ #d121c0bd: 55 }, 56)>, + <#0b08cd60: ({ #d121c0bd: 61 }, { #c1127ea9: 12, #298a4a8d: true })>, <#26796f6a: ({ #d121c0bd: 213 }, { #f9c96be9: { #c1127ea9: 193 } }, { #08ec7593: [ { #c1127ea9: 12, #298a4a8d: true } ] })>, - <#d80cb60b: ({ #d121c0bd: 55 }, 56)>, - <#0b08cd60: ({ #d121c0bd: 61 }, { #c1127ea9: 12, #298a4a8d: true })>, <#f3f3711a: ({ #d121c0bd: 214 })>, <#09e09de9: ({ #d121c0bd: 215, #26f32be5: 214 })>, <#26796f6a: diff --git a/facebook-clang-plugins/libtooling/tests/JsonASTExporter/lambda.cpp.exp b/facebook-clang-plugins/libtooling/tests/JsonASTExporter/lambda.cpp.exp index 34dcca1ca27..295f566b45d 100644 --- a/facebook-clang-plugins/libtooling/tests/JsonASTExporter/lambda.cpp.exp +++ b/facebook-clang-plugins/libtooling/tests/JsonASTExporter/lambda.cpp.exp @@ -5898,6 +5898,12 @@ "is_trivially_copyable" : true } ]], + ["RecordType" , [ + { + "pointer" : 22 + }, + 23 + ]], ["FunctionProtoType" , [ { "pointer" : 192 @@ -5910,12 +5916,6 @@ { } ]], - ["RecordType" , [ - { - "pointer" : 22 - }, - 23 - ]], ["TemplateTypeParmType" , [ { "pointer" : 194 @@ -6219,6 +6219,21 @@ ] } ]], + ["RecordType" , [ + { + "pointer" : 55 + }, + 56 + ]], + ["LValueReferenceType" , [ + { + "pointer" : 61 + }, + { + "type_ptr" : 12, + "is_trivially_copyable" : true + } + ]], ["FunctionProtoType" , [ { "pointer" : 213 @@ -6237,21 +6252,6 @@ ] } ]], - ["RecordType" , [ - { - "pointer" : 55 - }, - 56 - ]], - ["LValueReferenceType" , [ - { - "pointer" : 61 - }, - { - "type_ptr" : 12, - "is_trivially_copyable" : true - } - ]], ["TemplateTypeParmType" , [ { "pointer" : 214 diff --git a/facebook-clang-plugins/libtooling/tests/YojsonASTExporter/available_expression.m.exp b/facebook-clang-plugins/libtooling/tests/YojsonASTExporter/available_expression.m.exp index fa467739e7a..da769350c19 100644 --- a/facebook-clang-plugins/libtooling/tests/YojsonASTExporter/available_expression.m.exp +++ b/facebook-clang-plugins/libtooling/tests/YojsonASTExporter/available_expression.m.exp @@ -1,10 +1,10 @@ tests/available_expression.m:8:12: warning: class 'NSObject' defined without specifying a base class [-Wobjc-root-class] -@interface NSObject - ^ + 8 | @interface NSObject + | ^ tests/available_expression.m:8:20: note: add a super class to fix this problem -@interface NSObject - ^ - : NSObject + 8 | @interface NSObject + | ^ + | : NSObject <"TranslationUnitDecl" : ( { "pointer" : 1, diff --git a/facebook-clang-plugins/libtooling/tests/YojsonASTExporter/lambda.cpp.exp b/facebook-clang-plugins/libtooling/tests/YojsonASTExporter/lambda.cpp.exp index 7cffcf21d33..a9f6e64ddb5 100644 --- a/facebook-clang-plugins/libtooling/tests/YojsonASTExporter/lambda.cpp.exp +++ b/facebook-clang-plugins/libtooling/tests/YojsonASTExporter/lambda.cpp.exp @@ -5898,6 +5898,12 @@ "is_trivially_copyable" : true } )>, + <"RecordType" : ( + { + "pointer" : 22 + }, + 23 + )>, <"FunctionProtoType" : ( { "pointer" : 192 @@ -5910,12 +5916,6 @@ { } )>, - <"RecordType" : ( - { - "pointer" : 22 - }, - 23 - )>, <"TemplateTypeParmType" : ( { "pointer" : 194 @@ -6219,6 +6219,21 @@ ] } )>, + <"RecordType" : ( + { + "pointer" : 55 + }, + 56 + )>, + <"LValueReferenceType" : ( + { + "pointer" : 61 + }, + { + "type_ptr" : 12, + "is_trivially_copyable" : true + } + )>, <"FunctionProtoType" : ( { "pointer" : 213 @@ -6237,21 +6252,6 @@ ] } )>, - <"RecordType" : ( - { - "pointer" : 55 - }, - 56 - )>, - <"LValueReferenceType" : ( - { - "pointer" : 61 - }, - { - "type_ptr" : 12, - "is_trivially_copyable" : true - } - )>, <"TemplateTypeParmType" : ( { "pointer" : 214 diff --git a/infer/src/clang/ClangCommand.ml b/infer/src/clang/ClangCommand.ml index d8bf459873b..980a23fb4c2 100644 --- a/infer/src/clang/ClangCommand.ml +++ b/infer/src/clang/ClangCommand.ml @@ -141,7 +141,7 @@ let filter_and_replace_unsupported_args ?(replace_options_arg = fun _ s -> s) ?( let clang_cc1_cmd_sanitizer cmd = let replace_args arg = function | Some override_regex when Str.string_match override_regex arg 0 -> - Config.fcp_dir ^/ "clang" ^/ "install" ^/ "lib" ^/ "clang" ^/ "16.0.0" ^/ "include" + Config.fcp_dir ^/ "clang" ^/ "install" ^/ "lib" ^/ "clang" ^/ "17" ^/ "include" | _ -> arg in diff --git a/infer/src/clang/cTrans.ml b/infer/src/clang/cTrans.ml index bef334b50c1..3ce1d72bfea 100644 --- a/infer/src/clang/cTrans.ml +++ b/infer/src/clang/cTrans.ml @@ -1175,6 +1175,7 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s | `AO__hip_atomic_compare_exchange_weak | `AO__hip_atomic_exchange | `AO__hip_atomic_fetch_add + | `AO__hip_atomic_fetch_sub | `AO__hip_atomic_fetch_and | `AO__hip_atomic_fetch_max | `AO__hip_atomic_fetch_min diff --git a/infer/tests/build_systems/codetoanalyze/clang_translation/src/main.cpp.dot b/infer/tests/build_systems/codetoanalyze/clang_translation/src/main.cpp.dot index 9db991235ed..74a536c8ee4 100644 --- a/infer/tests/build_systems/codetoanalyze/clang_translation/src/main.cpp.dot +++ b/infer/tests/build_systems/codetoanalyze/clang_translation/src/main.cpp.dot @@ -26,7 +26,7 @@ digraph cfg { "main.fad58de7366495db_3" -> "main.fad58de7366495db_2" ; -"main.fad58de7366495db_4" [label="4: DeclStmt \n VARIABLE_DECLARED(s:std::basic_string,std::allocator>); [line 18, column 3]\n n$3=_fun_std::basic_string,std::allocator>::basic_string(&s:std::basic_string,std::allocator>*,\"1234\":char const *) [line 18, column 15]\n " shape="box"] +"main.fad58de7366495db_4" [label="4: DeclStmt \n VARIABLE_DECLARED(s:std::basic_string,std::allocator>); [line 18, column 3]\n n$3=_fun_std::basic_string,std::allocator>::basic_string<0>(&s:std::basic_string,std::allocator>*,\"1234\":char const *) [line 18, column 15]\n " shape="box"] "main.fad58de7366495db_4" -> "main.fad58de7366495db_3" ; diff --git a/infer/tests/build_systems/codetoanalyze/clang_translation/src/main_default_root.cpp.dot b/infer/tests/build_systems/codetoanalyze/clang_translation/src/main_default_root.cpp.dot index 9db991235ed..74a536c8ee4 100644 --- a/infer/tests/build_systems/codetoanalyze/clang_translation/src/main_default_root.cpp.dot +++ b/infer/tests/build_systems/codetoanalyze/clang_translation/src/main_default_root.cpp.dot @@ -26,7 +26,7 @@ digraph cfg { "main.fad58de7366495db_3" -> "main.fad58de7366495db_2" ; -"main.fad58de7366495db_4" [label="4: DeclStmt \n VARIABLE_DECLARED(s:std::basic_string,std::allocator>); [line 18, column 3]\n n$3=_fun_std::basic_string,std::allocator>::basic_string(&s:std::basic_string,std::allocator>*,\"1234\":char const *) [line 18, column 15]\n " shape="box"] +"main.fad58de7366495db_4" [label="4: DeclStmt \n VARIABLE_DECLARED(s:std::basic_string,std::allocator>); [line 18, column 3]\n n$3=_fun_std::basic_string,std::allocator>::basic_string<0>(&s:std::basic_string,std::allocator>*,\"1234\":char const *) [line 18, column 15]\n " shape="box"] "main.fad58de7366495db_4" -> "main.fad58de7366495db_3" ; diff --git a/infer/tests/build_systems/codetoanalyze/clang_translation/src/main_default_symlink.cpp.dot b/infer/tests/build_systems/codetoanalyze/clang_translation/src/main_default_symlink.cpp.dot index 9db991235ed..74a536c8ee4 100644 --- a/infer/tests/build_systems/codetoanalyze/clang_translation/src/main_default_symlink.cpp.dot +++ b/infer/tests/build_systems/codetoanalyze/clang_translation/src/main_default_symlink.cpp.dot @@ -26,7 +26,7 @@ digraph cfg { "main.fad58de7366495db_3" -> "main.fad58de7366495db_2" ; -"main.fad58de7366495db_4" [label="4: DeclStmt \n VARIABLE_DECLARED(s:std::basic_string,std::allocator>); [line 18, column 3]\n n$3=_fun_std::basic_string,std::allocator>::basic_string(&s:std::basic_string,std::allocator>*,\"1234\":char const *) [line 18, column 15]\n " shape="box"] +"main.fad58de7366495db_4" [label="4: DeclStmt \n VARIABLE_DECLARED(s:std::basic_string,std::allocator>); [line 18, column 3]\n n$3=_fun_std::basic_string,std::allocator>::basic_string<0>(&s:std::basic_string,std::allocator>*,\"1234\":char const *) [line 18, column 15]\n " shape="box"] "main.fad58de7366495db_4" -> "main.fad58de7366495db_3" ; diff --git a/infer/tests/build_systems/codetoanalyze/clang_translation/src/main_symlink.cpp.dot b/infer/tests/build_systems/codetoanalyze/clang_translation/src/main_symlink.cpp.dot index 9db991235ed..74a536c8ee4 100644 --- a/infer/tests/build_systems/codetoanalyze/clang_translation/src/main_symlink.cpp.dot +++ b/infer/tests/build_systems/codetoanalyze/clang_translation/src/main_symlink.cpp.dot @@ -26,7 +26,7 @@ digraph cfg { "main.fad58de7366495db_3" -> "main.fad58de7366495db_2" ; -"main.fad58de7366495db_4" [label="4: DeclStmt \n VARIABLE_DECLARED(s:std::basic_string,std::allocator>); [line 18, column 3]\n n$3=_fun_std::basic_string,std::allocator>::basic_string(&s:std::basic_string,std::allocator>*,\"1234\":char const *) [line 18, column 15]\n " shape="box"] +"main.fad58de7366495db_4" [label="4: DeclStmt \n VARIABLE_DECLARED(s:std::basic_string,std::allocator>); [line 18, column 3]\n n$3=_fun_std::basic_string,std::allocator>::basic_string<0>(&s:std::basic_string,std::allocator>*,\"1234\":char const *) [line 18, column 15]\n " shape="box"] "main.fad58de7366495db_4" -> "main.fad58de7366495db_3" ; diff --git a/infer/tests/codetoanalyze/cpp/liveness-20/coro.cpp b/infer/tests/codetoanalyze/cpp/liveness-20/coro.cpp index 673ea4b045b..6afbf835922 100644 --- a/infer/tests/codetoanalyze/cpp/liveness-20/coro.cpp +++ b/infer/tests/codetoanalyze/cpp/liveness-20/coro.cpp @@ -6,7 +6,7 @@ */ // make tests compatible with clang-12 for the moment -#include +#include namespace coro { @@ -15,12 +15,12 @@ struct Task { using promise_type = Task; bool await_ready() noexcept; - std::experimental::coroutine_handle<> await_suspend( - std::experimental::coroutine_handle> coro) noexcept; + std::coroutine_handle<> await_suspend( + std::coroutine_handle> coro) noexcept; T await_resume() noexcept; Task get_return_object(); - std::experimental::suspend_always initial_suspend() noexcept { return {}; } - std::experimental::suspend_always final_suspend() noexcept { return {}; } + std::suspend_always initial_suspend() noexcept { return {}; } + std::suspend_always final_suspend() noexcept { return {}; } void return_void(); void unhandled_exception() {} }; diff --git a/infer/tests/codetoanalyze/cpp/performance-11/cost-issues.exp b/infer/tests/codetoanalyze/cpp/performance-11/cost-issues.exp index ac4ced7fb5d..a990cea705c 100644 --- a/infer/tests/codetoanalyze/cpp/performance-11/cost-issues.exp +++ b/infer/tests/codetoanalyze/cpp/performance-11/cost-issues.exp @@ -29,10 +29,10 @@ codetoanalyze/cpp/performance/foreachtest.cpp, lambda_foreachtest.cpp:40_5e38852 codetoanalyze/cpp/performance/foreachtest.cpp, lambda_foreachtest.cpp:46_fdb9ecb7::__infer_inner_destructor_lambda_foreachtest.cpp:46_9b6f4c68, 2, OnUIThread:false, [] codetoanalyze/cpp/performance/foreachtest.cpp, lambda_foreachtest.cpp:46_fdb9ecb7::lambda_foreachtest.cpp:46_9b6f4c68, 3, OnUIThread:false, [] codetoanalyze/cpp/performance/foreachtest.cpp, lambda_foreachtest.cpp:46_fdb9ecb7::lambda_foreachtest.cpp:46_c1439a26, 3, OnUIThread:false, [] -codetoanalyze/cpp/performance/foreachtest.cpp, lambda_foreachtest.cpp:46_fdb9ecb7::operator(), 20 + 16 ⋅ vec->cpp.vector_elem.length.ub + 18 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Call to loop_linear_vec,Loop,{vec->cpp.vector_elem.length.ub},Call to loop_linear_vec,Loop] +codetoanalyze/cpp/performance/foreachtest.cpp, lambda_foreachtest.cpp:46_fdb9ecb7::operator(), 20 + 14 ⋅ vec->cpp.vector_elem.length.ub + 18 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Call to loop_linear_vec,Loop,{vec->cpp.vector_elem.length.ub},Call to loop_linear_vec,Loop] codetoanalyze/cpp/performance/foreachtest.cpp, list_quadratic_FN, 21, OnUIThread:false, [] codetoanalyze/cpp/performance/foreachtest.cpp, loop_linear_list, 12 + 8 ⋅ list->elements.length.ub + 14 ⋅ (list->elements.length.ub + 1), OnUIThread:false, [{list->elements.length.ub + 1},Loop,{list->elements.length.ub},Loop] -codetoanalyze/cpp/performance/foreachtest.cpp, loop_linear_vec, 18 + 16 ⋅ vec->cpp.vector_elem.length.ub + 18 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] +codetoanalyze/cpp/performance/foreachtest.cpp, loop_linear_vec, 18 + 14 ⋅ vec->cpp.vector_elem.length.ub + 18 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] codetoanalyze/cpp/performance/foreachtest.cpp, map_linear_FN, 9, OnUIThread:false, [] codetoanalyze/cpp/performance/foreachtest.cpp, vector_quadratic_FN, 27, OnUIThread:false, [] codetoanalyze/cpp/performance/integral_constant.cpp, iterate_integral_constant, 35, OnUIThread:false, [] @@ -103,7 +103,7 @@ codetoanalyze/cpp/performance/std_array.cpp, loop_over_arr_max_size_constant, 60 codetoanalyze/cpp/performance/std_array.cpp, loop_over_arr_size_constant, 35, OnUIThread:false, [] codetoanalyze/cpp/performance/string_test.cpp, call_google_strlen_linear, 2 + str->strlen.ub, OnUIThread:false, [{str->strlen.ub},Modeled call to google::StrLen] codetoanalyze/cpp/performance/string_test.cpp, call_google_strlen_with_loop_linear, 4 + 3 ⋅ str->strlen.ub + str->strlen.ub + 2 ⋅ (str->strlen.ub + 1), OnUIThread:false, [{str->strlen.ub + 1},Loop,{str->strlen.ub},Modeled call to google::StrLen,{str->strlen.ub},Loop] -codetoanalyze/cpp/performance/string_test.cpp, iterate_over_string, 15 + 12 ⋅ str->elements.length.ub + 18 ⋅ (str->elements.length.ub + 1), OnUIThread:false, [{str->elements.length.ub + 1},Loop,{str->elements.length.ub},Loop] +codetoanalyze/cpp/performance/string_test.cpp, iterate_over_string, 15 + 10 ⋅ str->elements.length.ub + 18 ⋅ (str->elements.length.ub + 1), OnUIThread:false, [{str->elements.length.ub + 1},Loop,{str->elements.length.ub},Loop] codetoanalyze/cpp/performance/string_test.cpp, string_compare_linear, 43 + 12 ⋅ a->cpp.vector_elem.length.ub + (a->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{a->cpp.vector_elem.length.ub + 1},Call to std::operator!=,Call to std::operator==_>,Loop,{a->cpp.vector_elem.length.ub},Call to std::operator!=,Call to std::operator==_>,Loop] codetoanalyze/cpp/performance/unordered_map.cpp, add_element_to_map_at_linear_FN, 5, OnUIThread:false, [] codetoanalyze/cpp/performance/unordered_map.cpp, add_element_to_map_insert_linear_FN, 3, OnUIThread:false, [] @@ -134,19 +134,19 @@ codetoanalyze/cpp/performance/vector.cpp, copy_iterative_method_linear, 4 + 7 codetoanalyze/cpp/performance/vector.cpp, copy_n_constant, 14, OnUIThread:false, [] codetoanalyze/cpp/performance/vector.cpp, copy_n_linear_FN, 15, OnUIThread:false, [] codetoanalyze/cpp/performance/vector.cpp, find_in_vector, 18 + vec->cpp.vector_elem.length.ub, OnUIThread:false, [{vec->cpp.vector_elem.length.ub},Modeled call to Container.find] -codetoanalyze/cpp/performance/vector.cpp, insert_new_vector_constant, 74, OnUIThread:false, [] -codetoanalyze/cpp/performance/vector.cpp, insert_new_vector_loop_constant, 101, OnUIThread:false, [] -codetoanalyze/cpp/performance/vector.cpp, insert_new_vector_loop_linear, 14 + 15 ⋅ n + 2 ⋅ (1+max(0, n)), OnUIThread:false, [{1+max(0, n)},Loop,{n},Loop] -codetoanalyze/cpp/performance/vector.cpp, insert_vector_constant, 44, OnUIThread:false, [] -codetoanalyze/cpp/performance/vector.cpp, iterate_over_vec_linear, 7 + 7 ⋅ vec->cpp.vector_elem.length.ub + 20 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] -codetoanalyze/cpp/performance/vector.cpp, iterate_rev_over_vec_linear, 18 + 10 ⋅ vec->cpp.vector_elem.length.ub + 35 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] +codetoanalyze/cpp/performance/vector.cpp, insert_new_vector_constant, 71, OnUIThread:false, [] +codetoanalyze/cpp/performance/vector.cpp, insert_new_vector_loop_constant, 99, OnUIThread:false, [] +codetoanalyze/cpp/performance/vector.cpp, insert_new_vector_loop_linear, 12 + 15 ⋅ n + 2 ⋅ (1+max(0, n)), OnUIThread:false, [{1+max(0, n)},Loop,{n},Loop] +codetoanalyze/cpp/performance/vector.cpp, insert_vector_constant, 42, OnUIThread:false, [] +codetoanalyze/cpp/performance/vector.cpp, iterate_over_vec_linear, 7 + 6 ⋅ vec->cpp.vector_elem.length.ub + 20 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] +codetoanalyze/cpp/performance/vector.cpp, iterate_rev_over_vec_linear, 18 + 9 ⋅ vec->cpp.vector_elem.length.ub + 35 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] codetoanalyze/cpp/performance/vector.cpp, iterate_two_vectors_linear, 4 + 3 ⋅ vec1->cpp.vector_elem.length.ub + 3 ⋅ vec2->cpp.vector_elem.length.ub + 3 ⋅ (vec1->cpp.vector_elem.length.ub + 1) + 3 ⋅ (vec2->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec2->cpp.vector_elem.length.ub + 1},Loop,{vec1->cpp.vector_elem.length.ub + 1},Loop,{vec2->cpp.vector_elem.length.ub},Loop,{vec1->cpp.vector_elem.length.ub},Loop] -codetoanalyze/cpp/performance/vector.cpp, iterate_vector_auto_linear, 15 + 17 ⋅ vec->cpp.vector_elem.length.ub + 18 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] +codetoanalyze/cpp/performance/vector.cpp, iterate_vector_auto_linear, 15 + 15 ⋅ vec->cpp.vector_elem.length.ub + 18 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] codetoanalyze/cpp/performance/vector.cpp, iterate_vector_constant_times_linear, 38 + 15 ⋅ vec->cpp.vector_elem.length.ub + 15 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Call to iterate_vector_linear,Loop,{vec->cpp.vector_elem.length.ub},Call to iterate_vector_linear,Loop] codetoanalyze/cpp/performance/vector.cpp, iterate_vector_linear, 2 + 3 ⋅ vec->cpp.vector_elem.length.ub + 3 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] codetoanalyze/cpp/performance/vector.cpp, iterate_vector_quadratic, 2 + 6 ⋅ vec->cpp.vector_elem.length.ub + 3 ⋅ vec->cpp.vector_elem.length.ub × vec->cpp.vector_elem.length.ub + 3 ⋅ vec->cpp.vector_elem.length.ub × (vec->cpp.vector_elem.length.ub + 1) + 3 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub + 1},Call to iterate_vector_linear,Loop,{vec->cpp.vector_elem.length.ub},Call to iterate_vector_linear,Loop,{vec->cpp.vector_elem.length.ub},Loop] -codetoanalyze/cpp/performance/vector.cpp, iteratec_over_vec_linear, 7 + 7 ⋅ vec->cpp.vector_elem.length.ub + 20 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] -codetoanalyze/cpp/performance/vector.cpp, iteratec_rev_over_vec_linear, 18 + 10 ⋅ vec->cpp.vector_elem.length.ub + 35 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] -codetoanalyze/cpp/performance/vector.cpp, loop_over_vec_linear, 15 + 12 ⋅ vec->cpp.vector_elem.length.ub + 18 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] -codetoanalyze/cpp/performance/vector.cpp, remove_duplicates_quadratic, 19 + 18 ⋅ vec2.cpp.vector_elem.length × vec1->cpp.vector_elem.length.ub + 33 ⋅ vec1->cpp.vector_elem.length.ub + 18 ⋅ vec1->cpp.vector_elem.length.ub × (vec2.cpp.vector_elem.length + 1) + 18 ⋅ (vec1->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec1->cpp.vector_elem.length.ub + 1},Loop,{vec2.cpp.vector_elem.length + 1},Loop,{vec1->cpp.vector_elem.length.ub},Loop,{vec1->cpp.vector_elem.length.ub},Loop,{vec2.cpp.vector_elem.length},Loop] +codetoanalyze/cpp/performance/vector.cpp, iteratec_over_vec_linear, 7 + 6 ⋅ vec->cpp.vector_elem.length.ub + 20 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] +codetoanalyze/cpp/performance/vector.cpp, iteratec_rev_over_vec_linear, 18 + 9 ⋅ vec->cpp.vector_elem.length.ub + 35 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] +codetoanalyze/cpp/performance/vector.cpp, loop_over_vec_linear, 15 + 10 ⋅ vec->cpp.vector_elem.length.ub + 18 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] +codetoanalyze/cpp/performance/vector.cpp, remove_duplicates_quadratic, 19 + 16 ⋅ vec2.cpp.vector_elem.length × vec1->cpp.vector_elem.length.ub + 31 ⋅ vec1->cpp.vector_elem.length.ub + 18 ⋅ vec1->cpp.vector_elem.length.ub × (vec2.cpp.vector_elem.length + 1) + 18 ⋅ (vec1->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec1->cpp.vector_elem.length.ub + 1},Loop,{vec2.cpp.vector_elem.length + 1},Loop,{vec1->cpp.vector_elem.length.ub},Loop,{vec1->cpp.vector_elem.length.ub},Loop,{vec2.cpp.vector_elem.length},Loop] codetoanalyze/cpp/performance/vector.cpp, sort_vector_nlogn, 12 + vec->cpp.vector_elem.length.ub × log(vec->cpp.vector_elem.length.ub), OnUIThread:false, [{vec->cpp.vector_elem.length.ub},Modeled call to Container.sort,{vec->cpp.vector_elem.length.ub},Modeled call to Container.sort] diff --git a/infer/tests/codetoanalyze/cpp/performance/cost-issues.exp b/infer/tests/codetoanalyze/cpp/performance/cost-issues.exp index 90e099e3707..c35cc362d02 100644 --- a/infer/tests/codetoanalyze/cpp/performance/cost-issues.exp +++ b/infer/tests/codetoanalyze/cpp/performance/cost-issues.exp @@ -29,10 +29,10 @@ codetoanalyze/cpp/performance/foreachtest.cpp, lambda_foreachtest.cpp:40_c46909d codetoanalyze/cpp/performance/foreachtest.cpp, lambda_foreachtest.cpp:46_e1383522::__infer_inner_destructor_lambda_~(lambda_at_foreachtest.cpp:46_29eb7782, 2, OnUIThread:false, [] codetoanalyze/cpp/performance/foreachtest.cpp, lambda_foreachtest.cpp:46_e1383522::lambda_(lambda_at_foreachtest.cpp:46_cd7709f2, 3, OnUIThread:false, [] codetoanalyze/cpp/performance/foreachtest.cpp, lambda_foreachtest.cpp:46_e1383522::lambda_~(lambda_at_foreachtest.cpp:46_29eb7782, 3, OnUIThread:false, [] -codetoanalyze/cpp/performance/foreachtest.cpp, lambda_foreachtest.cpp:46_e1383522::operator(), 12 + 16 ⋅ vec->cpp.vector_elem.length.ub + 18 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Call to loop_linear_vec,Loop,{vec->cpp.vector_elem.length.ub},Call to loop_linear_vec,Loop] +codetoanalyze/cpp/performance/foreachtest.cpp, lambda_foreachtest.cpp:46_e1383522::operator(), 12 + 14 ⋅ vec->cpp.vector_elem.length.ub + 18 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Call to loop_linear_vec,Loop,{vec->cpp.vector_elem.length.ub},Call to loop_linear_vec,Loop] codetoanalyze/cpp/performance/foreachtest.cpp, list_quadratic_FN, 13, OnUIThread:false, [] codetoanalyze/cpp/performance/foreachtest.cpp, loop_linear_list, 10 + 8 ⋅ list->elements.length.ub + 14 ⋅ (list->elements.length.ub + 1), OnUIThread:false, [{list->elements.length.ub + 1},Loop,{list->elements.length.ub},Loop] -codetoanalyze/cpp/performance/foreachtest.cpp, loop_linear_vec, 10 + 16 ⋅ vec->cpp.vector_elem.length.ub + 18 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] +codetoanalyze/cpp/performance/foreachtest.cpp, loop_linear_vec, 10 + 14 ⋅ vec->cpp.vector_elem.length.ub + 18 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] codetoanalyze/cpp/performance/foreachtest.cpp, map_linear_FN, 6, OnUIThread:false, [] codetoanalyze/cpp/performance/foreachtest.cpp, vector_quadratic_FN, 13, OnUIThread:false, [] codetoanalyze/cpp/performance/integral_constant.cpp, iterate_integral_constant, 35, OnUIThread:false, [] @@ -103,7 +103,7 @@ codetoanalyze/cpp/performance/std_array.cpp, loop_over_arr_max_size_constant, 60 codetoanalyze/cpp/performance/std_array.cpp, loop_over_arr_size_constant, 35, OnUIThread:false, [] codetoanalyze/cpp/performance/string_test.cpp, call_google_strlen_linear, 2 + str->strlen.ub, OnUIThread:false, [{str->strlen.ub},Modeled call to google::StrLen] codetoanalyze/cpp/performance/string_test.cpp, call_google_strlen_with_loop_linear, 4 + 3 ⋅ str->strlen.ub + str->strlen.ub + 2 ⋅ (str->strlen.ub + 1), OnUIThread:false, [{str->strlen.ub + 1},Loop,{str->strlen.ub},Modeled call to google::StrLen,{str->strlen.ub},Loop] -codetoanalyze/cpp/performance/string_test.cpp, iterate_over_string, 7 + 12 ⋅ str->elements.length.ub + 18 ⋅ (str->elements.length.ub + 1), OnUIThread:false, [{str->elements.length.ub + 1},Loop,{str->elements.length.ub},Loop] +codetoanalyze/cpp/performance/string_test.cpp, iterate_over_string, 7 + 10 ⋅ str->elements.length.ub + 18 ⋅ (str->elements.length.ub + 1), OnUIThread:false, [{str->elements.length.ub + 1},Loop,{str->elements.length.ub},Loop] codetoanalyze/cpp/performance/string_test.cpp, string_compare_linear, 43 + 12 ⋅ a->cpp.vector_elem.length.ub + (a->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{a->cpp.vector_elem.length.ub + 1},Call to std::operator!=,Call to std::operator==_>,Loop,{a->cpp.vector_elem.length.ub},Call to std::operator!=,Call to std::operator==_>,Loop] codetoanalyze/cpp/performance/unordered_map.cpp, add_element_to_map_at_linear_FN, 5, OnUIThread:false, [] codetoanalyze/cpp/performance/unordered_map.cpp, add_element_to_map_insert_linear_FN, 3, OnUIThread:false, [] @@ -134,19 +134,19 @@ codetoanalyze/cpp/performance/vector.cpp, copy_iterative_method_linear, 4 + 7 codetoanalyze/cpp/performance/vector.cpp, copy_n_constant, 6, OnUIThread:false, [] codetoanalyze/cpp/performance/vector.cpp, copy_n_linear_FN, 7, OnUIThread:false, [] codetoanalyze/cpp/performance/vector.cpp, find_in_vector, 6 + vec->cpp.vector_elem.length.ub, OnUIThread:false, [{vec->cpp.vector_elem.length.ub},Modeled call to Container.find] -codetoanalyze/cpp/performance/vector.cpp, insert_new_vector_constant, 58, OnUIThread:false, [] -codetoanalyze/cpp/performance/vector.cpp, insert_new_vector_loop_constant, 81, OnUIThread:false, [] -codetoanalyze/cpp/performance/vector.cpp, insert_new_vector_loop_linear, 14 + 11 ⋅ n + 2 ⋅ (1+max(0, n)), OnUIThread:false, [{1+max(0, n)},Loop,{n},Loop] -codetoanalyze/cpp/performance/vector.cpp, insert_vector_constant, 36, OnUIThread:false, [] -codetoanalyze/cpp/performance/vector.cpp, iterate_over_vec_linear, 3 + 7 ⋅ vec->cpp.vector_elem.length.ub + 20 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] -codetoanalyze/cpp/performance/vector.cpp, iterate_rev_over_vec_linear, 3 + 10 ⋅ vec->cpp.vector_elem.length.ub + 35 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] +codetoanalyze/cpp/performance/vector.cpp, insert_new_vector_constant, 55, OnUIThread:false, [] +codetoanalyze/cpp/performance/vector.cpp, insert_new_vector_loop_constant, 79, OnUIThread:false, [] +codetoanalyze/cpp/performance/vector.cpp, insert_new_vector_loop_linear, 12 + 11 ⋅ n + 2 ⋅ (1+max(0, n)), OnUIThread:false, [{1+max(0, n)},Loop,{n},Loop] +codetoanalyze/cpp/performance/vector.cpp, insert_vector_constant, 34, OnUIThread:false, [] +codetoanalyze/cpp/performance/vector.cpp, iterate_over_vec_linear, 3 + 6 ⋅ vec->cpp.vector_elem.length.ub + 20 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] +codetoanalyze/cpp/performance/vector.cpp, iterate_rev_over_vec_linear, 3 + 9 ⋅ vec->cpp.vector_elem.length.ub + 35 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] codetoanalyze/cpp/performance/vector.cpp, iterate_two_vectors_linear, 4 + 3 ⋅ vec1->cpp.vector_elem.length.ub + 3 ⋅ vec2->cpp.vector_elem.length.ub + 3 ⋅ (vec1->cpp.vector_elem.length.ub + 1) + 3 ⋅ (vec2->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec2->cpp.vector_elem.length.ub + 1},Loop,{vec1->cpp.vector_elem.length.ub + 1},Loop,{vec2->cpp.vector_elem.length.ub},Loop,{vec1->cpp.vector_elem.length.ub},Loop] -codetoanalyze/cpp/performance/vector.cpp, iterate_vector_auto_linear, 7 + 17 ⋅ vec->cpp.vector_elem.length.ub + 18 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] +codetoanalyze/cpp/performance/vector.cpp, iterate_vector_auto_linear, 7 + 15 ⋅ vec->cpp.vector_elem.length.ub + 18 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] codetoanalyze/cpp/performance/vector.cpp, iterate_vector_constant_times_linear, 38 + 15 ⋅ vec->cpp.vector_elem.length.ub + 15 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Call to iterate_vector_linear,Loop,{vec->cpp.vector_elem.length.ub},Call to iterate_vector_linear,Loop] codetoanalyze/cpp/performance/vector.cpp, iterate_vector_linear, 2 + 3 ⋅ vec->cpp.vector_elem.length.ub + 3 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] codetoanalyze/cpp/performance/vector.cpp, iterate_vector_quadratic, 2 + 6 ⋅ vec->cpp.vector_elem.length.ub + 3 ⋅ vec->cpp.vector_elem.length.ub × vec->cpp.vector_elem.length.ub + 3 ⋅ vec->cpp.vector_elem.length.ub × (vec->cpp.vector_elem.length.ub + 1) + 3 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub + 1},Call to iterate_vector_linear,Loop,{vec->cpp.vector_elem.length.ub},Call to iterate_vector_linear,Loop,{vec->cpp.vector_elem.length.ub},Loop] -codetoanalyze/cpp/performance/vector.cpp, iteratec_over_vec_linear, 3 + 7 ⋅ vec->cpp.vector_elem.length.ub + 20 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] -codetoanalyze/cpp/performance/vector.cpp, iteratec_rev_over_vec_linear, 3 + 10 ⋅ vec->cpp.vector_elem.length.ub + 35 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] -codetoanalyze/cpp/performance/vector.cpp, loop_over_vec_linear, 7 + 12 ⋅ vec->cpp.vector_elem.length.ub + 18 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] -codetoanalyze/cpp/performance/vector.cpp, remove_duplicates_quadratic, 11 + 18 ⋅ vec2.cpp.vector_elem.length × vec1->cpp.vector_elem.length.ub + 25 ⋅ vec1->cpp.vector_elem.length.ub + 18 ⋅ vec1->cpp.vector_elem.length.ub × (vec2.cpp.vector_elem.length + 1) + 18 ⋅ (vec1->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec1->cpp.vector_elem.length.ub + 1},Loop,{vec2.cpp.vector_elem.length + 1},Loop,{vec1->cpp.vector_elem.length.ub},Loop,{vec1->cpp.vector_elem.length.ub},Loop,{vec2.cpp.vector_elem.length},Loop] +codetoanalyze/cpp/performance/vector.cpp, iteratec_over_vec_linear, 3 + 6 ⋅ vec->cpp.vector_elem.length.ub + 20 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] +codetoanalyze/cpp/performance/vector.cpp, iteratec_rev_over_vec_linear, 3 + 9 ⋅ vec->cpp.vector_elem.length.ub + 35 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] +codetoanalyze/cpp/performance/vector.cpp, loop_over_vec_linear, 7 + 10 ⋅ vec->cpp.vector_elem.length.ub + 18 ⋅ (vec->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec->cpp.vector_elem.length.ub + 1},Loop,{vec->cpp.vector_elem.length.ub},Loop] +codetoanalyze/cpp/performance/vector.cpp, remove_duplicates_quadratic, 11 + 16 ⋅ vec2.cpp.vector_elem.length × vec1->cpp.vector_elem.length.ub + 23 ⋅ vec1->cpp.vector_elem.length.ub + 18 ⋅ vec1->cpp.vector_elem.length.ub × (vec2.cpp.vector_elem.length + 1) + 18 ⋅ (vec1->cpp.vector_elem.length.ub + 1), OnUIThread:false, [{vec1->cpp.vector_elem.length.ub + 1},Loop,{vec2.cpp.vector_elem.length + 1},Loop,{vec1->cpp.vector_elem.length.ub},Loop,{vec1->cpp.vector_elem.length.ub},Loop,{vec2.cpp.vector_elem.length},Loop] codetoanalyze/cpp/performance/vector.cpp, sort_vector_nlogn, 4 + vec->cpp.vector_elem.length.ub × log(vec->cpp.vector_elem.length.ub), OnUIThread:false, [{vec->cpp.vector_elem.length.ub},Modeled call to Container.sort,{vec->cpp.vector_elem.length.ub},Modeled call to Container.sort] diff --git a/infer/tests/codetoanalyze/cpp/pulse-20/coro.cpp b/infer/tests/codetoanalyze/cpp/pulse-20/coro.cpp index 4a6efedb060..8718a65ddb7 100644 --- a/infer/tests/codetoanalyze/cpp/pulse-20/coro.cpp +++ b/infer/tests/codetoanalyze/cpp/pulse-20/coro.cpp @@ -5,8 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -// make tests compatible with clang-12 for the moment -#include +// The test is not compatible with clang-12. +#include namespace coro { @@ -22,14 +22,14 @@ struct Task { using promise_type = Task; bool await_ready() noexcept; - std::experimental::coroutine_handle<> await_suspend( - std::experimental::coroutine_handle> coro) noexcept; + std::coroutine_handle<> await_suspend( + std::coroutine_handle> coro) noexcept; T await_resume() noexcept; Task get_return_object(); - std::experimental::suspend_always initial_suspend() noexcept { return {}; } - std::experimental::suspend_always final_suspend() noexcept { return {}; } + std::suspend_always initial_suspend() noexcept { return {}; } + std::suspend_always final_suspend() noexcept { return {}; } void return_value(T&& value); - std::experimental::suspend_always yield_value(T&& value); + std::suspend_always yield_value(T&& value); void unhandled_exception() {} }; diff --git a/infer/tests/codetoanalyze/cpp/pulse/call_lambdas.cpp b/infer/tests/codetoanalyze/cpp/pulse/call_lambdas.cpp index 82426bd766d..506b6471ef9 100644 --- a/infer/tests/codetoanalyze/cpp/pulse/call_lambdas.cpp +++ b/infer/tests/codetoanalyze/cpp/pulse/call_lambdas.cpp @@ -4,6 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ +#include #include template diff --git a/infer/tests/codetoanalyze/cpp/pulse/issues.exp b/infer/tests/codetoanalyze/cpp/pulse/issues.exp index 6386c203208..9653f5f8335 100644 --- a/infer/tests/codetoanalyze/cpp/pulse/issues.exp +++ b/infer/tests/codetoanalyze/cpp/pulse/issues.exp @@ -16,10 +16,10 @@ codetoanalyze/cpp/pulse/basics.cpp, struct_inside_loop_continue_ok, 0, PULSE_CON codetoanalyze/cpp/pulse/basics.cpp, call_builtin_add_overflow_bad, 5, NULLPTR_DEREFERENCE, no_bucket, ERROR, [is assigned to the constant 3,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] codetoanalyze/cpp/pulse/basics.cpp, call_builtin_mul_overflow_bad, 5, NULLPTR_DEREFERENCE, no_bucket, ERROR, [is assigned to the constant 3,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] codetoanalyze/cpp/pulse/basics.cpp, call_builtin_sub_overflow_bad, 5, NULLPTR_DEREFERENCE, no_bucket, ERROR, [is assigned to the constant 2,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] -codetoanalyze/cpp/pulse/call_lambdas.cpp, call_lambda_through_function_test_bad, 3, NULLPTR_DEREFERENCE, no_bucket, ERROR, [in call to `call_lambda_through_function`,in call to `call_lambda<(lambda_at_call_lambdas.cpp:16:22)>`,in call to `lambda_call_lambdas.cpp:16_f4cfd8cf::operator()`,value captured by value as `c`,returned,return from call to `lambda_call_lambdas.cpp:16_f4cfd8cf::operator()`,returned,return from call to `call_lambda<(lambda_at_call_lambdas.cpp:16:22)>`,returned,return from call to `call_lambda_through_function`,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] -codetoanalyze/cpp/pulse/call_lambdas.cpp, call_lambda_directly_test_bad, 3, NULLPTR_DEREFERENCE, no_bucket, ERROR, [in call to `call_lambda_directly`,in call to `lambda_call_lambdas.cpp:21_901326c8::operator()`,value captured by value as `c`,returned,return from call to `lambda_call_lambdas.cpp:21_901326c8::operator()`,returned,return from call to `call_lambda_directly`,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] -codetoanalyze/cpp/pulse/call_lambdas.cpp, call_std_fun_constructor_test_bad, 3, NULLPTR_DEREFERENCE, no_bucket, ERROR, [in call to `call_std_fun_constructor`,in call to `lambda_call_lambdas.cpp:54_bd5fef1c::operator()`,value captured by value as `c`,returned,return from call to `lambda_call_lambdas.cpp:54_bd5fef1c::operator()`,returned,return from call to `call_std_fun_constructor`,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] -codetoanalyze/cpp/pulse/call_lambdas.cpp, call_lambda_after_copy_test_bad, 3, NULLPTR_DEREFERENCE, no_bucket, ERROR, [in call to `call_lambda_after_copy`,in call to `lambda_call_lambdas.cpp:75_9a48b9fa::operator()`,value captured by ref as `d`,returned,return from call to `lambda_call_lambdas.cpp:75_9a48b9fa::operator()`,returned,return from call to `call_lambda_after_copy`,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] +codetoanalyze/cpp/pulse/call_lambdas.cpp, call_lambda_through_function_test_bad, 3, NULLPTR_DEREFERENCE, no_bucket, ERROR, [in call to `call_lambda_through_function`,in call to `call_lambda<(lambda_at_call_lambdas.cpp:17:22)>`,in call to `lambda_call_lambdas.cpp:17_dfbf5c17::operator()`,value captured by value as `c`,returned,return from call to `lambda_call_lambdas.cpp:17_dfbf5c17::operator()`,returned,return from call to `call_lambda<(lambda_at_call_lambdas.cpp:17:22)>`,returned,return from call to `call_lambda_through_function`,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] +codetoanalyze/cpp/pulse/call_lambdas.cpp, call_lambda_directly_test_bad, 3, NULLPTR_DEREFERENCE, no_bucket, ERROR, [in call to `call_lambda_directly`,in call to `lambda_call_lambdas.cpp:22_6b4b814e::operator()`,value captured by value as `c`,returned,return from call to `lambda_call_lambdas.cpp:22_6b4b814e::operator()`,returned,return from call to `call_lambda_directly`,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] +codetoanalyze/cpp/pulse/call_lambdas.cpp, call_std_fun_constructor_test_bad, 3, NULLPTR_DEREFERENCE, no_bucket, ERROR, [in call to `call_std_fun_constructor`,in call to `lambda_call_lambdas.cpp:55_1276ecaa::operator()`,value captured by value as `c`,returned,return from call to `lambda_call_lambdas.cpp:55_1276ecaa::operator()`,returned,return from call to `call_std_fun_constructor`,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] +codetoanalyze/cpp/pulse/call_lambdas.cpp, call_lambda_after_copy_test_bad, 3, NULLPTR_DEREFERENCE, no_bucket, ERROR, [in call to `call_lambda_after_copy`,in call to `lambda_call_lambdas.cpp:76_15bba7c9::operator()`,value captured by ref as `d`,returned,return from call to `lambda_call_lambdas.cpp:76_15bba7c9::operator()`,returned,return from call to `call_lambda_after_copy`,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] codetoanalyze/cpp/pulse/closures.cpp, ref_capture_destroy_invoke_bad, 6, USE_AFTER_LIFETIME, no_bucket, ERROR, [invalidation part of the trace starts here,variable `s` declared here,is the address of a stack variable `s` whose lifetime has ended,use-after-lifetime part of the trace starts here,variable `s` declared here,when calling `lambda_closures.cpp:20_0780ad07::operator()` here,value captured by ref as `s`,invalid access occurs here] codetoanalyze/cpp/pulse/closures.cpp, implicit_ref_capture_destroy_invoke_bad, 6, USE_AFTER_LIFETIME, no_bucket, ERROR, [invalidation part of the trace starts here,variable `s` declared here,is the address of a stack variable `s` whose lifetime has ended,use-after-lifetime part of the trace starts here,variable `s` declared here,when calling `lambda_closures.cpp:29_cd6cc34a::operator()` here,value captured by ref as `s`,invalid access occurs here] codetoanalyze/cpp/pulse/closures.cpp, reassign_lambda_capture_destroy_invoke_bad, 9, USE_AFTER_LIFETIME, no_bucket, ERROR, [invalidation part of the trace starts here,variable `s` declared here,is the address of a stack variable `s` whose lifetime has ended,use-after-lifetime part of the trace starts here,variable `s` declared here,when calling `lambda_closures.cpp:41_8d512e76::operator()` here,value captured by ref as `s`,invalid access occurs here] @@ -280,7 +280,7 @@ codetoanalyze/cpp/pulse/taint/basics.cpp, basics::string_source_bad, 0, PULSE_CO codetoanalyze/cpp/pulse/taint/basics.cpp, basics::string_source_bad, 2, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `basics::Obj::string_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#1` to `basics::Obj::string_sink` with kind `SimpleSink`], source: basics::Obj::string_source, sink: basics::Obj::string_sink, tainted expression: UNKNOWN codetoanalyze/cpp/pulse/taint/basics.cpp, basics::string_source_bad, 2, PULSE_UNNECESSARY_COPY_INTERMEDIATE, no_bucket, ERROR, [copied here (with type `std::basic_string,std::allocator>&`)] codetoanalyze/cpp/pulse/taint/basics.cpp, basics::getenv_source_bad, 0, PULSE_CONST_REFABLE, no_bucket, ERROR, [Parameter obj with type `basics::Obj`] -codetoanalyze/cpp/pulse/taint/basics.cpp, basics::getenv_source_bad, 2, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `getenv` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#1` to `basics::Obj::string_sink` with kind `SimpleSink`], source: getenv, sink: basics::Obj::string_sink, tainted expression: UNKNOWN +codetoanalyze/cpp/pulse/taint/basics.cpp, basics::getenv_source_bad, 2, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `getenv` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::basic_string<0>` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#1` to `basics::Obj::string_sink` with kind `SimpleSink`], source: getenv, sink: basics::Obj::string_sink, tainted expression: UNKNOWN codetoanalyze/cpp/pulse/taint/basics.cpp, basics::getenv_source_bad, 2, PULSE_UNNECESSARY_COPY_INTERMEDIATE, no_bucket, ERROR, [copied here (with type `std::basic_string,std::allocator>&`)] codetoanalyze/cpp/pulse/taint/basics.cpp, basics::via_field_bad1, 2, PULSE_UNNECESSARY_COPY_ASSIGNMENT, no_bucket, ERROR, [copy assigned here (with type `std::basic_string,std::allocator>&`)] codetoanalyze/cpp/pulse/taint/basics.cpp, basics::via_field_bad1, 3, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `basics::template_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::operator=` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `basics::template_sink` with kind `SimpleSink`], source: basics::template_source, sink: basics::template_sink, tainted expression: UNKNOWN @@ -322,14 +322,14 @@ codetoanalyze/cpp/pulse/taint/pointers.cpp, pointers::funptr_helper_bad1[special codetoanalyze/cpp/pulse/taint/pointers.cpp, pointers::funptr_helper_bad2[specialized with functions], 1, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN codetoanalyze/cpp/pulse/taint/pointers.cpp, pointers::funptr_helper_bad2[specialized with functions], 1, PULSE_UNNECESSARY_COPY_INTERMEDIATE, no_bucket, ERROR, [copied here (with type `std::basic_string,std::allocator>&`)] codetoanalyze/cpp/pulse/taint/pointers.cpp, pointers::funptr_helper_bad2, 1, PULSE_UNNECESSARY_COPY_INTERMEDIATE, no_bucket, ERROR, [copied here (with type `std::basic_string,std::allocator>&`)] -codetoanalyze/cpp/pulse/taint/strings.cpp, strings::sprintf1_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `sprintf` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN -codetoanalyze/cpp/pulse/taint/strings.cpp, strings::sprintf2_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `sprintf` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN -codetoanalyze/cpp/pulse/taint/strings.cpp, strings::strcpy1_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `strcpy` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN -codetoanalyze/cpp/pulse/taint/strings.cpp, strings::strcpy2_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `strcpy` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN -codetoanalyze/cpp/pulse/taint/strings.cpp, strings::strncpy_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `strncpy` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN -codetoanalyze/cpp/pulse/taint/strings.cpp, strings::memcpy_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `memcpy` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN -codetoanalyze/cpp/pulse/taint/strings.cpp, strings::memmove_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `memmove` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN -codetoanalyze/cpp/pulse/taint/strings.cpp, strings::memchr_bad, 3, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `memchr` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN +codetoanalyze/cpp/pulse/taint/strings.cpp, strings::sprintf1_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `sprintf` with no summary,in call to function `std::basic_string,std::allocator>::basic_string<0>` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN +codetoanalyze/cpp/pulse/taint/strings.cpp, strings::sprintf2_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `sprintf` with no summary,in call to function `std::basic_string,std::allocator>::basic_string<0>` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN +codetoanalyze/cpp/pulse/taint/strings.cpp, strings::strcpy1_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `strcpy` with no summary,in call to function `std::basic_string,std::allocator>::basic_string<0>` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN +codetoanalyze/cpp/pulse/taint/strings.cpp, strings::strcpy2_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `strcpy` with no summary,in call to function `std::basic_string,std::allocator>::basic_string<0>` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN +codetoanalyze/cpp/pulse/taint/strings.cpp, strings::strncpy_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `strncpy` with no summary,in call to function `std::basic_string,std::allocator>::basic_string<0>` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN +codetoanalyze/cpp/pulse/taint/strings.cpp, strings::memcpy_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `memcpy` with no summary,in call to function `std::basic_string,std::allocator>::basic_string<0>` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN +codetoanalyze/cpp/pulse/taint/strings.cpp, strings::memmove_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `memmove` with no summary,in call to function `std::basic_string,std::allocator>::basic_string<0>` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN +codetoanalyze/cpp/pulse/taint/strings.cpp, strings::memchr_bad, 3, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `memchr` with no summary,in call to function `std::basic_string,std::allocator>::basic_string<0>` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN codetoanalyze/cpp/pulse/taint/strings.cpp, strings::constructor1_bad, 2, PULSE_UNNECESSARY_COPY, no_bucket, ERROR, [copied here (with type `std::basic_string,std::allocator>&`)] codetoanalyze/cpp/pulse/taint/strings.cpp, strings::constructor1_bad, 3, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN codetoanalyze/cpp/pulse/taint/strings.cpp, strings::constructor1_bad, 3, PULSE_UNNECESSARY_COPY_INTERMEDIATE, no_bucket, ERROR, [copied here (with type `std::basic_string,std::allocator>&`)] diff --git a/infer/tests/codetoanalyze/cpp/pulse/issues.exp-11 b/infer/tests/codetoanalyze/cpp/pulse/issues.exp-11 index c9356a8f2e7..fd8185552a0 100644 --- a/infer/tests/codetoanalyze/cpp/pulse/issues.exp-11 +++ b/infer/tests/codetoanalyze/cpp/pulse/issues.exp-11 @@ -16,13 +16,13 @@ codetoanalyze/cpp/pulse/basics.cpp, struct_inside_loop_continue_ok, 0, PULSE_CON codetoanalyze/cpp/pulse/basics.cpp, call_builtin_add_overflow_bad, 5, NULLPTR_DEREFERENCE, no_bucket, ERROR, [is assigned to the constant 3,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] codetoanalyze/cpp/pulse/basics.cpp, call_builtin_mul_overflow_bad, 5, NULLPTR_DEREFERENCE, no_bucket, ERROR, [is assigned to the constant 3,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] codetoanalyze/cpp/pulse/basics.cpp, call_builtin_sub_overflow_bad, 5, NULLPTR_DEREFERENCE, no_bucket, ERROR, [is assigned to the constant 2,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] -codetoanalyze/cpp/pulse/call_lambdas.cpp, call_lambda_through_function_test_bad, 3, NULLPTR_DEREFERENCE, no_bucket, ERROR, [in call to `call_lambda_through_function`,in call to `call_lambda<(lambda_at_call_lambdas.cpp:16:22)>`,in call to `lambda_call_lambdas.cpp:16_f4cfd8cf::operator()`,value captured by value as `c`,returned,return from call to `lambda_call_lambdas.cpp:16_f4cfd8cf::operator()`,returned,return from call to `call_lambda<(lambda_at_call_lambdas.cpp:16:22)>`,returned,return from call to `call_lambda_through_function`,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] -codetoanalyze/cpp/pulse/call_lambdas.cpp, call_lambda_through_function_test_good, 3, NULLPTR_DEREFERENCE, no_bucket, ERROR, [in call to `call_lambda_through_function`,in call to `call_lambda<(lambda_at_call_lambdas.cpp:16:22)>`,in call to `lambda_call_lambdas.cpp:16_f4cfd8cf::operator()`,value captured by value as `c`,returned,return from call to `lambda_call_lambdas.cpp:16_f4cfd8cf::operator()`,returned,return from call to `call_lambda<(lambda_at_call_lambdas.cpp:16:22)>`,returned,return from call to `call_lambda_through_function`,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] -codetoanalyze/cpp/pulse/call_lambdas.cpp, call_lambda_directly_test_bad, 3, NULLPTR_DEREFERENCE, no_bucket, ERROR, [in call to `call_lambda_directly`,in call to `lambda_call_lambdas.cpp:21_901326c8::operator()`,value captured by value as `c`,returned,return from call to `lambda_call_lambdas.cpp:21_901326c8::operator()`,returned,return from call to `call_lambda_directly`,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] +codetoanalyze/cpp/pulse/call_lambdas.cpp, call_lambda_through_function_test_bad, 3, NULLPTR_DEREFERENCE, no_bucket, ERROR, [in call to `call_lambda_through_function`,in call to `call_lambda<(lambda_at_call_lambdas.cpp:17:22)>`,in call to `lambda_call_lambdas.cpp:17_dfbf5c17::operator()`,value captured by value as `c`,returned,return from call to `lambda_call_lambdas.cpp:17_dfbf5c17::operator()`,returned,return from call to `call_lambda<(lambda_at_call_lambdas.cpp:17:22)>`,returned,return from call to `call_lambda_through_function`,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] +codetoanalyze/cpp/pulse/call_lambdas.cpp, call_lambda_through_function_test_good, 3, NULLPTR_DEREFERENCE, no_bucket, ERROR, [in call to `call_lambda_through_function`,in call to `call_lambda<(lambda_at_call_lambdas.cpp:17:22)>`,in call to `lambda_call_lambdas.cpp:17_dfbf5c17::operator()`,value captured by value as `c`,returned,return from call to `lambda_call_lambdas.cpp:17_dfbf5c17::operator()`,returned,return from call to `call_lambda<(lambda_at_call_lambdas.cpp:17:22)>`,returned,return from call to `call_lambda_through_function`,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] +codetoanalyze/cpp/pulse/call_lambdas.cpp, call_lambda_directly_test_bad, 3, NULLPTR_DEREFERENCE, no_bucket, ERROR, [in call to `call_lambda_directly`,in call to `lambda_call_lambdas.cpp:22_6b4b814e::operator()`,value captured by value as `c`,returned,return from call to `lambda_call_lambdas.cpp:22_6b4b814e::operator()`,returned,return from call to `call_lambda_directly`,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] codetoanalyze/cpp/pulse/call_lambdas.cpp, call_std_fun_constructor_test_bad, 3, NULLPTR_DEREFERENCE, no_bucket, ERROR, [in call to `call_std_fun_constructor`,returned,return from call to `call_std_fun_constructor`,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] codetoanalyze/cpp/pulse/call_lambdas.cpp, call_std_fun_constructor_test_good, 3, NULLPTR_DEREFERENCE, no_bucket, ERROR, [in call to `call_std_fun_constructor`,returned,return from call to `call_std_fun_constructor`,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] -codetoanalyze/cpp/pulse/call_lambdas.cpp, call_lambda_after_copy_test_bad, 3, NULLPTR_DEREFERENCE, no_bucket, ERROR, [in call to `call_lambda_after_copy`,in call to `lambda_call_lambdas.cpp:75_9a48b9fa::operator()`,value captured by ref as `d`,returned,return from call to `lambda_call_lambdas.cpp:75_9a48b9fa::operator()`,returned,return from call to `call_lambda_after_copy`,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] -codetoanalyze/cpp/pulse/call_lambdas.cpp, call_lambda_after_copy_test_good, 3, NULLPTR_DEREFERENCE, no_bucket, ERROR, [in call to `call_lambda_after_copy`,in call to `lambda_call_lambdas.cpp:75_9a48b9fa::operator()`,value captured by ref as `d`,returned,return from call to `lambda_call_lambdas.cpp:75_9a48b9fa::operator()`,returned,return from call to `call_lambda_after_copy`,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] +codetoanalyze/cpp/pulse/call_lambdas.cpp, call_lambda_after_copy_test_bad, 3, NULLPTR_DEREFERENCE, no_bucket, ERROR, [in call to `call_lambda_after_copy`,in call to `lambda_call_lambdas.cpp:76_15bba7c9::operator()`,value captured by ref as `d`,returned,return from call to `lambda_call_lambdas.cpp:76_15bba7c9::operator()`,returned,return from call to `call_lambda_after_copy`,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] +codetoanalyze/cpp/pulse/call_lambdas.cpp, call_lambda_after_copy_test_good, 3, NULLPTR_DEREFERENCE, no_bucket, ERROR, [in call to `call_lambda_after_copy`,in call to `lambda_call_lambdas.cpp:76_15bba7c9::operator()`,value captured by ref as `d`,returned,return from call to `lambda_call_lambdas.cpp:76_15bba7c9::operator()`,returned,return from call to `call_lambda_after_copy`,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] codetoanalyze/cpp/pulse/closures.cpp, ref_capture_destroy_invoke_bad, 6, USE_AFTER_LIFETIME, no_bucket, ERROR, [invalidation part of the trace starts here,variable `s` declared here,is the address of a stack variable `s` whose lifetime has ended,use-after-lifetime part of the trace starts here,variable `s` declared here,when calling `lambda_closures.cpp:20_0780ad07::operator()` here,value captured by ref as `s`,invalid access occurs here] codetoanalyze/cpp/pulse/closures.cpp, implicit_ref_capture_destroy_invoke_bad, 6, USE_AFTER_LIFETIME, no_bucket, ERROR, [invalidation part of the trace starts here,variable `s` declared here,is the address of a stack variable `s` whose lifetime has ended,use-after-lifetime part of the trace starts here,variable `s` declared here,when calling `lambda_closures.cpp:29_cd6cc34a::operator()` here,value captured by ref as `s`,invalid access occurs here] codetoanalyze/cpp/pulse/closures.cpp, call_lambda_bad, 4, USE_AFTER_DELETE, no_bucket, ERROR, [invalidation part of the trace starts here,allocated by call to `new` (modelled),assigned,was invalidated by `delete`,use-after-lifetime part of the trace starts here,allocated by call to `new` (modelled),in call to `S::S`,parameter `this` of S::S,return from call to `S::S`,when calling `lambda_closures.cpp:164_d955040c::operator()` here,parameter `s` of lambda_closures.cpp:164_d955040c::operator(),invalid access occurs here] @@ -166,8 +166,8 @@ codetoanalyze/cpp/pulse/optional.cpp, emplace, 4, NULLPTR_DEREFERENCE_LATENT, no codetoanalyze/cpp/pulse/optional.cpp, operator_arrow_bad, 0, OPTIONAL_EMPTY_ACCESS, no_bucket, ERROR, [in call to `folly::Optional::Optional(=None)` (modelled),is assigned an empty value,in call to `folly::Optional::Optional(folly::Optional arg)` (modelled),is assigned an empty value,when calling `emplace` here,parameter `state` of emplace,in call to `folly::Optional::operator_bool`,parameter `this` of folly::Optional::operator_bool,return from call to `folly::Optional::operator_bool`,invalid access occurs here] codetoanalyze/cpp/pulse/optional.cpp, get_pointer_no_check_none_check_bad, 3, OPTIONAL_EMPTY_ACCESS, no_bucket, ERROR, [in call to `folly::Optional::get_pointer() empty case` (modelled),is assigned to the null pointer,assigned,invalid access occurs here] codetoanalyze/cpp/pulse/optional.cpp, test_trace_ref, 4, OPTIONAL_EMPTY_ACCESS, no_bucket, ERROR, [in call to `folly::Optional::operator=`,in call to `folly::Optional::reset()` (modelled),is assigned an empty value,return from call to `folly::Optional::operator=`,invalid access occurs here] -codetoanalyze/cpp/pulse/pair.cpp, pair::deref_makepair_constants0_bad, 5, NULLPTR_DEREFERENCE, no_bucket, ERROR, [in call to `pair::pairOfZeroNull3`,is assigned to the constant 58,assigned,in call to `std::pair::pair`,parameter `__param_0` of std::pair::pair,assigned,return from call to `std::pair::pair`,return from call to `pair::pairOfZeroNull3`,in call to `std::pair::pair`,parameter `__param_0` of std::pair::pair,assigned,return from call to `std::pair::pair`,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] -codetoanalyze/cpp/pulse/pair.cpp, pair::deref_makepair_constants1_bad, 5, NULLPTR_DEREFERENCE, no_bucket, ERROR, [in call to `pair::pairOfZeroNull3`,is assigned to the constant 42,assigned,in call to `std::pair::pair`,parameter `__param_0` of std::pair::pair,assigned,return from call to `std::pair::pair`,return from call to `pair::pairOfZeroNull3`,in call to `std::pair::pair`,parameter `__param_0` of std::pair::pair,assigned,return from call to `std::pair::pair`,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] +codetoanalyze/cpp/pulse/pair.cpp, pair::deref_makepair_constants0_bad, 5, NULLPTR_DEREFERENCE, no_bucket, ERROR, [in call to `pair::pairOfZeroNull3`,is assigned to the constant 58,assigned,in call to `std::pair::pair`,macro expanded here,parameter `__param_0` of std::pair::pair,assigned,return from call to `std::pair::pair`,return from call to `pair::pairOfZeroNull3`,in call to `std::pair::pair`,macro expanded here,parameter `__param_0` of std::pair::pair,assigned,return from call to `std::pair::pair`,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] +codetoanalyze/cpp/pulse/pair.cpp, pair::deref_makepair_constants1_bad, 5, NULLPTR_DEREFERENCE, no_bucket, ERROR, [in call to `pair::pairOfZeroNull3`,is assigned to the constant 42,assigned,in call to `std::pair::pair`,macro expanded here,parameter `__param_0` of std::pair::pair,assigned,return from call to `std::pair::pair`,return from call to `pair::pairOfZeroNull3`,in call to `std::pair::pair`,macro expanded here,parameter `__param_0` of std::pair::pair,assigned,return from call to `std::pair::pair`,taking "then" branch,is assigned to the null pointer,assigned,invalid access occurs here] codetoanalyze/cpp/pulse/path.cpp, FP_only_bad_on_42_latent, 2, NULLPTR_DEREFERENCE_LATENT, no_bucket, ERROR, [in call to `may_return_null`,parameter `x` of may_return_null,taking "then" branch,is assigned to the null pointer,returned,return from call to `may_return_null`,assigned,invalid access occurs here] codetoanalyze/cpp/pulse/path.cpp, FN_faulty_call_bad, 0, NULLPTR_DEREFERENCE, no_bucket, ERROR, [when calling `FP_only_bad_on_42_latent` here,in call to `may_return_null`,parameter `x` of may_return_null,taking "then" branch,is assigned to the null pointer,returned,return from call to `may_return_null`,assigned,invalid access occurs here] codetoanalyze/cpp/pulse/readonly_shared_ptr_param.cpp, read_shared_ptr_param_bad, 0, PULSE_READONLY_SHARED_PTR_PARAM, no_bucket, ERROR, [Parameter x with type `std::shared_ptr`,used] @@ -201,7 +201,7 @@ codetoanalyze/cpp/pulse/reference_stability.cpp, folly_fastmap_iterator_incremen codetoanalyze/cpp/pulse/reference_stability.cpp, iterator_copy_constructor_bad, 4, PULSE_REFERENCE_STABILITY, no_bucket, ERROR, [invalidation part of the trace starts here,parameter `map` of iterator_copy_constructor_bad,was potentially invalidated by `folly::F14FastMap::clear`,use-after-lifetime part of the trace starts here,parameter `map` of iterator_copy_constructor_bad,in call to `folly::F14FastMap::begin` (modelled),in call to `folly::f14::detail::ValueContainerIterator::ValueContainerIterator` (modelled),in call to `folly::f14::detail::ValueContainerIterator::ValueContainerIterator` (modelled),in call to `folly::f14::detail::ValueContainerIterator::operator->` (modelled),invalid access occurs here] codetoanalyze/cpp/pulse/reference_stability.cpp, iterator_copy_operator_equal_bad, 5, PULSE_REFERENCE_STABILITY, no_bucket, ERROR, [invalidation part of the trace starts here,parameter `map` of iterator_copy_operator_equal_bad,was potentially invalidated by `folly::F14FastMap::clear`,use-after-lifetime part of the trace starts here,parameter `map` of iterator_copy_operator_equal_bad,in call to `folly::F14FastMap::begin` (modelled),in call to `folly::f14::detail::ValueContainerIterator::ValueContainerIterator` (modelled),in call to `folly::f14::detail::ValueContainerIterator::operator=` (modelled),in call to `folly::f14::detail::ValueContainerIterator::operator->` (modelled),invalid access occurs here] codetoanalyze/cpp/pulse/reference_stability.cpp, reserve_operator_bracket_ok_FP, 4, PULSE_REFERENCE_STABILITY, no_bucket, ERROR, [invalidation part of the trace starts here,in call to `folly::F14FastMap::operator[]` (modelled),was potentially invalidated by `folly::F14FastMap::operator[]`,use-after-lifetime part of the trace starts here,in call to `folly::F14FastMap::operator[]` (modelled),in call to `folly::F14FastMap::at` (modelled),assigned,invalid access occurs here] -codetoanalyze/cpp/pulse/reference_stability.cpp, use_emplace_iterator_bad, 5, PULSE_REFERENCE_STABILITY, no_bucket, ERROR, [invalidation part of the trace starts here,parameter `map` of use_emplace_iterator_bad,was potentially invalidated by `folly::F14FastMap::clear`,use-after-lifetime part of the trace starts here,in call to `folly::F14FastMap::emplace` (modelled),in call to `std::pair*>,_Bool>::pair`,parameter `__param_0` of std::pair*>,_Bool>::pair,in call to `folly::f14::detail::ValueContainerIterator::ValueContainerIterator` (modelled),return from call to `std::pair*>,_Bool>::pair`,in call to `folly::f14::detail::ValueContainerIterator::ValueContainerIterator` (modelled),in call to `folly::f14::detail::ValueContainerIterator::operator->` (modelled),invalid access occurs here] +codetoanalyze/cpp/pulse/reference_stability.cpp, use_emplace_iterator_bad, 5, PULSE_REFERENCE_STABILITY, no_bucket, ERROR, [invalidation part of the trace starts here,parameter `map` of use_emplace_iterator_bad,was potentially invalidated by `folly::F14FastMap::clear`,use-after-lifetime part of the trace starts here,in call to `folly::F14FastMap::emplace` (modelled),in call to `std::pair*>,_Bool>::pair`,macro expanded here,parameter `__param_0` of std::pair*>,_Bool>::pair,in call to `folly::f14::detail::ValueContainerIterator::ValueContainerIterator` (modelled),return from call to `std::pair*>,_Bool>::pair`,in call to `folly::f14::detail::ValueContainerIterator::ValueContainerIterator` (modelled),in call to `folly::f14::detail::ValueContainerIterator::operator->` (modelled),invalid access occurs here] codetoanalyze/cpp/pulse/reference_wrapper.cpp, reference_wrapper_heap_bad, 2, USE_AFTER_DELETE, no_bucket, ERROR, [invalidation part of the trace starts here,when calling `getwrapperHeap` here,in call to `WrapsB::WrapsB`,allocated by call to `new` (modelled),assigned,return from call to `WrapsB::WrapsB`,when calling `WrapsB::~WrapsB` here,parameter `this` of WrapsB::~WrapsB,when calling `WrapsB::__infer_inner_destructor_~WrapsB` here,parameter `this` of WrapsB::__infer_inner_destructor_~WrapsB,was invalidated by `delete`,use-after-lifetime part of the trace starts here,in call to `getwrapperHeap`,in call to `WrapsB::WrapsB`,allocated by call to `new` (modelled),assigned,return from call to `WrapsB::WrapsB`,in call to `ReferenceWrapperHeap::ReferenceWrapperHeap`,parameter `a` of ReferenceWrapperHeap::ReferenceWrapperHeap,in call to `WrapsB::getb`,parameter `this` of WrapsB::getb,returned,return from call to `WrapsB::getb`,assigned,return from call to `ReferenceWrapperHeap::ReferenceWrapperHeap`,in call to `ReferenceWrapperHeap::ReferenceWrapperHeap`,parameter `__param_0` of ReferenceWrapperHeap::ReferenceWrapperHeap,assigned,return from call to `ReferenceWrapperHeap::ReferenceWrapperHeap`,return from call to `getwrapperHeap`,in call to `ReferenceWrapperHeap::ReferenceWrapperHeap`,parameter `__param_0` of ReferenceWrapperHeap::ReferenceWrapperHeap,assigned,return from call to `ReferenceWrapperHeap::ReferenceWrapperHeap`,invalid access occurs here] codetoanalyze/cpp/pulse/reference_wrapper.cpp, reference_wrapper_stack_bad, 2, USE_AFTER_LIFETIME, no_bucket, ERROR, [invalidation part of the trace starts here,variable `C++ temporary` declared here,when calling `getwrapperStack` here,variable `b` declared here,is the address of a stack variable `b` whose lifetime has ended,use-after-lifetime part of the trace starts here,variable `C++ temporary` declared here,in call to `getwrapperStack`,variable `b` declared here,in call to `ReferenceWrapperStack::ReferenceWrapperStack`,parameter `bref` of ReferenceWrapperStack::ReferenceWrapperStack,assigned,return from call to `ReferenceWrapperStack::ReferenceWrapperStack`,in call to `ReferenceWrapperStack::ReferenceWrapperStack`,parameter `__param_0` of ReferenceWrapperStack::ReferenceWrapperStack,assigned,return from call to `ReferenceWrapperStack::ReferenceWrapperStack`,return from call to `getwrapperStack`,in call to `ReferenceWrapperStack::ReferenceWrapperStack`,parameter `__param_0` of ReferenceWrapperStack::ReferenceWrapperStack,assigned,return from call to `ReferenceWrapperStack::ReferenceWrapperStack`,invalid access occurs here] codetoanalyze/cpp/pulse/returns.cpp, returns::return_literal_stack_reference_bad, 0, STACK_VARIABLE_ADDRESS_ESCAPE, no_bucket, ERROR, [variable `C++ temporary` declared here,returned here] @@ -291,7 +291,7 @@ codetoanalyze/cpp/pulse/taint/basics.cpp, basics::string_source_bad, 0, PULSE_CO codetoanalyze/cpp/pulse/taint/basics.cpp, basics::string_source_bad, 2, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `basics::Obj::string_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#1` to `basics::Obj::string_sink` with kind `SimpleSink`], source: basics::Obj::string_source, sink: basics::Obj::string_sink, tainted expression: UNKNOWN codetoanalyze/cpp/pulse/taint/basics.cpp, basics::string_source_bad, 2, PULSE_UNNECESSARY_COPY_INTERMEDIATE, no_bucket, ERROR, [copied here (with type `std::basic_string,std::allocator>&`)] codetoanalyze/cpp/pulse/taint/basics.cpp, basics::getenv_source_bad, 0, PULSE_CONST_REFABLE, no_bucket, ERROR, [Parameter obj with type `basics::Obj`] -codetoanalyze/cpp/pulse/taint/basics.cpp, basics::getenv_source_bad, 2, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `getenv` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#1` to `basics::Obj::string_sink` with kind `SimpleSink`], source: getenv, sink: basics::Obj::string_sink, tainted expression: UNKNOWN +codetoanalyze/cpp/pulse/taint/basics.cpp, basics::getenv_source_bad, 2, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `getenv` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::basic_string<0>` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#1` to `basics::Obj::string_sink` with kind `SimpleSink`], source: getenv, sink: basics::Obj::string_sink, tainted expression: UNKNOWN codetoanalyze/cpp/pulse/taint/basics.cpp, basics::getenv_source_bad, 2, PULSE_UNNECESSARY_COPY_INTERMEDIATE, no_bucket, ERROR, [copied here (with type `std::basic_string,std::allocator>&`)] codetoanalyze/cpp/pulse/taint/basics.cpp, basics::via_field_bad1, 2, PULSE_UNNECESSARY_COPY_ASSIGNMENT, no_bucket, ERROR, [copy assigned here (with type `std::basic_string,std::allocator>&`)] codetoanalyze/cpp/pulse/taint/basics.cpp, basics::via_field_bad1, 3, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `basics::template_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::operator=` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `basics::template_sink` with kind `SimpleSink`], source: basics::template_source, sink: basics::template_sink, tainted expression: UNKNOWN @@ -333,14 +333,14 @@ codetoanalyze/cpp/pulse/taint/pointers.cpp, pointers::funptr_helper_bad1[special codetoanalyze/cpp/pulse/taint/pointers.cpp, pointers::funptr_helper_bad2[specialized with functions], 1, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN codetoanalyze/cpp/pulse/taint/pointers.cpp, pointers::funptr_helper_bad2[specialized with functions], 1, PULSE_UNNECESSARY_COPY_INTERMEDIATE, no_bucket, ERROR, [copied here (with type `std::basic_string,std::allocator>&`)] codetoanalyze/cpp/pulse/taint/pointers.cpp, pointers::funptr_helper_bad2, 1, PULSE_UNNECESSARY_COPY_INTERMEDIATE, no_bucket, ERROR, [copied here (with type `std::basic_string,std::allocator>&`)] -codetoanalyze/cpp/pulse/taint/strings.cpp, strings::sprintf1_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `sprintf` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN -codetoanalyze/cpp/pulse/taint/strings.cpp, strings::sprintf2_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `sprintf` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN -codetoanalyze/cpp/pulse/taint/strings.cpp, strings::strcpy1_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `strcpy` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN -codetoanalyze/cpp/pulse/taint/strings.cpp, strings::strcpy2_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `strcpy` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN -codetoanalyze/cpp/pulse/taint/strings.cpp, strings::strncpy_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `strncpy` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN -codetoanalyze/cpp/pulse/taint/strings.cpp, strings::memcpy_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `memcpy` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN -codetoanalyze/cpp/pulse/taint/strings.cpp, strings::memmove_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `memmove` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN -codetoanalyze/cpp/pulse/taint/strings.cpp, strings::memchr_bad, 3, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `memchr` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN +codetoanalyze/cpp/pulse/taint/strings.cpp, strings::sprintf1_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `sprintf` with no summary,in call to function `std::basic_string,std::allocator>::basic_string<0>` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN +codetoanalyze/cpp/pulse/taint/strings.cpp, strings::sprintf2_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `sprintf` with no summary,in call to function `std::basic_string,std::allocator>::basic_string<0>` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN +codetoanalyze/cpp/pulse/taint/strings.cpp, strings::strcpy1_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `strcpy` with no summary,in call to function `std::basic_string,std::allocator>::basic_string<0>` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN +codetoanalyze/cpp/pulse/taint/strings.cpp, strings::strcpy2_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `strcpy` with no summary,in call to function `std::basic_string,std::allocator>::basic_string<0>` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN +codetoanalyze/cpp/pulse/taint/strings.cpp, strings::strncpy_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `strncpy` with no summary,in call to function `std::basic_string,std::allocator>::basic_string<0>` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN +codetoanalyze/cpp/pulse/taint/strings.cpp, strings::memcpy_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `memcpy` with no summary,in call to function `std::basic_string,std::allocator>::basic_string<0>` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN +codetoanalyze/cpp/pulse/taint/strings.cpp, strings::memmove_bad, 4, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `memmove` with no summary,in call to function `std::basic_string,std::allocator>::basic_string<0>` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN +codetoanalyze/cpp/pulse/taint/strings.cpp, strings::memchr_bad, 3, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::c_str` with no summary,in call to function `memchr` with no summary,in call to function `std::basic_string,std::allocator>::basic_string<0>` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN codetoanalyze/cpp/pulse/taint/strings.cpp, strings::constructor1_bad, 2, PULSE_UNNECESSARY_COPY_INTERMEDIATE, no_bucket, ERROR, [copied here (with type `std::basic_string,std::allocator>&`)] codetoanalyze/cpp/pulse/taint/strings.cpp, strings::constructor1_bad, 3, TAINT_ERROR, no_bucket, ERROR, [source of the taint here: value returned from `__infer_taint_source` with kind `SimpleSource`,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,in call to function `std::basic_string,std::allocator>::basic_string` with no summary,value passed as argument `#0` to `__infer_taint_sink` with kind `SimpleSink`], source: __infer_taint_source, sink: __infer_taint_sink, tainted expression: UNKNOWN codetoanalyze/cpp/pulse/taint/strings.cpp, strings::constructor1_bad, 3, PULSE_UNNECESSARY_COPY_INTERMEDIATE, no_bucket, ERROR, [copied here (with type `std::basic_string,std::allocator>&`)] diff --git a/infer/tests/codetoanalyze/cpp/shared/methods/byvals.cpp.dot b/infer/tests/codetoanalyze/cpp/shared/methods/byvals.cpp.dot index 57c35a5ff31..f6cba3fc110 100644 --- a/infer/tests/codetoanalyze/cpp/shared/methods/byvals.cpp.dot +++ b/infer/tests/codetoanalyze/cpp/shared/methods/byvals.cpp.dot @@ -71,36 +71,36 @@ digraph cfg { "dummy_struct#__infer_globals_init.24fe54080733cebf_3" -> "dummy_struct#__infer_globals_init.24fe54080733cebf_2" ; -"forward#std#5520452782429131.94f0e2c56e637def_1" [label="1: Start std::forward\nFormals: __t:int&\nLocals: \n " color=yellow style=filled] +"forward#std#8693326300642836.123ab85b9ace3e5e_1" [label="1: Start std::forward\nFormals: __t:int&\nLocals: \n " color=yellow style=filled] - "forward#std#5520452782429131.94f0e2c56e637def_1" -> "forward#std#5520452782429131.94f0e2c56e637def_3" ; -"forward#std#5520452782429131.94f0e2c56e637def_2" [label="2: Exit std::forward \n " color=yellow style=filled] + "forward#std#8693326300642836.123ab85b9ace3e5e_1" -> "forward#std#8693326300642836.123ab85b9ace3e5e_3" ; +"forward#std#8693326300642836.123ab85b9ace3e5e_2" [label="2: Exit std::forward \n " color=yellow style=filled] -"forward#std#5520452782429131.94f0e2c56e637def_3" [label="3: Return Stmt \n n$0=*&__t:int& [line 26, column 29]\n " shape="box"] +"forward#std#8693326300642836.123ab85b9ace3e5e_3" [label="3: Return Stmt \n n$0=*&__t:int& [line 26, column 29]\n " shape="box"] - "forward#std#5520452782429131.94f0e2c56e637def_3" -> "forward#std#5520452782429131.94f0e2c56e637def_4" ; -"forward#std#5520452782429131.94f0e2c56e637def_4" [label="4: Return Stmt \n *&return:int&&=(int&&)n$0 [line 26, column 3]\n " shape="box"] + "forward#std#8693326300642836.123ab85b9ace3e5e_3" -> "forward#std#8693326300642836.123ab85b9ace3e5e_4" ; +"forward#std#8693326300642836.123ab85b9ace3e5e_4" [label="4: Return Stmt \n *&return:int&&=(int&&)n$0 [line 26, column 3]\n " shape="box"] - "forward#std#5520452782429131.94f0e2c56e637def_4" -> "forward#std#5520452782429131.94f0e2c56e637def_2" ; -"forward#std#15235227492553.0bbcb2f82ac71e34_1" [label="1: Start std::forward\nFormals: __t:int&\nLocals: \n " color=yellow style=filled] + "forward#std#8693326300642836.123ab85b9ace3e5e_4" -> "forward#std#8693326300642836.123ab85b9ace3e5e_2" ; +"forward#std#32881243201550.4d44031ae211ec0d_1" [label="1: Start std::forward\nFormals: __t:int&\nLocals: \n " color=yellow style=filled] - "forward#std#15235227492553.0bbcb2f82ac71e34_1" -> "forward#std#15235227492553.0bbcb2f82ac71e34_3" ; -"forward#std#15235227492553.0bbcb2f82ac71e34_2" [label="2: Exit std::forward \n " color=yellow style=filled] + "forward#std#32881243201550.4d44031ae211ec0d_1" -> "forward#std#32881243201550.4d44031ae211ec0d_3" ; +"forward#std#32881243201550.4d44031ae211ec0d_2" [label="2: Exit std::forward \n " color=yellow style=filled] -"forward#std#15235227492553.0bbcb2f82ac71e34_3" [label="3: Return Stmt \n n$0=*&__t:int& [line 26, column 29]\n " shape="box"] +"forward#std#32881243201550.4d44031ae211ec0d_3" [label="3: Return Stmt \n n$0=*&__t:int& [line 26, column 29]\n " shape="box"] - "forward#std#15235227492553.0bbcb2f82ac71e34_3" -> "forward#std#15235227492553.0bbcb2f82ac71e34_4" ; -"forward#std#15235227492553.0bbcb2f82ac71e34_4" [label="4: Return Stmt \n *&return:int&=n$0 [line 26, column 3]\n " shape="box"] + "forward#std#32881243201550.4d44031ae211ec0d_3" -> "forward#std#32881243201550.4d44031ae211ec0d_4" ; +"forward#std#32881243201550.4d44031ae211ec0d_4" [label="4: Return Stmt \n *&return:int&=n$0 [line 26, column 3]\n " shape="box"] - "forward#std#15235227492553.0bbcb2f82ac71e34_4" -> "forward#std#15235227492553.0bbcb2f82ac71e34_2" ; + "forward#std#32881243201550.4d44031ae211ec0d_4" -> "forward#std#32881243201550.4d44031ae211ec0d_2" ; "make_id#p.704a07df7f1fd491_1" [label="1: Start pass_by_val::make_id\nFormals: args:int& args:int& args:int&& __return_param:pass_by_val::Id*\nLocals: 0$?%__sil_tmpSIL_materialize_temp__n$1:pass_by_val::Id \n " color=yellow style=filled]