diff --git a/.github/workflows/compile-queries.yml b/.github/workflows/compile-queries.yml index 292ae3b8b230..38452f97d36b 100644 --- a/.github/workflows/compile-queries.yml +++ b/.github/workflows/compile-queries.yml @@ -29,8 +29,6 @@ jobs: key: all-queries - name: check formatting run: find shared */ql -type f \( -name "*.qll" -o -name "*.ql" \) -print0 | xargs -0 -n 3000 -P 10 codeql query format -q --check-only - - name: Omit DatabaseQualityDiagnostics.ql from compile checking # Remove me once CodeQL 2.18.0 is released! - run: mv java/ql/src/Telemetry/DatabaseQualityDiagnostics.ql{,.hidden} - name: compile queries - check-only # run with --check-only if running in a PR (github.sha != main) if : ${{ github.event_name == 'pull_request' }} @@ -41,6 +39,3 @@ jobs: if : ${{ github.event_name != 'pull_request' }} shell: bash run: codeql query compile -q -j0 */ql/{src,examples} --keep-going --warnings=error --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}" --compilation-cache-size=500 - - name: Restore DatabaseQualityDiagnostics.ql after compile checking # Remove me once CodeQL 2.18.0 is released - run: mv java/ql/src/Telemetry/DatabaseQualityDiagnostics.ql{.hidden,} - diff --git a/cpp/downgrades/3d35dd6b50edfc540c14c6757e0c7b3c5b7b04dd/exprs.ql b/cpp/downgrades/3d35dd6b50edfc540c14c6757e0c7b3c5b7b04dd/exprs.ql new file mode 100644 index 000000000000..d1b8af0b6664 --- /dev/null +++ b/cpp/downgrades/3d35dd6b50edfc540c14c6757e0c7b3c5b7b04dd/exprs.ql @@ -0,0 +1,17 @@ +class Expr extends @expr { + string toString() { none() } +} + +class Location extends @location_expr { + string toString() { none() } +} + +predicate isExprWithNewBuiltin(Expr expr) { + exists(int kind | exprs(expr, kind, _) | 364 <= kind and kind <= 384) +} + +from Expr expr, int kind, int kind_new, Location location +where + exprs(expr, kind, location) and + if isExprWithNewBuiltin(expr) then kind_new = 1 else kind_new = kind +select expr, kind_new, location diff --git a/cpp/downgrades/3d35dd6b50edfc540c14c6757e0c7b3c5b7b04dd/old.dbscheme b/cpp/downgrades/3d35dd6b50edfc540c14c6757e0c7b3c5b7b04dd/old.dbscheme new file mode 100644 index 000000000000..3d35dd6b50ed --- /dev/null +++ b/cpp/downgrades/3d35dd6b50edfc540c14c6757e0c7b3c5b7b04dd/old.dbscheme @@ -0,0 +1,2289 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int ref +); + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref, + int handle: @variable ref, + int promise: @variable ref +); + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @functionorblock ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator. For example: + * ``` + * int a; + * decltype(1+a) b; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * would change the semantics of this decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @usertype.kind of + 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +| 5 = @typedef // classic C: typedef typedef type name +| 6 = @template +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +| 14 = @using_alias // a using name = type style typedef +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +is_proxy_class_for( + unique int id: @usertype ref, + unique int templ_param_id: @usertype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +/* + Fixed point types + precision(1) = short, precision(2) = default, precision(3) = long + is_unsigned(1) = unsigned is_unsigned(2) = signed + is_fract_type(1) = declared with _Fract + saturating(1) = declared with _Sat +*/ +/* TODO +fixedpointtypes( + unique int id: @fixedpointtype, + int precision: int ref, + int is_unsigned: int ref, + int is_fract_type: int ref, + int saturating: int ref); +*/ + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + /* TODO | @fixedpointtype */ + | @routinetype + | @ptrtomember + | @decltype; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 3 = size_and_alignment + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + ; + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@runtime_sizeof_or_alignof = @runtime_sizeof | @runtime_alignof; + +sizeof_bind( + unique int expr: @runtime_sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@functionorblock = @function | @stmt_block; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @functionorblock ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target ref +); + +/* XML Files */ + +xmlEncoding(unique int id: @file ref, string encoding: string ref); + +xmlDTDs( + unique int id: @xmldtd, + string root: string ref, + string publicId: string ref, + string systemId: string ref, + int fileid: @file ref +); + +xmlElements( + unique int id: @xmlelement, + string name: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int fileid: @file ref +); + +xmlAttrs( + unique int id: @xmlattribute, + int elementid: @xmlelement ref, + string name: string ref, + string value: string ref, + int idx: int ref, + int fileid: @file ref +); + +xmlNs( + int id: @xmlnamespace, + string prefixName: string ref, + string URI: string ref, + int fileid: @file ref +); + +xmlHasNs( + int elementId: @xmlnamespaceable ref, + int nsId: @xmlnamespace ref, + int fileid: @file ref +); + +xmlComments( + unique int id: @xmlcomment, + string text: string ref, + int parentid: @xmlparent ref, + int fileid: @file ref +); + +xmlChars( + unique int id: @xmlcharacters, + string text: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int isCDATA: int ref, + int fileid: @file ref +); + +@xmlparent = @file | @xmlelement; +@xmlnamespaceable = @xmlelement | @xmlattribute; + +xmllocations( + int xmlElement: @xmllocatable ref, + int location: @location_default ref +); + +@xmllocatable = @xmlcharacters + | @xmlelement + | @xmlcomment + | @xmlattribute + | @xmldtd + | @file + | @xmlnamespace; diff --git a/cpp/downgrades/3d35dd6b50edfc540c14c6757e0c7b3c5b7b04dd/semmlecode.cpp.dbscheme b/cpp/downgrades/3d35dd6b50edfc540c14c6757e0c7b3c5b7b04dd/semmlecode.cpp.dbscheme new file mode 100644 index 000000000000..abfce5c170f9 --- /dev/null +++ b/cpp/downgrades/3d35dd6b50edfc540c14c6757e0c7b3c5b7b04dd/semmlecode.cpp.dbscheme @@ -0,0 +1,2251 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int ref +); + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref, + int handle: @variable ref, + int promise: @variable ref +); + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @functionorblock ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator. For example: + * ``` + * int a; + * decltype(1+a) b; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * would change the semantics of this decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @usertype.kind of + 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +| 5 = @typedef // classic C: typedef typedef type name +| 6 = @template +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +| 14 = @using_alias // a using name = type style typedef +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +is_proxy_class_for( + unique int id: @usertype ref, + unique int templ_param_id: @usertype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +/* + Fixed point types + precision(1) = short, precision(2) = default, precision(3) = long + is_unsigned(1) = unsigned is_unsigned(2) = signed + is_fract_type(1) = declared with _Fract + saturating(1) = declared with _Sat +*/ +/* TODO +fixedpointtypes( + unique int id: @fixedpointtype, + int precision: int ref, + int is_unsigned: int ref, + int is_fract_type: int ref, + int saturating: int ref); +*/ + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + /* TODO | @fixedpointtype */ + | @routinetype + | @ptrtomember + | @decltype; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 3 = size_and_alignment + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + ; + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@runtime_sizeof_or_alignof = @runtime_sizeof | @runtime_alignof; + +sizeof_bind( + unique int expr: @runtime_sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@functionorblock = @function | @stmt_block; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @functionorblock ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target ref +); + +/* XML Files */ + +xmlEncoding(unique int id: @file ref, string encoding: string ref); + +xmlDTDs( + unique int id: @xmldtd, + string root: string ref, + string publicId: string ref, + string systemId: string ref, + int fileid: @file ref +); + +xmlElements( + unique int id: @xmlelement, + string name: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int fileid: @file ref +); + +xmlAttrs( + unique int id: @xmlattribute, + int elementid: @xmlelement ref, + string name: string ref, + string value: string ref, + int idx: int ref, + int fileid: @file ref +); + +xmlNs( + int id: @xmlnamespace, + string prefixName: string ref, + string URI: string ref, + int fileid: @file ref +); + +xmlHasNs( + int elementId: @xmlnamespaceable ref, + int nsId: @xmlnamespace ref, + int fileid: @file ref +); + +xmlComments( + unique int id: @xmlcomment, + string text: string ref, + int parentid: @xmlparent ref, + int fileid: @file ref +); + +xmlChars( + unique int id: @xmlcharacters, + string text: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int isCDATA: int ref, + int fileid: @file ref +); + +@xmlparent = @file | @xmlelement; +@xmlnamespaceable = @xmlelement | @xmlattribute; + +xmllocations( + int xmlElement: @xmllocatable ref, + int location: @location_default ref +); + +@xmllocatable = @xmlcharacters + | @xmlelement + | @xmlcomment + | @xmlattribute + | @xmldtd + | @file + | @xmlnamespace; diff --git a/cpp/downgrades/3d35dd6b50edfc540c14c6757e0c7b3c5b7b04dd/upgrade.properties b/cpp/downgrades/3d35dd6b50edfc540c14c6757e0c7b3c5b7b04dd/upgrade.properties new file mode 100644 index 000000000000..d697a16a42fd --- /dev/null +++ b/cpp/downgrades/3d35dd6b50edfc540c14c6757e0c7b3c5b7b04dd/upgrade.properties @@ -0,0 +1,3 @@ +description: Add new builtin operations +compatibility: partial +exprs.rel: run exprs.qlo diff --git a/cpp/ql/lib/change-notes/2024-07-11-additional-builtin-support.md b/cpp/ql/lib/change-notes/2024-07-11-additional-builtin-support.md new file mode 100644 index 000000000000..f389283ad1e1 --- /dev/null +++ b/cpp/ql/lib/change-notes/2024-07-11-additional-builtin-support.md @@ -0,0 +1,4 @@ +--- +category: feature +--- +* Added subclasses of `BuiltInOperations` for `__builtin_has_attribute`, `__builtin_is_corresponding_member`, `__builtin_is_pointer_interconvertible_with_class`, `__is_assignable_no_precondition_check`, `__is_bounded_array`, `__is_convertible`, `__is_corresponding_member`, `__is_nothrow_convertible`, `__is_pointer_interconvertible_with_class`, `__is_referenceable`, `__is_same_as`, `__is_trivially_copy_assignable`, `__is_unbounded_array`, `__is_valid_winrt_type`, `_is_win_class`, `__is_win_interface`, `__reference_binds_to_temporary`, `__reference_constructs_from_temporary`, and `__reference_converts_from_temporary`. diff --git a/cpp/ql/lib/semmle/code/cpp/exprs/BuiltInOperations.qll b/cpp/ql/lib/semmle/code/cpp/exprs/BuiltInOperations.qll index ba924d58da5b..dcf72604ca92 100644 --- a/cpp/ql/lib/semmle/code/cpp/exprs/BuiltInOperations.qll +++ b/cpp/ql/lib/semmle/code/cpp/exprs/BuiltInOperations.qll @@ -383,6 +383,37 @@ class BuiltInOperationIsConvertibleTo extends BuiltInOperation, @isconvtoexpr { override string getAPrimaryQlClass() { result = "BuiltInOperationIsConvertibleTo" } } +/** + * A C++ `__is_convertible` built-in operation (used by some implementations + * of the `` header). + * + * Returns `true` if the first type can be converted to the second type. + * ``` + * bool v = __is_convertible(MyType, OtherType); + * ``` + */ +class BuiltInOperationIsConvertible extends BuiltInOperation, @isconvertible { + override string toString() { result = "__is_convertible" } + + override string getAPrimaryQlClass() { result = "BuiltInOperationIsConvertible" } +} + +/** + * A C++ `__is_nothrow_convertible` built-in operation (used by some implementations + * of the `` header). + * + * Returns `true` if the first type can be converted to the second type and the + * conversion operator has an empty exception specification. + * ``` + * bool v = __is_nothrow_convertible(MyType, OtherType); + * ``` + */ +class BuiltInOperationIsNothrowConvertible extends BuiltInOperation, @isnothrowconvertible { + override string toString() { result = "__is_nothrow_convertible" } + + override string getAPrimaryQlClass() { result = "BuiltInOperationIsNothrowConvertible" } +} + /** * A C++ `__is_empty` built-in operation (used by some implementations of the * `` header). @@ -647,8 +678,7 @@ class BuiltInOperationIsTriviallyAssignable extends BuiltInOperation, @istrivial * The `__is_nothrow_assignable` built-in operation (used by some * implementations of the `` header). * - * Returns true if there exists a `C::operator =(const D& d) nothrow` - * assignment operator (i.e, with an empty exception specification). + * Returns true if there exists an assignment operator with an empty exception specification. * ``` * bool v = __is_nothrow_assignable(MyType1, MyType2); * ``` @@ -663,8 +693,7 @@ class BuiltInOperationIsNothrowAssignable extends BuiltInOperation, @isnothrowas * The `__is_assignable` built-in operation (used by some implementations * of the `` header). * - * Returns true if there exists a `C::operator =(const D& d)` assignment - * operator. + * Returns true if there exists an assignment operator. * ``` * bool v = __is_assignable(MyType1, MyType2); * ``` @@ -675,6 +704,25 @@ class BuiltInOperationIsAssignable extends BuiltInOperation, @isassignable { override string getAPrimaryQlClass() { result = "BuiltInOperationIsAssignable" } } +/** + * The `__is_assignable_no_precondition_check` built-in operation (used by some + * implementations of the `` header). + * + * Returns true if there exists an assignment operator. + * ``` + * bool v = __is_assignable_no_precondition_check(MyType1, MyType2); + * ``` + */ +class BuiltInOperationIsAssignableNoPreconditionCheck extends BuiltInOperation, + @isassignablenopreconditioncheck +{ + override string toString() { result = "__is_assignable_no_precondition_check" } + + override string getAPrimaryQlClass() { + result = "BuiltInOperationIsAssignableNoPreconditionCheck" + } +} + /** * The `__is_standard_layout` built-in operation (used by some implementations * of the `` header). @@ -708,6 +756,20 @@ class BuiltInOperationIsTriviallyCopyable extends BuiltInOperation, @istrivially override string getAPrimaryQlClass() { result = "BuiltInOperationIsTriviallyCopyable" } } +/** + * The `__is_trivially_copy_assignable` built-in operation (used by some + * implementations of the `` header). + * + * Returns `true` if instances of this type can be copied using a trivial + * copy operator. + */ +class BuiltInOperationIsTriviallyCopyAssignable extends BuiltInOperation, @istriviallycopyassignable +{ + override string toString() { result = "__is_trivially_copy_assignable" } + + override string getAPrimaryQlClass() { result = "BuiltInOperationIsTriviallyCopyAssignable" } +} + /** * The `__is_literal_type` built-in operation (used by some implementations of * the `` header). @@ -1062,6 +1124,24 @@ class BuiltInOperationIsSame extends BuiltInOperation, @issame { override string getAPrimaryQlClass() { result = "BuiltInOperationIsSame" } } +/** + * A C++ `__is_same_as` built-in operation (used by some implementations of the + * `` header). + * + * Returns `true` if two types are the same. + * ``` + * template + * struct is_same + * : public integral_constant + * { }; + * ``` + */ +class BuiltInOperationIsSameAs extends BuiltInOperation, @issameas { + override string toString() { result = "__is_same_as" } + + override string getAPrimaryQlClass() { result = "BuiltInOperationIsSameAs" } +} + /** * A C++ `__is_function` built-in operation (used by some implementations of the * `` header). @@ -1120,6 +1200,87 @@ class BuiltInOperationIsPointerInterconvertibleBaseOf extends BuiltInOperation, } } +/** + * A C++ `__is_pointer_interconvertible_with_class` built-in operation (used + * by some implementations of the `` header). + * + * Returns `true` if a member pointer is pointer-interconvertible with a + * class type. + * ``` + * template + * constexpr bool is_pointer_interconvertible_with_class(_Up _Tp::*mp) noexcept + * = __is_pointer_interconvertible_with_class(_Tp, mp); + * ``` + */ +class BuiltInOperationIsPointerInterconvertibleWithClass extends BuiltInOperation, + @ispointerinterconvertiblewithclass +{ + override string toString() { result = "__is_pointer_interconvertible_with_class" } + + override string getAPrimaryQlClass() { + result = "BuiltInOperationIsPointerInterconvertibleWithClass" + } +} + +/** + * A C++ `__builtin_is_pointer_interconvertible_with_class` built-in operation (used + * by some implementations of the `` header). + * + * Returns `true` if a member pointer is pointer-interconvertible with a class type. + * ``` + * template + * constexpr bool is_pointer_interconvertible_with_class(_Up _Tp::*mp) noexcept + * = __builtin_is_pointer_interconvertible_with_class(mp); + * ``` + */ +class BuiltInOperationBuiltInIsPointerInterconvertible extends BuiltInOperation, + @builtinispointerinterconvertiblewithclass +{ + override string toString() { result = "__builtin_is_pointer_interconvertible_with_class" } + + override string getAPrimaryQlClass() { + result = "BuiltInOperationBuiltInIsPointerInterconvertible" + } +} + +/** + * A C++ `__is_corresponding_member` built-in operation (used + * by some implementations of the `` header). + * + * Returns `true` if two member pointers refer to corresponding + * members in the initial sequences of two class types. + * ``` + * template + * constexpr bool is_corresponding_member(_Up1 _Tp1::*mp1, _Up2 _Tp2::*mp2 ) noexcept + * = __is_corresponding_member(_Tp1, _Tp2, mp1, mp2); + * ``` + */ +class BuiltInOperationIsCorrespondingMember extends BuiltInOperation, @iscorrespondingmember { + override string toString() { result = "__is_corresponding_member" } + + override string getAPrimaryQlClass() { result = "BuiltInOperationIsCorrespondingMember" } +} + +/** + * A C++ `__builtin_is_corresponding_member` built-in operation (used + * by some implementations of the `` header). + * + * Returns `true` if two member pointers refer to corresponding + * members in the initial sequences of two class types. + * ``` + * template + * constexpr bool is_corresponding_member(_Up1 _Tp1::*mp1, _Up2 _Tp2::*mp2 ) noexcept + * = __builtin_is_corresponding_member(mp1, mp2); + * ``` + */ +class BuiltInOperationBuiltInIsCorrespondingMember extends BuiltInOperation, + @builtiniscorrespondingmember +{ + override string toString() { result = "__builtin_is_corresponding_member" } + + override string getAPrimaryQlClass() { result = "BuiltInOperationBuiltInIsCorrespondingMember" } +} + /** * A C++ `__is_array` built-in operation (used by some implementations of the * `` header). @@ -1138,6 +1299,42 @@ class BuiltInOperationIsArray extends BuiltInOperation, @isarray { override string getAPrimaryQlClass() { result = "BuiltInOperationIsArray" } } +/** + * A C++ `__is_bounded_array` built-in operation (used by some implementations + * of the `` header). + * + * Returns `true` if a type is a bounded array type. + * ``` + * template + * struct is_bounded_array + * : public integral_constant + * { }; + * ``` + */ +class BuiltInOperationIsBoundedArray extends BuiltInOperation, @isboundedarray { + override string toString() { result = "__is_bounded_array" } + + override string getAPrimaryQlClass() { result = "BuiltInOperationIsBoundedArray" } +} + +/** + * A C++ `__is_unbounded_array` built-in operation (used by some implementations + * of the `` header). + * + * Returns `true` if a type is an unbounded array type. + * ``` + * template + * struct is_bounded_array + * : public integral_constant + * { }; + * ``` + */ +class BuiltInOperationIsUnboundedArray extends BuiltInOperation, @isunboundedarray { + override string toString() { result = "__is_unbounded_array" } + + override string getAPrimaryQlClass() { result = "BuiltInOperationIsUnboundedArray" } +} + /** * A C++ `__array_rank` built-in operation (used by some implementations of the * `` header). @@ -1554,10 +1751,10 @@ class BuiltInBitCast extends BuiltInOperation, @builtinbitcast { * * Returns `true` if a type is a trivial type. * ``` - * template - * struct is_trivial - * : public integral_constant - * {}; + * template + * struct is_trivial + * : public integral_constant + * {}; * ``` */ class BuiltInIsTrivial extends BuiltInOperation, @istrivialexpr { @@ -1565,3 +1762,126 @@ class BuiltInIsTrivial extends BuiltInOperation, @istrivialexpr { override string getAPrimaryQlClass() { result = "BuiltInIsTrivial" } } + +/** + * A C++ `__reference_constructs_from_temporary` built-in operation + * (used by some implementations of the `` header). + * + * Returns `true` if a reference type `_Tp` is bound to an expression of + * type `_Up` in direct-initialization, and a temporary object is bound. + * ``` + * template + * struct reference_constructs_from_temporary + * : public integral_constant + * {}; + * ``` + */ +class BuiltInOperationReferenceConstructsFromTemporary extends BuiltInOperation, + @referenceconstructsfromtemporary +{ + override string toString() { result = "__reference_constructs_from_temporary" } + + override string getAPrimaryQlClass() { + result = "BuiltInOperationReferenceConstructsFromTemporary" + } +} + +/** + * A C++ `__reference_converts_from_temporary` built-in operation + * (used by some implementations of the `` header). + * + * Returns `true` if a reference type `_Tp` is bound to an expression of + * type `_Up` in copy-initialization, and a temporary object is bound. + * ``` + * template + * struct reference_converts_from_temporary + * : public integral_constant + * {}; + * ``` + */ +class BuiltInOperationReferenceCovertsFromTemporary extends BuiltInOperation, + @referenceconvertsfromtemporary +{ + override string toString() { result = "__reference_converts_from_temporary" } + + override string getAPrimaryQlClass() { result = "BuiltInOperationReferenceCovertsFromTemporary" } +} + +/** + * A C++ `__reference_binds_to_temporary` built-in operation (used by some + * implementations of the `` header). + * + * Returns `true` if a reference of type `Type1` is bound to an expression of + * type `Type1`, and a temporary object is bound. + * ``` + * __reference_binds_to_temporary(Type1, Type2) + */ +class BuiltInOperationReferenceBindsToTemporary extends BuiltInOperation, @referencebindstotemporary +{ + override string toString() { result = "__reference_binds_to_temporary" } + + override string getAPrimaryQlClass() { result = "BuiltInOperationReferenceBindsToTemporary" } +} + +/** + * A C++ `__builtin_has_attribute` built-in operation. + * + * Returns `true` if a type or expression has been declared with the + * specified attribute. + * ``` + * __attribute__ ((aligned(8))) int v; + * bool has_attribute = __builtin_has_attribute(v, aligned); + * ``` + */ +class BuiltInOperationHasAttribute extends BuiltInOperation, @builtinhasattribute { + override string toString() { result = "__builtin_has_attribute" } + + override string getAPrimaryQlClass() { result = "BuiltInOperationHasAttribute" } +} + +/** + * A C++ `__is_referenceable` built-in operation. + * + * Returns `true` if a type can be referenced. + * ``` + * bool is_referenceable = __is_referenceable(int); + * ``` + */ +class BuiltInOperationIsReferenceable extends BuiltInOperation, @isreferenceable { + override string toString() { result = "__is_referenceable" } + + override string getAPrimaryQlClass() { result = "BuiltInOperationIsReferenceable" } +} + +/** + * The `__is_valid_winrt_type` built-in operation. This is a Microsoft extension. + * + * Returns `true` if the type is a valid WinRT type. + */ +class BuiltInOperationIsValidWinRtType extends BuiltInOperation, @isvalidwinrttype { + override string toString() { result = "__is_valid_winrt_type" } + + override string getAPrimaryQlClass() { result = "BuiltInOperationIsValidWinRtType" } +} + +/** + * The `__is_win_class` built-in operation. This is a Microsoft extension. + * + * Returns `true` if the class is a ref class. + */ +class BuiltInOperationIsWinClass extends BuiltInOperation, @iswinclass { + override string toString() { result = "__is_win_class" } + + override string getAPrimaryQlClass() { result = "BuiltInOperationIsWinClass" } +} + +/** + * The `__is_win_class` built-in operation. This is a Microsoft extension. + * + * Returns `true` if the class is an interface class. + */ +class BuiltInOperationIsWinInterface extends BuiltInOperation, @iswininterface { + override string toString() { result = "__is_win_interface" } + + override string getAPrimaryQlClass() { result = "BuiltInOperationIsWinInterface" } +} diff --git a/cpp/ql/lib/semmlecode.cpp.dbscheme b/cpp/ql/lib/semmlecode.cpp.dbscheme index abfce5c170f9..3d35dd6b50ed 100644 --- a/cpp/ql/lib/semmlecode.cpp.dbscheme +++ b/cpp/ql/lib/semmlecode.cpp.dbscheme @@ -1748,6 +1748,25 @@ case @expr.kind of | 361 = @isvoid | 362 = @isvolatile | 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface ; @var_args_expr = @vastartexpr @@ -1842,6 +1861,25 @@ case @expr.kind of | @isunsigned | @isvoid | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface ; new_allocated_type( diff --git a/cpp/ql/lib/semmlecode.cpp.dbscheme.stats b/cpp/ql/lib/semmlecode.cpp.dbscheme.stats index d6f973be1f64..fbb177927c72 100644 --- a/cpp/ql/lib/semmlecode.cpp.dbscheme.stats +++ b/cpp/ql/lib/semmlecode.cpp.dbscheme.stats @@ -2,7 +2,7 @@ @compilation - 9654 + 9651 @externalDataElement @@ -18,71 +18,71 @@ @location_default - 29787737 + 29785199 @location_stmt - 3820076 + 3820138 - @diagnostic - 5001 + @location_expr + 13188829 - @location_expr - 13188614 + @diagnostic + 4979 @file - 123139 + 123129 @folder - 16325 + 16323 @macro_expansion - 32959239 + 32951596 @other_macro_reference - 858248 + 858174 @function - 4646200 + 4645804 @fun_decl - 5010023 + 5009596 @var_decl - 8423424 + 8422707 @type_decl - 3242218 + 3280187 @namespace_decl - 311523 + 311514 @using - 369419 + 369388 @static_assert - 134652 + 134648 @parameter - 6576325 + 6575765 @membervariable - 1054750 + 1054767 @globalvariable @@ -90,11 +90,11 @@ @localvariable - 576895 + 576915 @enumconstant - 241682 + 241686 @errortype @@ -322,27 +322,27 @@ @pointer - 567656 + 567608 @type_with_specifiers - 1010307 + 1010221 @array - 110079 + 110070 @routineptr - 624503 + 624146 @reference - 1720495 + 1720096 @gnu_vector - 671 + 693 @routinereference @@ -350,7 +350,7 @@ @rvalue_reference - 620537 + 620183 @block @@ -358,43 +358,43 @@ @decltype - 27053 + 27051 @usertype - 5230182 + 5228803 @mangledname - 6448521 + 6447972 @type_mention - 4029338 + 4029404 @routinetype - 538026 + 537719 @ptrtomember - 37781 + 37778 @specifier - 24721 + 24719 @gnuattribute - 685665 + 686073 @stdattribute - 487639 + 476990 @declspec - 243121 + 243125 @msattribute @@ -402,15 +402,15 @@ @alignas - 9795 + 9794 @attribute_arg_token - 39180 + 39177 @attribute_arg_constant_expr - 370352 + 370787 @attribute_arg_empty @@ -430,35 +430,35 @@ @derivation - 390988 + 390765 @frienddecl - 706005 + 705602 @comment - 8682106 + 8267972 @namespace - 12127 + 12126 - @specialnamequalifyingelement - 466 + @namequalifier + 1508764 - @namequalifier - 1515301 + @specialnamequalifyingelement + 466 @value - 10777241 + 10777417 @initialiser - 1710223 + 1710171 @address_of @@ -466,15 +466,15 @@ @indirect - 292660 + 292665 @array_to_pointer - 1430911 + 1430934 @parexpr - 3587661 + 3587718 @arithnegexpr @@ -490,19 +490,19 @@ @notexpr - 276439 + 276443 @postincrexpr - 62048 + 62049 @postdecrexpr - 42037 + 42038 @preincrexpr - 70577 + 70578 @predecrexpr @@ -510,87 +510,87 @@ @conditionalexpr - 657271 + 657281 @addexpr - 398414 + 398421 @subexpr - 340775 + 340781 @mulexpr - 306372 + 306377 @divexpr - 133173 + 133175 @remexpr - 15618 + 15609 @paddexpr - 86666 + 86668 @psubexpr - 49902 + 49903 @pdiffexpr - 35178 + 33697 @lshiftexpr - 566331 + 566340 @rshiftexpr - 140847 + 140849 @andexpr - 489081 + 489088 @orexpr - 145472 + 145475 @xorexpr - 54177 + 54178 @eqexpr - 470674 + 470681 @neexpr - 301682 + 301687 @gtexpr - 104015 + 104007 @ltexpr - 101683 + 101675 @geexpr - 59252 + 59253 @leexpr - 212537 + 212540 @assignexpr - 937004 + 937019 @assignaddexpr @@ -602,7 +602,7 @@ @assignmulexpr - 8210 + 8209 @assigndivexpr @@ -610,7 +610,7 @@ @assignremexpr - 413 + 689 @assignlshiftexpr @@ -626,7 +626,7 @@ @assignorexpr - 23654 + 23626 @assignxorexpr @@ -642,23 +642,23 @@ @andlogicalexpr - 249965 + 249969 @orlogicalexpr - 866154 + 866168 @commaexpr - 122711 + 122868 @subscriptexpr - 364880 + 364458 @callexpr - 316245 + 316218 @vastartexpr @@ -678,27 +678,27 @@ @varaccess - 6029430 + 6029528 @runtime_sizeof - 295851 + 295856 @runtime_alignof - 49186 + 49158 @expr_stmt - 94392 + 94393 @routineexpr - 3150048 + 3176148 @type_operand - 1128813 + 1128831 @offsetofexpr @@ -706,11 +706,11 @@ @typescompexpr - 563806 + 563815 @literal - 4406917 + 4406923 @aggregateliteral @@ -718,27 +718,27 @@ @c_style_cast - 4210103 + 4210086 @temp_init - 795228 + 791807 @errorexpr - 46229 + 46203 @reference_to - 1569867 + 1568970 @ref_indirect - 1906417 + 1905327 @vacuous_destructor_call - 8035 + 8030 @assume @@ -794,35 +794,35 @@ @thisaccess - 1117561 + 1117527 @new_expr - 46995 + 46968 @delete_expr - 11618 + 11611 @throw_expr - 21053 + 21048 @condition_decl - 40753 + 40577 @braced_init_list - 1064 + 1060 @type_id - 35968 + 35947 @sizeof_pack - 5597 + 5596 @hasassignexpr @@ -866,7 +866,7 @@ @isabstractexpr - 19 + 18 @isbaseofexpr @@ -878,7 +878,7 @@ @isconvtoexpr - 206 + 197 @isemptyexpr @@ -886,7 +886,7 @@ @isenumexpr - 517 + 492 @ispodexpr @@ -910,7 +910,7 @@ @uuidof - 20293 + 20292 @delete_array_expr @@ -926,43 +926,43 @@ @ctordirectinit - 111383 + 111319 @ctorvirtualinit - 6320 + 6318 @ctorfieldinit - 198277 + 198163 @ctordelegatinginit - 3304 + 3302 @dtordirectdestruct - 41220 + 41197 @dtorvirtualdestruct - 4069 + 4067 @dtorfielddestruct - 41116 + 41092 @static_cast - 214369 + 214320 @reinterpret_cast - 30729 + 31628 @const_cast - 34971 + 34584 @dynamic_cast @@ -970,11 +970,11 @@ @lambdaexpr - 21456 + 21454 @param_ref - 235847 + 234832 @noopexpr @@ -982,7 +982,7 @@ @istriviallyconstructibleexpr - 1345 + 1280 @isdestructibleexpr @@ -994,7 +994,7 @@ @istriviallydestructibleexpr - 827 + 788 @istriviallyassignableexpr @@ -1002,7 +1002,7 @@ @isnothrowassignableexpr - 4138 + 3941 @istrivialexpr @@ -1038,7 +1038,7 @@ @isnothrowconstructibleexpr - 14278 + 13597 @hasfinalizerexpr @@ -1074,11 +1074,11 @@ @isfinalexpr - 1669 + 1668 @noexceptexpr - 24664 + 24558 @builtinshufflevector @@ -1090,7 +1090,7 @@ @builtinaddressof - 13114 + 13106 @vec_fill @@ -1110,11 +1110,11 @@ @co_await - 6 + 12 @co_yield - 1 + 4 @isassignable @@ -1250,67 +1250,143 @@ @reuseexpr - 333955 + 372471 + + + @istriviallycopyassignable + 2 + + + @isassignablenopreconditioncheck + 3 + + + @referencebindstotemporary + 2 + + + @issameas + 2 + + + @builtinhasattribute + 2 + + + @ispointerinterconvertiblewithclass + 2 + + + @builtinispointerinterconvertiblewithclass + 2 + + + @iscorrespondingmember + 2 + + + @builtiniscorrespondingmember + 2 + + + @isboundedarray + 2 + + + @isunboundedarray + 2 + + + @isreferenceable + 2 + + + @isnothrowconvertible + 2 + + + @referenceconstructsfromtemporary + 2 + + + @referenceconvertsfromtemporary + 2 + + + @isconvertible + 2 + + + @isvalidwinrttype + 1 + + + @iswinclass + 1 + + + @iswininterface + 1 @lambdacapture - 27986 + 27983 @stmt_expr - 1486099 + 1486124 @stmt_if - 725951 + 725963 @stmt_while - 29141 + 29134 @stmt_goto - 110696 + 110698 @stmt_label - 53144 + 53145 @stmt_return - 1285039 + 1284930 @stmt_block - 1424038 + 1423917 @stmt_end_test_while - 148881 + 148884 @stmt_for - 61559 + 61560 @stmt_switch_case - 207702 + 206808 @stmt_switch - 20787 + 20788 @stmt_asm - 109988 + 109990 @stmt_decl - 588988 + 588851 @stmt_empty - 191895 + 192673 @stmt_continue @@ -1318,11 +1394,11 @@ @stmt_break - 103193 + 103190 @stmt_try_block - 45069 + 44876 @stmt_microsoft_try @@ -1346,51 +1422,51 @@ @stmt_handler - 62736 + 62466 @stmt_constexpr_if - 52043 + 53108 @stmt_co_return - 2 + 5 @ppd_if - 666541 + 666484 @ppd_ifdef - 263071 + 263049 @ppd_ifndef - 266336 + 266314 @ppd_elif - 25187 + 25185 @ppd_else - 208964 + 208946 @ppd_endif - 1195950 + 1195848 @ppd_plain_include - 311114 + 311088 @ppd_define - 2407258 + 2292433 @ppd_undef - 258407 + 258385 @ppd_include_next @@ -1398,15 +1474,15 @@ @ppd_line - 27551 + 27519 @ppd_error - 103 + 98 @ppd_pragma - 311642 + 296776 @ppd_objc_import @@ -1418,7 +1494,7 @@ @link_target - 817 + 814 @xmldtd @@ -1436,23 +1512,23 @@ @xmlnamespace 4185 - - @xmlcharacters - 439958 - @xmlcomment 26812 + + @xmlcharacters + 439958 + compilations - 9654 + 9651 id - 9654 + 9651 cwd @@ -1470,7 +1546,7 @@ 1 2 - 9654 + 9651 @@ -1496,7 +1572,7 @@ compilation_args - 652584 + 652594 id @@ -1508,7 +1584,7 @@ arg - 34462 + 34463 @@ -1751,7 +1827,7 @@ 2 1043 - 2063 + 2064 @@ -1910,7 +1986,7 @@ 1 2 - 1757 + 1758 2 @@ -1946,7 +2022,7 @@ 1 2 - 1757 + 1758 2 @@ -2044,7 +2120,7 @@ seconds - 9748 + 9948 @@ -2134,38 +2210,38 @@ 5 - 7 - 119 + 8 + 159 - 8 + 9 10 159 10 11 - 79 + 119 11 - 12 - 159 + 14 + 119 - 12 - 17 + 16 + 18 159 - 18 - 22 + 19 + 27 159 - 25 - 98 - 159 + 38 + 96 + 119 @@ -2181,7 +2257,7 @@ 1 2 - 1757 + 1758 2 @@ -2233,12 +2309,12 @@ 3 4 - 1438 + 1318 4 5 - 319 + 439 5 @@ -2248,27 +2324,27 @@ 6 7 - 479 + 399 7 8 - 119 + 159 8 - 10 - 279 + 9 + 239 - 10 - 26 - 239 + 9 + 23 + 279 - 26 - 84 - 239 + 25 + 92 + 279 @@ -2316,16 +2392,21 @@ 3 4 - 79 + 39 - 137 - 138 + 4 + 5 39 - 142 - 143 + 136 + 137 + 39 + + + 145 + 146 39 @@ -2342,27 +2423,27 @@ 1 2 - 4994 + 4954 2 3 - 2117 + 2796 3 4 - 1278 + 1118 4 - 5 - 958 + 6 + 918 - 5 + 7 47 - 399 + 159 @@ -2378,32 +2459,32 @@ 1 2 - 4554 + 4235 2 3 - 1997 + 2317 3 4 - 1238 + 1358 4 5 - 839 + 1158 5 - 7 - 878 + 12 + 759 - 7 - 74 - 239 + 26 + 75 + 119 @@ -2419,12 +2500,12 @@ 1 2 - 8110 + 8390 2 3 - 1638 + 1558 @@ -2434,23 +2515,23 @@ diagnostic_for - 5457 + 5434 diagnostic - 5001 + 4979 compilation - 817 + 814 file_number - 19 + 18 file_number_diagnostic_number - 399 + 397 @@ -2464,12 +2545,12 @@ 1 2 - 4849 + 4828 2 7 - 152 + 151 @@ -2485,7 +2566,7 @@ 1 2 - 5001 + 4979 @@ -2501,7 +2582,7 @@ 1 2 - 5001 + 4979 @@ -2517,27 +2598,27 @@ 5 6 - 608 + 605 7 8 - 76 + 75 9 12 - 57 + 56 13 16 - 38 + 37 21 22 - 38 + 37 @@ -2553,7 +2634,7 @@ 1 2 - 817 + 814 @@ -2569,27 +2650,27 @@ 5 6 - 608 + 605 7 8 - 76 + 75 9 12 - 57 + 56 13 16 - 38 + 37 21 22 - 38 + 37 @@ -2605,7 +2686,7 @@ 263 264 - 19 + 18 @@ -2621,7 +2702,7 @@ 43 44 - 19 + 18 @@ -2637,7 +2718,7 @@ 21 22 - 19 + 18 @@ -2653,42 +2734,42 @@ 2 3 - 114 + 113 3 4 - 38 + 37 4 5 - 38 + 37 5 6 - 38 + 37 7 8 - 38 + 37 11 12 - 38 + 37 37 38 - 76 + 75 43 44 - 19 + 18 @@ -2704,37 +2785,37 @@ 2 3 - 114 + 113 3 4 - 38 + 37 4 5 - 38 + 37 5 6 - 38 + 37 7 8 - 38 + 37 11 12 - 38 + 37 43 44 - 95 + 94 @@ -2750,7 +2831,7 @@ 1 2 - 399 + 397 @@ -2760,19 +2841,19 @@ compilation_finished - 9654 + 9651 id - 9654 + 9651 cpu_seconds - 7763 + 6990 elapsed_seconds - 145 + 134 @@ -2786,7 +2867,7 @@ 1 2 - 9654 + 9651 @@ -2802,7 +2883,7 @@ 1 2 - 9654 + 9651 @@ -2818,17 +2899,17 @@ 1 2 - 6510 + 5457 2 3 - 872 + 1073 3 - 14 - 380 + 16 + 458 @@ -2844,12 +2925,12 @@ 1 2 - 7461 + 6341 2 3 - 302 + 648 @@ -2865,17 +2946,7 @@ 2 3 - 22 - - - 3 - 4 - 11 - - - 6 - 7 - 11 + 33 7 @@ -2888,38 +2959,38 @@ 11 - 9 - 10 + 10 + 11 11 - 37 - 38 + 11 + 12 11 - 47 - 48 + 54 + 55 11 - 118 - 119 + 156 + 157 11 - 140 - 141 + 173 + 174 11 - 229 - 230 + 177 + 178 11 - 255 - 256 + 261 + 262 11 @@ -2936,17 +3007,7 @@ 2 3 - 22 - - - 3 - 4 - 11 - - - 6 - 7 - 11 + 33 7 @@ -2959,38 +3020,38 @@ 11 - 9 - 10 + 10 + 11 11 - 37 - 38 + 11 + 12 11 - 47 - 48 + 48 + 49 11 - 97 - 98 + 109 + 110 11 - 112 - 113 + 120 + 121 11 - 183 - 184 + 132 + 133 11 - 208 - 209 + 232 + 233 11 @@ -4763,31 +4824,31 @@ locations_default - 29787737 + 29785199 id - 29787737 + 29785199 container - 123139 + 123129 startLine - 2093378 + 2093200 startColumn - 36848 + 36845 endLine - 2097576 + 2097398 endColumn - 48043 + 48039 @@ -4801,7 +4862,7 @@ 1 2 - 29787737 + 29785199 @@ -4817,7 +4878,7 @@ 1 2 - 29787737 + 29785199 @@ -4833,7 +4894,7 @@ 1 2 - 29787737 + 29785199 @@ -4849,7 +4910,7 @@ 1 2 - 29787737 + 29785199 @@ -4865,7 +4926,7 @@ 1 2 - 29787737 + 29785199 @@ -4881,62 +4942,62 @@ 1 11 - 9795 + 9794 11 18 - 10261 + 10260 18 30 - 9328 + 9327 30 42 - 9795 + 9794 43 61 - 9795 + 9794 61 79 - 9328 + 9327 80 106 - 9795 + 9794 109 149 - 9328 + 9327 149 199 - 9328 + 9327 206 292 - 9328 + 9327 305 469 - 9328 + 9327 482 850 - 9328 + 9327 939 @@ -4957,67 +5018,67 @@ 1 8 - 9328 + 9327 8 13 - 9328 + 9327 13 20 - 9795 + 9794 20 32 - 9328 + 9327 32 43 - 9795 + 9794 44 61 - 9328 + 9327 62 72 - 9328 + 9327 73 93 - 9328 + 9327 97 128 - 9328 + 9327 128 180 - 9328 + 9327 180 267 - 9328 + 9327 277 414 - 9328 + 9327 439 1465 - 9328 + 9327 1557 @@ -5038,62 +5099,62 @@ 1 4 - 8862 + 8861 4 5 - 7929 + 7928 5 6 - 7463 + 7462 6 8 - 11194 + 11193 8 10 - 9328 + 9327 10 15 - 10728 + 10727 15 23 - 9795 + 9794 23 28 - 11194 + 11193 28 34 - 9795 + 9794 34 44 - 9328 + 9327 44 55 - 9328 + 9327 55 66 - 9795 + 9794 66 @@ -5114,67 +5175,67 @@ 1 8 - 9328 + 9327 8 13 - 9328 + 9327 13 20 - 9795 + 9794 20 32 - 9328 + 9327 32 43 - 9795 + 9794 43 60 - 9328 + 9327 61 71 - 9328 + 9327 72 93 - 9328 + 9327 94 127 - 9328 + 9327 128 179 - 9328 + 9327 180 268 - 9328 + 9327 278 413 - 9328 + 9327 437 1465 - 9328 + 9327 1554 @@ -5195,67 +5256,67 @@ 1 9 - 9795 + 9794 9 13 - 9328 + 9327 13 18 - 9328 + 9327 18 26 - 10261 + 10260 27 33 - 9328 + 9327 33 39 - 9328 + 9327 39 47 - 10261 + 10260 47 54 - 9328 + 9327 54 60 - 10261 + 10260 60 66 - 9328 + 9327 66 74 - 9795 + 9794 74 78 - 9795 + 9794 78 90 - 6996 + 6995 @@ -5271,52 +5332,52 @@ 1 2 - 581183 + 581133 2 3 - 314846 + 314819 3 4 - 194971 + 194954 4 6 - 162320 + 162306 6 10 - 183310 + 183294 10 16 - 161854 + 161840 16 25 - 168384 + 168370 25 45 - 157189 + 157176 45 160 - 157656 + 157643 160 265 - 11660 + 11659 @@ -5332,42 +5393,42 @@ 1 2 - 870375 + 870301 2 3 - 273333 + 273310 3 5 - 193572 + 193555 5 8 - 173515 + 173500 8 13 - 187974 + 187958 13 20 - 160921 + 160907 20 51 - 159522 + 159508 51 265 - 74163 + 74157 @@ -5383,47 +5444,47 @@ 1 2 - 611501 + 611449 2 3 - 312980 + 312954 3 4 - 198236 + 198219 4 6 - 182844 + 182828 6 9 - 173048 + 173034 9 13 - 163253 + 163239 13 19 - 173981 + 173966 19 29 - 165119 + 165105 29 52 - 112411 + 112402 @@ -5439,22 +5500,22 @@ 1 2 - 1530386 + 1530256 2 3 - 348430 + 348400 3 5 - 161854 + 161840 5 16 - 52707 + 52703 @@ -5470,47 +5531,47 @@ 1 2 - 585847 + 585797 2 3 - 316245 + 316218 3 4 - 197770 + 197753 4 6 - 168384 + 168370 6 10 - 191706 + 191690 10 15 - 165585 + 165571 15 22 - 167918 + 167903 22 34 - 164186 + 164172 34 66 - 135733 + 135722 @@ -5612,7 +5673,7 @@ 23 35 - 3265 + 3264 38 @@ -5632,7 +5693,7 @@ 73 84 - 3265 + 3264 84 @@ -5642,12 +5703,12 @@ 96 101 - 3265 + 3264 101 105 - 3265 + 3264 107 @@ -5850,12 +5911,12 @@ 7 11 - 3265 + 3264 11 16 - 3265 + 3264 16 @@ -5865,7 +5926,7 @@ 22 24 - 3265 + 3264 24 @@ -5875,12 +5936,12 @@ 29 34 - 3265 + 3264 34 41 - 3265 + 3264 41 @@ -5921,52 +5982,52 @@ 1 2 - 591444 + 591394 2 3 - 306916 + 306890 3 4 - 198236 + 198219 4 6 - 159522 + 159508 6 10 - 182844 + 182828 10 16 - 160455 + 160441 16 25 - 170716 + 170702 25 45 - 158122 + 158109 45 160 - 158122 + 158109 160 265 - 11194 + 11193 @@ -5982,47 +6043,47 @@ 1 2 - 885767 + 885692 2 3 - 259806 + 259784 3 4 - 125005 + 124995 4 6 - 140864 + 140852 6 10 - 184709 + 184694 10 15 - 168384 + 168370 15 26 - 163253 + 163239 26 120 - 158122 + 158109 121 265 - 11660 + 11659 @@ -6038,22 +6099,22 @@ 1 2 - 1528054 + 1527924 2 3 - 341433 + 341404 3 5 - 170716 + 170702 5 10 - 57372 + 57367 @@ -6069,47 +6130,47 @@ 1 2 - 622696 + 622643 2 3 - 303185 + 303159 3 4 - 201501 + 201484 4 6 - 183777 + 183761 6 9 - 169783 + 169769 9 13 - 166518 + 166504 13 19 - 174914 + 174899 19 29 - 160921 + 160907 29 52 - 114277 + 114267 @@ -6125,47 +6186,47 @@ 1 2 - 597975 + 597924 2 3 - 306916 + 306890 3 4 - 196370 + 196354 4 6 - 169317 + 169302 6 9 - 154857 + 154844 9 14 - 168384 + 168370 14 21 - 178646 + 178630 21 32 - 163253 + 163239 32 60 - 158122 + 158109 60 @@ -6262,7 +6323,7 @@ 1 2 - 5597 + 5596 2 @@ -6338,7 +6399,7 @@ 1 2 - 5597 + 5596 2 @@ -6449,17 +6510,17 @@ 35 39 - 3265 + 3264 39 42 - 3265 + 3264 42 44 - 3265 + 3264 44 @@ -6490,7 +6551,7 @@ 1 2 - 5597 + 5596 2 @@ -6560,11 +6621,11 @@ locations_stmt - 3820076 + 3820138 id - 3820076 + 3820138 container @@ -6572,7 +6633,7 @@ startLine - 200182 + 200185 startColumn @@ -6580,7 +6641,7 @@ endLine - 194437 + 194441 endColumn @@ -6598,7 +6659,7 @@ 1 2 - 3820076 + 3820138 @@ -6614,7 +6675,7 @@ 1 2 - 3820076 + 3820138 @@ -6630,7 +6691,7 @@ 1 2 - 3820076 + 3820138 @@ -6646,7 +6707,7 @@ 1 2 - 3820076 + 3820138 @@ -6662,7 +6723,7 @@ 1 2 - 3820076 + 3820138 @@ -7063,12 +7124,12 @@ 1 2 - 21576 + 21577 2 3 - 15317 + 15318 3 @@ -7113,7 +7174,7 @@ 37 45 - 15111 + 15112 45 @@ -7154,7 +7215,7 @@ 4 6 - 14411 + 14412 6 @@ -7184,7 +7245,7 @@ 29 36 - 16017 + 16018 36 @@ -7194,7 +7255,7 @@ 44 54 - 15667 + 15668 54 @@ -7220,7 +7281,7 @@ 2 3 - 20876 + 20877 3 @@ -7250,7 +7311,7 @@ 8 9 - 20423 + 20424 9 @@ -7281,17 +7342,17 @@ 1 2 - 34650 + 34651 2 3 - 25838 + 25839 3 4 - 18467 + 18468 4 @@ -7336,7 +7397,7 @@ 12 14 - 15811 + 15812 14 @@ -7357,12 +7418,12 @@ 1 2 - 22173 + 22174 2 3 - 16223 + 16224 3 @@ -7377,17 +7438,17 @@ 6 8 - 14720 + 14721 8 10 - 13217 + 13218 10 14 - 18323 + 18324 14 @@ -7813,7 +7874,7 @@ 3 4 - 11508 + 11509 4 @@ -7823,7 +7884,7 @@ 6 8 - 12517 + 12518 8 @@ -7838,7 +7899,7 @@ 15 21 - 16120 + 16121 21 @@ -7848,12 +7909,12 @@ 27 34 - 14967 + 14968 34 42 - 15770 + 15771 42 @@ -7884,7 +7945,7 @@ 2 3 - 16161 + 16162 3 @@ -7904,7 +7965,7 @@ 8 11 - 15914 + 15915 11 @@ -7914,7 +7975,7 @@ 16 20 - 14617 + 14618 20 @@ -7950,7 +8011,7 @@ 1 2 - 32529 + 32530 2 @@ -8026,12 +8087,12 @@ 2 3 - 20423 + 20424 3 4 - 16861 + 16862 4 @@ -8046,7 +8107,7 @@ 6 7 - 20464 + 20465 7 @@ -8056,7 +8117,7 @@ 8 9 - 18776 + 18777 9 @@ -8097,7 +8158,7 @@ 3 4 - 12558 + 12559 4 @@ -8132,7 +8193,7 @@ 19 22 - 14061 + 14062 22 @@ -8542,11 +8603,11 @@ locations_expr - 13188614 + 13188829 id - 13188614 + 13188829 container @@ -8554,7 +8615,7 @@ startLine - 192235 + 192238 startColumn @@ -8562,7 +8623,7 @@ endLine - 192214 + 192217 endColumn @@ -8580,7 +8641,7 @@ 1 2 - 13188614 + 13188829 @@ -8596,7 +8657,7 @@ 1 2 - 13188614 + 13188829 @@ -8612,7 +8673,7 @@ 1 2 - 13188614 + 13188829 @@ -8628,7 +8689,7 @@ 1 2 - 13188614 + 13188829 @@ -8644,7 +8705,7 @@ 1 2 - 13188614 + 13188829 @@ -9065,7 +9126,7 @@ 5 9 - 16511 + 16512 9 @@ -9146,7 +9207,7 @@ 3 4 - 11364 + 11365 4 @@ -9161,7 +9222,7 @@ 8 11 - 16470 + 16471 11 @@ -9171,7 +9232,7 @@ 16 21 - 16470 + 16471 21 @@ -9186,7 +9247,7 @@ 35 43 - 15873 + 15874 43 @@ -9217,7 +9278,7 @@ 7 11 - 16717 + 16718 11 @@ -9257,7 +9318,7 @@ 44 49 - 16923 + 16924 49 @@ -9278,17 +9339,17 @@ 1 2 - 102119 + 102120 2 3 - 44697 + 44698 3 4 - 27691 + 27692 4 @@ -9334,7 +9395,7 @@ 16 21 - 16470 + 16471 21 @@ -9344,7 +9405,7 @@ 27 33 - 16470 + 16471 33 @@ -9354,12 +9415,12 @@ 38 43 - 15564 + 15565 43 47 - 14720 + 14721 47 @@ -9775,12 +9836,12 @@ 1 5 - 16161 + 16162 5 9 - 16511 + 16512 9 @@ -9790,22 +9851,22 @@ 15 23 - 15111 + 15112 23 32 - 15667 + 15668 32 44 - 14761 + 14762 44 60 - 14514 + 14515 60 @@ -9861,7 +9922,7 @@ 3 4 - 11364 + 11365 4 @@ -9906,7 +9967,7 @@ 40 49 - 14617 + 14618 49 @@ -9927,17 +9988,17 @@ 1 2 - 95633 + 95635 2 3 - 50091 + 50092 3 4 - 29420 + 29421 4 @@ -9973,7 +10034,7 @@ 7 11 - 16511 + 16512 11 @@ -10003,12 +10064,12 @@ 36 40 - 15317 + 15318 40 44 - 16470 + 16471 44 @@ -10039,7 +10100,7 @@ 4 7 - 16820 + 16821 7 @@ -10069,12 +10130,12 @@ 32 38 - 17520 + 17521 38 43 - 16161 + 16162 43 @@ -10474,23 +10535,23 @@ numlines - 1382525 + 1382407 element_id - 1375529 + 1375411 num_lines - 101683 + 101675 num_code - 84891 + 84884 num_comment - 59704 + 59699 @@ -10504,12 +10565,12 @@ 1 2 - 1368532 + 1368415 2 3 - 6996 + 6995 @@ -10525,7 +10586,7 @@ 1 2 - 1369465 + 1369348 2 @@ -10546,7 +10607,7 @@ 1 2 - 1375529 + 1375411 @@ -10562,22 +10623,22 @@ 1 2 - 68100 + 68094 2 3 - 12127 + 12126 3 4 - 7463 + 7462 4 21 - 7929 + 7928 29 @@ -10598,12 +10659,12 @@ 1 2 - 70432 + 70426 2 3 - 12127 + 12126 3 @@ -10613,7 +10674,7 @@ 4 6 - 9328 + 9327 6 @@ -10634,22 +10695,22 @@ 1 2 - 69499 + 69493 2 3 - 14926 + 14924 3 4 - 10728 + 10727 4 7 - 6530 + 6529 @@ -10665,27 +10726,27 @@ 1 2 - 52707 + 52703 2 3 - 14459 + 14458 3 5 - 6530 + 6529 5 42 - 6530 + 6529 44 922 - 4664 + 4663 @@ -10701,12 +10762,12 @@ 1 2 - 52707 + 52703 2 3 - 16791 + 16790 3 @@ -10716,7 +10777,7 @@ 5 8 - 6530 + 6529 8 @@ -10737,17 +10798,17 @@ 1 2 - 53174 + 53169 2 3 - 15858 + 15857 3 5 - 7463 + 7462 5 @@ -10757,7 +10818,7 @@ 7 10 - 3265 + 3264 @@ -10773,12 +10834,12 @@ 1 2 - 34516 + 34513 2 3 - 9328 + 9327 3 @@ -10788,7 +10849,7 @@ 4 6 - 4664 + 4663 6 @@ -10814,12 +10875,12 @@ 1 2 - 34516 + 34513 2 3 - 9328 + 9327 3 @@ -10829,17 +10890,17 @@ 4 6 - 4664 + 4663 6 8 - 4664 + 4663 10 38 - 2332 + 2331 @@ -10855,12 +10916,12 @@ 1 2 - 34516 + 34513 2 3 - 9328 + 9327 3 @@ -10870,17 +10931,17 @@ 4 6 - 4664 + 4663 6 10 - 4664 + 4663 10 37 - 2332 + 2331 @@ -10890,31 +10951,31 @@ diagnostics - 5001 + 4979 id - 5001 + 4979 severity - 19 + 18 error_tag - 38 + 37 error_message - 399 + 397 full_error_message - 4202 + 4184 location - 171 + 170 @@ -10928,7 +10989,7 @@ 1 2 - 5001 + 4979 @@ -10944,7 +11005,7 @@ 1 2 - 5001 + 4979 @@ -10960,7 +11021,7 @@ 1 2 - 5001 + 4979 @@ -10976,7 +11037,7 @@ 1 2 - 5001 + 4979 @@ -10992,7 +11053,7 @@ 1 2 - 5001 + 4979 @@ -11008,7 +11069,7 @@ 263 264 - 19 + 18 @@ -11024,7 +11085,7 @@ 2 3 - 19 + 18 @@ -11040,7 +11101,7 @@ 21 22 - 19 + 18 @@ -11056,7 +11117,7 @@ 221 222 - 19 + 18 @@ -11072,7 +11133,7 @@ 9 10 - 19 + 18 @@ -11088,12 +11149,12 @@ 43 44 - 19 + 18 220 221 - 19 + 18 @@ -11109,7 +11170,7 @@ 1 2 - 38 + 37 @@ -11125,12 +11186,12 @@ 1 2 - 19 + 18 20 21 - 19 + 18 @@ -11146,12 +11207,12 @@ 1 2 - 19 + 18 220 221 - 19 + 18 @@ -11167,12 +11228,12 @@ 1 2 - 19 + 18 8 9 - 19 + 18 @@ -11188,27 +11249,27 @@ 1 2 - 114 + 113 2 3 - 152 + 151 3 4 - 76 + 75 43 44 - 19 + 18 93 94 - 38 + 37 @@ -11224,7 +11285,7 @@ 1 2 - 399 + 397 @@ -11240,7 +11301,7 @@ 1 2 - 399 + 397 @@ -11256,22 +11317,22 @@ 1 2 - 133 + 132 2 3 - 152 + 151 3 4 - 76 + 75 93 94 - 38 + 37 @@ -11287,22 +11348,22 @@ 1 2 - 171 + 170 2 3 - 114 + 113 3 4 - 76 + 75 4 5 - 38 + 37 @@ -11318,12 +11379,12 @@ 1 2 - 4183 + 4165 43 44 - 19 + 18 @@ -11339,7 +11400,7 @@ 1 2 - 4202 + 4184 @@ -11355,7 +11416,7 @@ 1 2 - 4202 + 4184 @@ -11371,7 +11432,7 @@ 1 2 - 4202 + 4184 @@ -11387,7 +11448,7 @@ 1 2 - 4202 + 4184 @@ -11403,22 +11464,22 @@ 6 7 - 38 + 37 22 23 - 38 + 37 41 42 - 76 + 75 43 44 - 19 + 18 @@ -11434,7 +11495,7 @@ 1 2 - 171 + 170 @@ -11450,7 +11511,7 @@ 1 2 - 171 + 170 @@ -11466,22 +11527,22 @@ 1 2 - 19 + 18 3 4 - 38 + 37 5 6 - 38 + 37 6 7 - 76 + 75 @@ -11497,22 +11558,22 @@ 1 2 - 19 + 18 6 7 - 38 + 37 22 23 - 38 + 37 41 42 - 76 + 75 @@ -11522,15 +11583,15 @@ files - 123139 + 123129 id - 123139 + 123129 name - 123139 + 123129 @@ -11544,7 +11605,7 @@ 1 2 - 123139 + 123129 @@ -11560,7 +11621,7 @@ 1 2 - 123139 + 123129 @@ -11570,15 +11631,15 @@ folders - 16325 + 16323 id - 16325 + 16323 name - 16325 + 16323 @@ -11592,7 +11653,7 @@ 1 2 - 16325 + 16323 @@ -11608,7 +11669,7 @@ 1 2 - 16325 + 16323 @@ -11618,15 +11679,15 @@ containerparent - 138532 + 138520 parent - 16325 + 16323 child - 138532 + 138520 @@ -11640,12 +11701,12 @@ 1 2 - 7463 + 7462 2 3 - 3265 + 3264 3 @@ -11681,7 +11742,7 @@ 1 2 - 138532 + 138520 @@ -11691,11 +11752,11 @@ fileannotations - 5083033 + 5081854 id - 4855 + 4853 kind @@ -11703,11 +11764,11 @@ name - 54277 + 54265 value - 45630 + 45619 @@ -11726,7 +11787,7 @@ 2 3 - 4687 + 4686 @@ -11942,62 +12003,62 @@ 1 2 - 8781 + 8779 2 3 - 6163 + 6162 3 5 - 4139 + 4138 5 9 - 4228 + 4227 9 14 - 3948 + 3947 14 18 - 4139 + 4138 18 20 - 4676 + 4674 20 34 - 4183 + 4182 34 128 - 4463 + 4462 128 229 - 4083 + 4082 229 387 - 4206 + 4205 387 434 - 1264 + 1263 @@ -12013,7 +12074,7 @@ 1 2 - 54277 + 54265 @@ -12029,57 +12090,57 @@ 1 2 - 8792 + 8790 2 3 - 7987 + 7985 3 4 - 2539 + 2538 4 6 - 4474 + 4473 6 9 - 4094 + 4093 9 14 - 4172 + 4171 14 17 - 4094 + 4093 17 22 - 4552 + 4551 22 41 - 4172 + 4171 41 82 - 4127 + 4126 82 157 - 4071 + 4070 158 @@ -12100,7 +12161,7 @@ 1 2 - 7092 + 7090 2 @@ -12110,12 +12171,12 @@ 5 8 - 3300 + 3299 8 15 - 3501 + 3500 15 @@ -12125,12 +12186,12 @@ 17 19 - 4105 + 4104 19 34 - 3300 + 3299 34 @@ -12140,12 +12201,12 @@ 189 201 - 3579 + 3578 201 266 - 3523 + 3522 266 @@ -12155,7 +12216,7 @@ 322 399 - 3915 + 3914 399 @@ -12176,7 +12237,7 @@ 1 2 - 45619 + 45608 2 @@ -12197,7 +12258,7 @@ 1 2 - 7114 + 7113 2 @@ -12207,12 +12268,12 @@ 5 8 - 3479 + 3478 8 15 - 3523 + 3522 15 @@ -12222,22 +12283,22 @@ 17 19 - 3557 + 3556 19 29 - 3479 + 3478 29 39 - 3635 + 3634 39 48 - 3579 + 3578 48 @@ -12247,12 +12308,12 @@ 74 102 - 3423 + 3422 102 119 - 3568 + 3567 119 @@ -12267,15 +12328,15 @@ inmacroexpansion - 109784721 + 109786483 id - 18028276 + 18028566 inv - 2700307 + 2700352 @@ -12289,37 +12350,37 @@ 1 3 - 1582036 + 1582063 3 5 - 1077853 + 1077870 5 6 - 1184943 + 1184962 6 7 - 4820169 + 4820246 7 8 - 6386284 + 6386387 8 9 - 2605386 + 2605427 9 21 - 371602 + 371608 @@ -12335,32 +12396,32 @@ 1 2 - 378443 + 378450 2 3 - 544126 + 544144 3 4 - 351533 + 351538 4 7 - 200669 + 200672 7 8 - 207162 + 207166 8 9 - 241901 + 241904 9 @@ -12370,22 +12431,22 @@ 10 11 - 325503 + 325508 11 337 - 224867 + 224861 339 423 - 206363 + 206367 423 7616 - 17525 + 17526 @@ -12395,15 +12456,15 @@ affectedbymacroexpansion - 35690892 + 35691465 id - 5157002 + 5157087 inv - 2784914 + 2784960 @@ -12417,37 +12478,37 @@ 1 2 - 2816076 + 2816122 2 3 - 560157 + 560166 3 4 - 264920 + 264924 4 5 - 565823 + 565832 5 12 - 391923 + 391929 12 50 - 407422 + 407428 50 9900 - 150680 + 150682 @@ -12463,62 +12524,62 @@ 1 4 - 229127 + 229132 4 7 - 231800 + 231804 7 9 - 220489 + 220493 9 12 - 251100 + 251104 12 13 - 333995 + 334000 13 14 - 165596 + 165599 14 15 - 298859 + 298864 15 16 - 121849 + 121851 16 17 - 276622 + 276627 17 18 - 146948 + 146950 18 20 - 252148 + 252152 20 25 - 208989 + 208993 25 @@ -12533,19 +12594,19 @@ macroinvocations - 33190389 + 33182692 id - 33190389 + 33182692 macro_id - 78765 + 78746 location - 753510 + 753335 kind @@ -12563,7 +12624,7 @@ 1 2 - 33190389 + 33182692 @@ -12579,7 +12640,7 @@ 1 2 - 33190389 + 33182692 @@ -12595,7 +12656,7 @@ 1 2 - 33190389 + 33182692 @@ -12611,57 +12672,57 @@ 1 2 - 16108 + 16105 2 3 - 16421 + 16418 3 4 - 3087 + 3086 4 5 - 5224 + 5222 5 8 - 5638 + 5636 8 13 - 6051 + 6050 13 26 - 6119 + 6117 26 61 - 6007 + 6005 61 199 - 5917 + 5916 199 1697 - 5962 + 5961 1716 168807 - 2226 + 2225 @@ -12677,37 +12738,37 @@ 1 2 - 42084 + 42074 2 3 - 10302 + 10300 3 4 - 5112 + 5111 4 6 - 6779 + 6777 6 13 - 6421 + 6419 13 66 - 5951 + 5949 66 3614 - 2114 + 2113 @@ -12723,12 +12784,12 @@ 1 2 - 73082 + 73065 2 3 - 5682 + 5681 @@ -12744,37 +12805,37 @@ 1 2 - 278681 + 278617 2 3 - 168090 + 168051 3 4 - 70117 + 70101 4 5 - 59747 + 59734 5 9 - 69759 + 69743 9 21 - 58573 + 58559 21 244764 - 48538 + 48527 @@ -12790,12 +12851,12 @@ 1 2 - 707756 + 707592 2 350 - 45753 + 45742 @@ -12811,7 +12872,7 @@ 1 2 - 753510 + 753335 @@ -12884,15 +12945,15 @@ macroparent - 29680455 + 29673573 id - 29680455 + 29673573 parent_id - 23077000 + 23071649 @@ -12906,7 +12967,7 @@ 1 2 - 29680455 + 29673573 @@ -12922,17 +12983,17 @@ 1 2 - 17830675 + 17826541 2 3 - 4419217 + 4418192 3 88 - 827107 + 826915 @@ -12942,15 +13003,15 @@ macrolocationbind - 4043998 + 4044068 id - 2831290 + 2831338 location - 2021169 + 2021204 @@ -12964,22 +13025,22 @@ 1 2 - 2230032 + 2230070 2 3 - 341142 + 341148 3 7 - 230537 + 230540 7 57 - 29578 + 29579 @@ -12995,22 +13056,22 @@ 1 2 - 1611104 + 1611131 2 3 - 177691 + 177694 3 8 - 156877 + 156880 8 723 - 75496 + 75498 @@ -13020,11 +13081,11 @@ macro_argument_unexpanded - 83786944 + 83767514 invocation - 25979141 + 25973117 argument_index @@ -13032,7 +13093,7 @@ text - 315429 + 315356 @@ -13046,22 +13107,22 @@ 1 2 - 7366004 + 7364296 2 3 - 10578205 + 10575752 3 4 - 6083801 + 6082391 4 67 - 1951130 + 1950677 @@ -13077,22 +13138,22 @@ 1 2 - 7435529 + 7433804 2 3 - 10723430 + 10720943 3 4 - 5918977 + 5917605 4 67 - 1901204 + 1900763 @@ -13160,57 +13221,57 @@ 1 2 - 34756 + 34748 2 3 - 60709 + 60695 3 4 - 17585 + 17581 4 5 - 44657 + 44646 5 7 - 23704 + 23699 7 12 - 18357 + 18353 12 16 - 21422 + 21417 16 23 - 24756 + 24750 23 42 - 24107 + 24101 42 129 - 23861 + 23855 129 522417 - 21511 + 21506 @@ -13226,17 +13287,17 @@ 1 2 - 228118 + 228065 2 3 - 77120 + 77102 3 9 - 10191 + 10188 @@ -13246,11 +13307,11 @@ macro_argument_expanded - 83786944 + 83767514 invocation - 25979141 + 25973117 argument_index @@ -13258,7 +13319,7 @@ text - 191157 + 191113 @@ -13272,22 +13333,22 @@ 1 2 - 7366004 + 7364296 2 3 - 10578205 + 10575752 3 4 - 6083801 + 6082391 4 67 - 1951130 + 1950677 @@ -13303,22 +13364,22 @@ 1 2 - 10593150 + 10590693 2 3 - 9119085 + 9116971 3 4 - 5161172 + 5159975 4 9 - 1105732 + 1105476 @@ -13386,22 +13447,22 @@ 1 2 - 20605 + 20601 2 3 - 36971 + 36963 3 4 - 8982 + 8980 4 5 - 16231 + 16228 5 @@ -13411,37 +13472,37 @@ 6 7 - 22641 + 22636 7 9 - 14665 + 14662 9 14 - 11936 + 11933 14 19 - 14419 + 14416 19 48 - 14341 + 14337 48 151 - 14352 + 14349 152 1060462 - 13614 + 13610 @@ -13457,17 +13518,17 @@ 1 2 - 96742 + 96719 2 3 - 80141 + 80122 3 66 - 14274 + 14270 @@ -13477,19 +13538,19 @@ functions - 4646200 + 4645804 id - 4646200 + 4645804 name - 1917064 + 1916901 kind - 3265 + 3264 @@ -13503,7 +13564,7 @@ 1 2 - 4646200 + 4645804 @@ -13519,7 +13580,7 @@ 1 2 - 4646200 + 4645804 @@ -13535,22 +13596,22 @@ 1 2 - 1504266 + 1504138 2 3 - 152059 + 152046 3 5 - 150193 + 150180 5 1676 - 110546 + 110536 @@ -13566,7 +13627,7 @@ 1 2 - 1916598 + 1916435 2 @@ -13673,15 +13734,15 @@ function_entry_point - 1156769 + 1156670 id - 1146973 + 1146876 entry_point - 1156769 + 1156670 @@ -13695,12 +13756,12 @@ 1 2 - 1137178 + 1137081 2 3 - 9795 + 9794 @@ -13716,7 +13777,7 @@ 1 2 - 1156769 + 1156670 @@ -13726,15 +13787,15 @@ function_return_type - 4651331 + 4650935 id - 4646200 + 4645804 return_type - 987451 + 987367 @@ -13748,7 +13809,7 @@ 1 2 - 4641069 + 4640674 2 @@ -13769,22 +13830,22 @@ 1 2 - 510284 + 510240 2 3 - 375949 + 375917 3 10 - 75096 + 75090 10 2516 - 26120 + 26118 @@ -13794,23 +13855,23 @@ coroutine - 2 + 6 function - 2 + 6 traits - 1 + 3 handle - 2 + 6 promise - 2 + 6 @@ -13824,7 +13885,7 @@ 1 2 - 2 + 6 @@ -13840,7 +13901,7 @@ 1 2 - 2 + 6 @@ -13856,7 +13917,7 @@ 1 2 - 2 + 6 @@ -13869,11 +13930,21 @@ 12 + + 1 + 2 + 1 + 2 3 1 + + 3 + 4 + 1 + @@ -13885,11 +13956,21 @@ 12 + + 1 + 2 + 1 + 2 3 1 + + 3 + 4 + 1 + @@ -13901,11 +13982,21 @@ 12 + + 1 + 2 + 1 + 2 3 1 + + 3 + 4 + 1 + @@ -13920,7 +14011,7 @@ 1 2 - 2 + 6 @@ -13936,7 +14027,7 @@ 1 2 - 2 + 6 @@ -13952,7 +14043,7 @@ 1 2 - 2 + 6 @@ -13968,7 +14059,7 @@ 1 2 - 2 + 6 @@ -13984,7 +14075,7 @@ 1 2 - 2 + 6 @@ -14000,7 +14091,7 @@ 1 2 - 2 + 6 @@ -14010,11 +14101,11 @@ coroutine_new - 2 + 6 function - 2 + 6 new @@ -14032,7 +14123,7 @@ 1 2 - 2 + 6 @@ -14046,8 +14137,8 @@ 12 - 2 - 3 + 6 + 7 1 @@ -14058,11 +14149,11 @@ coroutine_delete - 2 + 6 function - 2 + 6 delete @@ -14080,7 +14171,7 @@ 1 2 - 2 + 6 @@ -14094,8 +14185,8 @@ 12 - 2 - 3 + 6 + 7 1 @@ -14106,59 +14197,59 @@ purefunctions - 100915 + 100911 id - 100915 + 100911 function_deleted - 137599 + 137587 id - 137599 + 137587 function_defaulted - 73697 + 73691 id - 73697 + 73691 function_prototyped - 4554311 + 4553923 id - 4554311 + 4553923 member_function_this_type - 545957 + 545645 id - 545957 + 545645 this_type - 187389 + 187282 @@ -14172,7 +14263,7 @@ 1 2 - 545957 + 545645 @@ -14188,32 +14279,32 @@ 1 2 - 67657 + 67619 2 3 - 44838 + 44812 3 4 - 30193 + 30176 4 5 - 15340 + 15331 5 7 - 15375 + 15366 7 66 - 13983 + 13975 @@ -14223,27 +14314,27 @@ fun_decls - 5015153 + 5014726 id - 5010023 + 5009596 function - 4502537 + 4502153 type_id - 986052 + 985968 name - 1819579 + 1819424 location - 3418532 + 3418241 @@ -14257,7 +14348,7 @@ 1 2 - 5010023 + 5009596 @@ -14273,7 +14364,7 @@ 1 2 - 5004892 + 5004465 2 @@ -14294,7 +14385,7 @@ 1 2 - 5010023 + 5009596 @@ -14310,7 +14401,7 @@ 1 2 - 5010023 + 5009596 @@ -14326,17 +14417,17 @@ 1 2 - 4073879 + 4073532 2 3 - 355893 + 355862 3 7 - 72764 + 72758 @@ -14352,12 +14443,12 @@ 1 2 - 4462889 + 4462509 2 3 - 39647 + 39643 @@ -14373,7 +14464,7 @@ 1 2 - 4502537 + 4502153 @@ -14389,12 +14480,12 @@ 1 2 - 4130318 + 4129966 2 4 - 371285 + 371253 5 @@ -14415,22 +14506,22 @@ 1 2 - 435654 + 435617 2 3 - 438452 + 438415 3 8 - 75096 + 75090 8 2761 - 36848 + 36845 @@ -14446,22 +14537,22 @@ 1 2 - 519613 + 519568 2 3 - 367554 + 367522 3 11 - 75563 + 75556 11 2477 - 23321 + 23319 @@ -14477,17 +14568,17 @@ 1 2 - 858714 + 858641 2 5 - 89556 + 89548 5 823 - 37781 + 37778 @@ -14503,22 +14594,22 @@ 1 2 - 754698 + 754634 2 3 - 131535 + 131524 3 10 - 74630 + 74623 10 2030 - 25187 + 25185 @@ -14534,27 +14625,27 @@ 1 2 - 1234664 + 1234559 2 3 - 266803 + 266780 3 4 - 80693 + 80687 4 6 - 136666 + 136655 6 1710 - 100750 + 100742 @@ -14570,22 +14661,22 @@ 1 2 - 1413777 + 1413656 2 3 - 151126 + 151113 3 5 - 144129 + 144117 5 1660 - 110546 + 110536 @@ -14601,17 +14692,17 @@ 1 2 - 1601285 + 1601149 2 4 - 134800 + 134789 4 930 - 83492 + 83485 @@ -14627,27 +14718,27 @@ 1 2 - 1255654 + 1255547 2 3 - 293390 + 293365 3 4 - 79761 + 79754 4 8 - 137599 + 137587 8 653 - 53174 + 53169 @@ -14663,17 +14754,17 @@ 1 2 - 2962355 + 2962102 2 4 - 296188 + 296163 4 55 - 159988 + 159975 @@ -14689,17 +14780,17 @@ 1 2 - 3029522 + 3029264 2 6 - 262605 + 262582 6 55 - 126405 + 126394 @@ -14715,12 +14806,12 @@ 1 2 - 3208634 + 3208361 2 25 - 209897 + 209879 @@ -14736,12 +14827,12 @@ 1 2 - 3246416 + 3246139 2 13 - 172116 + 172101 @@ -14751,22 +14842,22 @@ fun_def - 1935256 + 1935091 id - 1935256 + 1935091 fun_specialized - 26120 + 26118 id - 26120 + 26118 @@ -14784,11 +14875,11 @@ fun_decl_specifiers - 2904050 + 2903802 id - 1688043 + 1687899 name @@ -14806,17 +14897,17 @@ 1 2 - 490693 + 490652 2 3 - 1178691 + 1178591 3 4 - 18657 + 18655 @@ -14988,26 +15079,26 @@ fun_decl_empty_throws - 1933856 + 1933692 fun_decl - 1933856 + 1933692 fun_decl_noexcept - 60528 + 61680 fun_decl - 60528 + 61680 constant - 60424 + 61582 @@ -15021,7 +15112,7 @@ 1 2 - 60528 + 61680 @@ -15037,12 +15128,12 @@ 1 2 - 60321 + 61483 2 3 - 103 + 98 @@ -15052,22 +15143,22 @@ fun_decl_empty_noexcept - 869909 + 869834 fun_decl - 869909 + 869834 fun_decl_typedef_type - 2867 + 2864 fun_decl - 2867 + 2864 typedeftype_id @@ -15085,7 +15176,7 @@ 1 2 - 2867 + 2864 @@ -15161,19 +15252,19 @@ param_decl_bind - 7380000 + 7379371 id - 7380000 + 7379371 index - 7929 + 7928 fun_decl - 4223140 + 4222780 @@ -15187,7 +15278,7 @@ 1 2 - 7380000 + 7379371 @@ -15203,7 +15294,7 @@ 1 2 - 7380000 + 7379371 @@ -15381,22 +15472,22 @@ 1 2 - 2363447 + 2363245 2 3 - 1060682 + 1060592 3 4 - 502354 + 502312 4 18 - 296655 + 296630 @@ -15412,22 +15503,22 @@ 1 2 - 2363447 + 2363245 2 3 - 1060682 + 1060592 3 4 - 502354 + 502312 4 18 - 296655 + 296630 @@ -15437,27 +15528,27 @@ var_decls - 8494323 + 8493599 id - 8423424 + 8422707 variable - 7412184 + 7411553 type_id - 2384436 + 2384233 name - 667007 + 666951 location - 5307144 + 5306692 @@ -15471,7 +15562,7 @@ 1 2 - 8423424 + 8422707 @@ -15487,12 +15578,12 @@ 1 2 - 8355324 + 8354612 2 3 - 68100 + 68094 @@ -15508,7 +15599,7 @@ 1 2 - 8423424 + 8422707 @@ -15524,7 +15615,7 @@ 1 2 - 8420626 + 8419908 2 @@ -15545,17 +15636,17 @@ 1 2 - 6560933 + 6560374 2 3 - 697792 + 697733 3 7 - 153458 + 153445 @@ -15571,12 +15662,12 @@ 1 2 - 7241001 + 7240384 2 4 - 171183 + 171168 @@ -15592,12 +15683,12 @@ 1 2 - 7296974 + 7296352 2 3 - 115210 + 115200 @@ -15613,12 +15704,12 @@ 1 2 - 6867383 + 6866798 2 4 - 544800 + 544754 @@ -15634,27 +15725,27 @@ 1 2 - 1469283 + 1469158 2 3 - 509351 + 509308 3 4 - 97952 + 97943 4 7 - 187042 + 187026 7 762 - 120807 + 120797 @@ -15670,22 +15761,22 @@ 1 2 - 1602684 + 1602548 2 3 - 484630 + 484588 3 7 - 186575 + 186559 7 724 - 110546 + 110536 @@ -15701,17 +15792,17 @@ 1 2 - 1877417 + 1877257 2 3 - 384812 + 384779 3 128 - 122207 + 122196 @@ -15727,22 +15818,22 @@ 1 2 - 1705301 + 1705156 2 3 - 401604 + 401569 3 8 - 188441 + 188425 8 592 - 89089 + 89082 @@ -15758,37 +15849,37 @@ 1 2 - 340967 + 340937 2 3 - 86757 + 86750 3 4 - 48509 + 48505 4 6 - 51774 + 51770 6 12 - 52241 + 52236 12 33 - 50375 + 50371 34 3223 - 36382 + 36379 @@ -15804,37 +15895,37 @@ 1 2 - 368486 + 368455 2 3 - 77895 + 77888 3 4 - 45244 + 45240 4 6 - 49442 + 49438 6 14 - 53174 + 53169 14 56 - 50841 + 50837 56 3140 - 21922 + 21920 @@ -15850,27 +15941,27 @@ 1 2 - 456643 + 456605 2 3 - 93754 + 93746 3 5 - 46643 + 46639 5 19 - 50841 + 50837 19 1927 - 19124 + 19122 @@ -15886,32 +15977,32 @@ 1 2 - 378748 + 378716 2 3 - 90489 + 90481 3 5 - 59704 + 59699 5 9 - 51308 + 51303 9 21 - 50375 + 50371 21 1010 - 36382 + 36379 @@ -15927,17 +16018,17 @@ 1 2 - 4492275 + 4491892 2 3 - 531274 + 531228 3 1735 - 283595 + 283570 @@ -15953,17 +16044,17 @@ 1 2 - 4881285 + 4880869 2 17 - 415130 + 415095 17 1731 - 10728 + 10727 @@ -15979,12 +16070,12 @@ 1 2 - 4957315 + 4956893 2 1513 - 349829 + 349799 @@ -16000,12 +16091,12 @@ 1 2 - 5297815 + 5297364 2 6 - 9328 + 9327 @@ -16015,26 +16106,26 @@ var_def - 4024903 + 4024560 id - 4024903 + 4024560 var_decl_specifiers - 310648 + 378249 id - 310648 + 378249 name - 1399 + 1865 @@ -16048,7 +16139,7 @@ 1 2 - 310648 + 378249 @@ -16071,6 +16162,11 @@ 67 466 + + 145 + 146 + 466 + 585 586 @@ -16095,19 +16191,19 @@ type_decls - 3242218 + 3280187 id - 3242218 + 3280187 type_id - 3191843 + 3229815 location - 3163390 + 3163120 @@ -16121,7 +16217,7 @@ 1 2 - 3242218 + 3280187 @@ -16137,7 +16233,7 @@ 1 2 - 3242218 + 3280187 @@ -16153,12 +16249,12 @@ 1 2 - 3150330 + 3188306 2 5 - 41513 + 41509 @@ -16174,12 +16270,12 @@ 1 2 - 3150330 + 3188306 2 5 - 41513 + 41509 @@ -16195,12 +16291,12 @@ 1 2 - 3123276 + 3110884 2 20 - 40113 + 52236 @@ -16216,12 +16312,12 @@ 1 2 - 3123276 + 3110884 2 20 - 40113 + 52236 @@ -16231,33 +16327,33 @@ type_def - 2624653 + 2639354 id - 2624653 + 2639354 type_decl_top - 743037 + 742974 type_decl - 743037 + 742974 namespace_decls - 311523 + 311514 id - 311523 + 311514 namespace_id @@ -16265,11 +16361,11 @@ location - 311523 + 311514 bodylocation - 311523 + 311514 @@ -16283,7 +16379,7 @@ 1 2 - 311523 + 311514 @@ -16299,7 +16395,7 @@ 1 2 - 311523 + 311514 @@ -16315,7 +16411,7 @@ 1 2 - 311523 + 311514 @@ -16529,7 +16625,7 @@ 1 2 - 311523 + 311514 @@ -16545,7 +16641,7 @@ 1 2 - 311523 + 311514 @@ -16561,7 +16657,7 @@ 1 2 - 311523 + 311514 @@ -16577,7 +16673,7 @@ 1 2 - 311523 + 311514 @@ -16593,7 +16689,7 @@ 1 2 - 311523 + 311514 @@ -16609,7 +16705,7 @@ 1 2 - 311523 + 311514 @@ -16619,19 +16715,19 @@ usings - 369419 + 369388 id - 369419 + 369388 element_id - 315312 + 315286 location - 247679 + 247658 @@ -16645,7 +16741,7 @@ 1 2 - 369419 + 369388 @@ -16661,7 +16757,7 @@ 1 2 - 369419 + 369388 @@ -16677,12 +16773,12 @@ 1 2 - 263071 + 263049 2 3 - 50841 + 50837 3 @@ -16703,12 +16799,12 @@ 1 2 - 263071 + 263049 2 3 - 50841 + 50837 3 @@ -16729,22 +16825,22 @@ 1 2 - 202434 + 202417 2 4 - 10728 + 10727 4 5 - 31251 + 31248 5 11 - 3265 + 3264 @@ -16760,22 +16856,22 @@ 1 2 - 202434 + 202417 2 4 - 10728 + 10727 4 5 - 31251 + 31248 5 11 - 3265 + 3264 @@ -16785,15 +16881,15 @@ using_container - 462579 + 462471 parent - 10951 + 10949 child - 293313 + 293245 @@ -16807,7 +16903,7 @@ 1 2 - 3266 + 3265 2 @@ -16822,7 +16918,7 @@ 6 7 - 2472 + 2471 7 @@ -16842,7 +16938,7 @@ 179 183 - 850 + 849 201 @@ -16863,22 +16959,22 @@ 1 2 - 216338 + 216288 2 3 - 51257 + 51245 3 11 - 23603 + 23598 13 41 - 2114 + 2113 @@ -16888,19 +16984,19 @@ static_asserts - 134652 + 134648 id - 134652 + 134648 condition - 134652 + 134648 message - 30221 + 30220 location @@ -16922,7 +17018,7 @@ 1 2 - 134652 + 134648 @@ -16938,7 +17034,7 @@ 1 2 - 134652 + 134648 @@ -16954,7 +17050,7 @@ 1 2 - 134652 + 134648 @@ -16970,7 +17066,7 @@ 1 2 - 134652 + 134648 @@ -16986,7 +17082,7 @@ 1 2 - 134652 + 134648 @@ -17002,7 +17098,7 @@ 1 2 - 134652 + 134648 @@ -17018,7 +17114,7 @@ 1 2 - 134652 + 134648 @@ -17034,7 +17130,7 @@ 1 2 - 134652 + 134648 @@ -17153,7 +17249,7 @@ 1 2 - 23664 + 23663 2 @@ -17189,12 +17285,12 @@ 1 2 - 3288 + 3287 2 3 - 2831 + 2830 3 @@ -17229,7 +17325,7 @@ 17 18 - 3434 + 3433 19 @@ -17250,12 +17346,12 @@ 1 2 - 3288 + 3287 2 3 - 2831 + 2830 3 @@ -17290,7 +17386,7 @@ 17 18 - 3434 + 3433 19 @@ -17321,7 +17417,7 @@ 3 4 - 6081 + 6080 4 @@ -17357,7 +17453,7 @@ 4 5 - 3707 + 3706 5 @@ -17496,23 +17592,23 @@ params - 6740045 + 6739471 id - 6576325 + 6575765 function - 3879840 + 3879510 index - 7929 + 7928 type_id - 2188998 + 2188812 @@ -17526,7 +17622,7 @@ 1 2 - 6576325 + 6575765 @@ -17542,7 +17638,7 @@ 1 2 - 6576325 + 6575765 @@ -17558,12 +17654,12 @@ 1 2 - 6452719 + 6452169 2 4 - 123606 + 123595 @@ -17579,22 +17675,22 @@ 1 2 - 2257099 + 2256906 2 3 - 952002 + 951921 3 4 - 429590 + 429553 4 18 - 241149 + 241128 @@ -17610,22 +17706,22 @@ 1 2 - 2257099 + 2256906 2 3 - 952002 + 951921 3 4 - 429590 + 429553 4 18 - 241149 + 241128 @@ -17641,22 +17737,22 @@ 1 2 - 2555153 + 2554936 2 3 - 826063 + 825993 3 4 - 346097 + 346068 4 12 - 152525 + 152512 @@ -17910,22 +18006,22 @@ 1 2 - 1488407 + 1488280 2 3 - 440318 + 440281 3 8 - 170250 + 170235 8 518 - 90022 + 90015 @@ -17941,22 +18037,22 @@ 1 2 - 1708100 + 1707954 2 3 - 248145 + 248124 3 9 - 168384 + 168370 9 502 - 64368 + 64363 @@ -17972,17 +18068,17 @@ 1 2 - 1761740 + 1761590 2 3 - 348430 + 348400 3 13 - 78828 + 78821 @@ -17992,15 +18088,15 @@ overrides - 125864 + 125718 new - 122888 + 122746 old - 9753 + 9742 @@ -18014,12 +18110,12 @@ 1 2 - 119920 + 119782 2 4 - 2967 + 2964 @@ -18035,32 +18131,32 @@ 1 2 - 4293 + 4288 2 3 - 2100 + 2098 3 4 - 925 + 924 4 5 - 458 + 457 5 7 - 850 + 849 7 23 - 762 + 761 25 @@ -18075,19 +18171,19 @@ membervariables - 1056548 + 1056565 id - 1054750 + 1054767 type_id - 327744 + 327749 name - 451642 + 451649 @@ -18101,7 +18197,7 @@ 1 2 - 1053032 + 1053049 2 @@ -18122,7 +18218,7 @@ 1 2 - 1054750 + 1054767 @@ -18138,17 +18234,17 @@ 1 2 - 243041 + 243045 2 3 - 51900 + 51901 3 10 - 25530 + 25531 10 @@ -18169,17 +18265,17 @@ 1 2 - 255267 + 255271 2 3 - 46466 + 46467 3 40 - 24611 + 24612 41 @@ -18200,17 +18296,17 @@ 1 2 - 295341 + 295346 2 3 - 86540 + 86542 3 5 - 41192 + 41193 5 @@ -18231,12 +18327,12 @@ 1 2 - 367858 + 367864 2 3 - 51740 + 51741 3 @@ -18422,19 +18518,19 @@ localvariables - 576895 + 576915 id - 576895 + 576915 type_id - 37592 + 37715 name - 90648 + 90543 @@ -18448,7 +18544,7 @@ 1 2 - 576895 + 576915 @@ -18464,7 +18560,7 @@ 1 2 - 576895 + 576915 @@ -18480,17 +18576,17 @@ 1 2 - 21032 + 21174 2 3 - 5372 + 5362 3 4 - 2459 + 2456 4 @@ -18500,12 +18596,12 @@ 7 18 - 2855 + 2847 18 - 15849 - 2492 + 15850 + 2493 @@ -18521,27 +18617,27 @@ 1 2 - 26775 + 26907 2 3 - 4568 + 4562 3 5 - 2917 + 2918 5 - 31 - 2821 + 33 + 2835 - 31 + 33 3455 - 508 + 491 @@ -18557,27 +18653,27 @@ 1 2 - 57094 + 57028 2 3 - 14300 + 14284 3 5 - 8319 + 8309 5 15 - 6989 + 6981 15 5178 - 3943 + 3938 @@ -18593,17 +18689,17 @@ 1 2 - 76576 + 76488 2 3 - 7419 + 7410 3 1486 - 6652 + 6644 @@ -18613,15 +18709,15 @@ autoderivation - 147957 + 149570 var - 147957 + 149570 derivation_type - 517 + 492 @@ -18635,7 +18731,7 @@ 1 2 - 147957 + 149570 @@ -18649,29 +18745,29 @@ 12 - 33 - 34 - 103 + 34 + 35 + 98 - 91 - 92 - 103 + 101 + 102 + 98 - 354 - 355 - 103 + 377 + 378 + 98 - 392 - 393 - 103 + 411 + 412 + 98 - 560 - 561 - 103 + 595 + 596 + 98 @@ -18681,15 +18777,15 @@ orphaned_variables - 37359 + 37338 var - 37359 + 37338 function - 32837 + 32818 @@ -18703,7 +18799,7 @@ 1 2 - 37359 + 37338 @@ -18719,12 +18815,12 @@ 1 2 - 30785 + 30767 2 47 - 2052 + 2051 @@ -18734,11 +18830,11 @@ enumconstants - 241682 + 241686 id - 241682 + 241686 parent @@ -18754,11 +18850,11 @@ name - 241403 + 241407 location - 221585 + 221589 @@ -18772,7 +18868,7 @@ 1 2 - 241682 + 241686 @@ -18788,7 +18884,7 @@ 1 2 - 241682 + 241686 @@ -18804,7 +18900,7 @@ 1 2 - 241682 + 241686 @@ -18820,7 +18916,7 @@ 1 2 - 241682 + 241686 @@ -18836,7 +18932,7 @@ 1 2 - 241682 + 241686 @@ -19137,12 +19233,12 @@ 3 4 - 1757 + 1758 4 5 - 878 + 879 5 @@ -19157,7 +19253,7 @@ 12 20 - 878 + 879 20 @@ -19193,12 +19289,12 @@ 3 4 - 1757 + 1758 4 5 - 878 + 879 5 @@ -19213,7 +19309,7 @@ 12 20 - 878 + 879 20 @@ -19265,12 +19361,12 @@ 3 4 - 1757 + 1758 4 5 - 878 + 879 5 @@ -19285,7 +19381,7 @@ 12 20 - 878 + 879 20 @@ -19321,12 +19417,12 @@ 3 4 - 1757 + 1758 4 5 - 878 + 879 5 @@ -19341,7 +19437,7 @@ 12 20 - 878 + 879 20 @@ -19447,7 +19543,7 @@ 1 2 - 241123 + 241127 2 @@ -19468,7 +19564,7 @@ 1 2 - 241123 + 241127 2 @@ -19489,7 +19585,7 @@ 1 2 - 241403 + 241407 @@ -19505,7 +19601,7 @@ 1 2 - 241403 + 241407 @@ -19521,7 +19617,7 @@ 1 2 - 241123 + 241127 2 @@ -19542,7 +19638,7 @@ 1 2 - 220826 + 220830 2 @@ -19563,7 +19659,7 @@ 1 2 - 221585 + 221589 @@ -19579,7 +19675,7 @@ 1 2 - 220826 + 220830 2 @@ -19600,7 +19696,7 @@ 1 2 - 221585 + 221589 @@ -19616,7 +19712,7 @@ 1 2 - 220826 + 220830 2 @@ -19631,23 +19727,23 @@ builtintypes - 26120 + 26118 id - 26120 + 26118 name - 26120 + 26118 kind - 26120 + 26118 size - 3265 + 3264 sign @@ -19655,7 +19751,7 @@ alignment - 2332 + 2331 @@ -19669,7 +19765,7 @@ 1 2 - 26120 + 26118 @@ -19685,7 +19781,7 @@ 1 2 - 26120 + 26118 @@ -19701,7 +19797,7 @@ 1 2 - 26120 + 26118 @@ -19717,7 +19813,7 @@ 1 2 - 26120 + 26118 @@ -19733,7 +19829,7 @@ 1 2 - 26120 + 26118 @@ -19749,7 +19845,7 @@ 1 2 - 26120 + 26118 @@ -19765,7 +19861,7 @@ 1 2 - 26120 + 26118 @@ -19781,7 +19877,7 @@ 1 2 - 26120 + 26118 @@ -19797,7 +19893,7 @@ 1 2 - 26120 + 26118 @@ -19813,7 +19909,7 @@ 1 2 - 26120 + 26118 @@ -19829,7 +19925,7 @@ 1 2 - 26120 + 26118 @@ -19845,7 +19941,7 @@ 1 2 - 26120 + 26118 @@ -19861,7 +19957,7 @@ 1 2 - 26120 + 26118 @@ -19877,7 +19973,7 @@ 1 2 - 26120 + 26118 @@ -19893,7 +19989,7 @@ 1 2 - 26120 + 26118 @@ -20052,7 +20148,7 @@ 3 4 - 2332 + 2331 @@ -20312,7 +20408,7 @@ 2 3 - 2332 + 2331 @@ -20328,7 +20424,7 @@ 3 4 - 2332 + 2331 @@ -20338,15 +20434,15 @@ derivedtypes - 4330887 + 4330518 id - 4330887 + 4330518 name - 2161012 + 2160828 kind @@ -20354,7 +20450,7 @@ type_id - 2670830 + 2670603 @@ -20368,7 +20464,7 @@ 1 2 - 4330887 + 4330518 @@ -20384,7 +20480,7 @@ 1 2 - 4330887 + 4330518 @@ -20400,7 +20496,7 @@ 1 2 - 4330887 + 4330518 @@ -20416,17 +20512,17 @@ 1 2 - 1899340 + 1899178 2 5 - 164653 + 164638 5 1153 - 97019 + 97011 @@ -20442,7 +20538,7 @@ 1 2 - 2160079 + 2159895 2 @@ -20463,17 +20559,17 @@ 1 2 - 1899340 + 1899178 2 5 - 164653 + 164638 5 1135 - 97019 + 97011 @@ -20612,22 +20708,22 @@ 1 2 - 1651194 + 1651053 2 3 - 560193 + 560145 3 4 - 354027 + 353997 4 72 - 105415 + 105406 @@ -20643,22 +20739,22 @@ 1 2 - 1662389 + 1662247 2 3 - 552730 + 552683 3 4 - 351228 + 351198 4 72 - 104482 + 104473 @@ -20674,22 +20770,22 @@ 1 2 - 1655392 + 1655251 2 3 - 563924 + 563876 3 4 - 353094 + 353064 4 6 - 98418 + 98410 @@ -20699,11 +20795,11 @@ pointerishsize - 3210500 + 3210227 id - 3210500 + 3210227 size @@ -20725,7 +20821,7 @@ 1 2 - 3210500 + 3210227 @@ -20741,7 +20837,7 @@ 1 2 - 3210500 + 3210227 @@ -20815,19 +20911,19 @@ arraysizes - 88157 + 88149 id - 88157 + 88149 num_elements - 31717 + 31715 bytesize - 33117 + 33114 alignment @@ -20845,7 +20941,7 @@ 1 2 - 88157 + 88149 @@ -20861,7 +20957,7 @@ 1 2 - 88157 + 88149 @@ -20877,7 +20973,7 @@ 1 2 - 88157 + 88149 @@ -20898,7 +20994,7 @@ 2 3 - 23788 + 23786 3 @@ -20929,12 +21025,12 @@ 1 2 - 26587 + 26584 2 3 - 2332 + 2331 3 @@ -20955,7 +21051,7 @@ 1 2 - 26587 + 26584 2 @@ -20965,7 +21061,7 @@ 3 5 - 2332 + 2331 @@ -20986,17 +21082,17 @@ 2 3 - 23788 + 23786 3 4 - 3265 + 3264 4 6 - 2332 + 2331 7 @@ -21017,7 +21113,7 @@ 1 2 - 27519 + 27517 2 @@ -21043,12 +21139,12 @@ 1 2 - 27519 + 27517 2 3 - 4664 + 4663 4 @@ -21151,15 +21247,15 @@ typedefbase - 1672135 + 1671747 id - 1672135 + 1671747 type_id - 787114 + 786932 @@ -21173,7 +21269,7 @@ 1 2 - 1672135 + 1671747 @@ -21189,22 +21285,22 @@ 1 2 - 612558 + 612416 2 3 - 82557 + 82538 3 6 - 61481 + 61467 6 5437 - 30517 + 30510 @@ -21214,23 +21310,23 @@ decltypes - 165808 + 165094 id - 16658 + 16587 expr - 165808 + 165094 base_type - 9945 + 9903 parentheses_would_change_meaning - 19 + 18 @@ -21244,37 +21340,37 @@ 1 2 - 5077 + 5055 2 3 - 6180 + 6153 3 5 - 1102 + 1098 5 12 - 1293 + 1287 12 18 - 1350 + 1344 18 46 - 1255 + 1249 51 740 - 399 + 397 @@ -21290,7 +21386,7 @@ 1 2 - 16658 + 16587 @@ -21306,7 +21402,7 @@ 1 2 - 16658 + 16587 @@ -21322,7 +21418,7 @@ 1 2 - 165808 + 165094 @@ -21338,7 +21434,7 @@ 1 2 - 165808 + 165094 @@ -21354,7 +21450,7 @@ 1 2 - 165808 + 165094 @@ -21370,17 +21466,17 @@ 1 2 - 7226 + 7195 2 3 - 2263 + 2253 4 149 - 456 + 454 @@ -21396,37 +21492,37 @@ 1 2 - 722 + 719 2 3 - 6123 + 6097 3 4 - 342 + 340 4 5 - 969 + 965 5 7 - 760 + 757 7 32 - 798 + 795 32 3888 - 228 + 227 @@ -21442,7 +21538,7 @@ 1 2 - 9945 + 9903 @@ -21458,7 +21554,7 @@ 876 877 - 19 + 18 @@ -21474,7 +21570,7 @@ 8719 8720 - 19 + 18 @@ -21490,7 +21586,7 @@ 523 524 - 19 + 18 @@ -21500,15 +21596,15 @@ usertypes - 5230182 + 5228803 id - 5230182 + 5228803 name - 1351274 + 1351159 kind @@ -21526,7 +21622,7 @@ 1 2 - 5230182 + 5228803 @@ -21542,7 +21638,7 @@ 1 2 - 5230182 + 5228803 @@ -21558,27 +21654,27 @@ 1 2 - 982787 + 982703 2 3 - 153458 + 153445 3 7 - 104482 + 104473 7 61 - 101683 + 101675 65 874 - 8862 + 8861 @@ -21594,17 +21690,17 @@ 1 2 - 1210876 + 1210772 2 3 - 125005 + 125461 3 7 - 15392 + 14924 @@ -21638,8 +21734,8 @@ 466 - 135 - 136 + 133 + 134 466 @@ -21704,8 +21800,8 @@ 466 - 43 - 44 + 41 + 42 466 @@ -21746,19 +21842,19 @@ usertypesize - 1705768 + 1704689 id - 1705768 + 1704689 size - 13526 + 13525 alignment - 2332 + 2331 @@ -21772,7 +21868,7 @@ 1 2 - 1705768 + 1704689 @@ -21788,7 +21884,7 @@ 1 2 - 1705768 + 1704689 @@ -21804,7 +21900,7 @@ 1 2 - 3265 + 3264 2 @@ -21843,7 +21939,7 @@ 740 - 2472 + 2470 932 @@ -21860,7 +21956,7 @@ 1 2 - 10261 + 10260 2 @@ -21904,8 +22000,8 @@ 466 - 3211 - 3212 + 3209 + 3210 466 @@ -21952,26 +22048,26 @@ usertype_final - 9415 + 8966 id - 9415 + 8966 usertype_uuid - 36638 + 36637 id - 36638 + 36637 uuid - 36264 + 36263 @@ -21985,7 +22081,7 @@ 1 2 - 36638 + 36637 @@ -22001,7 +22097,7 @@ 1 2 - 35889 + 35888 2 @@ -22016,15 +22112,15 @@ mangled_name - 9478043 + 9476303 id - 9478043 + 9476303 mangled_name - 6448521 + 6447972 is_complete @@ -22042,7 +22138,7 @@ 1 2 - 9478043 + 9476303 @@ -22058,7 +22154,7 @@ 1 2 - 9478043 + 9476303 @@ -22074,12 +22170,12 @@ 1 2 - 6167725 + 6167199 2 874 - 280796 + 280772 @@ -22095,7 +22191,7 @@ 1 2 - 6448521 + 6447972 @@ -22109,8 +22205,8 @@ 12 - 20320 - 20321 + 20318 + 20319 466 @@ -22137,59 +22233,59 @@ is_pod_class - 530515 + 530392 id - 530515 + 530392 is_standard_layout_class - 1253788 + 1252748 id - 1253788 + 1252748 is_complete - 1645130 + 1644057 id - 1645130 + 1644057 is_class_template - 397872 + 397838 id - 397872 + 397838 class_instantiation - 1088668 + 1088576 to - 1088668 + 1088576 from - 168384 + 168370 @@ -22203,7 +22299,7 @@ 1 2 - 1088668 + 1088576 @@ -22219,42 +22315,42 @@ 1 2 - 59704 + 59699 2 3 - 29385 + 29383 3 4 - 15858 + 15857 4 5 - 13060 + 13059 5 6 - 9795 + 9794 6 10 - 12593 + 12592 10 16 - 13060 + 13059 16 70 - 13526 + 13525 70 @@ -22269,11 +22365,11 @@ class_template_argument - 2857953 + 2857290 type_id - 1304340 + 1304038 index @@ -22281,7 +22377,7 @@ arg_type - 832912 + 832719 @@ -22295,27 +22391,27 @@ 1 2 - 536388 + 536264 2 3 - 395940 + 395848 3 4 - 229337 + 229284 4 7 - 119283 + 119255 7 113 - 23391 + 23385 @@ -22331,22 +22427,22 @@ 1 2 - 562800 + 562669 2 3 - 407082 + 406987 3 4 - 242660 + 242604 4 113 - 91797 + 91776 @@ -22454,27 +22550,27 @@ 1 2 - 518534 + 518414 2 3 - 172856 + 172815 3 4 - 50865 + 50853 4 10 - 63495 + 63480 10 10265 - 27161 + 27154 @@ -22490,17 +22586,17 @@ 1 2 - 734146 + 733975 2 3 - 80599 + 80581 3 22 - 18167 + 18162 @@ -22510,11 +22606,11 @@ class_template_argument_value - 494891 + 494849 type_id - 304584 + 304558 index @@ -22522,7 +22618,7 @@ arg_value - 494891 + 494849 @@ -22536,12 +22632,12 @@ 1 2 - 249544 + 249523 2 3 - 53174 + 53169 3 @@ -22562,22 +22658,22 @@ 1 2 - 189374 + 189358 2 3 - 81160 + 81153 3 4 - 12127 + 12126 4 9 - 21922 + 21920 @@ -22655,7 +22751,7 @@ 1 2 - 494891 + 494849 @@ -22671,7 +22767,7 @@ 1 2 - 494891 + 494849 @@ -22681,15 +22777,15 @@ is_proxy_class_for - 62969 + 62031 id - 62969 + 62031 templ_param_id - 62969 + 62031 @@ -22703,7 +22799,7 @@ 1 2 - 62969 + 62031 @@ -22719,7 +22815,7 @@ 1 2 - 62969 + 62031 @@ -22729,19 +22825,19 @@ type_mentions - 4029338 + 4029404 id - 4029338 + 4029404 type_id - 198212 + 198215 location - 3995817 + 3995882 kind @@ -22759,7 +22855,7 @@ 1 2 - 4029338 + 4029404 @@ -22775,7 +22871,7 @@ 1 2 - 4029338 + 4029404 @@ -22791,7 +22887,7 @@ 1 2 - 4029338 + 4029404 @@ -22807,7 +22903,7 @@ 1 2 - 97608 + 97609 2 @@ -22832,7 +22928,7 @@ 7 12 - 15861 + 15862 12 @@ -22858,7 +22954,7 @@ 1 2 - 97608 + 97609 2 @@ -22883,7 +22979,7 @@ 7 12 - 15861 + 15862 12 @@ -22909,7 +23005,7 @@ 1 2 - 198212 + 198215 @@ -22925,12 +23021,12 @@ 1 2 - 3962295 + 3962360 2 3 - 33521 + 33522 @@ -22946,12 +23042,12 @@ 1 2 - 3962295 + 3962360 2 3 - 33521 + 33522 @@ -22967,7 +23063,7 @@ 1 2 - 3995817 + 3995882 @@ -23025,26 +23121,26 @@ is_function_template - 1401649 + 1401530 id - 1401649 + 1401530 function_instantiation - 894647 + 894135 to - 894647 + 894135 from - 144220 + 144138 @@ -23058,7 +23154,7 @@ 1 2 - 894647 + 894135 @@ -23074,27 +23170,27 @@ 1 2 - 100008 + 99951 2 3 - 14227 + 14219 3 6 - 11861 + 11855 6 21 - 11896 + 11889 22 870 - 6226 + 6223 @@ -23104,11 +23200,11 @@ function_template_argument - 2310067 + 2308747 function_id - 1319621 + 1318866 index @@ -23116,7 +23212,7 @@ arg_type - 300789 + 300617 @@ -23130,22 +23226,22 @@ 1 2 - 673411 + 673026 2 3 - 389910 + 389687 3 4 - 186519 + 186413 4 15 - 69779 + 69739 @@ -23161,22 +23257,22 @@ 1 2 - 690804 + 690409 2 3 - 399684 + 399456 3 4 - 166622 + 166527 4 9 - 62509 + 62473 @@ -23324,32 +23420,32 @@ 1 2 - 184258 + 184153 2 3 - 44038 + 44013 3 5 - 23167 + 23153 5 16 - 23201 + 23188 16 107 - 22714 + 22701 108 957 - 3408 + 3407 @@ -23365,17 +23461,17 @@ 1 2 - 271048 + 270893 2 4 - 25671 + 25656 4 17 - 4069 + 4067 @@ -23385,11 +23481,11 @@ function_template_argument_value - 358464 + 358259 function_id - 192467 + 192357 index @@ -23397,7 +23493,7 @@ arg_value - 355855 + 355651 @@ -23411,12 +23507,12 @@ 1 2 - 183215 + 183110 2 8 - 9252 + 9247 @@ -23432,17 +23528,17 @@ 1 2 - 175875 + 175774 2 31 - 15096 + 15088 32 97 - 1495 + 1494 @@ -23580,12 +23676,12 @@ 1 2 - 353246 + 353044 2 3 - 2608 + 2607 @@ -23601,7 +23697,7 @@ 1 2 - 355855 + 355651 @@ -23611,26 +23707,26 @@ is_variable_template - 46973 + 40299 id - 46973 + 40299 variable_instantiation - 171237 + 178341 to - 171237 + 178341 from - 25659 + 24829 @@ -23644,7 +23740,7 @@ 1 2 - 171237 + 178341 @@ -23660,42 +23756,42 @@ 1 2 - 13761 + 12217 2 3 - 2586 + 2857 3 4 - 1241 + 1182 4 6 - 1862 + 2167 6 8 - 1345 + 1280 8 - 12 - 2172 + 11 + 2069 - 12 - 38 - 1965 + 11 + 31 + 1872 - 46 - 278 - 724 + 33 + 291 + 1182 @@ -23705,19 +23801,19 @@ variable_template_argument - 308331 + 322099 variable_id - 162132 + 169671 index - 1758 + 1675 arg_type - 169995 + 175287 @@ -23731,22 +23827,22 @@ 1 2 - 82980 + 86017 2 3 - 50491 + 54192 3 4 - 18624 + 19213 4 17 - 10036 + 10247 @@ -23762,22 +23858,22 @@ 1 2 - 87636 + 90353 2 3 - 51733 + 55473 3 4 - 13554 + 14385 4 17 - 9208 + 9459 @@ -23791,49 +23887,54 @@ 12 - 9 - 10 - 103 + 10 + 11 + 98 - 19 - 20 - 620 + 20 + 21 + 591 - 26 - 27 - 413 + 27 + 28 + 295 - 47 - 48 - 103 + 28 + 29 + 98 - 93 - 94 - 103 + 50 + 51 + 98 - 185 - 186 - 103 + 100 + 101 + 98 - 548 - 549 - 103 + 196 + 197 + 98 - 627 - 628 - 103 + 589 + 590 + 98 - 1253 - 1254 - 103 + 697 + 698 + 98 + + + 1392 + 1393 + 98 @@ -23849,52 +23950,57 @@ 1 2 - 103 + 98 10 11 - 413 + 394 11 12 - 206 + 197 12 13 - 413 + 295 - 29 - 30 - 103 + 13 + 14 + 98 - 48 - 49 - 103 + 31 + 32 + 98 - 130 - 131 - 103 + 53 + 54 + 98 - 376 - 377 - 103 + 138 + 139 + 98 - 403 - 404 - 103 + 406 + 407 + 98 - 743 - 744 - 103 + 442 + 443 + 98 + + + 809 + 810 + 98 @@ -23910,22 +24016,22 @@ 1 2 - 136783 + 138338 2 3 - 19348 + 21578 3 - 24 - 12829 + 11 + 13301 - 24 - 110 - 1034 + 11 + 119 + 2069 @@ -23941,16 +24047,16 @@ 1 2 - 153130 + 158241 2 3 - 14795 + 14976 3 - 6 + 7 2069 @@ -23961,19 +24067,19 @@ variable_template_argument_value - 11795 + 11922 variable_id - 7760 + 8079 index - 413 + 394 arg_value - 11795 + 11922 @@ -23987,12 +24093,12 @@ 1 2 - 7346 + 7685 2 3 - 413 + 394 @@ -24008,17 +24114,17 @@ 1 2 - 4345 + 4828 2 3 - 3104 + 2955 4 5 - 310 + 295 @@ -24034,22 +24140,22 @@ 4 5 - 103 + 98 - 19 - 20 - 103 + 23 + 24 + 98 26 27 - 103 + 98 - 30 - 31 - 103 + 33 + 34 + 98 @@ -24065,22 +24171,22 @@ 7 8 - 103 + 98 - 28 - 29 - 103 + 32 + 33 + 98 38 39 - 103 + 98 - 41 - 42 - 103 + 44 + 45 + 98 @@ -24096,7 +24202,7 @@ 1 2 - 11795 + 11922 @@ -24112,7 +24218,7 @@ 1 2 - 11795 + 11922 @@ -24122,15 +24228,15 @@ routinetypes - 538026 + 537719 id - 538026 + 537719 return_type - 280336 + 280175 @@ -24144,7 +24250,7 @@ 1 2 - 538026 + 537719 @@ -24160,17 +24266,17 @@ 1 2 - 244159 + 244019 2 3 - 20940 + 20928 3 3595 - 15236 + 15227 @@ -24180,19 +24286,19 @@ routinetypeargs - 982320 + 982237 routine - 423060 + 423024 index - 7929 + 7928 type_id - 226689 + 226670 @@ -24206,27 +24312,27 @@ 1 2 - 152525 + 152512 2 3 - 133868 + 133856 3 4 - 63435 + 63430 4 5 - 45711 + 45707 5 18 - 27519 + 27517 @@ -24242,27 +24348,27 @@ 1 2 - 182377 + 182362 2 3 - 133401 + 133390 3 4 - 58771 + 58766 4 5 - 33583 + 33580 5 11 - 14926 + 14924 @@ -24420,27 +24526,27 @@ 1 2 - 146461 + 146449 2 3 - 30784 + 30782 3 5 - 16791 + 16790 5 12 - 18191 + 18189 12 110 - 14459 + 14458 @@ -24456,22 +24562,22 @@ 1 2 - 172582 + 172567 2 3 - 30784 + 30782 3 6 - 18657 + 18655 6 14 - 4664 + 4663 @@ -24481,19 +24587,19 @@ ptrtomembers - 37781 + 37778 id - 37781 + 37778 type_id - 37781 + 37778 class_id - 15392 + 15391 @@ -24507,7 +24613,7 @@ 1 2 - 37781 + 37778 @@ -24523,7 +24629,7 @@ 1 2 - 37781 + 37778 @@ -24539,7 +24645,7 @@ 1 2 - 37781 + 37778 @@ -24555,7 +24661,7 @@ 1 2 - 37781 + 37778 @@ -24571,7 +24677,7 @@ 1 2 - 13526 + 13525 8 @@ -24597,7 +24703,7 @@ 1 2 - 13526 + 13525 8 @@ -24617,15 +24723,15 @@ specifiers - 24721 + 24719 id - 24721 + 24719 str - 24721 + 24719 @@ -24639,7 +24745,7 @@ 1 2 - 24721 + 24719 @@ -24655,7 +24761,7 @@ 1 2 - 24721 + 24719 @@ -24665,11 +24771,11 @@ typespecifiers - 1291103 + 1290060 type_id - 1272912 + 1271871 spec_id @@ -24687,12 +24793,12 @@ 1 2 - 1254721 + 1253681 2 3 - 18191 + 18189 @@ -24733,12 +24839,7 @@ 219 220 - 466 - - - 221 - 222 - 466 + 932 2042 @@ -24753,11 +24854,11 @@ funspecifiers - 12603886 + 12596680 func_id - 3853638 + 3851434 spec_id @@ -24775,27 +24876,27 @@ 1 2 - 310668 + 310491 2 3 - 540079 + 539770 3 4 - 1133449 + 1132801 4 5 - 1623611 + 1622683 5 8 - 245828 + 245688 @@ -24911,11 +25012,11 @@ varspecifiers - 2244038 + 2243847 var_id - 1223936 + 1223832 spec_id @@ -24933,22 +25034,22 @@ 1 2 - 729510 + 729448 2 3 - 202434 + 202417 3 4 - 58304 + 58299 4 5 - 233686 + 233666 @@ -25009,27 +25110,27 @@ attributes - 729440 + 707258 id - 729440 + 707258 kind - 310 + 295 name - 1655 + 1576 name_space - 206 + 197 location - 479361 + 456496 @@ -25043,7 +25144,7 @@ 1 2 - 729440 + 707258 @@ -25059,7 +25160,7 @@ 1 2 - 729440 + 707258 @@ -25075,7 +25176,7 @@ 1 2 - 729440 + 707258 @@ -25091,7 +25192,7 @@ 1 2 - 729440 + 707258 @@ -25107,17 +25208,17 @@ 5 6 - 103 + 98 2332 2333 - 103 + 98 - 4713 - 4714 - 103 + 4841 + 4842 + 98 @@ -25133,17 +25234,17 @@ 1 2 - 103 + 98 6 7 - 103 + 98 11 12 - 103 + 98 @@ -25159,12 +25260,12 @@ 1 2 - 206 + 197 2 3 - 103 + 98 @@ -25180,17 +25281,17 @@ 2 3 - 103 + 98 2057 2058 - 103 + 98 2574 2575 - 103 + 98 @@ -25206,72 +25307,67 @@ 1 2 - 310 + 197 2 3 - 103 + 197 4 5 - 103 + 98 5 6 - 103 + 98 11 12 - 103 + 98 14 15 - 103 - - - 16 - 17 - 103 + 197 18 19 - 103 + 98 24 25 - 103 + 98 - 86 - 87 - 103 + 88 + 89 + 98 - 115 - 116 - 103 + 117 + 118 + 98 - 1048 - 1049 - 103 + 1080 + 1081 + 98 1760 1761 - 103 + 98 - 3944 - 3945 - 103 + 4037 + 4038 + 98 @@ -25287,12 +25383,12 @@ 1 2 - 1448 + 1379 2 3 - 206 + 197 @@ -25308,7 +25404,7 @@ 1 2 - 1655 + 1576 @@ -25324,67 +25420,67 @@ 1 2 - 310 + 295 2 3 - 206 + 197 4 5 - 103 + 98 6 7 - 103 + 98 8 9 - 103 + 98 9 10 - 103 + 98 14 15 - 103 + 98 18 19 - 103 + 98 59 60 - 103 + 98 72 73 - 103 + 98 333 334 - 103 + 98 1756 1757 - 103 + 98 2388 2389 - 103 + 98 @@ -25398,14 +25494,14 @@ 12 - 19 - 20 - 103 + 20 + 21 + 98 - 7031 - 7032 - 103 + 7158 + 7159 + 98 @@ -25421,12 +25517,12 @@ 1 2 - 103 + 98 3 4 - 103 + 98 @@ -25442,12 +25538,12 @@ 2 3 - 103 + 98 14 15 - 103 + 98 @@ -25463,12 +25559,12 @@ 9 10 - 103 + 98 4624 4625 - 103 + 98 @@ -25484,17 +25580,17 @@ 1 2 - 422351 + 398559 2 3 - 36316 + 35274 3 - 201 - 20693 + 202 + 22662 @@ -25510,7 +25606,7 @@ 1 2 - 479361 + 456496 @@ -25526,12 +25622,12 @@ 1 2 - 475119 + 452456 2 3 - 4242 + 4039 @@ -25547,7 +25643,7 @@ 1 2 - 479361 + 456496 @@ -25557,11 +25653,11 @@ attribute_args - 410000 + 410431 id - 410000 + 410431 kind @@ -25569,7 +25665,7 @@ attribute - 298054 + 298495 index @@ -25577,7 +25673,7 @@ location - 327440 + 327412 @@ -25591,7 +25687,7 @@ 1 2 - 410000 + 410431 @@ -25607,7 +25703,7 @@ 1 2 - 410000 + 410431 @@ -25623,7 +25719,7 @@ 1 2 - 410000 + 410431 @@ -25639,7 +25735,7 @@ 1 2 - 410000 + 410431 @@ -25663,8 +25759,8 @@ 466 - 794 - 795 + 795 + 796 466 @@ -25689,8 +25785,8 @@ 466 - 606 - 607 + 607 + 608 466 @@ -25754,17 +25850,17 @@ 1 2 - 215961 + 216409 2 3 - 52241 + 52236 3 4 - 29852 + 29849 @@ -25780,12 +25876,12 @@ 1 2 - 273799 + 274242 2 3 - 24254 + 24252 @@ -25801,17 +25897,17 @@ 1 2 - 215961 + 216409 2 3 - 52241 + 52236 3 4 - 29852 + 29849 @@ -25827,17 +25923,17 @@ 1 2 - 215961 + 216409 2 3 - 52241 + 52236 3 4 - 29852 + 29849 @@ -25861,8 +25957,8 @@ 466 - 639 - 640 + 640 + 641 466 @@ -25908,8 +26004,8 @@ 466 - 639 - 640 + 640 + 641 466 @@ -25952,17 +26048,17 @@ 1 2 - 278930 + 278440 2 3 - 23321 + 23786 3 9 - 24721 + 24719 17 @@ -25983,12 +26079,12 @@ 1 2 - 314846 + 314819 2 3 - 12593 + 12592 @@ -26004,17 +26100,17 @@ 1 2 - 278930 + 278440 2 3 - 23321 + 23786 3 9 - 24721 + 24719 17 @@ -26035,7 +26131,7 @@ 1 2 - 327440 + 327412 @@ -26045,15 +26141,15 @@ attribute_arg_value - 39180 + 39177 arg - 39180 + 39177 value - 15858 + 15857 @@ -26067,7 +26163,7 @@ 1 2 - 39180 + 39177 @@ -26083,7 +26179,7 @@ 1 2 - 14459 + 14458 2 @@ -26146,15 +26242,15 @@ attribute_arg_constant - 370352 + 370787 arg - 370352 + 370787 constant - 370352 + 370787 @@ -26168,7 +26264,7 @@ 1 2 - 370352 + 370787 @@ -26184,7 +26280,7 @@ 1 2 - 370352 + 370787 @@ -26295,15 +26391,15 @@ typeattributes - 84325 + 82963 type_id - 61666 + 58330 spec_id - 84325 + 82963 @@ -26317,17 +26413,17 @@ 1 2 - 55768 + 49659 2 - 4 - 4242 + 3 + 6897 - 12 + 3 13 - 1655 + 1773 @@ -26343,7 +26439,7 @@ 1 2 - 84325 + 82963 @@ -26353,15 +26449,15 @@ funcattributes - 651615 + 652026 func_id - 443117 + 443079 spec_id - 651615 + 652026 @@ -26375,17 +26471,17 @@ 1 2 - 334436 + 333941 2 3 - 65301 + 65762 3 6 - 34982 + 34979 6 @@ -26406,7 +26502,7 @@ 1 2 - 651615 + 652026 @@ -26522,15 +26618,15 @@ unspecifiedtype - 10145051 + 10143254 type_id - 10145051 + 10143254 unspecified_type_id - 6817474 + 6815961 @@ -26544,7 +26640,7 @@ 1 2 - 10145051 + 10143254 @@ -26560,17 +26656,17 @@ 1 2 - 4584630 + 4583307 2 3 - 1995426 + 1995256 3 145 - 237417 + 237397 @@ -26580,19 +26676,19 @@ member - 4943849 + 4941022 parent - 639217 + 638852 index - 8696 + 8691 child - 4899184 + 4896383 @@ -26606,42 +26702,42 @@ 1 3 - 19062 + 19051 3 4 - 344410 + 344213 4 5 - 37777 + 37755 5 7 - 52491 + 52461 7 10 - 52178 + 52148 10 15 - 49569 + 49540 15 24 - 48943 + 48915 24 251 - 34785 + 34765 @@ -26657,42 +26753,42 @@ 1 3 - 19062 + 19051 3 4 - 344341 + 344144 4 5 - 37811 + 37790 5 7 - 52595 + 52565 7 10 - 52526 + 52496 10 15 - 49186 + 49158 15 24 - 49012 + 48984 24 255 - 34681 + 34661 @@ -26708,17 +26804,17 @@ 1 2 - 1391 + 1390 2 3 - 800 + 799 3 4 - 939 + 938 5 @@ -26779,7 +26875,7 @@ 1 2 - 800 + 799 2 @@ -26834,7 +26930,7 @@ 2770 18057 - 452 + 451 @@ -26850,7 +26946,7 @@ 1 2 - 4899184 + 4896383 @@ -26866,12 +26962,12 @@ 1 2 - 4855876 + 4853100 2 8 - 43307 + 43283 @@ -26881,15 +26977,15 @@ enclosingfunction - 117840 + 117812 child - 117840 + 117812 parent - 67310 + 67294 @@ -26903,7 +26999,7 @@ 1 2 - 117840 + 117812 @@ -26919,22 +27015,22 @@ 1 2 - 35573 + 35565 2 3 - 20885 + 20880 3 4 - 5906 + 5905 4 45 - 4944 + 4943 @@ -26944,15 +27040,15 @@ derivations - 390988 + 390765 derivation - 390988 + 390765 sub - 370743 + 370531 index @@ -26960,11 +27056,11 @@ super - 202451 + 202335 location - 37672 + 37651 @@ -26978,7 +27074,7 @@ 1 2 - 390988 + 390765 @@ -26994,7 +27090,7 @@ 1 2 - 390988 + 390765 @@ -27010,7 +27106,7 @@ 1 2 - 390988 + 390765 @@ -27026,7 +27122,7 @@ 1 2 - 390988 + 390765 @@ -27042,12 +27138,12 @@ 1 2 - 355785 + 355582 2 7 - 14957 + 14949 @@ -27063,12 +27159,12 @@ 1 2 - 355785 + 355582 2 7 - 14957 + 14949 @@ -27084,12 +27180,12 @@ 1 2 - 355785 + 355582 2 7 - 14957 + 14949 @@ -27105,12 +27201,12 @@ 1 2 - 355785 + 355582 2 7 - 14957 + 14949 @@ -27255,12 +27351,12 @@ 1 2 - 195076 + 194965 2 1519 - 7374 + 7370 @@ -27276,12 +27372,12 @@ 1 2 - 195076 + 194965 2 1519 - 7374 + 7370 @@ -27297,12 +27393,12 @@ 1 2 - 201999 + 201883 2 4 - 452 + 451 @@ -27318,12 +27414,12 @@ 1 2 - 198798 + 198685 2 108 - 3652 + 3650 @@ -27339,22 +27435,22 @@ 1 2 - 28002 + 27986 2 5 - 3200 + 3198 5 15 - 2887 + 2885 15 134 - 2852 + 2850 136 @@ -27375,22 +27471,22 @@ 1 2 - 28002 + 27986 2 5 - 3200 + 3198 5 15 - 2887 + 2885 15 134 - 2852 + 2850 136 @@ -27411,7 +27507,7 @@ 1 2 - 37672 + 37651 @@ -27427,22 +27523,22 @@ 1 2 - 30367 + 30350 2 5 - 3339 + 3337 5 45 - 2852 + 2850 54 415 - 1113 + 1112 @@ -27452,11 +27548,11 @@ derspecifiers - 392867 + 392642 der_id - 390605 + 390382 spec_id @@ -27474,12 +27570,12 @@ 1 2 - 388344 + 388122 2 3 - 2261 + 2259 @@ -27520,11 +27616,11 @@ direct_base_offsets - 362081 + 361874 der_id - 362081 + 361874 offset @@ -27542,7 +27638,7 @@ 1 2 - 362081 + 361874 @@ -27593,11 +27689,11 @@ virtual_base_offsets - 6443 + 6442 sub - 3557 + 3556 super @@ -27650,12 +27746,12 @@ 1 2 - 2998 + 2997 2 4 - 302 + 301 4 @@ -27884,23 +27980,23 @@ frienddecls - 706005 + 705602 id - 706005 + 705602 type_id - 41846 + 41822 decl_id - 69292 + 69253 location - 6261 + 6257 @@ -27914,7 +28010,7 @@ 1 2 - 706005 + 705602 @@ -27930,7 +28026,7 @@ 1 2 - 706005 + 705602 @@ -27946,7 +28042,7 @@ 1 2 - 706005 + 705602 @@ -27962,47 +28058,47 @@ 1 2 - 6122 + 6118 2 3 - 13044 + 13037 3 6 - 2921 + 2920 6 10 - 3165 + 3163 10 17 - 3235 + 3233 17 24 - 3304 + 3302 25 36 - 3269 + 3267 37 55 - 3200 + 3198 55 103 - 3582 + 3580 @@ -28018,47 +28114,47 @@ 1 2 - 6122 + 6118 2 3 - 13044 + 13037 3 6 - 2921 + 2920 6 10 - 3165 + 3163 10 17 - 3235 + 3233 17 24 - 3304 + 3302 25 36 - 3269 + 3267 37 55 - 3200 + 3198 55 103 - 3582 + 3580 @@ -28074,12 +28170,12 @@ 1 2 - 40420 + 40397 2 13 - 1426 + 1425 @@ -28095,37 +28191,37 @@ 1 2 - 39968 + 39945 2 3 - 5809 + 5805 3 8 - 5948 + 5944 8 15 - 5356 + 5353 15 32 - 5217 + 5214 32 71 - 5217 + 5214 72 160 - 1774 + 1773 @@ -28141,37 +28237,37 @@ 1 2 - 39968 + 39945 2 3 - 5809 + 5805 3 8 - 5948 + 5944 8 15 - 5356 + 5353 15 32 - 5217 + 5214 32 71 - 5217 + 5214 72 160 - 1774 + 1773 @@ -28187,7 +28283,7 @@ 1 2 - 68631 + 68592 2 @@ -28208,7 +28304,7 @@ 1 2 - 5878 + 5875 2 @@ -28229,7 +28325,7 @@ 1 2 - 6122 + 6118 2 @@ -28250,7 +28346,7 @@ 1 2 - 5913 + 5910 2 @@ -28265,19 +28361,19 @@ comments - 8682106 + 8267972 id - 8682106 + 8267972 contents - 3305971 + 3148277 location - 8682106 + 8267972 @@ -28291,7 +28387,7 @@ 1 2 - 8682106 + 8267972 @@ -28307,7 +28403,7 @@ 1 2 - 8682106 + 8267972 @@ -28323,17 +28419,17 @@ 1 2 - 3024231 + 2879976 2 7 - 248527 + 236672 7 32784 - 33212 + 31628 @@ -28349,17 +28445,17 @@ 1 2 - 3024231 + 2879976 2 7 - 248527 + 236672 7 32784 - 33212 + 31628 @@ -28375,7 +28471,7 @@ 1 2 - 8682106 + 8267972 @@ -28391,7 +28487,7 @@ 1 2 - 8682106 + 8267972 @@ -28401,15 +28497,15 @@ commentbinding - 3088293 + 3088030 id - 2443208 + 2443000 element - 3011797 + 3011541 @@ -28423,12 +28519,12 @@ 1 2 - 2366245 + 2366044 2 97 - 76962 + 76955 @@ -28444,12 +28540,12 @@ 1 2 - 2935301 + 2935051 2 3 - 76496 + 76489 @@ -28459,15 +28555,15 @@ exprconv - 7033379 + 7033492 converted - 7033379 + 7033492 conversion - 7033379 + 7033492 @@ -28481,7 +28577,7 @@ 1 2 - 7033379 + 7033492 @@ -28497,7 +28593,7 @@ 1 2 - 7033379 + 7033492 @@ -28507,30 +28603,30 @@ compgenerated - 9267960 + 9273474 id - 9267960 + 9273474 synthetic_destructor_call - 473158 + 510792 element - 286203 + 324717 i - 380 + 359 destructor_call - 473158 + 510792 @@ -28544,27 +28640,27 @@ 1 2 - 188057 + 227088 2 3 - 50984 + 50651 3 4 - 21850 + 21775 4 - 6 - 21584 + 8 + 24539 - 6 + 8 20 - 3727 + 662 @@ -28580,27 +28676,27 @@ 1 2 - 188057 + 227088 2 3 - 50984 + 50651 3 4 - 21850 + 21775 4 - 6 - 21584 + 8 + 24539 - 6 + 8 20 - 3727 + 662 @@ -28616,102 +28712,97 @@ 2 3 - 19 + 18 3 4 - 19 + 18 4 5 - 19 + 18 5 6 - 19 + 18 6 7 - 19 + 18 7 8 - 19 + 18 10 11 - 19 + 18 11 12 - 19 + 18 16 17 - 19 + 18 19 20 - 19 + 18 27 28 - 19 + 18 35 36 - 19 - - - 37 - 38 - 19 + 18 83 84 - 19 + 18 196 197 - 19 + 18 435 436 - 19 + 18 1331 1332 - 19 + 18 - 2480 - 2481 - 19 + 2481 + 2482 + 18 5156 5157 - 19 + 18 - 15018 - 15019 - 19 + 17149 + 17150 + 18 @@ -28727,102 +28818,97 @@ 2 3 - 19 + 18 3 4 - 19 + 18 4 5 - 19 + 18 5 6 - 19 + 18 6 7 - 19 + 18 7 8 - 19 + 18 10 11 - 19 + 18 11 12 - 19 + 18 16 17 - 19 + 18 19 20 - 19 + 18 27 28 - 19 + 18 35 36 - 19 - - - 37 - 38 - 19 + 18 83 84 - 19 + 18 196 197 - 19 + 18 435 436 - 19 + 18 1331 1332 - 19 + 18 - 2480 - 2481 - 19 + 2481 + 2482 + 18 5156 5157 - 19 + 18 - 15018 - 15019 - 19 + 17149 + 17150 + 18 @@ -28838,7 +28924,7 @@ 1 2 - 473158 + 510792 @@ -28854,7 +28940,7 @@ 1 2 - 473158 + 510792 @@ -28864,15 +28950,15 @@ namespaces - 12127 + 12126 id - 12127 + 12126 name - 9795 + 9794 @@ -28886,7 +28972,7 @@ 1 2 - 12127 + 12126 @@ -28933,15 +29019,15 @@ namespacembrs - 2385836 + 2385633 parentid - 10261 + 10260 memberid - 2385836 + 2385633 @@ -29016,7 +29102,7 @@ 1 2 - 2385836 + 2385633 @@ -29026,11 +29112,11 @@ exprparents - 14207231 + 14207462 expr_id - 14207231 + 14207462 child_index @@ -29038,7 +29124,7 @@ parent_id - 9454166 + 9454319 @@ -29052,7 +29138,7 @@ 1 2 - 14207231 + 14207462 @@ -29068,7 +29154,7 @@ 1 2 - 14207231 + 14207462 @@ -29186,17 +29272,17 @@ 1 2 - 5409633 + 5409721 2 3 - 3706777 + 3706838 3 712 - 337754 + 337760 @@ -29212,17 +29298,17 @@ 1 2 - 5409633 + 5409721 2 3 - 3706777 + 3706838 3 712 - 337754 + 337760 @@ -29232,22 +29318,22 @@ expr_isload - 5168684 + 5082911 expr_id - 5168684 + 5082911 conversionkinds - 4221331 + 4221314 expr_id - 4221331 + 4221314 kind @@ -29265,7 +29351,7 @@ 1 2 - 4221331 + 4221314 @@ -29304,8 +29390,8 @@ 1 - 4131254 - 4131255 + 4131237 + 4131238 1 @@ -29316,15 +29402,15 @@ iscall - 3182186 + 3208148 caller - 3182186 + 3208148 kind - 57 + 56 @@ -29338,7 +29424,7 @@ 1 2 - 3182186 + 3208148 @@ -29354,17 +29440,17 @@ 1319 1320 - 19 + 18 2473 2474 - 19 + 18 - 163543 - 163544 - 19 + 165637 + 165638 + 18 @@ -29374,15 +29460,15 @@ numtemplatearguments - 393249 + 393024 expr_id - 393249 + 393024 num - 313 + 312 @@ -29396,7 +29482,7 @@ 1 2 - 393249 + 393024 @@ -29500,23 +29586,23 @@ namequalifiers - 1515301 + 1508764 id - 1515301 + 1508764 qualifiableelement - 1515301 + 1508764 qualifyingelement - 97613 + 97193 location - 304593 + 303282 @@ -29530,7 +29616,7 @@ 1 2 - 1515301 + 1508764 @@ -29546,7 +29632,7 @@ 1 2 - 1515301 + 1508764 @@ -29562,7 +29648,7 @@ 1 2 - 1515301 + 1508764 @@ -29578,7 +29664,7 @@ 1 2 - 1515301 + 1508764 @@ -29594,7 +29680,7 @@ 1 2 - 1515301 + 1508764 @@ -29610,7 +29696,7 @@ 1 2 - 1515301 + 1508764 @@ -29626,27 +29712,27 @@ 1 2 - 58457 + 58206 2 3 - 22420 + 22324 3 5 - 8918 + 8880 5 92 - 7378 + 7346 96 21584 - 437 + 435 @@ -29662,27 +29748,27 @@ 1 2 - 58457 + 58206 2 3 - 22420 + 22324 3 5 - 8918 + 8880 5 92 - 7378 + 7346 96 21584 - 437 + 435 @@ -29698,22 +29784,22 @@ 1 2 - 63877 + 63602 2 3 - 20671 + 20582 3 5 - 8386 + 8350 5 7095 - 4678 + 4658 @@ -29729,32 +29815,32 @@ 1 2 - 100656 + 100223 2 3 - 28430 + 28307 3 4 - 44651 + 44459 4 6 - 13768 + 13727 6 7 - 95692 + 95262 7 790 - 21393 + 21301 @@ -29770,32 +29856,32 @@ 1 2 - 100656 + 100223 2 3 - 28430 + 28307 3 4 - 44651 + 44459 4 6 - 13768 + 13727 6 7 - 95692 + 95262 7 790 - 21393 + 21301 @@ -29811,22 +29897,22 @@ 1 2 - 137206 + 136616 2 3 - 55738 + 55498 3 4 - 102443 + 102003 4 143 - 9204 + 9164 @@ -29836,15 +29922,15 @@ varbind - 6029430 + 6029528 expr - 6029430 + 6029528 var - 768569 + 768581 @@ -29858,7 +29944,7 @@ 1 2 - 6029430 + 6029528 @@ -29874,47 +29960,47 @@ 1 2 - 126228 + 126230 2 3 - 137881 + 137883 3 4 - 106298 + 106300 4 5 - 85215 + 85217 5 6 - 61292 + 61293 6 7 - 48115 + 48116 7 9 - 59624 + 59625 9 13 - 59274 + 59275 13 28 - 58883 + 58884 28 @@ -29929,15 +30015,15 @@ funbind - 3188690 + 3214624 expr - 3182471 + 3208432 fun - 512219 + 510072 @@ -29951,12 +30037,12 @@ 1 2 - 3176253 + 3202241 2 3 - 6218 + 6191 @@ -29972,32 +30058,32 @@ 1 2 - 315736 + 314454 2 3 - 78026 + 77652 3 4 - 31396 + 31261 4 7 - 46153 + 45955 7 121 - 38471 + 38305 123 5011 - 2434 + 2442 @@ -30007,11 +30093,11 @@ expr_allocator - 45951 + 45925 expr - 45951 + 45925 func @@ -30033,7 +30119,7 @@ 1 2 - 45951 + 45925 @@ -30049,7 +30135,7 @@ 1 2 - 45951 + 45925 @@ -30133,11 +30219,11 @@ expr_deallocator - 54613 + 54581 expr - 54613 + 54581 func @@ -30159,7 +30245,7 @@ 1 2 - 54613 + 54581 @@ -30175,7 +30261,7 @@ 1 2 - 54613 + 54581 @@ -30280,15 +30366,15 @@ expr_cond_guard - 657271 + 657281 cond - 657271 + 657281 guard - 657271 + 657281 @@ -30302,7 +30388,7 @@ 1 2 - 657271 + 657281 @@ -30318,7 +30404,7 @@ 1 2 - 657271 + 657281 @@ -30328,15 +30414,15 @@ expr_cond_true - 657268 + 657279 cond - 657268 + 657279 true - 657268 + 657279 @@ -30350,7 +30436,7 @@ 1 2 - 657268 + 657279 @@ -30366,7 +30452,7 @@ 1 2 - 657268 + 657279 @@ -30376,15 +30462,15 @@ expr_cond_false - 657271 + 657281 cond - 657271 + 657281 false - 657271 + 657281 @@ -30398,7 +30484,7 @@ 1 2 - 657271 + 657281 @@ -30414,7 +30500,7 @@ 1 2 - 657271 + 657281 @@ -30424,15 +30510,15 @@ values - 10777241 + 10777417 id - 10777241 + 10777417 str - 88067 + 88069 @@ -30446,7 +30532,7 @@ 1 2 - 10777241 + 10777417 @@ -30462,7 +30548,7 @@ 1 2 - 59548 + 59549 2 @@ -30472,7 +30558,7 @@ 3 6 - 6916 + 6917 6 @@ -30492,15 +30578,15 @@ valuetext - 4757336 + 4757348 id - 4757336 + 4757348 text - 703968 + 703970 @@ -30514,7 +30600,7 @@ 1 2 - 4757336 + 4757348 @@ -30535,12 +30621,12 @@ 2 3 - 102500 + 102501 3 7 - 56769 + 56770 7 @@ -30555,15 +30641,15 @@ valuebind - 11211484 + 11211667 val - 10777241 + 10777417 expr - 11211484 + 11211667 @@ -30577,12 +30663,12 @@ 1 2 - 10365543 + 10365712 2 7 - 411698 + 411704 @@ -30598,7 +30684,7 @@ 1 2 - 11211484 + 11211667 @@ -30608,15 +30694,15 @@ fieldoffsets - 1054750 + 1054767 id - 1054750 + 1054767 byteoffset - 22693 + 22694 bitoffset @@ -30634,7 +30720,7 @@ 1 2 - 1054750 + 1054767 @@ -30650,7 +30736,7 @@ 1 2 - 1054750 + 1054767 @@ -30712,7 +30798,7 @@ 1 2 - 22014 + 22015 2 @@ -30809,19 +30895,19 @@ bitfield - 20693 + 19706 id - 20693 + 19706 bits - 2586 + 2463 declared_bits - 2586 + 2463 @@ -30835,7 +30921,7 @@ 1 2 - 20693 + 19706 @@ -30851,7 +30937,7 @@ 1 2 - 20693 + 19706 @@ -30867,42 +30953,42 @@ 1 2 - 724 + 689 2 3 - 620 + 591 3 4 - 206 + 197 4 5 - 206 + 197 5 6 - 206 + 197 6 8 - 206 + 197 8 11 - 206 + 197 12 115 - 206 + 197 @@ -30918,7 +31004,7 @@ 1 2 - 2586 + 2463 @@ -30934,42 +31020,42 @@ 1 2 - 724 + 689 2 3 - 620 + 591 3 4 - 206 + 197 4 5 - 206 + 197 5 6 - 206 + 197 6 8 - 206 + 197 8 11 - 206 + 197 12 115 - 206 + 197 @@ -30985,7 +31071,7 @@ 1 2 - 2586 + 2463 @@ -30995,23 +31081,23 @@ initialisers - 1710223 + 1710171 init - 1710223 + 1710171 var - 719570 + 719548 expr - 1710223 + 1710171 location - 394513 + 394501 @@ -31025,7 +31111,7 @@ 1 2 - 1710223 + 1710171 @@ -31041,7 +31127,7 @@ 1 2 - 1710223 + 1710171 @@ -31057,7 +31143,7 @@ 1 2 - 1710223 + 1710171 @@ -31073,17 +31159,17 @@ 1 2 - 633825 + 633806 2 15 - 28723 + 28722 16 25 - 57020 + 57019 @@ -31099,17 +31185,17 @@ 1 2 - 633825 + 633806 2 15 - 28723 + 28722 16 25 - 57020 + 57019 @@ -31125,7 +31211,7 @@ 1 2 - 719563 + 719541 2 @@ -31146,7 +31232,7 @@ 1 2 - 1710223 + 1710171 @@ -31162,7 +31248,7 @@ 1 2 - 1710223 + 1710171 @@ -31178,7 +31264,7 @@ 1 2 - 1710223 + 1710171 @@ -31194,17 +31280,17 @@ 1 2 - 321597 + 321587 2 3 - 23956 + 23955 3 15 - 30976 + 30975 15 @@ -31225,12 +31311,12 @@ 1 2 - 344480 + 344470 2 4 - 36086 + 36085 4 @@ -31251,17 +31337,17 @@ 1 2 - 321597 + 321587 2 3 - 23956 + 23955 3 15 - 30976 + 30975 15 @@ -31287,15 +31373,15 @@ expr_ancestor - 477285 + 514901 exp - 477285 + 514901 ancestor - 268993 + 307486 @@ -31309,7 +31395,7 @@ 1 2 - 477285 + 514901 @@ -31325,27 +31411,27 @@ 1 2 - 163963 + 202889 2 3 - 55148 + 54930 3 4 - 22496 + 22400 4 - 6 - 22592 + 7 + 25070 - 6 + 7 26 - 4792 + 2196 @@ -31355,11 +31441,11 @@ exprs - 18388431 + 18388730 id - 18388431 + 18388730 kind @@ -31367,7 +31453,7 @@ location - 8488521 + 8488659 @@ -31381,7 +31467,7 @@ 1 2 - 18388431 + 18388730 @@ -31397,7 +31483,7 @@ 1 2 - 18388431 + 18388730 @@ -31575,22 +31661,22 @@ 1 2 - 7145513 + 7145629 2 3 - 663064 + 663075 3 18 - 638135 + 638145 18 71656 - 41807 + 41808 @@ -31606,17 +31692,17 @@ 1 2 - 7251587 + 7251705 2 3 - 618273 + 618283 3 32 - 618661 + 618671 @@ -31626,19 +31712,19 @@ expr_reuse - 333955 + 372471 reuse - 333955 + 372471 original - 333955 + 372452 value_category - 19 + 37 @@ -31652,7 +31738,7 @@ 1 2 - 333955 + 372471 @@ -31668,7 +31754,7 @@ 1 2 - 333955 + 372471 @@ -31684,7 +31770,12 @@ 1 2 - 333955 + 372433 + + + 2 + 3 + 18 @@ -31700,7 +31791,7 @@ 1 2 - 333955 + 372452 @@ -31714,9 +31805,14 @@ 12 - 17561 - 17562 - 19 + 15 + 16 + 18 + + + 19656 + 19657 + 18 @@ -31730,9 +31826,14 @@ 12 - 17561 - 17562 - 19 + 15 + 16 + 18 + + + 19655 + 19656 + 18 @@ -31742,15 +31843,15 @@ expr_types - 18456468 + 18452210 id - 18325931 + 18321703 typeid - 1236717 + 1236464 value_category @@ -31768,12 +31869,12 @@ 1 2 - 18195394 + 18191197 2 3 - 130536 + 130506 @@ -31789,7 +31890,7 @@ 1 2 - 18325931 + 18321703 @@ -31805,42 +31906,42 @@ 1 2 - 448002 + 447977 2 3 - 256901 + 256729 3 4 - 102760 + 102714 4 5 - 84078 + 84159 5 8 - 110166 + 110118 8 14 - 98352 + 98307 14 42 - 93486 + 93532 42 - 125373 - 42967 + 125371 + 42924 @@ -31856,17 +31957,17 @@ 1 2 - 1069040 + 1068826 2 3 - 157261 + 157225 3 4 - 10414 + 10412 @@ -31885,13 +31986,13 @@ 11 - 372581 - 372582 + 372567 + 372568 11 - 1250724 - 1250725 + 1250740 + 1250741 11 @@ -31916,8 +32017,8 @@ 11 - 92889 - 92890 + 92892 + 92893 11 @@ -31928,15 +32029,15 @@ new_allocated_type - 46995 + 46968 expr - 46995 + 46968 type_id - 27793 + 27777 @@ -31950,7 +32051,7 @@ 1 2 - 46995 + 46968 @@ -31966,12 +32067,12 @@ 1 2 - 11618 + 11611 2 3 - 14714 + 14705 3 @@ -32029,7 +32130,7 @@ 2 3 - 1936 + 1935 3 @@ -33071,15 +33172,15 @@ condition_decl_bind - 40753 + 40577 expr - 40753 + 40577 decl - 40753 + 40577 @@ -33093,7 +33194,7 @@ 1 2 - 40753 + 40577 @@ -33109,7 +33210,7 @@ 1 2 - 40753 + 40577 @@ -33119,15 +33220,15 @@ typeid_bind - 35968 + 35947 expr - 35968 + 35947 type_id - 16175 + 16165 @@ -33141,7 +33242,7 @@ 1 2 - 35968 + 35947 @@ -33157,7 +33258,7 @@ 1 2 - 15757 + 15748 3 @@ -33172,11 +33273,11 @@ uuidof_bind - 20293 + 20292 expr - 20293 + 20292 type_id @@ -33194,7 +33295,7 @@ 1 2 - 20293 + 20292 @@ -33225,11 +33326,11 @@ sizeof_bind - 199194 + 199197 expr - 199194 + 199197 type_id @@ -33247,7 +33348,7 @@ 1 2 - 199194 + 199197 @@ -33356,11 +33457,11 @@ lambdas - 21456 + 21454 expr - 21456 + 21454 default_capture @@ -33382,7 +33483,7 @@ 1 2 - 21456 + 21454 @@ -33398,7 +33499,7 @@ 1 2 - 21456 + 21454 @@ -33472,15 +33573,15 @@ lambda_capture - 27986 + 27983 id - 27986 + 27983 lambda - 20523 + 20521 index @@ -33488,7 +33589,7 @@ field - 27986 + 27983 captured_by_reference @@ -33514,7 +33615,7 @@ 1 2 - 27986 + 27983 @@ -33530,7 +33631,7 @@ 1 2 - 27986 + 27983 @@ -33546,7 +33647,7 @@ 1 2 - 27986 + 27983 @@ -33562,7 +33663,7 @@ 1 2 - 27986 + 27983 @@ -33578,7 +33679,7 @@ 1 2 - 27986 + 27983 @@ -33594,7 +33695,7 @@ 1 2 - 27986 + 27983 @@ -33610,12 +33711,12 @@ 1 2 - 13060 + 13059 2 3 - 7463 + 7462 @@ -33631,12 +33732,12 @@ 1 2 - 13060 + 13059 2 3 - 7463 + 7462 @@ -33652,12 +33753,12 @@ 1 2 - 13060 + 13059 2 3 - 7463 + 7462 @@ -33673,7 +33774,7 @@ 1 2 - 20523 + 20521 @@ -33689,7 +33790,7 @@ 1 2 - 20523 + 20521 @@ -33705,12 +33806,12 @@ 1 2 - 13060 + 13059 2 3 - 7463 + 7462 @@ -33842,7 +33943,7 @@ 1 2 - 27986 + 27983 @@ -33858,7 +33959,7 @@ 1 2 - 27986 + 27983 @@ -33874,7 +33975,7 @@ 1 2 - 27986 + 27983 @@ -33890,7 +33991,7 @@ 1 2 - 27986 + 27983 @@ -33906,7 +34007,7 @@ 1 2 - 27986 + 27983 @@ -33922,7 +34023,7 @@ 1 2 - 27986 + 27983 @@ -34351,19 +34452,19 @@ stmts - 4618654 + 4652754 id - 4618654 + 4652754 kind - 1965 + 1872 location - 2268406 + 2173505 @@ -34377,7 +34478,7 @@ 1 2 - 4618654 + 4652754 @@ -34393,7 +34494,7 @@ 1 2 - 4618654 + 4652754 @@ -34409,97 +34510,97 @@ 1 2 - 103 + 98 18 19 - 103 + 98 22 23 - 103 + 98 - 46 - 47 - 103 + 51 + 52 + 98 - 75 - 76 - 103 + 76 + 77 + 98 - 83 - 84 - 103 + 84 + 85 + 98 - 102 - 103 - 103 + 107 + 108 + 98 - 154 - 155 - 103 + 163 + 164 + 98 - 242 - 243 - 103 + 258 + 259 + 98 - 284 - 285 - 103 + 299 + 300 + 98 - 383 - 384 - 103 + 412 + 413 + 98 - 418 - 419 - 103 + 498 + 499 + 98 - 503 - 504 - 103 + 539 + 540 + 98 - 1326 - 1327 - 103 + 1372 + 1373 + 98 - 2636 - 2637 - 103 + 2811 + 2812 + 98 - 4622 - 4623 - 103 + 4882 + 4883 + 98 - 8806 - 8807 - 103 + 9278 + 9279 + 98 - 11579 - 11580 - 103 + 12170 + 12171 + 98 - 13339 - 13340 - 103 + 14180 + 14181 + 98 @@ -34515,97 +34616,97 @@ 1 2 - 103 + 98 8 9 - 103 + 98 18 19 - 103 + 98 45 46 - 103 + 98 50 51 - 103 + 98 56 57 - 103 + 98 74 75 - 103 - - - 89 - 90 - 103 + 98 101 102 - 103 + 98 - 128 - 129 - 103 + 103 + 104 + 98 - 209 - 210 - 103 + 131 + 132 + 98 + + + 225 + 226 + 98 252 253 - 103 + 98 368 369 - 103 + 98 - 642 - 643 - 103 + 650 + 651 + 98 - 1743 - 1744 - 103 + 1754 + 1755 + 98 - 2190 - 2191 - 103 + 2198 + 2199 + 98 - 4228 - 4229 - 103 + 4253 + 4254 + 98 - 6071 - 6072 - 103 + 6102 + 6103 + 98 - 6567 - 6568 - 103 + 6617 + 6618 + 98 @@ -34621,22 +34722,22 @@ 1 2 - 1878336 + 1726665 2 - 4 - 173927 + 3 + 178637 - 4 - 12 - 174031 + 3 + 8 + 166419 - 12 + 8 689 - 42110 + 101783 @@ -34652,12 +34753,12 @@ 1 2 - 2211706 + 2118820 2 8 - 56699 + 54684 @@ -34763,15 +34864,15 @@ if_initialization - 310 + 295 if_stmt - 310 + 295 init_id - 310 + 295 @@ -34785,7 +34886,7 @@ 1 2 - 310 + 295 @@ -34801,7 +34902,7 @@ 1 2 - 310 + 295 @@ -34811,15 +34912,15 @@ if_then - 725951 + 725963 if_stmt - 725951 + 725963 then_id - 725951 + 725963 @@ -34833,7 +34934,7 @@ 1 2 - 725951 + 725963 @@ -34849,7 +34950,7 @@ 1 2 - 725951 + 725963 @@ -34859,15 +34960,15 @@ if_else - 184679 + 184682 if_stmt - 184679 + 184682 else_id - 184679 + 184682 @@ -34881,7 +34982,7 @@ 1 2 - 184679 + 184682 @@ -34897,7 +34998,7 @@ 1 2 - 184679 + 184682 @@ -34907,15 +35008,15 @@ constexpr_if_initialization - 2 + 3 constexpr_if_stmt - 2 + 3 init_id - 2 + 3 @@ -34929,7 +35030,7 @@ 1 2 - 2 + 3 @@ -34945,7 +35046,7 @@ 1 2 - 2 + 3 @@ -34955,15 +35056,15 @@ constexpr_if_then - 52043 + 53108 constexpr_if_stmt - 52043 + 53108 then_id - 52043 + 53108 @@ -34977,7 +35078,7 @@ 1 2 - 52043 + 53108 @@ -34993,7 +35094,7 @@ 1 2 - 52043 + 53108 @@ -35003,15 +35104,15 @@ constexpr_if_else - 30522 + 30840 constexpr_if_stmt - 30522 + 30840 else_id - 30522 + 30840 @@ -35025,7 +35126,7 @@ 1 2 - 30522 + 30840 @@ -35041,7 +35142,7 @@ 1 2 - 30522 + 30840 @@ -35051,15 +35152,15 @@ while_body - 29141 + 29134 while_stmt - 29141 + 29134 body_id - 29141 + 29134 @@ -35073,7 +35174,7 @@ 1 2 - 29141 + 29134 @@ -35089,7 +35190,7 @@ 1 2 - 29141 + 29134 @@ -35099,15 +35200,15 @@ do_body - 148881 + 148884 do_stmt - 148881 + 148884 body_id - 148881 + 148884 @@ -35121,7 +35222,7 @@ 1 2 - 148881 + 148884 @@ -35137,7 +35238,7 @@ 1 2 - 148881 + 148884 @@ -35147,15 +35248,15 @@ switch_initialization - 6 + 8 switch_stmt - 6 + 8 init_id - 6 + 8 @@ -35169,7 +35270,7 @@ 1 2 - 6 + 8 @@ -35185,7 +35286,7 @@ 1 2 - 6 + 8 @@ -35195,19 +35296,19 @@ switch_case - 207702 + 206808 switch_stmt - 11029 + 10982 index - 4678 + 4658 case_id - 207702 + 206808 @@ -35221,57 +35322,57 @@ 2 3 - 57 + 56 3 4 - 2396 + 2385 4 5 - 1768 + 1760 5 6 - 1045 + 1041 6 8 - 988 + 984 8 9 - 532 + 530 9 10 - 1026 + 1022 10 11 - 361 + 359 11 14 - 1007 + 1003 14 31 - 931 + 927 36 247 - 912 + 908 @@ -35287,57 +35388,57 @@ 2 3 - 57 + 56 3 4 - 2396 + 2385 4 5 - 1768 + 1760 5 6 - 1045 + 1041 6 8 - 988 + 984 8 9 - 532 + 530 9 10 - 1026 + 1022 10 11 - 361 + 359 11 14 - 1007 + 1003 14 31 - 931 + 927 36 247 - 912 + 908 @@ -35353,32 +35454,32 @@ 14 15 - 1236 + 1230 19 20 - 570 + 568 33 34 - 2015 + 2007 34 63 - 399 + 397 68 304 - 361 + 359 358 581 - 95 + 94 @@ -35394,32 +35495,32 @@ 14 15 - 1236 + 1230 19 20 - 570 + 568 33 34 - 2015 + 2007 34 63 - 399 + 397 68 304 - 361 + 359 358 581 - 95 + 94 @@ -35435,7 +35536,7 @@ 1 2 - 207702 + 206808 @@ -35451,7 +35552,7 @@ 1 2 - 207702 + 206808 @@ -35461,15 +35562,15 @@ switch_body - 20787 + 20788 switch_stmt - 20787 + 20788 body_id - 20787 + 20788 @@ -35483,7 +35584,7 @@ 1 2 - 20787 + 20788 @@ -35499,7 +35600,7 @@ 1 2 - 20787 + 20788 @@ -35509,15 +35610,15 @@ for_initialization - 53406 + 53407 for_stmt - 53406 + 53407 init_id - 53406 + 53407 @@ -35531,7 +35632,7 @@ 1 2 - 53406 + 53407 @@ -35547,7 +35648,7 @@ 1 2 - 53406 + 53407 @@ -35557,15 +35658,15 @@ for_condition - 55671 + 55672 for_stmt - 55671 + 55672 condition_id - 55671 + 55672 @@ -35579,7 +35680,7 @@ 1 2 - 55671 + 55672 @@ -35595,7 +35696,7 @@ 1 2 - 55671 + 55672 @@ -35605,15 +35706,15 @@ for_update - 53509 + 53510 for_stmt - 53509 + 53510 update_id - 53509 + 53510 @@ -35627,7 +35728,7 @@ 1 2 - 53509 + 53510 @@ -35643,7 +35744,7 @@ 1 2 - 53509 + 53510 @@ -35653,15 +35754,15 @@ for_body - 61559 + 61560 for_stmt - 61559 + 61560 body_id - 61559 + 61560 @@ -35675,7 +35776,7 @@ 1 2 - 61559 + 61560 @@ -35691,7 +35792,7 @@ 1 2 - 61559 + 61560 @@ -35701,19 +35802,19 @@ stmtparents - 4054557 + 4054504 id - 4054557 + 4054504 index - 12327 + 12326 parent - 1721299 + 1721253 @@ -35727,7 +35828,7 @@ 1 2 - 4054557 + 4054504 @@ -35743,7 +35844,7 @@ 1 2 - 4054557 + 4054504 @@ -35803,7 +35904,7 @@ 77 - 195140 + 195141 704 @@ -35864,7 +35965,7 @@ 77 - 195140 + 195141 704 @@ -35881,27 +35982,27 @@ 1 2 - 989142 + 989112 2 3 - 372562 + 372551 3 4 - 105701 + 105697 4 6 - 111255 + 111251 6 17 - 130355 + 130357 17 @@ -35922,27 +36023,27 @@ 1 2 - 989142 + 989112 2 3 - 372562 + 372551 3 4 - 105701 + 105697 4 6 - 111255 + 111251 6 17 - 130355 + 130357 17 @@ -35957,30 +36058,30 @@ ishandler - 62736 + 62466 block - 62736 + 62466 stmt_decl_bind - 580797 + 580812 stmt - 540979 + 541032 num - 75 + 74 decl - 580692 + 580708 @@ -35994,12 +36095,12 @@ 1 2 - 520271 + 520345 2 19 - 20707 + 20687 @@ -36015,12 +36116,12 @@ 1 2 - 520271 + 520345 2 19 - 20707 + 20687 @@ -36099,18 +36200,18 @@ 4 - 2570 - 2571 + 2571 + 2572 4 - 4968 - 4969 + 4969 + 4970 4 - 129790 - 129791 + 129953 + 129954 4 @@ -36190,18 +36291,18 @@ 4 - 2570 - 2571 + 2571 + 2572 4 - 4968 - 4969 + 4969 + 4970 4 - 129765 - 129766 + 129928 + 129929 4 @@ -36218,7 +36319,7 @@ 1 2 - 580655 + 580671 2 @@ -36239,7 +36340,7 @@ 1 2 - 580692 + 580708 @@ -36249,19 +36350,19 @@ stmt_decl_entry_bind - 523673 + 580812 stmt - 484155 + 541032 num - 75 + 74 decl_entry - 523614 + 580754 @@ -36275,12 +36376,12 @@ 1 2 - 463710 + 520345 2 19 - 20444 + 20687 @@ -36296,12 +36397,12 @@ 1 2 - 463710 + 520345 2 19 - 20444 + 20687 @@ -36380,18 +36481,18 @@ 4 - 2561 - 2562 + 2571 + 2572 4 - 4905 - 4906 + 4969 + 4970 4 - 116157 - 116158 + 129953 + 129954 4 @@ -36471,18 +36572,18 @@ 4 - 2561 - 2562 + 2571 + 2572 4 - 4905 - 4906 + 4969 + 4970 4 - 116143 - 116144 + 129939 + 129940 4 @@ -36499,7 +36600,7 @@ 1 2 - 523593 + 580733 3 @@ -36520,7 +36621,7 @@ 1 2 - 523614 + 580754 @@ -36530,15 +36631,15 @@ blockscope - 1415642 + 1415522 block - 1415642 + 1415522 enclosing - 1300432 + 1300321 @@ -36552,7 +36653,7 @@ 1 2 - 1415642 + 1415522 @@ -36568,12 +36669,12 @@ 1 2 - 1235130 + 1235025 2 13 - 65301 + 65295 @@ -36583,11 +36684,11 @@ jumpinfo - 254469 + 254474 id - 254469 + 254474 str @@ -36595,7 +36696,7 @@ target - 53144 + 53145 @@ -36609,7 +36710,7 @@ 1 2 - 254469 + 254474 @@ -36625,7 +36726,7 @@ 1 2 - 254469 + 254474 @@ -36723,7 +36824,7 @@ 2 3 - 26477 + 26478 3 @@ -36733,7 +36834,7 @@ 4 5 - 5352 + 5353 5 @@ -36759,7 +36860,7 @@ 1 2 - 53144 + 53145 @@ -36769,19 +36870,19 @@ preprocdirects - 4386889 + 4186401 id - 4386889 + 4186401 kind - 1138 + 5130 location - 4384302 + 4145824 @@ -36795,7 +36896,7 @@ 1 2 - 4386889 + 4186401 @@ -36811,7 +36912,7 @@ 1 2 - 4386889 + 4186401 @@ -36825,59 +36926,59 @@ 12 - 1 - 2 - 103 + 4 + 5 + 466 - 122 - 123 - 103 + 54 + 55 + 466 - 694 - 695 - 103 + 151 + 152 + 466 - 799 - 800 - 103 + 448 + 449 + 466 - 932 - 933 - 103 + 554 + 555 + 466 - 1689 - 1690 - 103 + 564 + 565 + 466 - 1792 - 1793 - 103 + 571 + 572 + 466 - 3012 - 3013 - 103 + 667 + 668 + 466 - 3802 - 3803 - 103 + 1429 + 1430 + 466 - 6290 - 6291 - 103 + 1970 + 1971 + 466 - 23266 - 23267 - 103 + 2564 + 2565 + 466 @@ -36891,59 +36992,59 @@ 12 - 1 - 2 - 103 + 4 + 5 + 466 - 122 - 123 - 103 + 54 + 55 + 466 - 694 - 695 - 103 + 151 + 152 + 466 - 799 - 800 - 103 + 448 + 449 + 466 - 932 - 933 - 103 + 554 + 555 + 466 - 1689 - 1690 - 103 + 564 + 565 + 466 - 1792 - 1793 - 103 + 571 + 572 + 466 - 3012 - 3013 - 103 + 667 + 668 + 466 - 3802 - 3803 - 103 + 1429 + 1430 + 466 - 6290 - 6291 - 103 + 1883 + 1884 + 466 - 23241 - 23242 - 103 + 2564 + 2565 + 466 @@ -36959,12 +37060,12 @@ 1 2 - 4384198 + 4145358 - 26 - 27 - 103 + 88 + 89 + 466 @@ -36980,7 +37081,7 @@ 1 2 - 4384302 + 4145824 @@ -36990,15 +37091,15 @@ preprocpair - 1430102 + 1429980 begin - 1195950 + 1195848 elseelifend - 1430102 + 1429980 @@ -37012,17 +37113,17 @@ 1 2 - 977656 + 977573 2 3 - 208031 + 208014 3 11 - 10261 + 10260 @@ -37038,7 +37139,7 @@ 1 2 - 1430102 + 1429980 @@ -37048,41 +37149,41 @@ preproctrue - 766359 + 766294 branch - 766359 + 766294 preprocfalse - 331171 + 331143 branch - 331171 + 331143 preproctext - 3537219 + 3368495 id - 3537219 + 3368495 head - 2563493 + 2441215 body - 1498199 + 1426735 @@ -37096,7 +37197,7 @@ 1 2 - 3537219 + 3368495 @@ -37112,7 +37213,7 @@ 1 2 - 3537219 + 3368495 @@ -37128,12 +37229,12 @@ 1 2 - 2417708 + 2302384 2 740 - 145784 + 138830 @@ -37149,12 +37250,12 @@ 1 2 - 2501827 + 2382490 2 5 - 61666 + 58724 @@ -37170,17 +37271,17 @@ 1 2 - 1356242 + 1291550 2 6 - 112364 + 107005 6 11630 - 29591 + 28179 @@ -37196,17 +37297,17 @@ 1 2 - 1359243 + 1294407 2 7 - 112675 + 107300 7 2980 - 26280 + 25026 @@ -37216,15 +37317,15 @@ includes - 312980 + 312954 id - 312980 + 312954 included - 117076 + 117066 @@ -37238,7 +37339,7 @@ 1 2 - 312980 + 312954 @@ -37254,32 +37355,32 @@ 1 2 - 61103 + 61098 2 3 - 21922 + 21920 3 4 - 12593 + 12592 4 6 - 10261 + 10260 6 14 - 8862 + 8861 14 47 - 2332 + 2331 @@ -37289,15 +37390,15 @@ link_targets - 817 + 814 id - 817 + 814 binary - 817 + 814 @@ -37311,7 +37412,7 @@ 1 2 - 817 + 814 @@ -37327,7 +37428,7 @@ 1 2 - 817 + 814 @@ -37337,11 +37438,11 @@ link_parent - 38867468 + 38845246 element - 4926386 + 4923570 link_target @@ -37359,17 +37460,17 @@ 1 2 - 664089 + 663709 2 9 - 25845 + 25830 9 10 - 4236452 + 4234029 diff --git a/cpp/ql/lib/upgrades/abfce5c170f93e281948f7689ece373464fdaf87/old.dbscheme b/cpp/ql/lib/upgrades/abfce5c170f93e281948f7689ece373464fdaf87/old.dbscheme new file mode 100644 index 000000000000..abfce5c170f9 --- /dev/null +++ b/cpp/ql/lib/upgrades/abfce5c170f93e281948f7689ece373464fdaf87/old.dbscheme @@ -0,0 +1,2251 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int ref +); + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref, + int handle: @variable ref, + int promise: @variable ref +); + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @functionorblock ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator. For example: + * ``` + * int a; + * decltype(1+a) b; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * would change the semantics of this decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @usertype.kind of + 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +| 5 = @typedef // classic C: typedef typedef type name +| 6 = @template +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +| 14 = @using_alias // a using name = type style typedef +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +is_proxy_class_for( + unique int id: @usertype ref, + unique int templ_param_id: @usertype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +/* + Fixed point types + precision(1) = short, precision(2) = default, precision(3) = long + is_unsigned(1) = unsigned is_unsigned(2) = signed + is_fract_type(1) = declared with _Fract + saturating(1) = declared with _Sat +*/ +/* TODO +fixedpointtypes( + unique int id: @fixedpointtype, + int precision: int ref, + int is_unsigned: int ref, + int is_fract_type: int ref, + int saturating: int ref); +*/ + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + /* TODO | @fixedpointtype */ + | @routinetype + | @ptrtomember + | @decltype; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 3 = size_and_alignment + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + ; + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@runtime_sizeof_or_alignof = @runtime_sizeof | @runtime_alignof; + +sizeof_bind( + unique int expr: @runtime_sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@functionorblock = @function | @stmt_block; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @functionorblock ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target ref +); + +/* XML Files */ + +xmlEncoding(unique int id: @file ref, string encoding: string ref); + +xmlDTDs( + unique int id: @xmldtd, + string root: string ref, + string publicId: string ref, + string systemId: string ref, + int fileid: @file ref +); + +xmlElements( + unique int id: @xmlelement, + string name: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int fileid: @file ref +); + +xmlAttrs( + unique int id: @xmlattribute, + int elementid: @xmlelement ref, + string name: string ref, + string value: string ref, + int idx: int ref, + int fileid: @file ref +); + +xmlNs( + int id: @xmlnamespace, + string prefixName: string ref, + string URI: string ref, + int fileid: @file ref +); + +xmlHasNs( + int elementId: @xmlnamespaceable ref, + int nsId: @xmlnamespace ref, + int fileid: @file ref +); + +xmlComments( + unique int id: @xmlcomment, + string text: string ref, + int parentid: @xmlparent ref, + int fileid: @file ref +); + +xmlChars( + unique int id: @xmlcharacters, + string text: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int isCDATA: int ref, + int fileid: @file ref +); + +@xmlparent = @file | @xmlelement; +@xmlnamespaceable = @xmlelement | @xmlattribute; + +xmllocations( + int xmlElement: @xmllocatable ref, + int location: @location_default ref +); + +@xmllocatable = @xmlcharacters + | @xmlelement + | @xmlcomment + | @xmlattribute + | @xmldtd + | @file + | @xmlnamespace; diff --git a/cpp/ql/lib/upgrades/abfce5c170f93e281948f7689ece373464fdaf87/semmlecode.cpp.dbscheme b/cpp/ql/lib/upgrades/abfce5c170f93e281948f7689ece373464fdaf87/semmlecode.cpp.dbscheme new file mode 100644 index 000000000000..3d35dd6b50ed --- /dev/null +++ b/cpp/ql/lib/upgrades/abfce5c170f93e281948f7689ece373464fdaf87/semmlecode.cpp.dbscheme @@ -0,0 +1,2289 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int ref +); + +diagnostics( + unique int id: @diagnostic, + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref, + int handle: @variable ref, + int promise: @variable ref +); + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @functionorblock ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator. For example: + * ``` + * int a; + * decltype(1+a) b; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * would change the semantics of this decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @usertype.kind of + 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +| 5 = @typedef // classic C: typedef typedef type name +| 6 = @template +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +| 14 = @using_alias // a using name = type style typedef +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +is_proxy_class_for( + unique int id: @usertype ref, + unique int templ_param_id: @usertype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +/* + Fixed point types + precision(1) = short, precision(2) = default, precision(3) = long + is_unsigned(1) = unsigned is_unsigned(2) = signed + is_fract_type(1) = declared with _Fract + saturating(1) = declared with _Sat +*/ +/* TODO +fixedpointtypes( + unique int id: @fixedpointtype, + int precision: int ref, + int is_unsigned: int ref, + int is_fract_type: int ref, + int saturating: int ref); +*/ + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + /* TODO | @fixedpointtype */ + | @routinetype + | @ptrtomember + | @decltype; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 3 = size_and_alignment + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + ; + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@runtime_sizeof_or_alignof = @runtime_sizeof | @runtime_alignof; + +sizeof_bind( + unique int expr: @runtime_sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@functionorblock = @function | @stmt_block; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @functionorblock ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target ref +); + +/* XML Files */ + +xmlEncoding(unique int id: @file ref, string encoding: string ref); + +xmlDTDs( + unique int id: @xmldtd, + string root: string ref, + string publicId: string ref, + string systemId: string ref, + int fileid: @file ref +); + +xmlElements( + unique int id: @xmlelement, + string name: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int fileid: @file ref +); + +xmlAttrs( + unique int id: @xmlattribute, + int elementid: @xmlelement ref, + string name: string ref, + string value: string ref, + int idx: int ref, + int fileid: @file ref +); + +xmlNs( + int id: @xmlnamespace, + string prefixName: string ref, + string URI: string ref, + int fileid: @file ref +); + +xmlHasNs( + int elementId: @xmlnamespaceable ref, + int nsId: @xmlnamespace ref, + int fileid: @file ref +); + +xmlComments( + unique int id: @xmlcomment, + string text: string ref, + int parentid: @xmlparent ref, + int fileid: @file ref +); + +xmlChars( + unique int id: @xmlcharacters, + string text: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int isCDATA: int ref, + int fileid: @file ref +); + +@xmlparent = @file | @xmlelement; +@xmlnamespaceable = @xmlelement | @xmlattribute; + +xmllocations( + int xmlElement: @xmllocatable ref, + int location: @location_default ref +); + +@xmllocatable = @xmlcharacters + | @xmlelement + | @xmlcomment + | @xmlattribute + | @xmldtd + | @file + | @xmlnamespace; diff --git a/cpp/ql/lib/upgrades/abfce5c170f93e281948f7689ece373464fdaf87/upgrade.properties b/cpp/ql/lib/upgrades/abfce5c170f93e281948f7689ece373464fdaf87/upgrade.properties new file mode 100644 index 000000000000..db0e7e92d0e9 --- /dev/null +++ b/cpp/ql/lib/upgrades/abfce5c170f93e281948f7689ece373464fdaf87/upgrade.properties @@ -0,0 +1,2 @@ +description: Add new builtin operations +compatibility: backwards diff --git a/cpp/ql/test/library-tests/builtins/type_traits/clang.cpp b/cpp/ql/test/library-tests/builtins/type_traits/clang.cpp index 2c25f1881382..167023c1a33c 100644 --- a/cpp/ql/test/library-tests/builtins/type_traits/clang.cpp +++ b/cpp/ql/test/library-tests/builtins/type_traits/clang.cpp @@ -1,4 +1,4 @@ -// semmle-extractor-options: --clang --clang_version 100000 +// semmle-extractor-options: --clang --clang_version 180000 struct S { void f() {} @@ -93,3 +93,18 @@ struct S2 { bool bok_is_trivial1 = __is_trivial(int); bool bok_is_trivial2 = __is_trivial(S2); + +bool bok_reference_binds_to_temporary1 = __reference_binds_to_temporary(int&, long&); +bool bok_reference_binds_to_temporary2 = __reference_binds_to_temporary(int const &, long&); + +bool b_is_same_as1 = __is_same_as(int, int); +bool b_is_same_as2 = __is_same_as(int, float); + +bool b_is_bounded_array1 = __is_bounded_array(int[]); +bool b_is_bounded_array2 = __is_bounded_array(int[42]); + +bool b_is_unbounded_array1 = __is_unbounded_array(int[]); +bool b_is_unbounded_array2 = __is_unbounded_array(int[42]); + +bool b_is_referenceable1 = __is_referenceable(int); +bool b_is_referenceable2 = __is_referenceable(void); diff --git a/cpp/ql/test/library-tests/builtins/type_traits/expr.expected b/cpp/ql/test/library-tests/builtins/type_traits/expr.expected index 9cc6ec6ec929..edf63baef9e9 100644 --- a/cpp/ql/test/library-tests/builtins/type_traits/expr.expected +++ b/cpp/ql/test/library-tests/builtins/type_traits/expr.expected @@ -125,9 +125,78 @@ | clang.cpp:94:24:94:40 | int | | | | clang.cpp:95:24:95:39 | S2 | | | | clang.cpp:95:24:95:39 | __is_trivial | S2 | 0 | +| clang.cpp:97:42:97:84 | __reference_binds_to_temporary | int &,long & | 0 | +| clang.cpp:97:42:97:84 | int & | | | +| clang.cpp:97:42:97:84 | long & | | | +| clang.cpp:98:42:98:91 | __reference_binds_to_temporary | const int &,long & | 1 | +| clang.cpp:98:42:98:91 | const int & | | | +| clang.cpp:98:42:98:91 | long & | | | +| clang.cpp:100:22:100:43 | __is_same_as | int,int | 1 | +| clang.cpp:100:22:100:43 | int | | | +| clang.cpp:100:22:100:43 | int | | | +| clang.cpp:101:22:101:45 | __is_same_as | int,float | 0 | +| clang.cpp:101:22:101:45 | float | | | +| clang.cpp:101:22:101:45 | int | | | +| clang.cpp:103:28:103:52 | __is_bounded_array | int[] | 0 | +| clang.cpp:103:28:103:52 | int[] | | | +| clang.cpp:104:28:104:54 | __is_bounded_array | int[42] | 1 | +| clang.cpp:104:28:104:54 | int[42] | | | +| clang.cpp:104:51:104:52 | 42 | | 42 | +| clang.cpp:104:51:104:52 | (unsigned long)... | | 42 | +| clang.cpp:106:30:106:56 | __is_unbounded_array | int[] | 1 | +| clang.cpp:106:30:106:56 | int[] | | | +| clang.cpp:107:30:107:58 | __is_unbounded_array | int[42] | 0 | +| clang.cpp:107:30:107:58 | int[42] | | | +| clang.cpp:107:55:107:56 | 42 | | 42 | +| clang.cpp:107:55:107:56 | (unsigned long)... | | 42 | +| clang.cpp:109:28:109:50 | __is_referenceable | int | 1 | +| clang.cpp:109:28:109:50 | int | | | +| clang.cpp:110:28:110:51 | __is_referenceable | void | 0 | +| clang.cpp:110:28:110:51 | void | | | | file://:0:0:0:0 | 0 | | 0 | | file://:0:0:0:0 | 1 | | 1 | | file://:0:0:0:0 | 2 | | 2 | +| gcc.cpp:3:25:3:25 | 8 | | 8 | +| gcc.cpp:4:25:4:59 | 0 | | 0 | +| gcc.cpp:4:25:4:59 | __builtin_has_attribute | v,0 | 1 | +| gcc.cpp:4:49:4:49 | v | | | +| gcc.cpp:5:25:5:62 | 0 | | 0 | +| gcc.cpp:5:25:5:62 | __builtin_has_attribute | v,0 | 0 | +| gcc.cpp:5:49:5:49 | v | | | +| gcc.cpp:13:50:13:111 | __builtin_is_pointer_interconvertible_with_class | i | 1 | +| gcc.cpp:13:99:13:110 | i | | | +| gcc.cpp:14:50:14:111 | __builtin_is_pointer_interconvertible_with_class | d | 0 | +| gcc.cpp:14:99:14:110 | d | | | +| gcc.cpp:16:35:16:95 | __builtin_is_corresponding_member | i,i | 1 | +| gcc.cpp:16:69:16:80 | i | | | +| gcc.cpp:16:83:16:94 | i | | | +| gcc.cpp:17:35:17:95 | __builtin_is_corresponding_member | i,d | 0 | +| gcc.cpp:17:69:17:80 | i | | | +| gcc.cpp:17:83:17:94 | d | | | +| gcc.cpp:19:34:19:67 | __is_nothrow_convertible | int,int | 1 | +| gcc.cpp:19:34:19:67 | int | | | +| gcc.cpp:19:34:19:67 | int | | | +| gcc.cpp:20:34:20:72 | __is_nothrow_convertible | a_struct,int | 0 | +| gcc.cpp:20:34:20:72 | a_struct | | | +| gcc.cpp:20:34:20:72 | int | | | +| gcc.cpp:22:26:22:51 | __is_convertible | int,int | 1 | +| gcc.cpp:22:26:22:51 | int | | | +| gcc.cpp:22:26:22:51 | int | | | +| gcc.cpp:23:26:23:56 | __is_convertible | a_struct,int | 0 | +| gcc.cpp:23:26:23:56 | a_struct | | | +| gcc.cpp:23:26:23:56 | int | | | +| gcc.cpp:25:47:25:95 | __reference_constructs_from_temporary | int &&,int | 1 | +| gcc.cpp:25:47:25:95 | int | | | +| gcc.cpp:25:47:25:95 | int && | | | +| gcc.cpp:26:47:26:97 | __reference_constructs_from_temporary | int &&,int && | 0 | +| gcc.cpp:26:47:26:97 | int && | | | +| gcc.cpp:26:47:26:97 | int && | | | +| gcc.cpp:28:45:28:91 | __reference_converts_from_temporary | int &&,int | 1 | +| gcc.cpp:28:45:28:91 | int | | | +| gcc.cpp:28:45:28:91 | int && | | | +| gcc.cpp:29:45:29:93 | __reference_converts_from_temporary | int &&,int && | 0 | +| gcc.cpp:29:45:29:93 | int && | | | +| gcc.cpp:29:45:29:93 | int && | | | | ms.cpp:38:41:38:45 | 0 | | 0 | | ms.cpp:88:27:88:45 | __has_assign | empty | 0 | | ms.cpp:88:27:88:45 | empty | | | @@ -452,3 +521,38 @@ | ms.cpp:272:51:272:104 | __is_pointer_interconvertible_base_of | empty,abstract | 0 | | ms.cpp:272:51:272:104 | abstract | | | | ms.cpp:272:51:272:104 | empty | | | +| ms.cpp:274:44:274:85 | __is_trivially_copy_assignable | has_assign | 0 | +| ms.cpp:274:44:274:85 | has_assign | | | +| ms.cpp:275:44:275:78 | __is_trivially_copy_assignable | int | 1 | +| ms.cpp:275:44:275:78 | int | | | +| ms.cpp:277:51:277:107 | __is_assignable_no_precondition_check | a_struct,a_struct | 1 | +| ms.cpp:277:51:277:107 | a_struct | | | +| ms.cpp:277:51:277:107 | a_struct | | | +| ms.cpp:278:51:278:104 | __is_assignable_no_precondition_check | a_struct,empty | 0 | +| ms.cpp:278:51:278:104 | a_struct | | | +| ms.cpp:278:51:278:104 | empty | | | +| ms.cpp:279:51:279:102 | __is_assignable_no_precondition_check | a_struct,int | 0 | +| ms.cpp:279:51:279:102 | a_struct | | | +| ms.cpp:279:51:279:102 | int | | | +| ms.cpp:281:54:281:117 | __is_pointer_interconvertible_with_class | a_struct,i | 1 | +| ms.cpp:281:54:281:117 | a_struct | | | +| ms.cpp:281:105:281:116 | i | | | +| ms.cpp:282:54:282:117 | __is_pointer_interconvertible_with_class | a_struct,d | 0 | +| ms.cpp:282:54:282:117 | a_struct | | | +| ms.cpp:282:105:282:116 | d | | | +| ms.cpp:284:39:284:111 | __is_corresponding_member | a_struct,a_struct,i,i | 1 | +| ms.cpp:284:39:284:111 | a_struct | | | +| ms.cpp:284:39:284:111 | a_struct | | | +| ms.cpp:284:85:284:96 | i | | | +| ms.cpp:284:99:284:110 | i | | | +| ms.cpp:285:39:285:111 | __is_corresponding_member | a_struct,a_struct,i,d | 0 | +| ms.cpp:285:39:285:111 | a_struct | | | +| ms.cpp:285:39:285:111 | a_struct | | | +| ms.cpp:285:85:285:96 | i | | | +| ms.cpp:285:99:285:110 | d | | | +| ms.cpp:287:34:287:59 | __is_valid_winrt_type | int | 1 | +| ms.cpp:287:34:287:59 | int | | | +| ms.cpp:288:27:288:45 | __is_win_class | int | 0 | +| ms.cpp:288:27:288:45 | int | | | +| ms.cpp:289:31:289:53 | __is_win_interface | int | 0 | +| ms.cpp:289:31:289:53 | int | | | diff --git a/cpp/ql/test/library-tests/builtins/type_traits/gcc.cpp b/cpp/ql/test/library-tests/builtins/type_traits/gcc.cpp new file mode 100644 index 000000000000..54224343e7e2 --- /dev/null +++ b/cpp/ql/test/library-tests/builtins/type_traits/gcc.cpp @@ -0,0 +1,29 @@ +// semmle-extractor-options: --gnu_version 130000 + +__attribute__ ((aligned(8))) int v; +bool b_has_attribute1 = __builtin_has_attribute(v, aligned); +bool b_has_attribute2 = __builtin_has_attribute(v, aligned(4)); + + +struct a_struct { + int i; + double d; +}; + +bool b_is_pointer_interconvertible_with_class1 = __builtin_is_pointer_interconvertible_with_class(&a_struct::i); +bool b_is_pointer_interconvertible_with_class2 = __builtin_is_pointer_interconvertible_with_class(&a_struct::d); + +bool b_is_corresponding_member1 = __builtin_is_corresponding_member(&a_struct::i, &a_struct::i); +bool b_is_corresponding_member2 = __builtin_is_corresponding_member(&a_struct::i, &a_struct::d); + +bool b_is_nothrow_convertible1 = __is_nothrow_convertible(int, int); +bool b_is_nothrow_convertible2 = __is_nothrow_convertible(a_struct, int); + +bool b_is_convertible1 = __is_convertible(int, int); +bool b_is_convertible2 = __is_convertible(a_struct, int); + +bool b_reference_constructs_from_temporary1 = __reference_constructs_from_temporary(int&&, int); +bool b_reference_constructs_from_temporary2 = __reference_constructs_from_temporary(int&&, int&&); + +bool b_reference_converts_from_temporary1 = __reference_converts_from_temporary(int&&, int); +bool b_reference_converts_from_temporary2 = __reference_converts_from_temporary(int&&, int&&); diff --git a/cpp/ql/test/library-tests/builtins/type_traits/ms.cpp b/cpp/ql/test/library-tests/builtins/type_traits/ms.cpp index 6083f9dc6bb5..d51248dd3ec8 100644 --- a/cpp/ql/test/library-tests/builtins/type_traits/ms.cpp +++ b/cpp/ql/test/library-tests/builtins/type_traits/ms.cpp @@ -270,4 +270,21 @@ void f(void) { bool b_is_pointer_interconvertible_base_of1 = __is_pointer_interconvertible_base_of(empty, empty); bool b_is_pointer_interconvertible_base_of2 = __is_pointer_interconvertible_base_of(empty, abstract); + + bool b_is_trivially_copy_assignable1 = __is_trivially_copy_assignable(has_assign); + bool b_is_trivially_copy_assignable2 = __is_trivially_copy_assignable(int); + + bool b_is_assignable_no_precondition_check1 = __is_assignable_no_precondition_check(a_struct, a_struct); + bool b_is_assignable_no_precondition_check2 = __is_assignable_no_precondition_check(a_struct, empty); + bool b_is_assignable_no_precondition_check3 = __is_assignable_no_precondition_check(a_struct, int); + + bool b_is_pointer_interconvertible_with_class1 = __is_pointer_interconvertible_with_class(a_struct, &a_struct::i); + bool b_is_pointer_interconvertible_with_class2 = __is_pointer_interconvertible_with_class(a_struct, &a_struct::d); + + bool b_is_corresponding_member1 = __is_corresponding_member(a_struct, a_struct, &a_struct::i, &a_struct::i); + bool b_is_corresponding_member2 = __is_corresponding_member(a_struct, a_struct, &a_struct::i, &a_struct::d); + + bool b_is_valid_winrt_type = __is_valid_winrt_type(int); + bool b_is_win_class = __is_win_class(int); + bool b_is_win_interface = __is_win_interface(int); } diff --git a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DotNet.cs b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DotNet.cs index 655c89abd771..0e47f1d1911d 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DotNet.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DotNet.cs @@ -69,6 +69,11 @@ private string GetRestoreArgs(RestoreSettings restoreSettings) args += " --force"; } + if (restoreSettings.TargetWindows) + { + args += " /p:EnableWindowsTargeting=true"; + } + return args; } diff --git a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/FileProvider.cs b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/FileProvider.cs index e908855df0a9..b6463ea24caa 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/FileProvider.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/FileProvider.cs @@ -62,7 +62,7 @@ private string[] SelectTextFileNamesByExtension(string filetype, params string[] private string[] SelectTextFileNamesByName(string name) { var ret = allNonBinary.Value.SelectFileNamesByName(name).ToArray(); - var ending = ret.Length == 0 ? "." : $": {string.Join(", ", ret.OrderBy(s => s))}."; + var ending = ret.Length == 0 ? "." : $": {string.Join(", ", ret)}."; logger.LogInfo($"Found {ret.Length} {name} files in {SourceDir}{ending}"); return ret; } @@ -91,7 +91,9 @@ private IEnumerable SelectSmallFiles(IEnumerable files) private FileInfo[] GetAllFiles() { logger.LogInfo($"Finding files in {SourceDir}..."); - var files = SourceDir.GetFiles("*.*", new EnumerationOptions { RecurseSubdirectories = true }); + var files = SourceDir + .GetFiles("*.*", new EnumerationOptions { RecurseSubdirectories = true }) + .OrderBy(f => f.FullName); var filteredFiles = files.Where(f => { diff --git a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/IDotNet.cs b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/IDotNet.cs index c4e4557aa34e..2c10afa80ef2 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/IDotNet.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/IDotNet.cs @@ -17,7 +17,7 @@ public interface IDotNet IList GetNugetFeedsFromFolder(string folderPath); } - public record class RestoreSettings(string File, string PackageDirectory, bool ForceDotnetRefAssemblyFetching, string? PathToNugetConfig = null, bool ForceReevaluation = false); + public record class RestoreSettings(string File, string PackageDirectory, bool ForceDotnetRefAssemblyFetching, string? PathToNugetConfig = null, bool ForceReevaluation = false, bool TargetWindows = false); public partial record class RestoreResult(bool Success, IList Output) { diff --git a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs index 4ad4c8c9e31a..5d7a0a8ab928 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs @@ -225,10 +225,13 @@ private IEnumerable RestoreSolutions(out DependencyContainer dependencie var successCount = 0; var nugetSourceFailures = 0; var assets = new Assets(logger); + + var isWindows = fileContent.UseWindowsForms || fileContent.UseWpf; + var projects = fileProvider.Solutions.SelectMany(solution => { logger.LogInfo($"Restoring solution {solution}..."); - var res = dotnet.Restore(new(solution, PackageDirectory.DirInfo.FullName, ForceDotnetRefAssemblyFetching: true)); + var res = dotnet.Restore(new(solution, PackageDirectory.DirInfo.FullName, ForceDotnetRefAssemblyFetching: true, TargetWindows: isWindows)); if (res.Success) { successCount++; @@ -258,6 +261,9 @@ private void RestoreProjects(IEnumerable projects, out ConcurrentBag collectedDependencies = []; + + var isWindows = fileContent.UseWindowsForms || fileContent.UseWpf; + var sync = new object(); var projectGroups = projects.GroupBy(Path.GetDirectoryName); Parallel.ForEach(projectGroups, new ParallelOptions { MaxDegreeOfParallelism = DependencyManager.Threads }, projectGroup => @@ -266,7 +272,7 @@ private void RestoreProjects(IEnumerable projects, out ConcurrentBag + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Text = "Form1"; + } + + #endregion +} diff --git a/csharp/ql/integration-tests/all-platforms/standalone_winforms/Form1.cs b/csharp/ql/integration-tests/all-platforms/standalone_winforms/Form1.cs new file mode 100644 index 000000000000..834b9ce772b0 --- /dev/null +++ b/csharp/ql/integration-tests/all-platforms/standalone_winforms/Form1.cs @@ -0,0 +1,9 @@ +namespace winforms; + +public partial class Form1 : Form +{ + public Form1() + { + InitializeComponent(); + } +} diff --git a/csharp/ql/integration-tests/all-platforms/standalone_winforms/Program.cs b/csharp/ql/integration-tests/all-platforms/standalone_winforms/Program.cs new file mode 100644 index 000000000000..822a48b121e2 --- /dev/null +++ b/csharp/ql/integration-tests/all-platforms/standalone_winforms/Program.cs @@ -0,0 +1,16 @@ +namespace winforms; + +static class Program +{ + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + // To customize application configuration such as set high DPI settings or default font, + // see https://aka.ms/applicationconfiguration. + ApplicationConfiguration.Initialize(); + Application.Run(new Form1()); + } +} \ No newline at end of file diff --git a/csharp/ql/integration-tests/all-platforms/standalone_winforms/global.json b/csharp/ql/integration-tests/all-platforms/standalone_winforms/global.json new file mode 100644 index 000000000000..5c3fd64fbd12 --- /dev/null +++ b/csharp/ql/integration-tests/all-platforms/standalone_winforms/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "8.0.101" + } +} diff --git a/csharp/ql/integration-tests/all-platforms/standalone_winforms/test.py b/csharp/ql/integration-tests/all-platforms/standalone_winforms/test.py new file mode 100644 index 000000000000..8609eca2f16f --- /dev/null +++ b/csharp/ql/integration-tests/all-platforms/standalone_winforms/test.py @@ -0,0 +1,3 @@ +from create_database_utils import * + +run_codeql_database_create(lang="csharp", extra_args=["--build-mode=none"]) diff --git a/csharp/ql/integration-tests/all-platforms/standalone_winforms/winforms.csproj b/csharp/ql/integration-tests/all-platforms/standalone_winforms/winforms.csproj new file mode 100644 index 000000000000..bcc83124518c --- /dev/null +++ b/csharp/ql/integration-tests/all-platforms/standalone_winforms/winforms.csproj @@ -0,0 +1,11 @@ + + + + WinExe + net8.0-windows + enable + true + enable + + + \ No newline at end of file diff --git a/csharp/ql/lib/semmle/code/csharp/Location.qll b/csharp/ql/lib/semmle/code/csharp/Location.qll index eb6a30e7d35d..9b2cea470ed7 100644 --- a/csharp/ql/lib/semmle/code/csharp/Location.qll +++ b/csharp/ql/lib/semmle/code/csharp/Location.qll @@ -110,12 +110,21 @@ class SourceLocation extends Location, @location_default { bindingset[version] private int versionField(string version, int field) { - exists(string format | - format = "(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)" or - format = "(\\d+)\\.(\\d+)\\.(\\d+)" or - format = "(\\d+)\\.(\\d+)" + exists(string format, int i | + format = "(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)|" + "(\\d+)\\.(\\d+)\\.(\\d+)|" + "(\\d+)\\.(\\d+)" and + result = version.regexpCapture(format, i).toInt() | - result = version.regexpCapture(format, field).toInt() + i = [1, 5, 8] and + field = 1 + or + i = [2, 6, 9] and + field = 2 + or + i = [3, 7] and + field = 3 + or + i = 4 and + field = 4 ) and result >= 0 and result <= 255 @@ -123,8 +132,19 @@ private int versionField(string version, int field) { /** An assembly version, for example `4.0.0.0` or `4.5`. */ class Version extends string { + private int major; + bindingset[this] - Version() { exists(versionField(this, 1)) } + Version() { major = versionField(this, 1) } + + bindingset[this] + private int getVersionField(int field) { + field = 1 and + result = major + or + field in [2 .. 4] and + result = versionField(this, field) + } /** * Gets field `field` of this version. @@ -132,13 +152,47 @@ class Version extends string { */ bindingset[this] int getField(int field) { - field in [1 .. 4] and - if exists(versionField(this, field)) then result = versionField(this, field) else result = 0 + result = this.getVersionField(field) + or + field in [2 .. 4] and + not exists(this.getVersionField(field)) and + result = 0 + } + + bindingset[this] + private string getCanonicalizedField(int field) { + exists(string s, int length | + s = this.getVersionField(field).toString() and + length = s.length() + | + // make each field consist of 3 digits + result = concat(int i | i in [1 .. 3 - length] | "0") + s + ) + } + + /** + * Gets a canonicalized version of this string, where lexicographical ordering + * corresponds to version ordering. + */ + bindingset[this] + string getCanonicalizedVersion() { + exists(string res, int length | + res = + strictconcat(int field, string s | + s = this.getCanonicalizedField(field) + | + s, "." order by field + ) and + length = res.length() + | + // make each canonicalized version consist of 4 chunks of 3 digits separated by a dot + result = res + concat(int i | i = [1 .. 15 - length] / 4 and i > 0 | ".000") + ) } /** Gets the major version, for example `1` in `1.2.3.4`. */ bindingset[this] - int getMajor() { result = this.getField(1) } + int getMajor() { result = major } /** Gets the major revision, for example `2` in `1.2.3.4`. */ bindingset[this] @@ -164,9 +218,7 @@ class Version extends string { */ bindingset[this, other] predicate isEarlierThan(Version other) { - exists(int i | this.getField(i) < other.getField(i) | - forall(int j | j in [1 .. i - 1] | this.getField(j) = other.getField(j)) - ) + this.getCanonicalizedVersion() < other.getCanonicalizedVersion() } /** diff --git a/csharp/ql/lib/semmle/code/csharp/security/xml/InsecureXMLQuery.qll b/csharp/ql/lib/semmle/code/csharp/security/xml/InsecureXMLQuery.qll index 25793a8a71cc..ba98888fa6fc 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/xml/InsecureXMLQuery.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/xml/InsecureXMLQuery.qll @@ -5,6 +5,19 @@ import csharp private import semmle.code.csharp.commons.TargetFramework +pragma[nomagic] +private float getAssemblyVersion(Assembly a) { + result = a.getVersion().regexpCapture("([0-9]+\\.[0-9]+).*", 1).toFloat() and + // This method is only accurate when we're looking at versions before 4.0. + result < 4.0 +} + +pragma[nomagic] +private Version getTargetFrameworkVersion(TargetFrameworkAttribute tfa) { + tfa.isNetFramework() and + result = tfa.getFrameworkVersion() +} + /** * Holds if the type `t` is in an assembly that has been compiled against a .NET framework version * before the given version. @@ -14,21 +27,16 @@ private predicate isNetFrameworkBefore(Type t, string version) { // For assemblies compiled against framework versions before 4 the TargetFrameworkAttribute // will not be present. In this case, we can revert back to the assembly version, which may not // contain full minor version information. - exists(string assemblyVersion | - assemblyVersion = - t.getALocation().(Assembly).getVersion().regexpCapture("([0-9]+\\.[0-9]+).*", 1) - | - assemblyVersion.toFloat() < version.toFloat() and - // This method is only accurate when we're looking at versions before 4.0. - assemblyVersion.toFloat() < 4.0 + exists(float assemblyVersion | + assemblyVersion = getAssemblyVersion(t.getALocation()) and + assemblyVersion < version.toFloat() ) or // For 4.0 and above the TargetFrameworkAttribute should be present to provide detailed version // information. exists(TargetFrameworkAttribute tfa | tfa.hasElement(t) and - tfa.isNetFramework() and - tfa.getFrameworkVersion().isEarlierThan(version) + getTargetFrameworkVersion(tfa).isEarlierThan(version) ) } @@ -173,7 +181,7 @@ module XmlReader { reason = "DTD processing is enabled by default in versions < 4.0" and evidence = this and not exists(this.getSettings()) and - isNetFrameworkBefore(this.(MethodCall).getTarget().getDeclaringType(), "4.0") + isNetFrameworkBefore(this.getTarget().getDeclaringType(), "4.0") or // bad settings flow here exists(ObjectCreation settings | diff --git a/go/extractor/extractor.go b/go/extractor/extractor.go index 090bd486c3a7..df3a43f80cfa 100644 --- a/go/extractor/extractor.go +++ b/go/extractor/extractor.go @@ -193,10 +193,20 @@ func ExtractWithFlags(buildFlags []string, patterns []string) error { log.Println("Starting to extract packages.") sep := regexp.QuoteMeta(string(filepath.Separator)) - // if a path matches this regexp, we don't want to extract this package. Currently, it checks - // - that the path does not contain a `..` segment, and - // - the path does not contain a `vendor` directory. - noExtractRe := regexp.MustCompile(`.*(^|` + sep + `)(\.\.|vendor)($|` + sep + `).*`) + + // Construct a list of directory segments to exclude from extraction, starting with ".." + excludedDirs := []string{`\.\.`} + + // If CODEQL_EXTRACTOR_GO_EXTRACT_VENDOR_DIRS is "true", we extract `vendor` directories; + // otherwise (the default) is to exclude them from extraction + includeVendor := os.Getenv("CODEQL_EXTRACTOR_GO_EXTRACT_VENDOR_DIRS") == "true" + if !includeVendor { + excludedDirs = append(excludedDirs, "vendor") + } + + // If a path matches this regexp, we don't extract this package. It checks whether the path + // contains one of the `excludedDirs`. + noExtractRe := regexp.MustCompile(`.*(^|` + sep + `)(` + strings.Join(excludedDirs, "|") + `)($|` + sep + `).*`) // extract AST information for all packages packages.Visit(pkgs, nil, func(pkg *packages.Package) { diff --git a/go/ql/integration-tests/all-platforms/go/extract-vendor/build-environment.expected b/go/ql/integration-tests/all-platforms/go/extract-vendor/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/extract-vendor/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} diff --git a/go/ql/integration-tests/all-platforms/go/extract-vendor/diagnostics.expected b/go/ql/integration-tests/all-platforms/go/extract-vendor/diagnostics.expected new file mode 100644 index 000000000000..56d774b7037c --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/extract-vendor/diagnostics.expected @@ -0,0 +1,14 @@ +{ + "markdownMessage": "A single `go.mod` file was found.\n\n`go.mod`", + "severity": "note", + "source": { + "extractorName": "go", + "id": "go/autobuilder/single-root-go-mod-found", + "name": "A single `go.mod` file was found in the root" + }, + "visibility": { + "cliSummaryTable": false, + "statusPage": false, + "telemetry": true + } +} diff --git a/go/ql/integration-tests/all-platforms/go/extract-vendor/force_sequential_test_execution b/go/ql/integration-tests/all-platforms/go/extract-vendor/force_sequential_test_execution new file mode 100644 index 000000000000..47ca99290999 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/extract-vendor/force_sequential_test_execution @@ -0,0 +1,2 @@ +# go get has been observed to sometimes fail when multiple tests try to simultaneously fetch the same package. +goget diff --git a/go/ql/integration-tests/all-platforms/go/extract-vendor/src/go.mod b/go/ql/integration-tests/all-platforms/go/extract-vendor/src/go.mod new file mode 100644 index 000000000000..bfb907e7b813 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/extract-vendor/src/go.mod @@ -0,0 +1,5 @@ +go 1.14 + +require example.com/test v0.1.0 + +module test diff --git a/go/ql/integration-tests/all-platforms/go/extract-vendor/src/go.sum b/go/ql/integration-tests/all-platforms/go/extract-vendor/src/go.sum new file mode 100644 index 000000000000..77b7c845ca63 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/extract-vendor/src/go.sum @@ -0,0 +1 @@ +example.com/test v0.1.0/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= diff --git a/go/ql/integration-tests/all-platforms/go/extract-vendor/src/test.go b/go/ql/integration-tests/all-platforms/go/extract-vendor/src/test.go new file mode 100644 index 000000000000..1939e3478d48 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/extract-vendor/src/test.go @@ -0,0 +1,11 @@ +package test + +import ( + subdir "example.com/test" +) + +func Test() { + + foo := subdir.Add(2, 2) + println(foo) +} diff --git a/go/ql/integration-tests/all-platforms/go/extract-vendor/src/vendor/example.com/test/add.go b/go/ql/integration-tests/all-platforms/go/extract-vendor/src/vendor/example.com/test/add.go new file mode 100644 index 000000000000..b1ce6a2a3a39 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/extract-vendor/src/vendor/example.com/test/add.go @@ -0,0 +1,5 @@ +package test + +func Add(a, b int) int { + return a + b +} diff --git a/go/ql/integration-tests/all-platforms/go/extract-vendor/src/vendor/modules.txt b/go/ql/integration-tests/all-platforms/go/extract-vendor/src/vendor/modules.txt new file mode 100644 index 000000000000..023bcb386e2d --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/extract-vendor/src/vendor/modules.txt @@ -0,0 +1,3 @@ +# example.com/test v0.1.0 +## explicit; go 1.14 +example.com/test diff --git a/go/ql/integration-tests/all-platforms/go/extract-vendor/test.expected b/go/ql/integration-tests/all-platforms/go/extract-vendor/test.expected new file mode 100644 index 000000000000..d03518bd540f --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/extract-vendor/test.expected @@ -0,0 +1,5 @@ +extractedFiles +| src/go.mod:0:0:0:0 | src/go.mod | +| src/test.go:0:0:0:0 | src/test.go | +| src/vendor/example.com/test/add.go:0:0:0:0 | src/vendor/example.com/test/add.go | +#select diff --git a/go/ql/integration-tests/all-platforms/go/extract-vendor/test.py b/go/ql/integration-tests/all-platforms/go/extract-vendor/test.py new file mode 100644 index 000000000000..2bd482201b8b --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/extract-vendor/test.py @@ -0,0 +1,4 @@ +from go_integration_test import * + +os.environ['CODEQL_EXTRACTOR_GO_EXTRACT_VENDOR_DIRS'] = "true" +go_integration_test() diff --git a/go/ql/integration-tests/all-platforms/go/extract-vendor/test.ql b/go/ql/integration-tests/all-platforms/go/extract-vendor/test.ql new file mode 100644 index 000000000000..459a43015602 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/extract-vendor/test.ql @@ -0,0 +1,8 @@ +import go +import semmle.go.DiagnosticsReporting + +query predicate extractedFiles(File f) { any() } + +from string msg, int sev +where reportableDiagnostics(_, msg, sev) +select msg, sev diff --git a/go/ql/lib/ext/empty.model.yml b/go/ql/lib/ext/empty.model.yml index 867714a30443..8d661a9f1db6 100644 --- a/go/ql/lib/ext/empty.model.yml +++ b/go/ql/lib/ext/empty.model.yml @@ -17,3 +17,7 @@ extensions: pack: codeql/go-all extensible: neutralModel data: [] + - addsTo: + pack: codeql/go-all + extensible: packageGrouping + data: [] diff --git a/go/ql/lib/ext/github.com.astaxie.beego.context.model.yml b/go/ql/lib/ext/github.com.astaxie.beego.context.model.yml deleted file mode 100644 index 5a41e55b6db4..000000000000 --- a/go/ql/lib/ext/github.com.astaxie.beego.context.model.yml +++ /dev/null @@ -1,58 +0,0 @@ -extensions: - - addsTo: - pack: codeql/go-all - extensible: summaryModel - data: - - ["github.com/astaxie/beego/context", "", False, "WriteBody", "", "", "Argument[2]", "Argument[1]", "taint", "manual"] - - ["github.com/beego/beego/server/web/context", "", False, "WriteBody", "", "", "Argument[2]", "Argument[1]", "taint", "manual"] - - addsTo: - pack: codeql/go-all - extensible: sourceModel - data: - - ["github.com/astaxie/beego/context", "BeegoInput", True, "Bind", "", "", "Argument[0]", "remote", "manual"] - - ["github.com/astaxie/beego/context", "BeegoInput", True, "Cookie", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/astaxie/beego/context", "BeegoInput", True, "Data", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/astaxie/beego/context", "BeegoInput", True, "GetData", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/astaxie/beego/context", "BeegoInput", True, "Header", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/astaxie/beego/context", "BeegoInput", True, "Param", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/astaxie/beego/context", "BeegoInput", True, "Params", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/astaxie/beego/context", "BeegoInput", True, "Query", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/astaxie/beego/context", "BeegoInput", True, "Refer", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/astaxie/beego/context", "BeegoInput", True, "Referer", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/astaxie/beego/context", "BeegoInput", True, "RequestBody", "", "", "", "remote", "manual"] - - ["github.com/astaxie/beego/context", "BeegoInput", True, "URI", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/astaxie/beego/context", "BeegoInput", True, "URL", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/astaxie/beego/context", "BeegoInput", True, "UserAgent", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/astaxie/beego/context", "Context", True, "GetCookie", "", "", "ReturnValue", "remote", "manual"] - - - ["github.com/beego/beego/context", "BeegoInput", True, "Bind", "", "", "Argument[0]", "remote", "manual"] - - ["github.com/beego/beego/context", "BeegoInput", True, "Cookie", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/context", "BeegoInput", True, "Data", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/context", "BeegoInput", True, "GetData", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/context", "BeegoInput", True, "Header", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/context", "BeegoInput", True, "Param", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/context", "BeegoInput", True, "Params", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/context", "BeegoInput", True, "Query", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/context", "BeegoInput", True, "Refer", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/context", "BeegoInput", True, "Referer", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/context", "BeegoInput", True, "RequestBody", "", "", "", "remote", "manual"] - - ["github.com/beego/beego/context", "BeegoInput", True, "URI", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/context", "BeegoInput", True, "URL", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/context", "BeegoInput", True, "UserAgent", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/context", "Context", True, "GetCookie", "", "", "ReturnValue", "remote", "manual"] - - - ["github.com/beego/beego/server/web/context", "BeegoInput", True, "Bind", "", "", "Argument[0]", "remote", "manual"] - - ["github.com/beego/beego/server/web/context", "BeegoInput", True, "Cookie", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/server/web/context", "BeegoInput", True, "Data", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/server/web/context", "BeegoInput", True, "GetData", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/server/web/context", "BeegoInput", True, "Header", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/server/web/context", "BeegoInput", True, "Param", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/server/web/context", "BeegoInput", True, "Params", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/server/web/context", "BeegoInput", True, "Query", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/server/web/context", "BeegoInput", True, "Refer", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/server/web/context", "BeegoInput", True, "Referer", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/server/web/context", "BeegoInput", True, "RequestBody", "", "", "", "remote", "manual"] - - ["github.com/beego/beego/server/web/context", "BeegoInput", True, "URI", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/server/web/context", "BeegoInput", True, "URL", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/server/web/context", "BeegoInput", True, "UserAgent", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/server/web/context", "Context", True, "GetCookie", "", "", "ReturnValue", "remote", "manual"] diff --git a/go/ql/lib/ext/github.com.astaxie.beego.model.yml b/go/ql/lib/ext/github.com.astaxie.beego.model.yml deleted file mode 100644 index 27a9c9cb5904..000000000000 --- a/go/ql/lib/ext/github.com.astaxie.beego.model.yml +++ /dev/null @@ -1,48 +0,0 @@ -extensions: - - addsTo: - pack: codeql/go-all - extensible: summaryModel - data: - - ["github.com/astaxie/beego", "", False, "HTML2str", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/astaxie/beego", "", False, "Htmlquote", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/astaxie/beego", "", False, "Htmlunquote", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/astaxie/beego", "", False, "MapGet", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"] - - ["github.com/astaxie/beego", "", False, "ParseForm", "", "", "Argument[0]", "Argument[1]", "taint", "manual"] - - ["github.com/astaxie/beego", "", False, "Str2html", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/astaxie/beego", "", False, "Substr", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/beego/beego", "", False, "HTML2str", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/beego/beego", "", False, "Htmlquote", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/beego/beego", "", False, "Htmlunquote", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/beego/beego", "", False, "MapGet", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"] - - ["github.com/beego/beego", "", False, "ParseForm", "", "", "Argument[0]", "Argument[1]", "taint", "manual"] - - ["github.com/beego/beego", "", False, "Str2html", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/beego/beego", "", False, "Substr", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/beego/beego/server/web", "", False, "HTML2str", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/beego/beego/server/web", "", False, "Htmlquote", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/beego/beego/server/web", "", False, "Htmlunquote", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/beego/beego/server/web", "", False, "MapGet", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"] - - ["github.com/beego/beego/server/web", "", False, "ParseForm", "", "", "Argument[0]", "Argument[1]", "taint", "manual"] - - ["github.com/beego/beego/server/web", "", False, "Str2html", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/beego/beego/server/web", "", False, "Substr", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - addsTo: - pack: codeql/go-all - extensible: sourceModel - data: - - ["github.com/astaxie/beego", "Controller", True, "ParseForm", "", "", "Argument[0]", "remote", "manual"] - - ["github.com/astaxie/beego", "Controller", True, "GetFile", "", "", "ReturnValue[0..1]", "remote", "manual"] - - ["github.com/astaxie/beego", "Controller", True, "GetFiles", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/astaxie/beego", "Controller", True, "GetString", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/astaxie/beego", "Controller", True, "GetStrings", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/astaxie/beego", "Controller", True, "Input", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego", "Controller", True, "ParseForm", "", "", "Argument[0]", "remote", "manual"] - - ["github.com/beego/beego", "Controller", True, "GetFile", "", "", "ReturnValue[0..1]", "remote", "manual"] - - ["github.com/beego/beego", "Controller", True, "GetFiles", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego", "Controller", True, "GetString", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego", "Controller", True, "GetStrings", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego", "Controller", True, "Input", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/server/web", "Controller", True, "ParseForm", "", "", "Argument[0]", "remote", "manual"] - - ["github.com/beego/beego/server/web", "Controller", True, "GetFile", "", "", "ReturnValue[0..1]", "remote", "manual"] - - ["github.com/beego/beego/server/web", "Controller", True, "GetFiles", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/server/web", "Controller", True, "GetString", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/server/web", "Controller", True, "GetStrings", "", "", "ReturnValue[0]", "remote", "manual"] - - ["github.com/beego/beego/server/web", "Controller", True, "Input", "", "", "ReturnValue[0]", "remote", "manual"] diff --git a/go/ql/lib/ext/github.com.astaxie.beego.utils.model.yml b/go/ql/lib/ext/github.com.astaxie.beego.utils.model.yml deleted file mode 100644 index 261c1dab61a9..000000000000 --- a/go/ql/lib/ext/github.com.astaxie.beego.utils.model.yml +++ /dev/null @@ -1,31 +0,0 @@ -extensions: - - addsTo: - pack: codeql/go-all - extensible: summaryModel - data: - - ["github.com/astaxie/beego/utils", "", False, "SliceChunk", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/astaxie/beego/utils", "", False, "SliceDiff", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/astaxie/beego/utils", "", False, "SliceFilter", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/astaxie/beego/utils", "", False, "SliceIntersect", "", "", "Argument[0..1]", "ReturnValue", "taint", "manual"] - - ["github.com/astaxie/beego/utils", "", False, "SliceMerge", "", "", "Argument[0..1]", "ReturnValue", "taint", "manual"] - - ["github.com/astaxie/beego/utils", "", False, "SlicePad", "", "", "Argument[0..2]", "ReturnValue", "taint", "manual"] - - ["github.com/astaxie/beego/utils", "", False, "SliceRand", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/astaxie/beego/utils", "", False, "SliceReduce", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/astaxie/beego/utils", "", False, "SliceShuffle", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/astaxie/beego/utils", "", False, "SliceUnique", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/astaxie/beego/utils", "BeeMap", True, "Get", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] - - ["github.com/astaxie/beego/utils", "BeeMap", True, "Items", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] - - ["github.com/astaxie/beego/utils", "BeeMap", True, "Set", "", "", "Argument[1]", "Argument[receiver]", "taint", "manual"] - - ["github.com/beego/beego/core/utils", "", False, "SliceChunk", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/beego/beego/core/utils", "", False, "SliceDiff", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/beego/beego/core/utils", "", False, "SliceFilter", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/beego/beego/core/utils", "", False, "SliceIntersect", "", "", "Argument[0..1]", "ReturnValue", "taint", "manual"] - - ["github.com/beego/beego/core/utils", "", False, "SliceMerge", "", "", "Argument[0..1]", "ReturnValue", "taint", "manual"] - - ["github.com/beego/beego/core/utils", "", False, "SlicePad", "", "", "Argument[0..2]", "ReturnValue", "taint", "manual"] - - ["github.com/beego/beego/core/utils", "", False, "SliceRand", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/beego/beego/core/utils", "", False, "SliceReduce", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/beego/beego/core/utils", "", False, "SliceShuffle", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/beego/beego/core/utils", "", False, "SliceUnique", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] - - ["github.com/beego/beego/core/utils", "BeeMap", True, "Get", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] - - ["github.com/beego/beego/core/utils", "BeeMap", True, "Items", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] - - ["github.com/beego/beego/core/utils", "BeeMap", True, "Set", "", "", "Argument[1]", "Argument[receiver]", "taint", "manual"] diff --git a/go/ql/lib/ext/github.com.beego.beego.core.utils.model.yml b/go/ql/lib/ext/github.com.beego.beego.core.utils.model.yml new file mode 100644 index 000000000000..4eb0688e37e7 --- /dev/null +++ b/go/ql/lib/ext/github.com.beego.beego.core.utils.model.yml @@ -0,0 +1,25 @@ +extensions: + - addsTo: + pack: codeql/go-all + extensible: packageGrouping + data: + - ["beego-utils", "github.com/astaxie/beego/utils"] + - ["beego-utils", "github.com/beego/beego/utils"] + - ["beego-utils", "github.com/beego/beego/core/utils"] + - addsTo: + pack: codeql/go-all + extensible: summaryModel + data: + - ["group:beego-utils", "", False, "SliceChunk", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] + - ["group:beego-utils", "", False, "SliceDiff", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] + - ["group:beego-utils", "", False, "SliceFilter", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] + - ["group:beego-utils", "", False, "SliceIntersect", "", "", "Argument[0..1]", "ReturnValue", "taint", "manual"] + - ["group:beego-utils", "", False, "SliceMerge", "", "", "Argument[0..1]", "ReturnValue", "taint", "manual"] + - ["group:beego-utils", "", False, "SlicePad", "", "", "Argument[0..2]", "ReturnValue", "taint", "manual"] + - ["group:beego-utils", "", False, "SliceRand", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] + - ["group:beego-utils", "", False, "SliceReduce", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] + - ["group:beego-utils", "", False, "SliceShuffle", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] + - ["group:beego-utils", "", False, "SliceUnique", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] + - ["group:beego-utils", "BeeMap", True, "Get", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] + - ["group:beego-utils", "BeeMap", True, "Items", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"] + - ["group:beego-utils", "BeeMap", True, "Set", "", "", "Argument[1]", "Argument[receiver]", "taint", "manual"] diff --git a/go/ql/lib/ext/github.com.beego.beego.server.web.context.model.yml b/go/ql/lib/ext/github.com.beego.beego.server.web.context.model.yml new file mode 100644 index 000000000000..89f8eeebfba4 --- /dev/null +++ b/go/ql/lib/ext/github.com.beego.beego.server.web.context.model.yml @@ -0,0 +1,32 @@ +extensions: + - addsTo: + pack: codeql/go-all + extensible: packageGrouping + data: + - ["beego-context", "github.com/astaxie/beego/context"] + - ["beego-context", "github.com/beego/beego/context"] + - ["beego-context", "github.com/beego/beego/server/web/context"] + - addsTo: + pack: codeql/go-all + extensible: summaryModel + data: + - ["group:beego-context", "", False, "WriteBody", "", "", "Argument[2]", "Argument[1]", "taint", "manual"] + - addsTo: + pack: codeql/go-all + extensible: sourceModel + data: + - ["group:beego-context", "BeegoInput", True, "Bind", "", "", "Argument[0]", "remote", "manual"] + - ["group:beego-context", "BeegoInput", True, "Cookie", "", "", "ReturnValue[0]", "remote", "manual"] + - ["group:beego-context", "BeegoInput", True, "Data", "", "", "ReturnValue[0]", "remote", "manual"] + - ["group:beego-context", "BeegoInput", True, "GetData", "", "", "ReturnValue[0]", "remote", "manual"] + - ["group:beego-context", "BeegoInput", True, "Header", "", "", "ReturnValue[0]", "remote", "manual"] + - ["group:beego-context", "BeegoInput", True, "Param", "", "", "ReturnValue[0]", "remote", "manual"] + - ["group:beego-context", "BeegoInput", True, "Params", "", "", "ReturnValue[0]", "remote", "manual"] + - ["group:beego-context", "BeegoInput", True, "Query", "", "", "ReturnValue[0]", "remote", "manual"] + - ["group:beego-context", "BeegoInput", True, "Refer", "", "", "ReturnValue[0]", "remote", "manual"] + - ["group:beego-context", "BeegoInput", True, "Referer", "", "", "ReturnValue[0]", "remote", "manual"] + - ["group:beego-context", "BeegoInput", True, "RequestBody", "", "", "", "remote", "manual"] + - ["group:beego-context", "BeegoInput", True, "URI", "", "", "ReturnValue[0]", "remote", "manual"] + - ["group:beego-context", "BeegoInput", True, "URL", "", "", "ReturnValue[0]", "remote", "manual"] + - ["group:beego-context", "BeegoInput", True, "UserAgent", "", "", "ReturnValue[0]", "remote", "manual"] + - ["group:beego-context", "Context", True, "GetCookie", "", "", "ReturnValue", "remote", "manual"] diff --git a/go/ql/lib/ext/github.com.beego.beego.server.web.model.yml b/go/ql/lib/ext/github.com.beego.beego.server.web.model.yml new file mode 100644 index 000000000000..ee14aa224d4f --- /dev/null +++ b/go/ql/lib/ext/github.com.beego.beego.server.web.model.yml @@ -0,0 +1,29 @@ +extensions: + - addsTo: + pack: codeql/go-all + extensible: packageGrouping + data: + - ["beego", "github.com/astaxie/beego"] + - ["beego", "github.com/beego/beego"] + - ["beego", "github.com/beego/beego/server/web"] + - addsTo: + pack: codeql/go-all + extensible: summaryModel + data: + - ["group:beego", "", False, "HTML2str", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] + - ["group:beego", "", False, "Htmlquote", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] + - ["group:beego", "", False, "Htmlunquote", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] + - ["group:beego", "", False, "MapGet", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"] + - ["group:beego", "", False, "ParseForm", "", "", "Argument[0]", "Argument[1]", "taint", "manual"] + - ["group:beego", "", False, "Str2html", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] + - ["group:beego", "", False, "Substr", "", "", "Argument[0]", "ReturnValue", "taint", "manual"] + - addsTo: + pack: codeql/go-all + extensible: sourceModel + data: + - ["group:beego", "Controller", True, "ParseForm", "", "", "Argument[0]", "remote", "manual"] + - ["group:beego", "Controller", True, "GetFile", "", "", "ReturnValue[0..1]", "remote", "manual"] + - ["group:beego", "Controller", True, "GetFiles", "", "", "ReturnValue[0]", "remote", "manual"] + - ["group:beego", "Controller", True, "GetString", "", "", "ReturnValue[0]", "remote", "manual"] + - ["group:beego", "Controller", True, "GetStrings", "", "", "ReturnValue[0]", "remote", "manual"] + - ["group:beego", "Controller", True, "Input", "", "", "ReturnValue[0]", "remote", "manual"] diff --git a/go/ql/lib/semmle/go/dataflow/ExternalFlow.qll b/go/ql/lib/semmle/go/dataflow/ExternalFlow.qll index 583f96661a49..f8a7457b11b0 100644 --- a/go/ql/lib/semmle/go/dataflow/ExternalFlow.qll +++ b/go/ql/lib/semmle/go/dataflow/ExternalFlow.qll @@ -20,7 +20,10 @@ * 1. The `package` column selects a package. Note that if the package does not * contain a major version suffix (like "/v2") then we will match all major * versions. This can be disabled by putting `fixed-version:` at the start - * of the package path. + * of the package path. Also, instead of a package path, if this column is + * "group:" then it indicates that the row applies to all + * packages in the group `` according to the `packageGrouping` + * predicate. * 2. The `type` column selects a type within that package. * 3. The `subtypes` is a boolean that indicates whether to jump to an * arbitrary subtype of that type. @@ -78,7 +81,7 @@ */ private import go -import internal.ExternalFlowExtensions +import internal.ExternalFlowExtensions as FlowExtensions private import FlowSummary as FlowSummary private import internal.DataFlowPrivate private import internal.FlowSummaryImpl @@ -87,6 +90,89 @@ private import internal.FlowSummaryImpl::Private private import internal.FlowSummaryImpl::Private::External private import codeql.mad.ModelValidation as SharedModelVal +/** Gets the prefix for a group of packages. */ +private string groupPrefix() { result = "group:" } + +/** + * Gets a package represented by `packageOrGroup`. + * + * If `packageOrGroup` is of the form `group:` then `result` is a + * package in the group ``, as determined by `packageGrouping`. + * Otherwise, `result` is `packageOrGroup`. + */ +bindingset[packageOrGroup] +private string getPackage(string packageOrGroup) { + not packageOrGroup.prefix(groupPrefix().length()) = groupPrefix() and result = packageOrGroup + or + exists(string group | + FlowExtensions::packageGrouping(group, result) and + packageOrGroup = groupPrefix() + group + ) +} + +/** + * Holds if a source model exists for the given parameters. + * + * Note that `group:` references are expanded into one or more actual packages + * by this predicate. + */ +predicate sourceModel( + string package, string type, boolean subtypes, string name, string signature, string ext, + string output, string kind, string provenance, QlBuiltins::ExtensionId madId +) { + exists(string packageOrGroup | + package = getPackage(packageOrGroup) and + FlowExtensions::sourceModel(packageOrGroup, type, subtypes, name, signature, ext, output, kind, + provenance, madId) + ) +} + +/** + * Holds if a sink model exists for the given parameters. + * + * Note that `group:` references are expanded into one or more actual packages + * by this predicate. + */ +predicate sinkModel( + string package, string type, boolean subtypes, string name, string signature, string ext, + string input, string kind, string provenance, QlBuiltins::ExtensionId madId +) { + exists(string packageOrGroup | package = getPackage(packageOrGroup) | + FlowExtensions::sinkModel(packageOrGroup, type, subtypes, name, signature, ext, input, kind, + provenance, madId) + ) +} + +/** + * Holds if a summary model exists for the given parameters. + * + * Note that `group:` references are expanded into one or more actual packages + * by this predicate. + */ +predicate summaryModel( + string package, string type, boolean subtypes, string name, string signature, string ext, + string input, string output, string kind, string provenance, QlBuiltins::ExtensionId madId +) { + exists(string packageOrGroup | package = getPackage(packageOrGroup) | + FlowExtensions::summaryModel(packageOrGroup, type, subtypes, name, signature, ext, input, + output, kind, provenance, madId) + ) +} + +/** + * Holds if a neutral model exists for the given parameters. + * + * Note that `group:` references are expanded into one or more actual packages + * by this predicate. + */ +predicate neutralModel( + string package, string type, string name, string signature, string kind, string provenance +) { + exists(string packageOrGroup | package = getPackage(packageOrGroup) | + FlowExtensions::neutralModel(packageOrGroup, type, name, signature, kind, provenance) + ) +} + /** * Holds if the given extension tuple `madId` should pretty-print as `model`. * @@ -286,12 +372,30 @@ module ModelValidation { ) } + private string getInvalidPackageGroup() { + exists(string pred, string group, string package | + FlowExtensions::sourceModel(package, _, _, _, _, _, _, _, _, _) and pred = "source" + or + FlowExtensions::sinkModel(package, _, _, _, _, _, _, _, _, _) and pred = "sink" + or + FlowExtensions::summaryModel(package, _, _, _, _, _, _, _, _, _, _) and + pred = "summary" + or + FlowExtensions::neutralModel(package, _, _, _, _, _) and + pred = "neutral" + | + package = groupPrefix() + group and + not FlowExtensions::packageGrouping(group, _) and + result = "Dubious package group \"" + package + "\" in " + pred + " model." + ) + } + /** Holds if some row in a MaD flow model appears to contain typos. */ query predicate invalidModelRow(string msg) { msg = [ getInvalidModelSignature(), getInvalidModelInput(), getInvalidModelOutput(), - KindVal::getInvalidModelKind() + KindVal::getInvalidModelKind(), getInvalidPackageGroup() ] } } diff --git a/go/ql/lib/semmle/go/dataflow/internal/ExternalFlowExtensions.qll b/go/ql/lib/semmle/go/dataflow/internal/ExternalFlowExtensions.qll index 1cc3fe7292ea..b1e1c906028c 100644 --- a/go/ql/lib/semmle/go/dataflow/internal/ExternalFlowExtensions.qll +++ b/go/ql/lib/semmle/go/dataflow/internal/ExternalFlowExtensions.qll @@ -32,3 +32,8 @@ extensible predicate summaryModel( extensible predicate neutralModel( string package, string type, string name, string signature, string kind, string provenance ); + +/** + * Holds if the package `package` is part of the group `group`. + */ +extensible predicate packageGrouping(string group, string package); diff --git a/go/ql/test/experimental/CWE-090/LDAPInjection.expected b/go/ql/test/experimental/CWE-090/LDAPInjection.expected index 1b21ad41b8e0..ff6470f80f04 100644 --- a/go/ql/test/experimental/CWE-090/LDAPInjection.expected +++ b/go/ql/test/experimental/CWE-090/LDAPInjection.expected @@ -1,18 +1,18 @@ edges -| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:59:3:59:11 | untrusted | provenance | Src:MaD:747 | -| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:61:3:61:51 | ...+... | provenance | Src:MaD:747 | -| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:62:3:62:33 | slice literal | provenance | Src:MaD:747 | -| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:62:24:62:32 | untrusted | provenance | Src:MaD:747 | -| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:66:3:66:11 | untrusted | provenance | Src:MaD:747 | -| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:68:3:68:51 | ...+... | provenance | Src:MaD:747 | -| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:69:3:69:33 | slice literal | provenance | Src:MaD:747 | -| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:69:24:69:32 | untrusted | provenance | Src:MaD:747 | -| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:73:3:73:11 | untrusted | provenance | Src:MaD:747 | -| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:75:3:75:51 | ...+... | provenance | Src:MaD:747 | -| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:76:3:76:33 | slice literal | provenance | Src:MaD:747 | -| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:76:24:76:32 | untrusted | provenance | Src:MaD:747 | -| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:80:22:80:30 | untrusted | provenance | Src:MaD:747 | -| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:81:25:81:33 | untrusted | provenance | Src:MaD:747 | +| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:59:3:59:11 | untrusted | provenance | Src:MaD:686 | +| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:61:3:61:51 | ...+... | provenance | Src:MaD:686 | +| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:62:3:62:33 | slice literal | provenance | Src:MaD:686 | +| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:62:24:62:32 | untrusted | provenance | Src:MaD:686 | +| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:66:3:66:11 | untrusted | provenance | Src:MaD:686 | +| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:68:3:68:51 | ...+... | provenance | Src:MaD:686 | +| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:69:3:69:33 | slice literal | provenance | Src:MaD:686 | +| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:69:24:69:32 | untrusted | provenance | Src:MaD:686 | +| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:73:3:73:11 | untrusted | provenance | Src:MaD:686 | +| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:75:3:75:51 | ...+... | provenance | Src:MaD:686 | +| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:76:3:76:33 | slice literal | provenance | Src:MaD:686 | +| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:76:24:76:32 | untrusted | provenance | Src:MaD:686 | +| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:80:22:80:30 | untrusted | provenance | Src:MaD:686 | +| LDAPInjection.go:57:15:57:29 | call to UserAgent | LDAPInjection.go:81:25:81:33 | untrusted | provenance | Src:MaD:686 | | LDAPInjection.go:62:3:62:33 | slice literal [array] | LDAPInjection.go:62:3:62:33 | slice literal | provenance | | | LDAPInjection.go:62:24:62:32 | untrusted | LDAPInjection.go:62:3:62:33 | slice literal [array] | provenance | | | LDAPInjection.go:69:3:69:33 | slice literal [array] | LDAPInjection.go:69:3:69:33 | slice literal | provenance | | diff --git a/go/ql/test/experimental/CWE-203/Timing.expected b/go/ql/test/experimental/CWE-203/Timing.expected index 9abfb3d575b4..97462acd2492 100644 --- a/go/ql/test/experimental/CWE-203/Timing.expected +++ b/go/ql/test/experimental/CWE-203/Timing.expected @@ -1,9 +1,9 @@ edges -| timing.go:15:18:15:27 | selection of Header | timing.go:15:18:15:45 | call to Get | provenance | MaD:728 | +| timing.go:15:18:15:27 | selection of Header | timing.go:15:18:15:45 | call to Get | provenance | MaD:667 | | timing.go:15:18:15:45 | call to Get | timing.go:17:31:17:42 | headerSecret | provenance | | -| timing.go:28:18:28:27 | selection of Header | timing.go:28:18:28:45 | call to Get | provenance | MaD:728 | +| timing.go:28:18:28:27 | selection of Header | timing.go:28:18:28:45 | call to Get | provenance | MaD:667 | | timing.go:28:18:28:45 | call to Get | timing.go:30:47:30:58 | headerSecret | provenance | | -| timing.go:41:18:41:27 | selection of Header | timing.go:41:18:41:45 | call to Get | provenance | MaD:728 | +| timing.go:41:18:41:27 | selection of Header | timing.go:41:18:41:45 | call to Get | provenance | MaD:667 | | timing.go:41:18:41:45 | call to Get | timing.go:42:25:42:36 | headerSecret | provenance | | nodes | timing.go:15:18:15:27 | selection of Header | semmle.label | selection of Header | diff --git a/go/ql/test/experimental/CWE-287/ImproperLdapAuth.expected b/go/ql/test/experimental/CWE-287/ImproperLdapAuth.expected index 6c21e152efc7..c83a815689c7 100644 --- a/go/ql/test/experimental/CWE-287/ImproperLdapAuth.expected +++ b/go/ql/test/experimental/CWE-287/ImproperLdapAuth.expected @@ -1,5 +1,5 @@ edges -| ImproperLdapAuth.go:18:18:18:24 | selection of URL | ImproperLdapAuth.go:18:18:18:32 | call to Query | provenance | MaD:808 | +| ImproperLdapAuth.go:18:18:18:24 | selection of URL | ImproperLdapAuth.go:18:18:18:32 | call to Query | provenance | MaD:747 | | ImproperLdapAuth.go:18:18:18:32 | call to Query | ImproperLdapAuth.go:28:23:28:34 | bindPassword | provenance | | | ImproperLdapAuth.go:87:18:87:19 | "" | ImproperLdapAuth.go:97:23:97:34 | bindPassword | provenance | | nodes diff --git a/go/ql/test/experimental/CWE-369/DivideByZero.expected b/go/ql/test/experimental/CWE-369/DivideByZero.expected index 5303951e4dc8..8d54fe70758b 100644 --- a/go/ql/test/experimental/CWE-369/DivideByZero.expected +++ b/go/ql/test/experimental/CWE-369/DivideByZero.expected @@ -1,24 +1,24 @@ edges -| DivideByZero.go:10:12:10:16 | selection of URL | DivideByZero.go:10:12:10:24 | call to Query | provenance | MaD:808 | +| DivideByZero.go:10:12:10:16 | selection of URL | DivideByZero.go:10:12:10:24 | call to Query | provenance | MaD:747 | | DivideByZero.go:10:12:10:24 | call to Query | DivideByZero.go:11:27:11:32 | param1 | provenance | | | DivideByZero.go:11:2:11:33 | ... := ...[0] | DivideByZero.go:12:16:12:20 | value | provenance | | | DivideByZero.go:11:27:11:32 | param1 | DivideByZero.go:11:2:11:33 | ... := ...[0] | provenance | Config | -| DivideByZero.go:17:12:17:16 | selection of URL | DivideByZero.go:17:12:17:24 | call to Query | provenance | MaD:808 | +| DivideByZero.go:17:12:17:16 | selection of URL | DivideByZero.go:17:12:17:24 | call to Query | provenance | MaD:747 | | DivideByZero.go:17:12:17:24 | call to Query | DivideByZero.go:18:11:18:24 | type conversion | provenance | | | DivideByZero.go:18:11:18:24 | type conversion | DivideByZero.go:19:16:19:20 | value | provenance | | -| DivideByZero.go:24:12:24:16 | selection of URL | DivideByZero.go:24:12:24:24 | call to Query | provenance | MaD:808 | +| DivideByZero.go:24:12:24:16 | selection of URL | DivideByZero.go:24:12:24:24 | call to Query | provenance | MaD:747 | | DivideByZero.go:24:12:24:24 | call to Query | DivideByZero.go:25:31:25:36 | param1 | provenance | | | DivideByZero.go:25:2:25:45 | ... := ...[0] | DivideByZero.go:26:16:26:20 | value | provenance | | | DivideByZero.go:25:31:25:36 | param1 | DivideByZero.go:25:2:25:45 | ... := ...[0] | provenance | Config | -| DivideByZero.go:31:12:31:16 | selection of URL | DivideByZero.go:31:12:31:24 | call to Query | provenance | MaD:808 | +| DivideByZero.go:31:12:31:16 | selection of URL | DivideByZero.go:31:12:31:24 | call to Query | provenance | MaD:747 | | DivideByZero.go:31:12:31:24 | call to Query | DivideByZero.go:32:33:32:38 | param1 | provenance | | | DivideByZero.go:32:2:32:43 | ... := ...[0] | DivideByZero.go:33:16:33:20 | value | provenance | | | DivideByZero.go:32:33:32:38 | param1 | DivideByZero.go:32:2:32:43 | ... := ...[0] | provenance | Config | -| DivideByZero.go:38:12:38:16 | selection of URL | DivideByZero.go:38:12:38:24 | call to Query | provenance | MaD:808 | +| DivideByZero.go:38:12:38:16 | selection of URL | DivideByZero.go:38:12:38:24 | call to Query | provenance | MaD:747 | | DivideByZero.go:38:12:38:24 | call to Query | DivideByZero.go:39:32:39:37 | param1 | provenance | | | DivideByZero.go:39:2:39:46 | ... := ...[0] | DivideByZero.go:40:16:40:20 | value | provenance | | | DivideByZero.go:39:32:39:37 | param1 | DivideByZero.go:39:2:39:46 | ... := ...[0] | provenance | Config | -| DivideByZero.go:54:12:54:16 | selection of URL | DivideByZero.go:54:12:54:24 | call to Query | provenance | MaD:808 | +| DivideByZero.go:54:12:54:16 | selection of URL | DivideByZero.go:54:12:54:24 | call to Query | provenance | MaD:747 | | DivideByZero.go:54:12:54:24 | call to Query | DivideByZero.go:55:11:55:24 | type conversion | provenance | | | DivideByZero.go:55:11:55:24 | type conversion | DivideByZero.go:57:17:57:21 | value | provenance | | nodes diff --git a/go/ql/test/experimental/CWE-522-DecompressionBombs/DecompressionBombs.expected b/go/ql/test/experimental/CWE-522-DecompressionBombs/DecompressionBombs.expected index 691a39136461..c431b749378f 100644 --- a/go/ql/test/experimental/CWE-522-DecompressionBombs/DecompressionBombs.expected +++ b/go/ql/test/experimental/CWE-522-DecompressionBombs/DecompressionBombs.expected @@ -1,5 +1,5 @@ edges -| test.go:59:16:59:44 | call to FormValue | test.go:128:20:128:27 | definition of filename | provenance | Src:MaD:743 | +| test.go:59:16:59:44 | call to FormValue | test.go:128:20:128:27 | definition of filename | provenance | Src:MaD:682 | | test.go:60:15:60:26 | selection of Body | test.go:158:19:158:22 | definition of file | provenance | | | test.go:61:24:61:35 | selection of Body | test.go:169:28:169:31 | definition of file | provenance | | | test.go:62:13:62:24 | selection of Body | test.go:181:17:181:20 | definition of file | provenance | | @@ -31,7 +31,7 @@ edges | test.go:145:12:145:19 | call to Open | test.go:147:37:147:38 | rc | provenance | | | test.go:158:19:158:22 | definition of file | test.go:159:25:159:28 | file | provenance | | | test.go:159:2:159:29 | ... := ...[0] | test.go:160:48:160:52 | file1 | provenance | | -| test.go:159:25:159:28 | file | test.go:159:2:159:29 | ... := ...[0] | provenance | MaD:620 | +| test.go:159:25:159:28 | file | test.go:159:2:159:29 | ... := ...[0] | provenance | MaD:559 | | test.go:160:2:160:69 | ... := ...[0] | test.go:163:26:163:29 | file | provenance | | | test.go:160:32:160:53 | call to NewReader | test.go:160:2:160:69 | ... := ...[0] | provenance | Config | | test.go:160:48:160:52 | file1 | test.go:160:32:160:53 | call to NewReader | provenance | MaD:46 | @@ -39,7 +39,7 @@ edges | test.go:163:26:163:29 | file | test.go:163:3:163:36 | ... := ...[0] | provenance | MaD:8 | | test.go:169:28:169:31 | definition of file | test.go:170:25:170:28 | file | provenance | | | test.go:170:2:170:29 | ... := ...[0] | test.go:171:57:171:61 | file2 | provenance | | -| test.go:170:25:170:28 | file | test.go:170:2:170:29 | ... := ...[0] | provenance | MaD:620 | +| test.go:170:25:170:28 | file | test.go:170:2:170:29 | ... := ...[0] | provenance | MaD:559 | | test.go:171:2:171:78 | ... := ...[0] | test.go:175:26:175:29 | file | provenance | | | test.go:171:41:171:62 | call to NewReader | test.go:171:2:171:78 | ... := ...[0] | provenance | Config | | test.go:171:57:171:61 | file2 | test.go:171:41:171:62 | call to NewReader | provenance | MaD:46 | diff --git a/go/ql/test/experimental/CWE-74/DsnInjection.expected b/go/ql/test/experimental/CWE-74/DsnInjection.expected index d305280c9e11..84911854fb14 100644 --- a/go/ql/test/experimental/CWE-74/DsnInjection.expected +++ b/go/ql/test/experimental/CWE-74/DsnInjection.expected @@ -1,5 +1,5 @@ edges -| Dsn.go:47:10:47:30 | call to FormValue | Dsn.go:49:102:49:105 | name | provenance | Src:MaD:743 | +| Dsn.go:47:10:47:30 | call to FormValue | Dsn.go:49:102:49:105 | name | provenance | Src:MaD:682 | | Dsn.go:49:11:49:106 | []type{args} [array] | Dsn.go:49:11:49:106 | call to Sprintf | provenance | MaD:248 | | Dsn.go:49:11:49:106 | call to Sprintf | Dsn.go:50:29:50:33 | dbDSN | provenance | | | Dsn.go:49:102:49:105 | name | Dsn.go:49:11:49:106 | []type{args} [array] | provenance | | diff --git a/go/ql/test/experimental/CWE-79/HTMLTemplateEscapingPassthrough.expected b/go/ql/test/experimental/CWE-79/HTMLTemplateEscapingPassthrough.expected index c697e5398030..3e94b795995a 100644 --- a/go/ql/test/experimental/CWE-79/HTMLTemplateEscapingPassthrough.expected +++ b/go/ql/test/experimental/CWE-79/HTMLTemplateEscapingPassthrough.expected @@ -1,28 +1,28 @@ edges | HTMLTemplateEscapingPassthrough.go:29:12:29:41 | type conversion | HTMLTemplateEscapingPassthrough.go:30:39:30:39 | a | provenance | | -| HTMLTemplateEscapingPassthrough.go:29:26:29:40 | call to UserAgent | HTMLTemplateEscapingPassthrough.go:29:12:29:41 | type conversion | provenance | Src:MaD:747 | +| HTMLTemplateEscapingPassthrough.go:29:26:29:40 | call to UserAgent | HTMLTemplateEscapingPassthrough.go:29:12:29:41 | type conversion | provenance | Src:MaD:686 | | HTMLTemplateEscapingPassthrough.go:35:9:35:38 | type conversion | HTMLTemplateEscapingPassthrough.go:36:40:36:40 | a | provenance | | -| HTMLTemplateEscapingPassthrough.go:35:23:35:37 | call to UserAgent | HTMLTemplateEscapingPassthrough.go:35:9:35:38 | type conversion | provenance | Src:MaD:747 | +| HTMLTemplateEscapingPassthrough.go:35:23:35:37 | call to UserAgent | HTMLTemplateEscapingPassthrough.go:35:9:35:38 | type conversion | provenance | Src:MaD:686 | | HTMLTemplateEscapingPassthrough.go:40:9:40:34 | type conversion | HTMLTemplateEscapingPassthrough.go:41:40:41:40 | a | provenance | | -| HTMLTemplateEscapingPassthrough.go:40:19:40:33 | call to UserAgent | HTMLTemplateEscapingPassthrough.go:40:9:40:34 | type conversion | provenance | Src:MaD:747 | +| HTMLTemplateEscapingPassthrough.go:40:19:40:33 | call to UserAgent | HTMLTemplateEscapingPassthrough.go:40:9:40:34 | type conversion | provenance | Src:MaD:686 | | HTMLTemplateEscapingPassthrough.go:46:11:46:44 | type conversion | HTMLTemplateEscapingPassthrough.go:47:41:47:41 | c | provenance | | -| HTMLTemplateEscapingPassthrough.go:46:29:46:43 | call to UserAgent | HTMLTemplateEscapingPassthrough.go:46:11:46:44 | type conversion | provenance | Src:MaD:747 | +| HTMLTemplateEscapingPassthrough.go:46:29:46:43 | call to UserAgent | HTMLTemplateEscapingPassthrough.go:46:11:46:44 | type conversion | provenance | Src:MaD:686 | | HTMLTemplateEscapingPassthrough.go:50:11:50:38 | type conversion | HTMLTemplateEscapingPassthrough.go:51:44:51:44 | d | provenance | | -| HTMLTemplateEscapingPassthrough.go:50:23:50:37 | call to UserAgent | HTMLTemplateEscapingPassthrough.go:50:11:50:38 | type conversion | provenance | Src:MaD:747 | +| HTMLTemplateEscapingPassthrough.go:50:23:50:37 | call to UserAgent | HTMLTemplateEscapingPassthrough.go:50:11:50:38 | type conversion | provenance | Src:MaD:686 | | HTMLTemplateEscapingPassthrough.go:54:11:54:41 | type conversion | HTMLTemplateEscapingPassthrough.go:55:44:55:44 | e | provenance | | -| HTMLTemplateEscapingPassthrough.go:54:26:54:40 | call to UserAgent | HTMLTemplateEscapingPassthrough.go:54:11:54:41 | type conversion | provenance | Src:MaD:747 | +| HTMLTemplateEscapingPassthrough.go:54:26:54:40 | call to UserAgent | HTMLTemplateEscapingPassthrough.go:54:11:54:41 | type conversion | provenance | Src:MaD:686 | | HTMLTemplateEscapingPassthrough.go:58:11:58:39 | type conversion | HTMLTemplateEscapingPassthrough.go:59:38:59:38 | b | provenance | | -| HTMLTemplateEscapingPassthrough.go:58:24:58:38 | call to UserAgent | HTMLTemplateEscapingPassthrough.go:58:11:58:39 | type conversion | provenance | Src:MaD:747 | +| HTMLTemplateEscapingPassthrough.go:58:24:58:38 | call to UserAgent | HTMLTemplateEscapingPassthrough.go:58:11:58:39 | type conversion | provenance | Src:MaD:686 | | HTMLTemplateEscapingPassthrough.go:62:11:62:42 | type conversion | HTMLTemplateEscapingPassthrough.go:63:44:63:44 | f | provenance | | -| HTMLTemplateEscapingPassthrough.go:62:27:62:41 | call to UserAgent | HTMLTemplateEscapingPassthrough.go:62:11:62:42 | type conversion | provenance | Src:MaD:747 | +| HTMLTemplateEscapingPassthrough.go:62:27:62:41 | call to UserAgent | HTMLTemplateEscapingPassthrough.go:62:11:62:42 | type conversion | provenance | Src:MaD:686 | | HTMLTemplateEscapingPassthrough.go:66:11:66:39 | type conversion | HTMLTemplateEscapingPassthrough.go:67:38:67:38 | g | provenance | | -| HTMLTemplateEscapingPassthrough.go:66:24:66:38 | call to UserAgent | HTMLTemplateEscapingPassthrough.go:66:11:66:39 | type conversion | provenance | Src:MaD:747 | -| HTMLTemplateEscapingPassthrough.go:75:17:75:31 | call to UserAgent | HTMLTemplateEscapingPassthrough.go:76:38:76:44 | escaped | provenance | Src:MaD:747 | -| HTMLTemplateEscapingPassthrough.go:81:10:81:24 | call to UserAgent | HTMLTemplateEscapingPassthrough.go:84:38:84:40 | src | provenance | Src:MaD:747 | -| HTMLTemplateEscapingPassthrough.go:89:10:89:24 | call to UserAgent | HTMLTemplateEscapingPassthrough.go:91:64:91:66 | src | provenance | Src:MaD:747 | +| HTMLTemplateEscapingPassthrough.go:66:24:66:38 | call to UserAgent | HTMLTemplateEscapingPassthrough.go:66:11:66:39 | type conversion | provenance | Src:MaD:686 | +| HTMLTemplateEscapingPassthrough.go:75:17:75:31 | call to UserAgent | HTMLTemplateEscapingPassthrough.go:76:38:76:44 | escaped | provenance | Src:MaD:686 | +| HTMLTemplateEscapingPassthrough.go:81:10:81:24 | call to UserAgent | HTMLTemplateEscapingPassthrough.go:84:38:84:40 | src | provenance | Src:MaD:686 | +| HTMLTemplateEscapingPassthrough.go:89:10:89:24 | call to UserAgent | HTMLTemplateEscapingPassthrough.go:91:64:91:66 | src | provenance | Src:MaD:686 | | HTMLTemplateEscapingPassthrough.go:91:16:91:77 | type conversion | HTMLTemplateEscapingPassthrough.go:92:38:92:46 | converted | provenance | | | HTMLTemplateEscapingPassthrough.go:91:38:91:67 | call to HTMLEscapeString | HTMLTemplateEscapingPassthrough.go:91:16:91:77 | type conversion | provenance | | -| HTMLTemplateEscapingPassthrough.go:91:64:91:66 | src | HTMLTemplateEscapingPassthrough.go:91:38:91:67 | call to HTMLEscapeString | provenance | MaD:595 | +| HTMLTemplateEscapingPassthrough.go:91:64:91:66 | src | HTMLTemplateEscapingPassthrough.go:91:38:91:67 | call to HTMLEscapeString | provenance | MaD:534 | nodes | HTMLTemplateEscapingPassthrough.go:29:12:29:41 | type conversion | semmle.label | type conversion | | HTMLTemplateEscapingPassthrough.go:29:26:29:40 | call to UserAgent | semmle.label | call to UserAgent | diff --git a/go/ql/test/experimental/CWE-918/SSRF.expected b/go/ql/test/experimental/CWE-918/SSRF.expected index 92b571da8e4b..081fcf1cd4bb 100644 --- a/go/ql/test/experimental/CWE-918/SSRF.expected +++ b/go/ql/test/experimental/CWE-918/SSRF.expected @@ -1,9 +1,9 @@ edges -| builtin.go:19:12:19:34 | call to FormValue | builtin.go:22:21:22:62 | ...+... | provenance | Src:MaD:743 | -| builtin.go:83:21:83:31 | call to Referer | builtin.go:88:27:88:40 | untrustedInput | provenance | Src:MaD:746 | -| builtin.go:97:21:97:31 | call to Referer | builtin.go:101:36:101:49 | untrustedInput | provenance | Src:MaD:746 | -| builtin.go:111:21:111:31 | call to Referer | builtin.go:114:15:114:28 | untrustedInput | provenance | Src:MaD:746 | -| builtin.go:129:21:129:31 | call to Referer | builtin.go:132:38:132:51 | untrustedInput | provenance | Src:MaD:746 | +| builtin.go:19:12:19:34 | call to FormValue | builtin.go:22:21:22:62 | ...+... | provenance | Src:MaD:682 | +| builtin.go:83:21:83:31 | call to Referer | builtin.go:88:27:88:40 | untrustedInput | provenance | Src:MaD:685 | +| builtin.go:97:21:97:31 | call to Referer | builtin.go:101:36:101:49 | untrustedInput | provenance | Src:MaD:685 | +| builtin.go:111:21:111:31 | call to Referer | builtin.go:114:15:114:28 | untrustedInput | provenance | Src:MaD:685 | +| builtin.go:129:21:129:31 | call to Referer | builtin.go:132:38:132:51 | untrustedInput | provenance | Src:MaD:685 | | new-tests.go:26:26:26:30 | &... | new-tests.go:31:48:31:56 | selection of word | provenance | | | new-tests.go:26:26:26:30 | &... | new-tests.go:32:48:32:56 | selection of safe | provenance | | | new-tests.go:26:26:26:30 | &... | new-tests.go:35:49:35:57 | selection of word | provenance | | @@ -19,7 +19,7 @@ edges | new-tests.go:39:18:39:30 | call to Param | new-tests.go:47:11:47:46 | ...+... | provenance | | | new-tests.go:49:18:49:30 | call to Query | new-tests.go:50:11:50:46 | ...+... | provenance | | | new-tests.go:62:2:62:39 | ... := ...[0] | new-tests.go:63:17:63:23 | reqBody | provenance | | -| new-tests.go:62:31:62:38 | selection of Body | new-tests.go:62:2:62:39 | ... := ...[0] | provenance | MaD:613 | +| new-tests.go:62:31:62:38 | selection of Body | new-tests.go:62:2:62:39 | ... := ...[0] | provenance | MaD:552 | | new-tests.go:63:17:63:23 | reqBody | new-tests.go:63:26:63:30 | &... | provenance | MaD:187 | | new-tests.go:63:26:63:30 | &... | new-tests.go:68:48:68:56 | selection of word | provenance | | | new-tests.go:63:26:63:30 | &... | new-tests.go:69:48:69:56 | selection of safe | provenance | | @@ -33,12 +33,12 @@ edges | new-tests.go:74:12:74:58 | []type{args} [array] | new-tests.go:74:12:74:58 | call to Sprintf | provenance | MaD:248 | | new-tests.go:74:49:74:57 | selection of word | new-tests.go:74:12:74:58 | []type{args} [array] | provenance | | | new-tests.go:74:49:74:57 | selection of word | new-tests.go:74:12:74:58 | call to Sprintf | provenance | FunctionModel | -| new-tests.go:78:18:78:24 | selection of URL | new-tests.go:78:18:78:32 | call to Query | provenance | MaD:808 | -| new-tests.go:78:18:78:32 | call to Query | new-tests.go:78:18:78:46 | call to Get | provenance | MaD:815 | +| new-tests.go:78:18:78:24 | selection of URL | new-tests.go:78:18:78:32 | call to Query | provenance | MaD:747 | +| new-tests.go:78:18:78:32 | call to Query | new-tests.go:78:18:78:46 | call to Get | provenance | MaD:754 | | new-tests.go:78:18:78:46 | call to Get | new-tests.go:79:11:79:46 | ...+... | provenance | | | new-tests.go:81:18:81:67 | call to TrimPrefix | new-tests.go:82:11:82:46 | ...+... | provenance | | | new-tests.go:81:37:81:43 | selection of URL | new-tests.go:81:37:81:48 | selection of Path | provenance | | -| new-tests.go:81:37:81:48 | selection of Path | new-tests.go:81:18:81:67 | call to TrimPrefix | provenance | MaD:931 | +| new-tests.go:81:37:81:48 | selection of Path | new-tests.go:81:18:81:67 | call to TrimPrefix | provenance | MaD:870 | | new-tests.go:86:10:86:20 | call to Vars | new-tests.go:88:11:88:46 | ...+... | provenance | | | new-tests.go:95:18:95:45 | call to URLParam | new-tests.go:96:11:96:46 | ...+... | provenance | | nodes diff --git a/go/ql/test/library-tests/semmle/go/dataflow/DefaultTaintSanitizer/DefaultSanitizer.expected b/go/ql/test/library-tests/semmle/go/dataflow/DefaultTaintSanitizer/DefaultSanitizer.expected index 6140dbb7d080..a19e41c241cc 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/DefaultTaintSanitizer/DefaultSanitizer.expected +++ b/go/ql/test/library-tests/semmle/go/dataflow/DefaultTaintSanitizer/DefaultSanitizer.expected @@ -1,10 +1,10 @@ edges | Builtin.go:6:2:6:2 | definition of b | Builtin.go:8:9:8:17 | type conversion | provenance | | -| Builtin.go:7:2:7:15 | selection of Body | Builtin.go:6:2:6:2 | definition of b | provenance | MaD:626 | +| Builtin.go:7:2:7:15 | selection of Body | Builtin.go:6:2:6:2 | definition of b | provenance | MaD:565 | | Builtin.go:12:2:12:2 | definition of b | Builtin.go:17:9:17:17 | type conversion | provenance | | -| Builtin.go:13:2:13:15 | selection of Body | Builtin.go:12:2:12:2 | definition of b | provenance | MaD:626 | +| Builtin.go:13:2:13:15 | selection of Body | Builtin.go:12:2:12:2 | definition of b | provenance | MaD:565 | | Builtin.go:21:2:21:2 | definition of b | Builtin.go:24:10:24:18 | type conversion | provenance | | -| Builtin.go:22:2:22:15 | selection of Body | Builtin.go:21:2:21:2 | definition of b | provenance | MaD:626 | +| Builtin.go:22:2:22:15 | selection of Body | Builtin.go:21:2:21:2 | definition of b | provenance | MaD:565 | nodes | Builtin.go:6:2:6:2 | definition of b | semmle.label | definition of b | | Builtin.go:7:2:7:15 | selection of Body | semmle.label | selection of Body | diff --git a/go/ql/test/library-tests/semmle/go/dataflow/ThreatModels/threat-models-flowtest1.expected b/go/ql/test/library-tests/semmle/go/dataflow/ThreatModels/threat-models-flowtest1.expected index 048fde10674e..9bffdf15a4cb 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/ThreatModels/threat-models-flowtest1.expected +++ b/go/ql/test/library-tests/semmle/go/dataflow/ThreatModels/threat-models-flowtest1.expected @@ -1,6 +1,6 @@ edges -| test.go:32:11:32:15 | selection of URL | test.go:32:11:32:23 | call to Query | provenance | MaD:808 | -| test.go:32:11:32:23 | call to Query | test.go:32:11:32:36 | call to Get | provenance | MaD:815 | +| test.go:32:11:32:15 | selection of URL | test.go:32:11:32:23 | call to Query | provenance | MaD:747 | +| test.go:32:11:32:23 | call to Query | test.go:32:11:32:36 | call to Get | provenance | MaD:754 | | test.go:32:11:32:36 | call to Get | test.go:34:7:34:30 | ...+... | provenance | | nodes | test.go:32:11:32:15 | selection of URL | semmle.label | selection of URL | diff --git a/go/ql/test/library-tests/semmle/go/dataflow/ThreatModels/threat-models-flowtest2.expected b/go/ql/test/library-tests/semmle/go/dataflow/ThreatModels/threat-models-flowtest2.expected index 7c9b9865e855..459c7601a368 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/ThreatModels/threat-models-flowtest2.expected +++ b/go/ql/test/library-tests/semmle/go/dataflow/ThreatModels/threat-models-flowtest2.expected @@ -1,7 +1,7 @@ edges | test.go:27:11:27:63 | call to ExecuteQuery | test.go:28:7:28:11 | query | provenance | Src:MaD:1 | -| test.go:32:11:32:15 | selection of URL | test.go:32:11:32:23 | call to Query | provenance | MaD:808 | -| test.go:32:11:32:23 | call to Query | test.go:32:11:32:36 | call to Get | provenance | MaD:815 | +| test.go:32:11:32:15 | selection of URL | test.go:32:11:32:23 | call to Query | provenance | MaD:747 | +| test.go:32:11:32:23 | call to Query | test.go:32:11:32:36 | call to Get | provenance | MaD:754 | | test.go:32:11:32:36 | call to Get | test.go:34:7:34:30 | ...+... | provenance | | nodes | test.go:27:11:27:63 | call to ExecuteQuery | semmle.label | call to ExecuteQuery | diff --git a/go/ql/test/library-tests/semmle/go/dataflow/ThreatModels/threat-models-flowtest3.expected b/go/ql/test/library-tests/semmle/go/dataflow/ThreatModels/threat-models-flowtest3.expected index 8d488a8346bc..357bc6b4c916 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/ThreatModels/threat-models-flowtest3.expected +++ b/go/ql/test/library-tests/semmle/go/dataflow/ThreatModels/threat-models-flowtest3.expected @@ -2,8 +2,8 @@ edges | test.go:9:10:9:40 | call to ReadEnvironment | test.go:11:7:11:29 | ...+... | provenance | Src:MaD:2 | | test.go:15:9:15:32 | call to GetCliArg | test.go:17:7:17:28 | ...+... | provenance | Src:MaD:4 | | test.go:27:11:27:63 | call to ExecuteQuery | test.go:28:7:28:11 | query | provenance | Src:MaD:1 | -| test.go:32:11:32:15 | selection of URL | test.go:32:11:32:23 | call to Query | provenance | MaD:808 | -| test.go:32:11:32:23 | call to Query | test.go:32:11:32:36 | call to Get | provenance | MaD:815 | +| test.go:32:11:32:15 | selection of URL | test.go:32:11:32:23 | call to Query | provenance | MaD:747 | +| test.go:32:11:32:23 | call to Query | test.go:32:11:32:36 | call to Get | provenance | MaD:754 | | test.go:32:11:32:36 | call to Get | test.go:34:7:34:30 | ...+... | provenance | | nodes | test.go:9:10:9:40 | call to ReadEnvironment | semmle.label | call to ReadEnvironment | diff --git a/go/ql/test/library-tests/semmle/go/dataflow/ThreatModels/threat-models-flowtest4.expected b/go/ql/test/library-tests/semmle/go/dataflow/ThreatModels/threat-models-flowtest4.expected index df5bff83eb7a..0675c895e229 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/ThreatModels/threat-models-flowtest4.expected +++ b/go/ql/test/library-tests/semmle/go/dataflow/ThreatModels/threat-models-flowtest4.expected @@ -3,8 +3,8 @@ edges | test.go:15:9:15:32 | call to GetCliArg | test.go:17:7:17:28 | ...+... | provenance | Src:MaD:4 | | test.go:21:11:21:36 | call to GetCustom | test.go:23:7:23:30 | ...+... | provenance | Src:MaD:3 | | test.go:27:11:27:63 | call to ExecuteQuery | test.go:28:7:28:11 | query | provenance | Src:MaD:1 | -| test.go:32:11:32:15 | selection of URL | test.go:32:11:32:23 | call to Query | provenance | MaD:808 | -| test.go:32:11:32:23 | call to Query | test.go:32:11:32:36 | call to Get | provenance | MaD:815 | +| test.go:32:11:32:15 | selection of URL | test.go:32:11:32:23 | call to Query | provenance | MaD:747 | +| test.go:32:11:32:23 | call to Query | test.go:32:11:32:36 | call to Get | provenance | MaD:754 | | test.go:32:11:32:36 | call to Get | test.go:34:7:34:30 | ...+... | provenance | | nodes | test.go:9:10:9:40 | call to ReadEnvironment | semmle.label | call to ReadEnvironment | diff --git a/go/ql/test/library-tests/semmle/go/dataflow/ThreatModels/threat-models-flowtest5.expected b/go/ql/test/library-tests/semmle/go/dataflow/ThreatModels/threat-models-flowtest5.expected index 824d22e1e91e..833e9b7ae675 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/ThreatModels/threat-models-flowtest5.expected +++ b/go/ql/test/library-tests/semmle/go/dataflow/ThreatModels/threat-models-flowtest5.expected @@ -1,8 +1,8 @@ edges | test.go:9:10:9:40 | call to ReadEnvironment | test.go:11:7:11:29 | ...+... | provenance | Src:MaD:3 | | test.go:15:9:15:32 | call to GetCliArg | test.go:17:7:17:28 | ...+... | provenance | Src:MaD:5 | -| test.go:32:11:32:15 | selection of URL | test.go:32:11:32:23 | call to Query | provenance | MaD:808 | -| test.go:32:11:32:23 | call to Query | test.go:32:11:32:36 | call to Get | provenance | MaD:815 | +| test.go:32:11:32:15 | selection of URL | test.go:32:11:32:23 | call to Query | provenance | MaD:747 | +| test.go:32:11:32:23 | call to Query | test.go:32:11:32:36 | call to Get | provenance | MaD:754 | | test.go:32:11:32:36 | call to Get | test.go:34:7:34:30 | ...+... | provenance | | nodes | test.go:9:10:9:40 | call to ReadEnvironment | semmle.label | call to ReadEnvironment | diff --git a/go/ql/test/library-tests/semmle/go/dataflow/ThreatModels/threat-models-flowtest6.expected b/go/ql/test/library-tests/semmle/go/dataflow/ThreatModels/threat-models-flowtest6.expected index 789c6d954c8c..a255c58f19ab 100644 --- a/go/ql/test/library-tests/semmle/go/dataflow/ThreatModels/threat-models-flowtest6.expected +++ b/go/ql/test/library-tests/semmle/go/dataflow/ThreatModels/threat-models-flowtest6.expected @@ -1,8 +1,8 @@ edges | test.go:15:9:15:32 | call to GetCliArg | test.go:17:7:17:28 | ...+... | provenance | Src:MaD:5 | | test.go:27:11:27:63 | call to ExecuteQuery | test.go:28:7:28:11 | query | provenance | Src:MaD:2 | -| test.go:32:11:32:15 | selection of URL | test.go:32:11:32:23 | call to Query | provenance | MaD:808 | -| test.go:32:11:32:23 | call to Query | test.go:32:11:32:36 | call to Get | provenance | MaD:815 | +| test.go:32:11:32:15 | selection of URL | test.go:32:11:32:23 | call to Query | provenance | MaD:747 | +| test.go:32:11:32:23 | call to Query | test.go:32:11:32:36 | call to Get | provenance | MaD:754 | | test.go:32:11:32:36 | call to Get | test.go:34:7:34:30 | ...+... | provenance | | nodes | test.go:15:9:15:32 | call to GetCliArg | semmle.label | call to GetCliArg | diff --git a/go/ql/test/library-tests/semmle/go/frameworks/Beego/ReflectedXss.expected b/go/ql/test/library-tests/semmle/go/frameworks/Beego/ReflectedXss.expected index 6845b74b9126..9f76a01ff824 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/Beego/ReflectedXss.expected +++ b/go/ql/test/library-tests/semmle/go/frameworks/Beego/ReflectedXss.expected @@ -1,104 +1,104 @@ edges -| test.go:33:6:33:10 | definition of bound | test.go:35:13:35:30 | type conversion | provenance | Src:MaD:252 | -| test.go:33:6:33:10 | definition of bound | test.go:36:13:36:27 | type conversion | provenance | Src:MaD:252 | -| test.go:33:6:33:10 | definition of bound | test.go:37:13:37:29 | type conversion | provenance | Src:MaD:252 | -| test.go:42:20:42:42 | call to Cookie | test.go:42:13:42:43 | type conversion | provenance | Src:MaD:253 | -| test.go:47:20:47:31 | call to Data | test.go:47:13:47:52 | type conversion | provenance | Src:MaD:254 | -| test.go:52:20:52:43 | call to GetData | test.go:52:13:52:53 | type conversion | provenance | Src:MaD:255 | -| test.go:57:20:57:42 | call to Header | test.go:57:13:57:43 | type conversion | provenance | Src:MaD:256 | -| test.go:62:20:62:41 | call to Param | test.go:62:13:62:42 | type conversion | provenance | Src:MaD:257 | -| test.go:67:20:67:33 | call to Params | test.go:67:13:67:45 | type conversion | provenance | Src:MaD:258 | -| test.go:72:20:72:41 | call to Query | test.go:72:13:72:42 | type conversion | provenance | Src:MaD:259 | -| test.go:77:20:77:32 | call to Refer | test.go:77:13:77:33 | type conversion | provenance | Src:MaD:260 | -| test.go:82:20:82:34 | call to Referer | test.go:82:13:82:35 | type conversion | provenance | Src:MaD:261 | -| test.go:87:20:87:30 | call to URI | test.go:87:13:87:31 | type conversion | provenance | Src:MaD:263 | -| test.go:92:20:92:30 | call to URL | test.go:92:13:92:31 | type conversion | provenance | Src:MaD:264 | -| test.go:97:20:97:36 | call to UserAgent | test.go:97:13:97:37 | type conversion | provenance | Src:MaD:265 | -| test.go:102:14:102:25 | call to Data | test.go:102:14:102:45 | type assertion | provenance | Src:MaD:254 | -| test.go:114:14:114:25 | call to Data | test.go:114:14:114:45 | type assertion | provenance | Src:MaD:254 | -| test.go:126:14:126:25 | call to Data | test.go:126:14:126:45 | type assertion | provenance | Src:MaD:254 | -| test.go:143:23:143:42 | call to Data | test.go:143:23:143:62 | type assertion | provenance | Src:MaD:254 | -| test.go:199:15:199:26 | call to Data | test.go:200:36:200:53 | type assertion | provenance | Src:MaD:254 | -| test.go:199:15:199:26 | call to Data | test.go:201:39:201:56 | type assertion | provenance | Src:MaD:254 | -| test.go:199:15:199:26 | call to Data | test.go:202:28:202:56 | type assertion | provenance | Src:MaD:254 | -| test.go:199:15:199:26 | call to Data | test.go:204:36:204:53 | type assertion | provenance | Src:MaD:254 | -| test.go:199:15:199:26 | call to Data | test.go:205:34:205:51 | type assertion | provenance | Src:MaD:254 | +| test.go:33:6:33:10 | definition of bound | test.go:35:13:35:30 | type conversion | provenance | Src:MaD:270 | +| test.go:33:6:33:10 | definition of bound | test.go:36:13:36:27 | type conversion | provenance | Src:MaD:270 | +| test.go:33:6:33:10 | definition of bound | test.go:37:13:37:29 | type conversion | provenance | Src:MaD:270 | +| test.go:42:20:42:42 | call to Cookie | test.go:42:13:42:43 | type conversion | provenance | Src:MaD:271 | +| test.go:47:20:47:31 | call to Data | test.go:47:13:47:52 | type conversion | provenance | Src:MaD:272 | +| test.go:52:20:52:43 | call to GetData | test.go:52:13:52:53 | type conversion | provenance | Src:MaD:273 | +| test.go:57:20:57:42 | call to Header | test.go:57:13:57:43 | type conversion | provenance | Src:MaD:274 | +| test.go:62:20:62:41 | call to Param | test.go:62:13:62:42 | type conversion | provenance | Src:MaD:275 | +| test.go:67:20:67:33 | call to Params | test.go:67:13:67:45 | type conversion | provenance | Src:MaD:276 | +| test.go:72:20:72:41 | call to Query | test.go:72:13:72:42 | type conversion | provenance | Src:MaD:277 | +| test.go:77:20:77:32 | call to Refer | test.go:77:13:77:33 | type conversion | provenance | Src:MaD:278 | +| test.go:82:20:82:34 | call to Referer | test.go:82:13:82:35 | type conversion | provenance | Src:MaD:279 | +| test.go:87:20:87:30 | call to URI | test.go:87:13:87:31 | type conversion | provenance | Src:MaD:281 | +| test.go:92:20:92:30 | call to URL | test.go:92:13:92:31 | type conversion | provenance | Src:MaD:282 | +| test.go:97:20:97:36 | call to UserAgent | test.go:97:13:97:37 | type conversion | provenance | Src:MaD:283 | +| test.go:102:14:102:25 | call to Data | test.go:102:14:102:45 | type assertion | provenance | Src:MaD:272 | +| test.go:114:14:114:25 | call to Data | test.go:114:14:114:45 | type assertion | provenance | Src:MaD:272 | +| test.go:126:14:126:25 | call to Data | test.go:126:14:126:45 | type assertion | provenance | Src:MaD:272 | +| test.go:143:23:143:42 | call to Data | test.go:143:23:143:62 | type assertion | provenance | Src:MaD:272 | +| test.go:199:15:199:26 | call to Data | test.go:200:36:200:53 | type assertion | provenance | Src:MaD:272 | +| test.go:199:15:199:26 | call to Data | test.go:201:39:201:56 | type assertion | provenance | Src:MaD:272 | +| test.go:199:15:199:26 | call to Data | test.go:202:28:202:56 | type assertion | provenance | Src:MaD:272 | +| test.go:199:15:199:26 | call to Data | test.go:204:36:204:53 | type assertion | provenance | Src:MaD:272 | +| test.go:199:15:199:26 | call to Data | test.go:205:34:205:51 | type assertion | provenance | Src:MaD:272 | | test.go:200:21:200:54 | call to HTML2str | test.go:200:14:200:55 | type conversion | provenance | | -| test.go:200:36:200:53 | type assertion | test.go:200:21:200:54 | call to HTML2str | provenance | MaD:297 | +| test.go:200:36:200:53 | type assertion | test.go:200:21:200:54 | call to HTML2str | provenance | MaD:288 | | test.go:201:21:201:57 | call to Htmlunquote | test.go:201:14:201:58 | type conversion | provenance | | -| test.go:201:39:201:56 | type assertion | test.go:201:21:201:57 | call to Htmlunquote | provenance | MaD:299 | +| test.go:201:39:201:56 | type assertion | test.go:201:21:201:57 | call to Htmlunquote | provenance | MaD:290 | | test.go:202:2:202:68 | ... := ...[0] | test.go:203:14:203:28 | type assertion | provenance | | -| test.go:202:28:202:56 | type assertion | test.go:202:2:202:68 | ... := ...[0] | provenance | MaD:300 | +| test.go:202:28:202:56 | type assertion | test.go:202:2:202:68 | ... := ...[0] | provenance | MaD:291 | | test.go:204:21:204:54 | call to Str2html | test.go:204:14:204:55 | type conversion | provenance | | -| test.go:204:36:204:53 | type assertion | test.go:204:21:204:54 | call to Str2html | provenance | MaD:302 | +| test.go:204:36:204:53 | type assertion | test.go:204:21:204:54 | call to Str2html | provenance | MaD:293 | | test.go:205:21:205:58 | call to Substr | test.go:205:14:205:59 | type conversion | provenance | | -| test.go:205:34:205:51 | type assertion | test.go:205:21:205:58 | call to Substr | provenance | MaD:303 | +| test.go:205:34:205:51 | type assertion | test.go:205:21:205:58 | call to Substr | provenance | MaD:294 | | test.go:207:6:207:6 | definition of s | test.go:209:14:209:28 | type conversion | provenance | | -| test.go:208:18:208:33 | selection of Form | test.go:207:6:207:6 | definition of s | provenance | MaD:301 | -| test.go:223:2:223:34 | ... := ...[0] | test.go:225:31:225:31 | f | provenance | Src:MaD:319 | -| test.go:223:2:223:34 | ... := ...[1] | test.go:224:14:224:32 | type conversion | provenance | Src:MaD:319 | +| test.go:208:18:208:33 | selection of Form | test.go:207:6:207:6 | definition of s | provenance | MaD:292 | +| test.go:223:2:223:34 | ... := ...[0] | test.go:225:31:225:31 | f | provenance | Src:MaD:296 | +| test.go:223:2:223:34 | ... := ...[1] | test.go:224:14:224:32 | type conversion | provenance | Src:MaD:296 | | test.go:225:2:225:32 | ... := ...[0] | test.go:226:14:226:20 | content | provenance | | -| test.go:225:31:225:31 | f | test.go:225:2:225:32 | ... := ...[0] | provenance | MaD:613 | -| test.go:228:2:228:40 | ... := ...[0] | test.go:229:14:229:38 | type conversion | provenance | Src:MaD:320 | -| test.go:231:7:231:28 | call to GetString | test.go:232:14:232:22 | type conversion | provenance | Src:MaD:321 | -| test.go:234:8:234:35 | call to GetStrings | test.go:235:14:235:26 | type conversion | provenance | Src:MaD:322 | -| test.go:237:9:237:17 | call to Input | test.go:238:14:238:27 | type conversion | provenance | Src:MaD:323 | -| test.go:240:6:240:8 | definition of str | test.go:242:14:242:30 | type conversion | provenance | Src:MaD:318 | -| test.go:246:15:246:36 | call to GetString | test.go:249:21:249:29 | untrusted | provenance | Src:MaD:321 | -| test.go:259:23:259:44 | call to GetCookie | test.go:259:16:259:45 | type conversion | provenance | Src:MaD:266 | -| test.go:270:62:270:83 | call to GetCookie | test.go:270:55:270:84 | type conversion | provenance | Src:MaD:266 | -| test.go:275:2:275:40 | ... := ...[0] | test.go:278:21:278:28 | index expression | provenance | Src:MaD:320 | -| test.go:275:2:275:40 | ... := ...[0] | test.go:283:44:283:60 | selection of Filename | provenance | Src:MaD:320 | -| test.go:275:2:275:40 | ... := ...[0] | test.go:284:38:284:49 | genericFiles | provenance | Src:MaD:320 | -| test.go:275:2:275:40 | ... := ...[0] | test.go:285:37:285:48 | genericFiles | provenance | Src:MaD:320 | -| test.go:275:2:275:40 | ... := ...[0] | test.go:291:4:291:15 | genericFiles | provenance | Src:MaD:320 | -| test.go:275:2:275:40 | ... := ...[0] | test.go:293:42:293:53 | genericFiles | provenance | Src:MaD:320 | -| test.go:275:2:275:40 | ... := ...[0] | test.go:294:53:294:64 | genericFiles | provenance | Src:MaD:320 | -| test.go:275:2:275:40 | ... := ...[0] | test.go:295:38:295:49 | genericFiles | provenance | Src:MaD:320 | -| test.go:275:2:275:40 | ... := ...[0] | test.go:296:49:296:60 | genericFiles | provenance | Src:MaD:320 | -| test.go:275:2:275:40 | ... := ...[0] | test.go:297:51:297:65 | index expression | provenance | Src:MaD:320 | -| test.go:275:2:275:40 | ... := ...[0] | test.go:298:36:298:47 | genericFiles | provenance | Src:MaD:320 | -| test.go:275:2:275:40 | ... := ...[0] | test.go:299:37:299:48 | genericFiles | provenance | Src:MaD:320 | -| test.go:275:2:275:40 | ... := ...[0] | test.go:301:39:301:50 | genericFiles | provenance | Src:MaD:320 | -| test.go:275:2:275:40 | ... := ...[0] | test.go:302:40:302:51 | genericFiles | provenance | Src:MaD:320 | -| test.go:275:2:275:40 | ... := ...[0] | test.go:303:39:303:50 | genericFiles | provenance | Src:MaD:320 | +| test.go:225:31:225:31 | f | test.go:225:2:225:32 | ... := ...[0] | provenance | MaD:552 | +| test.go:228:2:228:40 | ... := ...[0] | test.go:229:14:229:38 | type conversion | provenance | Src:MaD:297 | +| test.go:231:7:231:28 | call to GetString | test.go:232:14:232:22 | type conversion | provenance | Src:MaD:298 | +| test.go:234:8:234:35 | call to GetStrings | test.go:235:14:235:26 | type conversion | provenance | Src:MaD:299 | +| test.go:237:9:237:17 | call to Input | test.go:238:14:238:27 | type conversion | provenance | Src:MaD:300 | +| test.go:240:6:240:8 | definition of str | test.go:242:14:242:30 | type conversion | provenance | Src:MaD:295 | +| test.go:246:15:246:36 | call to GetString | test.go:249:21:249:29 | untrusted | provenance | Src:MaD:298 | +| test.go:259:23:259:44 | call to GetCookie | test.go:259:16:259:45 | type conversion | provenance | Src:MaD:284 | +| test.go:270:62:270:83 | call to GetCookie | test.go:270:55:270:84 | type conversion | provenance | Src:MaD:284 | +| test.go:275:2:275:40 | ... := ...[0] | test.go:278:21:278:28 | index expression | provenance | Src:MaD:297 | +| test.go:275:2:275:40 | ... := ...[0] | test.go:283:44:283:60 | selection of Filename | provenance | Src:MaD:297 | +| test.go:275:2:275:40 | ... := ...[0] | test.go:284:38:284:49 | genericFiles | provenance | Src:MaD:297 | +| test.go:275:2:275:40 | ... := ...[0] | test.go:285:37:285:48 | genericFiles | provenance | Src:MaD:297 | +| test.go:275:2:275:40 | ... := ...[0] | test.go:291:4:291:15 | genericFiles | provenance | Src:MaD:297 | +| test.go:275:2:275:40 | ... := ...[0] | test.go:293:42:293:53 | genericFiles | provenance | Src:MaD:297 | +| test.go:275:2:275:40 | ... := ...[0] | test.go:294:53:294:64 | genericFiles | provenance | Src:MaD:297 | +| test.go:275:2:275:40 | ... := ...[0] | test.go:295:38:295:49 | genericFiles | provenance | Src:MaD:297 | +| test.go:275:2:275:40 | ... := ...[0] | test.go:296:49:296:60 | genericFiles | provenance | Src:MaD:297 | +| test.go:275:2:275:40 | ... := ...[0] | test.go:297:51:297:65 | index expression | provenance | Src:MaD:297 | +| test.go:275:2:275:40 | ... := ...[0] | test.go:298:36:298:47 | genericFiles | provenance | Src:MaD:297 | +| test.go:275:2:275:40 | ... := ...[0] | test.go:299:37:299:48 | genericFiles | provenance | Src:MaD:297 | +| test.go:275:2:275:40 | ... := ...[0] | test.go:301:39:301:50 | genericFiles | provenance | Src:MaD:297 | +| test.go:275:2:275:40 | ... := ...[0] | test.go:302:40:302:51 | genericFiles | provenance | Src:MaD:297 | +| test.go:275:2:275:40 | ... := ...[0] | test.go:303:39:303:50 | genericFiles | provenance | Src:MaD:297 | | test.go:276:2:276:13 | definition of genericFiles [array] | test.go:297:51:297:62 | genericFiles [array] | provenance | | | test.go:278:21:278:28 | index expression | test.go:276:2:276:13 | definition of genericFiles [array] | provenance | | | test.go:283:44:283:60 | selection of Filename | test.go:283:21:283:61 | call to GetDisplayString | provenance | FunctionModel | | test.go:284:21:284:53 | call to SliceChunk | test.go:284:21:284:92 | selection of Filename | provenance | | -| test.go:284:38:284:49 | genericFiles | test.go:284:21:284:53 | call to SliceChunk | provenance | MaD:336 | +| test.go:284:38:284:49 | genericFiles | test.go:284:21:284:53 | call to SliceChunk | provenance | MaD:253 | | test.go:285:21:285:60 | call to SliceDiff | test.go:285:21:285:96 | selection of Filename | provenance | | -| test.go:285:37:285:48 | genericFiles | test.go:285:21:285:60 | call to SliceDiff | provenance | MaD:337 | +| test.go:285:37:285:48 | genericFiles | test.go:285:21:285:60 | call to SliceDiff | provenance | MaD:254 | | test.go:290:3:292:44 | call to SliceFilter | test.go:290:3:292:80 | selection of Filename | provenance | | -| test.go:291:4:291:15 | genericFiles | test.go:290:3:292:44 | call to SliceFilter | provenance | MaD:338 | +| test.go:291:4:291:15 | genericFiles | test.go:290:3:292:44 | call to SliceFilter | provenance | MaD:255 | | test.go:293:21:293:65 | call to SliceIntersect | test.go:293:21:293:101 | selection of Filename | provenance | | -| test.go:293:42:293:53 | genericFiles | test.go:293:21:293:65 | call to SliceIntersect | provenance | MaD:339 | +| test.go:293:42:293:53 | genericFiles | test.go:293:21:293:65 | call to SliceIntersect | provenance | MaD:256 | | test.go:294:21:294:65 | call to SliceIntersect | test.go:294:21:294:101 | selection of Filename | provenance | | -| test.go:294:53:294:64 | genericFiles | test.go:294:21:294:65 | call to SliceIntersect | provenance | MaD:339 | +| test.go:294:53:294:64 | genericFiles | test.go:294:21:294:65 | call to SliceIntersect | provenance | MaD:256 | | test.go:295:21:295:61 | call to SliceMerge | test.go:295:21:295:97 | selection of Filename | provenance | | -| test.go:295:38:295:49 | genericFiles | test.go:295:21:295:61 | call to SliceMerge | provenance | MaD:340 | +| test.go:295:38:295:49 | genericFiles | test.go:295:21:295:61 | call to SliceMerge | provenance | MaD:257 | | test.go:296:21:296:61 | call to SliceMerge | test.go:296:21:296:97 | selection of Filename | provenance | | -| test.go:296:49:296:60 | genericFiles | test.go:296:21:296:61 | call to SliceMerge | provenance | MaD:340 | +| test.go:296:49:296:60 | genericFiles | test.go:296:21:296:61 | call to SliceMerge | provenance | MaD:257 | | test.go:297:21:297:66 | call to SlicePad | test.go:297:21:297:102 | selection of Filename | provenance | | | test.go:297:51:297:62 | genericFiles [array] | test.go:297:51:297:65 | index expression | provenance | | -| test.go:297:51:297:65 | index expression | test.go:297:21:297:66 | call to SlicePad | provenance | MaD:341 | +| test.go:297:51:297:65 | index expression | test.go:297:21:297:66 | call to SlicePad | provenance | MaD:258 | | test.go:298:21:298:66 | call to SlicePad | test.go:298:21:298:102 | selection of Filename | provenance | | -| test.go:298:36:298:47 | genericFiles | test.go:298:21:298:66 | call to SlicePad | provenance | MaD:341 | +| test.go:298:36:298:47 | genericFiles | test.go:298:21:298:66 | call to SlicePad | provenance | MaD:258 | | test.go:299:21:299:49 | call to SliceRand | test.go:299:21:299:82 | selection of Filename | provenance | | -| test.go:299:37:299:48 | genericFiles | test.go:299:21:299:49 | call to SliceRand | provenance | MaD:342 | +| test.go:299:37:299:48 | genericFiles | test.go:299:21:299:49 | call to SliceRand | provenance | MaD:259 | | test.go:301:21:301:97 | call to SliceReduce | test.go:301:21:301:133 | selection of Filename | provenance | | -| test.go:301:39:301:50 | genericFiles | test.go:301:21:301:97 | call to SliceReduce | provenance | MaD:343 | +| test.go:301:39:301:50 | genericFiles | test.go:301:21:301:97 | call to SliceReduce | provenance | MaD:260 | | test.go:302:21:302:52 | call to SliceShuffle | test.go:302:21:302:88 | selection of Filename | provenance | | -| test.go:302:40:302:51 | genericFiles | test.go:302:21:302:52 | call to SliceShuffle | provenance | MaD:344 | +| test.go:302:40:302:51 | genericFiles | test.go:302:21:302:52 | call to SliceShuffle | provenance | MaD:261 | | test.go:303:21:303:51 | call to SliceUnique | test.go:303:21:303:87 | selection of Filename | provenance | | -| test.go:303:39:303:50 | genericFiles | test.go:303:21:303:51 | call to SliceUnique | provenance | MaD:345 | +| test.go:303:39:303:50 | genericFiles | test.go:303:21:303:51 | call to SliceUnique | provenance | MaD:262 | | test.go:308:2:308:5 | definition of bMap | test.go:311:21:311:24 | bMap | provenance | | | test.go:308:2:308:5 | definition of bMap | test.go:312:21:312:24 | bMap | provenance | | -| test.go:309:15:309:36 | call to GetString | test.go:310:22:310:30 | untrusted | provenance | Src:MaD:321 | -| test.go:310:22:310:30 | untrusted | test.go:308:2:308:5 | definition of bMap | provenance | MaD:348 | -| test.go:311:21:311:24 | bMap | test.go:311:21:311:39 | call to Get | provenance | MaD:346 | +| test.go:309:15:309:36 | call to GetString | test.go:310:22:310:30 | untrusted | provenance | Src:MaD:298 | +| test.go:310:22:310:30 | untrusted | test.go:308:2:308:5 | definition of bMap | provenance | MaD:265 | +| test.go:311:21:311:24 | bMap | test.go:311:21:311:39 | call to Get | provenance | MaD:263 | | test.go:311:21:311:39 | call to Get | test.go:311:21:311:48 | type assertion | provenance | | -| test.go:312:21:312:24 | bMap | test.go:312:21:312:32 | call to Items | provenance | MaD:347 | +| test.go:312:21:312:24 | bMap | test.go:312:21:312:32 | call to Items | provenance | MaD:264 | | test.go:312:21:312:32 | call to Items | test.go:312:21:312:52 | type assertion | provenance | | nodes | test.go:33:6:33:10 | definition of bound | semmle.label | definition of bound | diff --git a/go/ql/test/library-tests/semmle/go/frameworks/Beego/TaintedPath.expected b/go/ql/test/library-tests/semmle/go/frameworks/Beego/TaintedPath.expected index 9681164d8259..001f56be494f 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/Beego/TaintedPath.expected +++ b/go/ql/test/library-tests/semmle/go/frameworks/Beego/TaintedPath.expected @@ -1,12 +1,12 @@ edges -| test.go:215:15:215:26 | call to Data | test.go:216:18:216:26 | untrusted | provenance | Src:MaD:254 | -| test.go:215:15:215:26 | call to Data | test.go:217:10:217:18 | untrusted | provenance | Src:MaD:254 | -| test.go:215:15:215:26 | call to Data | test.go:218:35:218:43 | untrusted | provenance | Src:MaD:254 | -| test.go:324:17:324:37 | selection of RequestBody | test.go:324:40:324:43 | &... | provenance | Src:MaD:262 MaD:187 | +| test.go:215:15:215:26 | call to Data | test.go:216:18:216:26 | untrusted | provenance | Src:MaD:272 | +| test.go:215:15:215:26 | call to Data | test.go:217:10:217:18 | untrusted | provenance | Src:MaD:272 | +| test.go:215:15:215:26 | call to Data | test.go:218:35:218:43 | untrusted | provenance | Src:MaD:272 | +| test.go:324:17:324:37 | selection of RequestBody | test.go:324:40:324:43 | &... | provenance | Src:MaD:280 MaD:187 | | test.go:324:40:324:43 | &... | test.go:326:35:326:43 | untrusted | provenance | | -| test.go:332:15:332:26 | call to Data | test.go:334:23:334:31 | untrusted | provenance | Src:MaD:254 | -| test.go:340:15:340:26 | call to Data | test.go:342:53:342:61 | untrusted | provenance | Src:MaD:284 | -| test.go:340:15:340:26 | call to Data | test.go:344:23:344:31 | untrusted | provenance | Src:MaD:284 | +| test.go:332:15:332:26 | call to Data | test.go:334:23:334:31 | untrusted | provenance | Src:MaD:272 | +| test.go:340:15:340:26 | call to Data | test.go:342:53:342:61 | untrusted | provenance | Src:MaD:272 | +| test.go:340:15:340:26 | call to Data | test.go:344:23:344:31 | untrusted | provenance | Src:MaD:272 | nodes | test.go:215:15:215:26 | call to Data | semmle.label | call to Data | | test.go:216:18:216:26 | untrusted | semmle.label | untrusted | diff --git a/go/ql/test/library-tests/semmle/go/frameworks/BeegoOrm/SqlInjection.expected b/go/ql/test/library-tests/semmle/go/frameworks/BeegoOrm/SqlInjection.expected index cf07b5e5f74a..cbdfc45c9124 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/BeegoOrm/SqlInjection.expected +++ b/go/ql/test/library-tests/semmle/go/frameworks/BeegoOrm/SqlInjection.expected @@ -1,36 +1,36 @@ edges -| test.go:10:15:10:41 | call to UserAgent | test.go:12:11:12:19 | untrusted | provenance | Src:MaD:747 | -| test.go:10:15:10:41 | call to UserAgent | test.go:13:23:13:31 | untrusted | provenance | Src:MaD:747 | -| test.go:10:15:10:41 | call to UserAgent | test.go:14:14:14:22 | untrusted | provenance | Src:MaD:747 | -| test.go:10:15:10:41 | call to UserAgent | test.go:15:26:15:34 | untrusted | provenance | Src:MaD:747 | -| test.go:10:15:10:41 | call to UserAgent | test.go:16:12:16:20 | untrusted | provenance | Src:MaD:747 | -| test.go:10:15:10:41 | call to UserAgent | test.go:17:24:17:32 | untrusted | provenance | Src:MaD:747 | -| test.go:10:15:10:41 | call to UserAgent | test.go:18:15:18:23 | untrusted | provenance | Src:MaD:747 | -| test.go:10:15:10:41 | call to UserAgent | test.go:19:27:19:35 | untrusted | provenance | Src:MaD:747 | -| test.go:24:15:24:41 | call to UserAgent | test.go:26:12:26:20 | untrusted | provenance | Src:MaD:747 | -| test.go:24:15:24:41 | call to UserAgent | test.go:27:10:27:18 | untrusted | provenance | Src:MaD:747 | -| test.go:24:15:24:41 | call to UserAgent | test.go:28:15:28:23 | untrusted | provenance | Src:MaD:747 | -| test.go:24:15:24:41 | call to UserAgent | test.go:29:14:29:22 | untrusted | provenance | Src:MaD:747 | -| test.go:24:15:24:41 | call to UserAgent | test.go:30:15:30:23 | untrusted | provenance | Src:MaD:747 | -| test.go:24:15:24:41 | call to UserAgent | test.go:31:8:31:16 | untrusted | provenance | Src:MaD:747 | -| test.go:24:15:24:41 | call to UserAgent | test.go:32:11:32:19 | untrusted | provenance | Src:MaD:747 | -| test.go:24:15:24:41 | call to UserAgent | test.go:33:9:33:17 | untrusted | provenance | Src:MaD:747 | -| test.go:24:15:24:41 | call to UserAgent | test.go:34:8:34:16 | untrusted | provenance | Src:MaD:747 | -| test.go:24:15:24:41 | call to UserAgent | test.go:35:8:35:16 | untrusted | provenance | Src:MaD:747 | -| test.go:24:15:24:41 | call to UserAgent | test.go:36:13:36:21 | untrusted | provenance | Src:MaD:747 | -| test.go:24:15:24:41 | call to UserAgent | test.go:37:13:37:21 | untrusted | provenance | Src:MaD:747 | -| test.go:24:15:24:41 | call to UserAgent | test.go:38:12:38:20 | untrusted | provenance | Src:MaD:747 | -| test.go:24:15:24:41 | call to UserAgent | test.go:39:12:39:20 | untrusted | provenance | Src:MaD:747 | -| test.go:24:15:24:41 | call to UserAgent | test.go:40:9:40:17 | untrusted | provenance | Src:MaD:747 | -| test.go:24:15:24:41 | call to UserAgent | test.go:41:12:41:20 | untrusted | provenance | Src:MaD:747 | -| test.go:24:15:24:41 | call to UserAgent | test.go:42:16:42:24 | untrusted | provenance | Src:MaD:747 | -| test.go:24:15:24:41 | call to UserAgent | test.go:42:27:42:35 | untrusted | provenance | Src:MaD:747 | -| test.go:24:15:24:41 | call to UserAgent | test.go:43:12:43:20 | untrusted | provenance | Src:MaD:747 | -| test.go:24:15:24:41 | call to UserAgent | test.go:44:14:44:22 | untrusted | provenance | Src:MaD:747 | -| test.go:24:15:24:41 | call to UserAgent | test.go:44:25:44:33 | untrusted | provenance | Src:MaD:747 | -| test.go:48:15:48:41 | call to UserAgent | test.go:49:12:49:20 | untrusted | provenance | Src:MaD:747 | -| test.go:54:15:54:41 | call to UserAgent | test.go:56:31:56:39 | untrusted | provenance | Src:MaD:747 | -| test.go:60:15:60:41 | call to UserAgent | test.go:62:19:62:27 | untrusted | provenance | Src:MaD:747 | +| test.go:10:15:10:41 | call to UserAgent | test.go:12:11:12:19 | untrusted | provenance | Src:MaD:686 | +| test.go:10:15:10:41 | call to UserAgent | test.go:13:23:13:31 | untrusted | provenance | Src:MaD:686 | +| test.go:10:15:10:41 | call to UserAgent | test.go:14:14:14:22 | untrusted | provenance | Src:MaD:686 | +| test.go:10:15:10:41 | call to UserAgent | test.go:15:26:15:34 | untrusted | provenance | Src:MaD:686 | +| test.go:10:15:10:41 | call to UserAgent | test.go:16:12:16:20 | untrusted | provenance | Src:MaD:686 | +| test.go:10:15:10:41 | call to UserAgent | test.go:17:24:17:32 | untrusted | provenance | Src:MaD:686 | +| test.go:10:15:10:41 | call to UserAgent | test.go:18:15:18:23 | untrusted | provenance | Src:MaD:686 | +| test.go:10:15:10:41 | call to UserAgent | test.go:19:27:19:35 | untrusted | provenance | Src:MaD:686 | +| test.go:24:15:24:41 | call to UserAgent | test.go:26:12:26:20 | untrusted | provenance | Src:MaD:686 | +| test.go:24:15:24:41 | call to UserAgent | test.go:27:10:27:18 | untrusted | provenance | Src:MaD:686 | +| test.go:24:15:24:41 | call to UserAgent | test.go:28:15:28:23 | untrusted | provenance | Src:MaD:686 | +| test.go:24:15:24:41 | call to UserAgent | test.go:29:14:29:22 | untrusted | provenance | Src:MaD:686 | +| test.go:24:15:24:41 | call to UserAgent | test.go:30:15:30:23 | untrusted | provenance | Src:MaD:686 | +| test.go:24:15:24:41 | call to UserAgent | test.go:31:8:31:16 | untrusted | provenance | Src:MaD:686 | +| test.go:24:15:24:41 | call to UserAgent | test.go:32:11:32:19 | untrusted | provenance | Src:MaD:686 | +| test.go:24:15:24:41 | call to UserAgent | test.go:33:9:33:17 | untrusted | provenance | Src:MaD:686 | +| test.go:24:15:24:41 | call to UserAgent | test.go:34:8:34:16 | untrusted | provenance | Src:MaD:686 | +| test.go:24:15:24:41 | call to UserAgent | test.go:35:8:35:16 | untrusted | provenance | Src:MaD:686 | +| test.go:24:15:24:41 | call to UserAgent | test.go:36:13:36:21 | untrusted | provenance | Src:MaD:686 | +| test.go:24:15:24:41 | call to UserAgent | test.go:37:13:37:21 | untrusted | provenance | Src:MaD:686 | +| test.go:24:15:24:41 | call to UserAgent | test.go:38:12:38:20 | untrusted | provenance | Src:MaD:686 | +| test.go:24:15:24:41 | call to UserAgent | test.go:39:12:39:20 | untrusted | provenance | Src:MaD:686 | +| test.go:24:15:24:41 | call to UserAgent | test.go:40:9:40:17 | untrusted | provenance | Src:MaD:686 | +| test.go:24:15:24:41 | call to UserAgent | test.go:41:12:41:20 | untrusted | provenance | Src:MaD:686 | +| test.go:24:15:24:41 | call to UserAgent | test.go:42:16:42:24 | untrusted | provenance | Src:MaD:686 | +| test.go:24:15:24:41 | call to UserAgent | test.go:42:27:42:35 | untrusted | provenance | Src:MaD:686 | +| test.go:24:15:24:41 | call to UserAgent | test.go:43:12:43:20 | untrusted | provenance | Src:MaD:686 | +| test.go:24:15:24:41 | call to UserAgent | test.go:44:14:44:22 | untrusted | provenance | Src:MaD:686 | +| test.go:24:15:24:41 | call to UserAgent | test.go:44:25:44:33 | untrusted | provenance | Src:MaD:686 | +| test.go:48:15:48:41 | call to UserAgent | test.go:49:12:49:20 | untrusted | provenance | Src:MaD:686 | +| test.go:54:15:54:41 | call to UserAgent | test.go:56:31:56:39 | untrusted | provenance | Src:MaD:686 | +| test.go:60:15:60:41 | call to UserAgent | test.go:62:19:62:27 | untrusted | provenance | Src:MaD:686 | nodes | test.go:10:15:10:41 | call to UserAgent | semmle.label | call to UserAgent | | test.go:12:11:12:19 | untrusted | semmle.label | untrusted | diff --git a/go/ql/test/library-tests/semmle/go/frameworks/Echo/ReflectedXss.expected b/go/ql/test/library-tests/semmle/go/frameworks/Echo/ReflectedXss.expected index ffb416f5824d..897c61f42154 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/Echo/ReflectedXss.expected +++ b/go/ql/test/library-tests/semmle/go/frameworks/Echo/ReflectedXss.expected @@ -8,28 +8,28 @@ edges | test.go:51:2:51:30 | ... := ...[0] | test.go:52:16:52:37 | index expression | provenance | | | test.go:57:2:57:46 | ... := ...[0] | test.go:58:13:58:22 | fileHeader | provenance | | | test.go:58:2:58:29 | ... := ...[0] | test.go:60:2:60:5 | file | provenance | | -| test.go:58:13:58:22 | fileHeader | test.go:58:2:58:29 | ... := ...[0] | provenance | MaD:700 | +| test.go:58:13:58:22 | fileHeader | test.go:58:2:58:29 | ... := ...[0] | provenance | MaD:639 | | test.go:59:2:59:7 | definition of buffer | test.go:61:20:61:25 | buffer | provenance | | -| test.go:60:2:60:5 | file | test.go:59:2:59:7 | definition of buffer | provenance | MaD:626 | +| test.go:60:2:60:5 | file | test.go:59:2:59:7 | definition of buffer | provenance | MaD:565 | | test.go:66:2:66:31 | ... := ...[0] | test.go:67:16:67:41 | index expression | provenance | | | test.go:72:2:72:31 | ... := ...[0] | test.go:74:13:74:22 | fileHeader | provenance | | | test.go:74:2:74:29 | ... := ...[0] | test.go:76:2:76:5 | file | provenance | | -| test.go:74:13:74:22 | fileHeader | test.go:74:2:74:29 | ... := ...[0] | provenance | MaD:700 | +| test.go:74:13:74:22 | fileHeader | test.go:74:2:74:29 | ... := ...[0] | provenance | MaD:639 | | test.go:75:2:75:7 | definition of buffer | test.go:77:20:77:25 | buffer | provenance | | -| test.go:76:2:76:5 | file | test.go:75:2:75:7 | definition of buffer | provenance | MaD:626 | +| test.go:76:2:76:5 | file | test.go:75:2:75:7 | definition of buffer | provenance | MaD:565 | | test.go:82:2:82:32 | ... := ...[0] | test.go:83:16:83:24 | selection of Value | provenance | | | test.go:88:13:88:25 | call to Cookies | test.go:89:16:89:31 | selection of Value | provenance | | | test.go:99:11:99:15 | &... | test.go:100:16:100:21 | selection of s | provenance | | | test.go:112:17:112:19 | definition of ctx | test.go:114:16:114:18 | ctx | provenance | | -| test.go:113:21:113:42 | call to Param | test.go:112:17:112:19 | definition of ctx | provenance | MaD:431 | -| test.go:114:16:114:18 | ctx | test.go:114:16:114:33 | call to Get | provenance | MaD:430 | +| test.go:113:21:113:42 | call to Param | test.go:112:17:112:19 | definition of ctx | provenance | MaD:370 | +| test.go:114:16:114:18 | ctx | test.go:114:16:114:33 | call to Get | provenance | MaD:369 | | test.go:114:16:114:33 | call to Get | test.go:114:16:114:42 | type assertion | provenance | | | test.go:124:11:124:32 | call to Param | test.go:125:16:125:20 | param | provenance | | | test.go:130:11:130:32 | call to Param | test.go:131:20:131:32 | type conversion | provenance | | | test.go:136:11:136:32 | call to Param | test.go:137:29:137:41 | type conversion | provenance | | | test.go:148:11:148:32 | call to Param | test.go:149:30:149:34 | param | provenance | | | test.go:149:12:149:35 | call to NewReader | test.go:150:31:150:36 | reader | provenance | | -| test.go:149:30:149:34 | param | test.go:149:12:149:35 | call to NewReader | provenance | MaD:909 | +| test.go:149:30:149:34 | param | test.go:149:12:149:35 | call to NewReader | provenance | MaD:848 | | test.go:164:11:164:32 | call to Param | test.go:165:23:165:35 | type conversion | provenance | | nodes | test.go:15:11:15:32 | call to Param | semmle.label | call to Param | diff --git a/go/ql/test/library-tests/semmle/go/frameworks/Encoding/jsoniter.expected b/go/ql/test/library-tests/semmle/go/frameworks/Encoding/jsoniter.expected index 36dc9d014faa..d16dc0b9c1f3 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/Encoding/jsoniter.expected +++ b/go/ql/test/library-tests/semmle/go/frameworks/Encoding/jsoniter.expected @@ -4,13 +4,13 @@ edges | jsoniter.go:23:20:23:38 | call to getUntrustedBytes | jsoniter.go:31:21:31:34 | untrustedInput | provenance | | | jsoniter.go:24:21:24:40 | call to getUntrustedString | jsoniter.go:35:27:35:41 | untrustedString | provenance | | | jsoniter.go:24:21:24:40 | call to getUntrustedString | jsoniter.go:39:31:39:45 | untrustedString | provenance | | -| jsoniter.go:27:17:27:30 | untrustedInput | jsoniter.go:27:33:27:37 | &... | provenance | MaD:422 | +| jsoniter.go:27:17:27:30 | untrustedInput | jsoniter.go:27:33:27:37 | &... | provenance | MaD:361 | | jsoniter.go:27:33:27:37 | &... | jsoniter.go:28:15:28:24 | selection of field | provenance | | -| jsoniter.go:31:21:31:34 | untrustedInput | jsoniter.go:31:37:31:42 | &... | provenance | MaD:420 | +| jsoniter.go:31:21:31:34 | untrustedInput | jsoniter.go:31:37:31:42 | &... | provenance | MaD:359 | | jsoniter.go:31:37:31:42 | &... | jsoniter.go:32:15:32:25 | selection of field | provenance | | -| jsoniter.go:35:27:35:41 | untrustedString | jsoniter.go:35:44:35:49 | &... | provenance | MaD:423 | +| jsoniter.go:35:27:35:41 | untrustedString | jsoniter.go:35:44:35:49 | &... | provenance | MaD:362 | | jsoniter.go:35:44:35:49 | &... | jsoniter.go:36:15:36:25 | selection of field | provenance | | -| jsoniter.go:39:31:39:45 | untrustedString | jsoniter.go:39:48:39:53 | &... | provenance | MaD:421 | +| jsoniter.go:39:31:39:45 | untrustedString | jsoniter.go:39:48:39:53 | &... | provenance | MaD:360 | | jsoniter.go:39:48:39:53 | &... | jsoniter.go:40:15:40:25 | selection of field | provenance | | nodes | jsoniter.go:23:20:23:38 | call to getUntrustedBytes | semmle.label | call to getUntrustedBytes | diff --git a/go/ql/test/library-tests/semmle/go/frameworks/Revel/ReflectedXss.expected b/go/ql/test/library-tests/semmle/go/frameworks/Revel/ReflectedXss.expected index 1ebdd0f3afb0..d6bffa163255 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/Revel/ReflectedXss.expected +++ b/go/ql/test/library-tests/semmle/go/frameworks/Revel/ReflectedXss.expected @@ -1,10 +1,10 @@ edges | EndToEnd.go:35:2:35:4 | definition of buf | EndToEnd.go:37:24:37:26 | buf | provenance | | | EndToEnd.go:36:18:36:25 | selection of Params | EndToEnd.go:36:18:36:30 | selection of Form | provenance | | -| EndToEnd.go:36:18:36:30 | selection of Form | EndToEnd.go:36:18:36:47 | call to Get | provenance | MaD:815 | -| EndToEnd.go:36:18:36:47 | call to Get | EndToEnd.go:35:2:35:4 | definition of buf | provenance | MaD:629 | +| EndToEnd.go:36:18:36:30 | selection of Form | EndToEnd.go:36:18:36:47 | call to Get | provenance | MaD:754 | +| EndToEnd.go:36:18:36:47 | call to Get | EndToEnd.go:35:2:35:4 | definition of buf | provenance | MaD:568 | | EndToEnd.go:69:22:69:29 | selection of Params | EndToEnd.go:69:22:69:34 | selection of Form | provenance | | -| EndToEnd.go:69:22:69:34 | selection of Form | EndToEnd.go:69:22:69:51 | call to Get | provenance | MaD:815 | +| EndToEnd.go:69:22:69:34 | selection of Form | EndToEnd.go:69:22:69:51 | call to Get | provenance | MaD:754 | | Revel.go:70:22:70:29 | selection of Params | Revel.go:70:22:70:35 | selection of Query | provenance | | | examples/booking/app/init.go:36:44:36:48 | selection of URL | examples/booking/app/init.go:36:44:36:53 | selection of Path | provenance | | | examples/booking/app/init.go:40:49:40:53 | selection of URL | examples/booking/app/init.go:40:49:40:58 | selection of Path | provenance | | diff --git a/go/ql/test/library-tests/semmle/go/frameworks/Revel/TaintedPath.expected b/go/ql/test/library-tests/semmle/go/frameworks/Revel/TaintedPath.expected index 20f6a5bf62a6..20897225a40a 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/Revel/TaintedPath.expected +++ b/go/ql/test/library-tests/semmle/go/frameworks/Revel/TaintedPath.expected @@ -1,8 +1,8 @@ edges | EndToEnd.go:58:18:58:25 | selection of Params | EndToEnd.go:58:18:58:30 | selection of Form | provenance | | -| EndToEnd.go:58:18:58:30 | selection of Form | EndToEnd.go:58:18:58:47 | call to Get | provenance | MaD:815 | +| EndToEnd.go:58:18:58:30 | selection of Form | EndToEnd.go:58:18:58:47 | call to Get | provenance | MaD:754 | | EndToEnd.go:64:26:64:33 | selection of Params | EndToEnd.go:64:26:64:38 | selection of Form | provenance | | -| EndToEnd.go:64:26:64:38 | selection of Form | EndToEnd.go:64:26:64:55 | call to Get | provenance | MaD:815 | +| EndToEnd.go:64:26:64:38 | selection of Form | EndToEnd.go:64:26:64:55 | call to Get | provenance | MaD:754 | nodes | EndToEnd.go:58:18:58:25 | selection of Params | semmle.label | selection of Params | | EndToEnd.go:58:18:58:30 | selection of Form | semmle.label | selection of Form | diff --git a/go/ql/test/library-tests/semmle/go/frameworks/Twirp/RequestForgery.expected b/go/ql/test/library-tests/semmle/go/frameworks/Twirp/RequestForgery.expected index d8d22b59dac9..b7e85057f325 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/Twirp/RequestForgery.expected +++ b/go/ql/test/library-tests/semmle/go/frameworks/Twirp/RequestForgery.expected @@ -6,9 +6,9 @@ edges | rpc/notes/service.twirp.go:493:2:493:2 | capture variable reqContent | rpc/notes/service.twirp.go:495:35:495:44 | reqContent | provenance | | | rpc/notes/service.twirp.go:495:35:495:44 | reqContent | server/main.go:19:56:19:61 | definition of params | provenance | | | rpc/notes/service.twirp.go:538:2:538:33 | ... := ...[0] | rpc/notes/service.twirp.go:544:27:544:29 | buf | provenance | | -| rpc/notes/service.twirp.go:538:25:538:32 | selection of Body | rpc/notes/service.twirp.go:538:2:538:33 | ... := ...[0] | provenance | MaD:620 | +| rpc/notes/service.twirp.go:538:25:538:32 | selection of Body | rpc/notes/service.twirp.go:538:2:538:33 | ... := ...[0] | provenance | MaD:559 | | rpc/notes/service.twirp.go:543:2:543:11 | definition of reqContent | rpc/notes/service.twirp.go:574:2:574:2 | capture variable reqContent | provenance | | -| rpc/notes/service.twirp.go:544:27:544:29 | buf | rpc/notes/service.twirp.go:543:2:543:11 | definition of reqContent | provenance | MaD:505 | +| rpc/notes/service.twirp.go:544:27:544:29 | buf | rpc/notes/service.twirp.go:543:2:543:11 | definition of reqContent | provenance | MaD:444 | | rpc/notes/service.twirp.go:554:6:554:13 | definition of typedReq | rpc/notes/service.twirp.go:558:44:558:51 | typedReq | provenance | | | rpc/notes/service.twirp.go:558:44:558:51 | typedReq | server/main.go:19:56:19:61 | definition of params | provenance | | | rpc/notes/service.twirp.go:574:2:574:2 | capture variable reqContent | rpc/notes/service.twirp.go:576:35:576:44 | reqContent | provenance | | diff --git a/go/ql/test/library-tests/semmle/go/frameworks/XNetHtml/ReflectedXss.expected b/go/ql/test/library-tests/semmle/go/frameworks/XNetHtml/ReflectedXss.expected index 165d6f040cd5..f4df600321f3 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/XNetHtml/ReflectedXss.expected +++ b/go/ql/test/library-tests/semmle/go/frameworks/XNetHtml/ReflectedXss.expected @@ -1,40 +1,40 @@ edges -| test.go:12:12:12:22 | selection of URL | test.go:12:12:12:30 | call to Query | provenance | MaD:808 | -| test.go:12:12:12:30 | call to Query | test.go:12:12:12:44 | call to Get | provenance | MaD:815 | +| test.go:12:12:12:22 | selection of URL | test.go:12:12:12:30 | call to Query | provenance | MaD:747 | +| test.go:12:12:12:30 | call to Query | test.go:12:12:12:44 | call to Get | provenance | MaD:754 | | test.go:12:12:12:44 | call to Get | test.go:15:42:15:47 | param1 | provenance | | | test.go:15:22:15:48 | call to UnescapeString | test.go:15:15:15:49 | type conversion | provenance | | -| test.go:15:42:15:47 | param1 | test.go:15:22:15:48 | call to UnescapeString | provenance | MaD:487 | +| test.go:15:42:15:47 | param1 | test.go:15:22:15:48 | call to UnescapeString | provenance | MaD:426 | | test.go:17:2:17:36 | ... := ...[0] | test.go:18:15:18:31 | type conversion | provenance | | | test.go:17:2:17:36 | ... := ...[0] | test.go:29:22:29:25 | node | provenance | | -| test.go:17:24:17:35 | selection of Body | test.go:17:2:17:36 | ... := ...[0] | provenance | MaD:482 | +| test.go:17:24:17:35 | selection of Body | test.go:17:2:17:36 | ... := ...[0] | provenance | MaD:421 | | test.go:20:2:20:48 | ... := ...[0] | test.go:21:15:21:32 | type conversion | provenance | | -| test.go:20:36:20:47 | selection of Body | test.go:20:2:20:48 | ... := ...[0] | provenance | MaD:485 | +| test.go:20:36:20:47 | selection of Body | test.go:20:2:20:48 | ... := ...[0] | provenance | MaD:424 | | test.go:23:2:23:50 | ... := ...[0] | test.go:24:15:24:35 | type conversion | provenance | | -| test.go:23:33:23:44 | selection of Body | test.go:23:2:23:50 | ... := ...[0] | provenance | MaD:483 | +| test.go:23:33:23:44 | selection of Body | test.go:23:2:23:50 | ... := ...[0] | provenance | MaD:422 | | test.go:26:2:26:62 | ... := ...[0] | test.go:27:15:27:36 | type conversion | provenance | | -| test.go:26:45:26:56 | selection of Body | test.go:26:2:26:62 | ... := ...[0] | provenance | MaD:484 | +| test.go:26:45:26:56 | selection of Body | test.go:26:2:26:62 | ... := ...[0] | provenance | MaD:423 | | test.go:31:15:31:45 | call to NewTokenizer | test.go:32:15:32:23 | tokenizer | provenance | | | test.go:31:15:31:45 | call to NewTokenizer | test.go:33:15:33:23 | tokenizer | provenance | | | test.go:31:15:31:45 | call to NewTokenizer | test.go:34:17:34:25 | tokenizer | provenance | | | test.go:31:15:31:45 | call to NewTokenizer | test.go:36:15:36:23 | tokenizer | provenance | | | test.go:31:15:31:45 | call to NewTokenizer | test.go:37:22:37:30 | tokenizer | provenance | | -| test.go:31:33:31:44 | selection of Body | test.go:31:15:31:45 | call to NewTokenizer | provenance | MaD:480 | -| test.go:32:15:32:23 | tokenizer | test.go:32:15:32:34 | call to Buffered | provenance | MaD:490 | -| test.go:33:15:33:23 | tokenizer | test.go:33:15:33:29 | call to Raw | provenance | MaD:491 | +| test.go:31:33:31:44 | selection of Body | test.go:31:15:31:45 | call to NewTokenizer | provenance | MaD:419 | +| test.go:32:15:32:23 | tokenizer | test.go:32:15:32:34 | call to Buffered | provenance | MaD:429 | +| test.go:33:15:33:23 | tokenizer | test.go:33:15:33:29 | call to Raw | provenance | MaD:430 | | test.go:34:2:34:35 | ... := ...[1] | test.go:35:15:35:19 | value | provenance | | -| test.go:34:17:34:25 | tokenizer | test.go:34:2:34:35 | ... := ...[1] | provenance | MaD:492 | -| test.go:36:15:36:23 | tokenizer | test.go:36:15:36:30 | call to Text | provenance | MaD:493 | -| test.go:37:22:37:30 | tokenizer | test.go:37:22:37:38 | call to Token | provenance | MaD:494 | +| test.go:34:17:34:25 | tokenizer | test.go:34:2:34:35 | ... := ...[1] | provenance | MaD:431 | +| test.go:36:15:36:23 | tokenizer | test.go:36:15:36:30 | call to Text | provenance | MaD:432 | +| test.go:37:22:37:30 | tokenizer | test.go:37:22:37:38 | call to Token | provenance | MaD:433 | | test.go:37:22:37:38 | call to Token | test.go:37:15:37:44 | type conversion | provenance | | | test.go:39:23:39:77 | call to NewTokenizerFragment | test.go:40:15:40:31 | tokenizerFragment | provenance | | -| test.go:39:49:39:60 | selection of Body | test.go:39:23:39:77 | call to NewTokenizerFragment | provenance | MaD:481 | -| test.go:40:15:40:31 | tokenizerFragment | test.go:40:15:40:42 | call to Buffered | provenance | MaD:490 | +| test.go:39:49:39:60 | selection of Body | test.go:39:23:39:77 | call to NewTokenizerFragment | provenance | MaD:420 | +| test.go:40:15:40:31 | tokenizerFragment | test.go:40:15:40:42 | call to Buffered | provenance | MaD:429 | | test.go:42:6:42:14 | definition of cleanNode | test.go:45:22:45:31 | &... | provenance | | | test.go:42:6:42:14 | definition of cleanNode | test.go:45:22:45:31 | &... | provenance | | | test.go:42:6:42:14 | definition of cleanNode | test.go:45:23:45:31 | cleanNode | provenance | | | test.go:43:2:43:43 | ... := ...[0] | test.go:44:24:44:34 | taintedNode | provenance | | -| test.go:43:31:43:42 | selection of Body | test.go:43:2:43:43 | ... := ...[0] | provenance | MaD:482 | -| test.go:44:24:44:34 | taintedNode | test.go:42:6:42:14 | definition of cleanNode | provenance | MaD:488 | +| test.go:43:31:43:42 | selection of Body | test.go:43:2:43:43 | ... := ...[0] | provenance | MaD:421 | +| test.go:44:24:44:34 | taintedNode | test.go:42:6:42:14 | definition of cleanNode | provenance | MaD:427 | | test.go:45:22:45:31 | &... | test.go:45:22:45:31 | &... | provenance | | | test.go:45:22:45:31 | &... | test.go:45:22:45:31 | &... | provenance | | | test.go:45:22:45:31 | &... | test.go:45:23:45:31 | cleanNode | provenance | | @@ -46,8 +46,8 @@ edges | test.go:47:6:47:15 | definition of cleanNode2 | test.go:50:22:50:32 | &... | provenance | | | test.go:47:6:47:15 | definition of cleanNode2 | test.go:50:23:50:32 | cleanNode2 | provenance | | | test.go:48:2:48:44 | ... := ...[0] | test.go:49:26:49:37 | taintedNode2 | provenance | | -| test.go:48:32:48:43 | selection of Body | test.go:48:2:48:44 | ... := ...[0] | provenance | MaD:482 | -| test.go:49:26:49:37 | taintedNode2 | test.go:47:6:47:15 | definition of cleanNode2 | provenance | MaD:489 | +| test.go:48:32:48:43 | selection of Body | test.go:48:2:48:44 | ... := ...[0] | provenance | MaD:421 | +| test.go:49:26:49:37 | taintedNode2 | test.go:47:6:47:15 | definition of cleanNode2 | provenance | MaD:428 | | test.go:50:22:50:32 | &... | test.go:50:22:50:32 | &... | provenance | | | test.go:50:22:50:32 | &... | test.go:50:22:50:32 | &... | provenance | | | test.go:50:22:50:32 | &... | test.go:50:23:50:32 | cleanNode2 | provenance | | diff --git a/go/ql/test/library-tests/semmle/go/frameworks/XNetHtml/SqlInjection.expected b/go/ql/test/library-tests/semmle/go/frameworks/XNetHtml/SqlInjection.expected index 76d7f0dd9317..f11a0a8b7f64 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/XNetHtml/SqlInjection.expected +++ b/go/ql/test/library-tests/semmle/go/frameworks/XNetHtml/SqlInjection.expected @@ -1,6 +1,6 @@ edges -| test.go:56:2:56:42 | ... := ...[0] | test.go:57:29:57:40 | selection of Value | provenance | Src:MaD:740 | -| test.go:57:29:57:40 | selection of Value | test.go:57:11:57:41 | call to EscapeString | provenance | MaD:479 | +| test.go:56:2:56:42 | ... := ...[0] | test.go:57:29:57:40 | selection of Value | provenance | Src:MaD:679 | +| test.go:57:29:57:40 | selection of Value | test.go:57:11:57:41 | call to EscapeString | provenance | MaD:418 | nodes | test.go:56:2:56:42 | ... := ...[0] | semmle.label | ... := ...[0] | | test.go:57:11:57:41 | call to EscapeString | semmle.label | call to EscapeString | diff --git a/go/ql/test/query-tests/Security/CWE-022/ZipSlip.expected b/go/ql/test/query-tests/Security/CWE-022/ZipSlip.expected index 4112a9094927..ce874f03fab5 100644 --- a/go/ql/test/query-tests/Security/CWE-022/ZipSlip.expected +++ b/go/ql/test/query-tests/Security/CWE-022/ZipSlip.expected @@ -7,9 +7,9 @@ edges | UnsafeUnzipSymlinkGood.go:76:70:76:80 | selection of Name | UnsafeUnzipSymlinkGood.go:52:24:52:32 | definition of candidate | provenance | | | ZipSlip.go:11:2:15:2 | range statement[1] | ZipSlip.go:12:24:12:29 | selection of Name | provenance | | | ZipSlip.go:12:3:12:30 | ... := ...[0] | ZipSlip.go:14:20:14:20 | p | provenance | | -| ZipSlip.go:12:24:12:29 | selection of Name | ZipSlip.go:12:3:12:30 | ... := ...[0] | provenance | MaD:820 | +| ZipSlip.go:12:24:12:29 | selection of Name | ZipSlip.go:12:3:12:30 | ... := ...[0] | provenance | MaD:759 | | tarslip.go:15:2:15:30 | ... := ...[0] | tarslip.go:16:23:16:33 | selection of Name | provenance | | -| tarslip.go:16:23:16:33 | selection of Name | tarslip.go:16:14:16:34 | call to Dir | provenance | MaD:835 | +| tarslip.go:16:23:16:33 | selection of Name | tarslip.go:16:14:16:34 | call to Dir | provenance | MaD:774 | | tst.go:23:2:43:2 | range statement[1] | tst.go:29:20:29:23 | path | provenance | | nodes | UnsafeUnzipSymlinkGood.go:52:24:52:32 | definition of candidate | semmle.label | definition of candidate | diff --git a/go/ql/test/query-tests/Security/CWE-078/CommandInjection.expected b/go/ql/test/query-tests/Security/CWE-078/CommandInjection.expected index 6d399f758a3e..5a19b2063f5c 100644 --- a/go/ql/test/query-tests/Security/CWE-078/CommandInjection.expected +++ b/go/ql/test/query-tests/Security/CWE-078/CommandInjection.expected @@ -1,27 +1,27 @@ edges -| ArgumentInjection.go:9:10:9:16 | selection of URL | ArgumentInjection.go:9:10:9:24 | call to Query | provenance | MaD:808 | +| ArgumentInjection.go:9:10:9:16 | selection of URL | ArgumentInjection.go:9:10:9:24 | call to Query | provenance | MaD:747 | | ArgumentInjection.go:9:10:9:24 | call to Query | ArgumentInjection.go:10:31:10:34 | path | provenance | | -| CommandInjection2.go:13:15:13:21 | selection of URL | CommandInjection2.go:13:15:13:29 | call to Query | provenance | MaD:808 | +| CommandInjection2.go:13:15:13:21 | selection of URL | CommandInjection2.go:13:15:13:29 | call to Query | provenance | MaD:747 | | CommandInjection2.go:13:15:13:29 | call to Query | CommandInjection2.go:15:67:15:75 | imageName | provenance | | | CommandInjection2.go:15:34:15:88 | []type{args} [array] | CommandInjection2.go:15:34:15:88 | call to Sprintf | provenance | MaD:248 | | CommandInjection2.go:15:67:15:75 | imageName | CommandInjection2.go:15:34:15:88 | []type{args} [array] | provenance | | | CommandInjection2.go:15:67:15:75 | imageName | CommandInjection2.go:15:34:15:88 | call to Sprintf | provenance | FunctionModel | -| CommandInjection2.go:41:15:41:21 | selection of URL | CommandInjection2.go:41:15:41:29 | call to Query | provenance | MaD:808 | +| CommandInjection2.go:41:15:41:21 | selection of URL | CommandInjection2.go:41:15:41:29 | call to Query | provenance | MaD:747 | | CommandInjection2.go:41:15:41:29 | call to Query | CommandInjection2.go:44:67:44:75 | imageName | provenance | | | CommandInjection2.go:44:34:44:88 | []type{args} [array] | CommandInjection2.go:44:34:44:88 | call to Sprintf | provenance | MaD:248 | | CommandInjection2.go:44:67:44:75 | imageName | CommandInjection2.go:44:34:44:88 | []type{args} [array] | provenance | | | CommandInjection2.go:44:67:44:75 | imageName | CommandInjection2.go:44:34:44:88 | call to Sprintf | provenance | FunctionModel | -| CommandInjection.go:9:13:9:19 | selection of URL | CommandInjection.go:9:13:9:27 | call to Query | provenance | MaD:808 | +| CommandInjection.go:9:13:9:19 | selection of URL | CommandInjection.go:9:13:9:27 | call to Query | provenance | MaD:747 | | CommandInjection.go:9:13:9:27 | call to Query | CommandInjection.go:10:22:10:28 | cmdName | provenance | | -| GitSubcommands.go:11:13:11:19 | selection of URL | GitSubcommands.go:11:13:11:27 | call to Query | provenance | MaD:808 | +| GitSubcommands.go:11:13:11:19 | selection of URL | GitSubcommands.go:11:13:11:27 | call to Query | provenance | MaD:747 | | GitSubcommands.go:11:13:11:27 | call to Query | GitSubcommands.go:13:31:13:37 | tainted | provenance | | | GitSubcommands.go:11:13:11:27 | call to Query | GitSubcommands.go:14:31:14:37 | tainted | provenance | | | GitSubcommands.go:11:13:11:27 | call to Query | GitSubcommands.go:15:30:15:36 | tainted | provenance | | | GitSubcommands.go:11:13:11:27 | call to Query | GitSubcommands.go:16:35:16:41 | tainted | provenance | | | GitSubcommands.go:11:13:11:27 | call to Query | GitSubcommands.go:17:36:17:42 | tainted | provenance | | -| GitSubcommands.go:33:13:33:19 | selection of URL | GitSubcommands.go:33:13:33:27 | call to Query | provenance | MaD:808 | +| GitSubcommands.go:33:13:33:19 | selection of URL | GitSubcommands.go:33:13:33:27 | call to Query | provenance | MaD:747 | | GitSubcommands.go:33:13:33:27 | call to Query | GitSubcommands.go:38:32:38:38 | tainted | provenance | | -| SanitizingDoubleDash.go:9:13:9:19 | selection of URL | SanitizingDoubleDash.go:9:13:9:27 | call to Query | provenance | MaD:808 | +| SanitizingDoubleDash.go:9:13:9:19 | selection of URL | SanitizingDoubleDash.go:9:13:9:27 | call to Query | provenance | MaD:747 | | SanitizingDoubleDash.go:9:13:9:27 | call to Query | SanitizingDoubleDash.go:13:25:13:31 | tainted | provenance | | | SanitizingDoubleDash.go:9:13:9:27 | call to Query | SanitizingDoubleDash.go:14:23:14:33 | slice expression | provenance | | | SanitizingDoubleDash.go:9:13:9:27 | call to Query | SanitizingDoubleDash.go:39:31:39:37 | tainted | provenance | | @@ -56,7 +56,7 @@ edges | SanitizingDoubleDash.go:69:21:69:28 | arrayLit | SanitizingDoubleDash.go:69:14:69:35 | call to append | provenance | MaD:28 | | SanitizingDoubleDash.go:69:21:69:28 | arrayLit [array] | SanitizingDoubleDash.go:69:14:69:35 | call to append | provenance | MaD:29 | | SanitizingDoubleDash.go:69:21:69:28 | arrayLit [array] | SanitizingDoubleDash.go:69:14:69:35 | call to append [array] | provenance | MaD:29 | -| SanitizingDoubleDash.go:92:13:92:19 | selection of URL | SanitizingDoubleDash.go:92:13:92:27 | call to Query | provenance | MaD:808 | +| SanitizingDoubleDash.go:92:13:92:19 | selection of URL | SanitizingDoubleDash.go:92:13:92:27 | call to Query | provenance | MaD:747 | | SanitizingDoubleDash.go:92:13:92:27 | call to Query | SanitizingDoubleDash.go:95:25:95:31 | tainted | provenance | | | SanitizingDoubleDash.go:92:13:92:27 | call to Query | SanitizingDoubleDash.go:96:24:96:34 | slice expression | provenance | | | SanitizingDoubleDash.go:92:13:92:27 | call to Query | SanitizingDoubleDash.go:100:31:100:37 | tainted | provenance | | diff --git a/go/ql/test/query-tests/Security/CWE-079/ReflectedXss.expected b/go/ql/test/query-tests/Security/CWE-079/ReflectedXss.expected index 13a97e6e7735..690d37f30b51 100644 --- a/go/ql/test/query-tests/Security/CWE-079/ReflectedXss.expected +++ b/go/ql/test/query-tests/Security/CWE-079/ReflectedXss.expected @@ -1,18 +1,18 @@ edges -| ReflectedXss.go:11:15:11:20 | selection of Form | ReflectedXss.go:11:15:11:36 | call to Get | provenance | MaD:815 | +| ReflectedXss.go:11:15:11:20 | selection of Form | ReflectedXss.go:11:15:11:36 | call to Get | provenance | MaD:754 | | ReflectedXss.go:11:15:11:36 | call to Get | ReflectedXss.go:14:44:14:51 | username | provenance | | -| contenttype.go:11:11:11:16 | selection of Form | contenttype.go:11:11:11:28 | call to Get | provenance | MaD:815 | +| contenttype.go:11:11:11:16 | selection of Form | contenttype.go:11:11:11:28 | call to Get | provenance | MaD:754 | | contenttype.go:11:11:11:28 | call to Get | contenttype.go:17:11:17:22 | type conversion | provenance | | -| contenttype.go:49:11:49:16 | selection of Form | contenttype.go:49:11:49:28 | call to Get | provenance | MaD:815 | +| contenttype.go:49:11:49:16 | selection of Form | contenttype.go:49:11:49:28 | call to Get | provenance | MaD:754 | | contenttype.go:49:11:49:28 | call to Get | contenttype.go:53:34:53:37 | data | provenance | | -| contenttype.go:63:10:63:28 | call to FormValue | contenttype.go:64:52:64:55 | data | provenance | Src:MaD:743 | -| contenttype.go:73:10:73:28 | call to FormValue | contenttype.go:79:11:79:14 | data | provenance | Src:MaD:743 | -| contenttype.go:88:10:88:28 | call to FormValue | contenttype.go:91:4:91:7 | data | provenance | Src:MaD:743 | -| contenttype.go:113:10:113:28 | call to FormValue | contenttype.go:114:50:114:53 | data | provenance | Src:MaD:743 | -| reflectedxsstest.go:31:2:31:44 | ... := ...[0] | reflectedxsstest.go:32:34:32:37 | file | provenance | Src:MaD:742 | -| reflectedxsstest.go:31:2:31:44 | ... := ...[1] | reflectedxsstest.go:34:46:34:60 | selection of Filename | provenance | Src:MaD:742 | +| contenttype.go:63:10:63:28 | call to FormValue | contenttype.go:64:52:64:55 | data | provenance | Src:MaD:682 | +| contenttype.go:73:10:73:28 | call to FormValue | contenttype.go:79:11:79:14 | data | provenance | Src:MaD:682 | +| contenttype.go:88:10:88:28 | call to FormValue | contenttype.go:91:4:91:7 | data | provenance | Src:MaD:682 | +| contenttype.go:113:10:113:28 | call to FormValue | contenttype.go:114:50:114:53 | data | provenance | Src:MaD:682 | +| reflectedxsstest.go:31:2:31:44 | ... := ...[0] | reflectedxsstest.go:32:34:32:37 | file | provenance | Src:MaD:681 | +| reflectedxsstest.go:31:2:31:44 | ... := ...[1] | reflectedxsstest.go:34:46:34:60 | selection of Filename | provenance | Src:MaD:681 | | reflectedxsstest.go:32:2:32:38 | ... := ...[0] | reflectedxsstest.go:33:49:33:55 | content | provenance | | -| reflectedxsstest.go:32:34:32:37 | file | reflectedxsstest.go:32:2:32:38 | ... := ...[0] | provenance | MaD:613 | +| reflectedxsstest.go:32:34:32:37 | file | reflectedxsstest.go:32:2:32:38 | ... := ...[0] | provenance | MaD:552 | | reflectedxsstest.go:33:17:33:56 | []type{args} [array] | reflectedxsstest.go:33:17:33:56 | call to Sprintf | provenance | MaD:248 | | reflectedxsstest.go:33:17:33:56 | call to Sprintf | reflectedxsstest.go:33:10:33:57 | type conversion | provenance | | | reflectedxsstest.go:33:49:33:55 | content | reflectedxsstest.go:33:17:33:56 | []type{args} [array] | provenance | | @@ -21,25 +21,25 @@ edges | reflectedxsstest.go:34:17:34:61 | call to Sprintf | reflectedxsstest.go:34:10:34:62 | type conversion | provenance | | | reflectedxsstest.go:34:46:34:60 | selection of Filename | reflectedxsstest.go:34:17:34:61 | []type{args} [array] | provenance | | | reflectedxsstest.go:34:46:34:60 | selection of Filename | reflectedxsstest.go:34:17:34:61 | call to Sprintf | provenance | FunctionModel | -| reflectedxsstest.go:38:2:38:35 | ... := ...[0] | reflectedxsstest.go:39:16:39:21 | reader | provenance | Src:MaD:744 | +| reflectedxsstest.go:38:2:38:35 | ... := ...[0] | reflectedxsstest.go:39:16:39:21 | reader | provenance | Src:MaD:683 | | reflectedxsstest.go:39:2:39:32 | ... := ...[0] | reflectedxsstest.go:40:14:40:17 | part | provenance | | | reflectedxsstest.go:39:2:39:32 | ... := ...[0] | reflectedxsstest.go:42:2:42:5 | part | provenance | | -| reflectedxsstest.go:39:16:39:21 | reader | reflectedxsstest.go:39:2:39:32 | ... := ...[0] | provenance | MaD:703 | -| reflectedxsstest.go:40:14:40:17 | part | reflectedxsstest.go:40:14:40:28 | call to FileName | provenance | MaD:701 | +| reflectedxsstest.go:39:16:39:21 | reader | reflectedxsstest.go:39:2:39:32 | ... := ...[0] | provenance | MaD:642 | +| reflectedxsstest.go:40:14:40:17 | part | reflectedxsstest.go:40:14:40:28 | call to FileName | provenance | MaD:640 | | reflectedxsstest.go:40:14:40:28 | call to FileName | reflectedxsstest.go:44:46:44:53 | partName | provenance | | | reflectedxsstest.go:41:2:41:10 | definition of byteSlice | reflectedxsstest.go:45:10:45:18 | byteSlice | provenance | | -| reflectedxsstest.go:42:2:42:5 | part | reflectedxsstest.go:41:2:41:10 | definition of byteSlice | provenance | MaD:626 | +| reflectedxsstest.go:42:2:42:5 | part | reflectedxsstest.go:41:2:41:10 | definition of byteSlice | provenance | MaD:565 | | reflectedxsstest.go:44:17:44:54 | []type{args} [array] | reflectedxsstest.go:44:17:44:54 | call to Sprintf | provenance | MaD:248 | | reflectedxsstest.go:44:17:44:54 | call to Sprintf | reflectedxsstest.go:44:10:44:55 | type conversion | provenance | | | reflectedxsstest.go:44:46:44:53 | partName | reflectedxsstest.go:44:17:44:54 | []type{args} [array] | provenance | | | reflectedxsstest.go:44:46:44:53 | partName | reflectedxsstest.go:44:17:44:54 | call to Sprintf | provenance | FunctionModel | -| reflectedxsstest.go:51:14:51:18 | selection of URL | reflectedxsstest.go:51:14:51:26 | call to Query | provenance | MaD:808 | +| reflectedxsstest.go:51:14:51:18 | selection of URL | reflectedxsstest.go:51:14:51:26 | call to Query | provenance | MaD:747 | | reflectedxsstest.go:51:14:51:26 | call to Query | reflectedxsstest.go:54:11:54:21 | type conversion | provenance | | -| tst.go:14:15:14:20 | selection of Form | tst.go:14:15:14:36 | call to Get | provenance | MaD:815 | +| tst.go:14:15:14:20 | selection of Form | tst.go:14:15:14:36 | call to Get | provenance | MaD:754 | | tst.go:14:15:14:36 | call to Get | tst.go:18:32:18:32 | a | provenance | | | tst.go:18:19:18:38 | call to Join | tst.go:18:12:18:39 | type conversion | provenance | | -| tst.go:18:32:18:32 | a | tst.go:18:19:18:38 | call to Join | provenance | MaD:907 | -| tst.go:48:14:48:19 | selection of Form | tst.go:48:14:48:34 | call to Get | provenance | MaD:815 | +| tst.go:18:32:18:32 | a | tst.go:18:19:18:38 | call to Join | provenance | MaD:846 | +| tst.go:48:14:48:19 | selection of Form | tst.go:48:14:48:34 | call to Get | provenance | MaD:754 | | tst.go:48:14:48:34 | call to Get | tst.go:53:12:53:26 | type conversion | provenance | | | websocketXss.go:30:7:30:10 | definition of xnet | websocketXss.go:32:24:32:27 | xnet | provenance | | | websocketXss.go:34:3:34:7 | definition of xnet2 | websocketXss.go:36:24:36:28 | xnet2 | provenance | | diff --git a/go/ql/test/query-tests/Security/CWE-089/SqlInjection.expected b/go/ql/test/query-tests/Security/CWE-089/SqlInjection.expected index 3e81377e6a45..3fca7405f8d1 100644 --- a/go/ql/test/query-tests/Security/CWE-089/SqlInjection.expected +++ b/go/ql/test/query-tests/Security/CWE-089/SqlInjection.expected @@ -1,12 +1,12 @@ edges | SqlInjection.go:10:7:11:30 | []type{args} [array] | SqlInjection.go:10:7:11:30 | call to Sprintf | provenance | MaD:248 | | SqlInjection.go:10:7:11:30 | call to Sprintf | SqlInjection.go:12:11:12:11 | q | provenance | | -| SqlInjection.go:11:3:11:9 | selection of URL | SqlInjection.go:11:3:11:17 | call to Query | provenance | MaD:808 | +| SqlInjection.go:11:3:11:9 | selection of URL | SqlInjection.go:11:3:11:17 | call to Query | provenance | MaD:747 | | SqlInjection.go:11:3:11:17 | call to Query | SqlInjection.go:11:3:11:29 | index expression | provenance | | | SqlInjection.go:11:3:11:29 | index expression | SqlInjection.go:10:7:11:30 | []type{args} [array] | provenance | | | SqlInjection.go:11:3:11:29 | index expression | SqlInjection.go:10:7:11:30 | call to Sprintf | provenance | FunctionModel | | issue48.go:17:2:17:33 | ... := ...[0] | issue48.go:18:17:18:17 | b | provenance | | -| issue48.go:17:25:17:32 | selection of Body | issue48.go:17:2:17:33 | ... := ...[0] | provenance | MaD:613 | +| issue48.go:17:25:17:32 | selection of Body | issue48.go:17:2:17:33 | ... := ...[0] | provenance | MaD:552 | | issue48.go:18:17:18:17 | b | issue48.go:18:20:18:39 | &... | provenance | MaD:187 | | issue48.go:18:20:18:39 | &... | issue48.go:21:3:21:33 | index expression | provenance | | | issue48.go:20:8:21:34 | []type{args} [array] | issue48.go:20:8:21:34 | call to Sprintf | provenance | MaD:248 | @@ -14,7 +14,7 @@ edges | issue48.go:21:3:21:33 | index expression | issue48.go:20:8:21:34 | []type{args} [array] | provenance | | | issue48.go:21:3:21:33 | index expression | issue48.go:20:8:21:34 | call to Sprintf | provenance | FunctionModel | | issue48.go:27:2:27:34 | ... := ...[0] | issue48.go:28:17:28:18 | b2 | provenance | | -| issue48.go:27:26:27:33 | selection of Body | issue48.go:27:2:27:34 | ... := ...[0] | provenance | MaD:613 | +| issue48.go:27:26:27:33 | selection of Body | issue48.go:27:2:27:34 | ... := ...[0] | provenance | MaD:552 | | issue48.go:28:17:28:18 | b2 | issue48.go:28:21:28:41 | &... | provenance | MaD:187 | | issue48.go:28:21:28:41 | &... | issue48.go:31:3:31:31 | selection of Category | provenance | | | issue48.go:30:8:31:32 | []type{args} [array] | issue48.go:30:8:31:32 | call to Sprintf | provenance | MaD:248 | @@ -22,7 +22,7 @@ edges | issue48.go:31:3:31:31 | selection of Category | issue48.go:30:8:31:32 | []type{args} [array] | provenance | | | issue48.go:31:3:31:31 | selection of Category | issue48.go:30:8:31:32 | call to Sprintf | provenance | FunctionModel | | issue48.go:37:17:37:50 | type conversion | issue48.go:37:53:37:73 | &... | provenance | MaD:187 | -| issue48.go:37:24:37:30 | selection of URL | issue48.go:37:24:37:38 | call to Query | provenance | MaD:808 | +| issue48.go:37:24:37:30 | selection of URL | issue48.go:37:24:37:38 | call to Query | provenance | MaD:747 | | issue48.go:37:24:37:38 | call to Query | issue48.go:37:17:37:50 | type conversion | provenance | | | issue48.go:37:53:37:73 | &... | issue48.go:40:3:40:31 | selection of Category | provenance | | | issue48.go:39:8:40:32 | []type{args} [array] | issue48.go:39:8:40:32 | call to Sprintf | provenance | MaD:248 | @@ -31,17 +31,17 @@ edges | issue48.go:40:3:40:31 | selection of Category | issue48.go:39:8:40:32 | call to Sprintf | provenance | FunctionModel | | main.go:11:11:11:16 | selection of Form | main.go:11:11:11:28 | index expression | provenance | | | main.go:15:11:15:84 | []type{args} [array] | main.go:15:11:15:84 | call to Sprintf | provenance | MaD:248 | -| main.go:15:63:15:67 | selection of URL | main.go:15:63:15:75 | call to Query | provenance | MaD:808 | +| main.go:15:63:15:67 | selection of URL | main.go:15:63:15:75 | call to Query | provenance | MaD:747 | | main.go:15:63:15:75 | call to Query | main.go:15:63:15:83 | index expression | provenance | | | main.go:15:63:15:83 | index expression | main.go:15:11:15:84 | []type{args} [array] | provenance | | | main.go:15:63:15:83 | index expression | main.go:15:11:15:84 | call to Sprintf | provenance | FunctionModel | | main.go:16:11:16:85 | []type{args} [array] | main.go:16:11:16:85 | call to Sprintf | provenance | MaD:248 | -| main.go:16:63:16:70 | selection of Header | main.go:16:63:16:84 | call to Get | provenance | MaD:728 | +| main.go:16:63:16:70 | selection of Header | main.go:16:63:16:84 | call to Get | provenance | MaD:667 | | main.go:16:63:16:84 | call to Get | main.go:16:11:16:85 | []type{args} [array] | provenance | | | main.go:16:63:16:84 | call to Get | main.go:16:11:16:85 | call to Sprintf | provenance | FunctionModel | | main.go:28:17:31:2 | &... [pointer, Category] | main.go:34:3:34:13 | RequestData [pointer, Category] | provenance | | | main.go:28:18:31:2 | struct literal [Category] | main.go:28:17:31:2 | &... [pointer, Category] | provenance | | -| main.go:30:13:30:19 | selection of URL | main.go:30:13:30:27 | call to Query | provenance | MaD:808 | +| main.go:30:13:30:19 | selection of URL | main.go:30:13:30:27 | call to Query | provenance | MaD:747 | | main.go:30:13:30:27 | call to Query | main.go:30:13:30:39 | index expression | provenance | | | main.go:30:13:30:39 | index expression | main.go:28:18:31:2 | struct literal [Category] | provenance | | | main.go:33:7:34:23 | []type{args} [array] | main.go:33:7:34:23 | call to Sprintf | provenance | MaD:248 | @@ -54,7 +54,7 @@ edges | main.go:39:2:39:12 | definition of RequestData [pointer, Category] | main.go:43:3:43:13 | RequestData [pointer, Category] | provenance | | | main.go:40:2:40:12 | RequestData [pointer, Category] | main.go:40:2:40:12 | implicit dereference [Category] | provenance | | | main.go:40:2:40:12 | implicit dereference [Category] | main.go:39:2:39:12 | definition of RequestData [pointer, Category] | provenance | | -| main.go:40:25:40:31 | selection of URL | main.go:40:25:40:39 | call to Query | provenance | MaD:808 | +| main.go:40:25:40:31 | selection of URL | main.go:40:25:40:39 | call to Query | provenance | MaD:747 | | main.go:40:25:40:39 | call to Query | main.go:40:25:40:51 | index expression | provenance | | | main.go:40:25:40:51 | index expression | main.go:40:2:40:12 | implicit dereference [Category] | provenance | | | main.go:42:7:43:23 | []type{args} [array] | main.go:42:7:43:23 | call to Sprintf | provenance | MaD:248 | @@ -67,7 +67,7 @@ edges | main.go:48:2:48:12 | definition of RequestData [pointer, Category] | main.go:52:3:52:13 | RequestData [pointer, Category] | provenance | | | main.go:49:3:49:14 | star expression [Category] | main.go:48:2:48:12 | definition of RequestData [pointer, Category] | provenance | | | main.go:49:4:49:14 | RequestData [pointer, Category] | main.go:49:3:49:14 | star expression [Category] | provenance | | -| main.go:49:28:49:34 | selection of URL | main.go:49:28:49:42 | call to Query | provenance | MaD:808 | +| main.go:49:28:49:34 | selection of URL | main.go:49:28:49:42 | call to Query | provenance | MaD:747 | | main.go:49:28:49:42 | call to Query | main.go:49:28:49:54 | index expression | provenance | | | main.go:49:28:49:54 | index expression | main.go:49:3:49:14 | star expression [Category] | provenance | | | main.go:51:7:52:23 | []type{args} [array] | main.go:51:7:52:23 | call to Sprintf | provenance | MaD:248 | @@ -80,7 +80,7 @@ edges | main.go:57:2:57:12 | definition of RequestData [pointer, Category] | main.go:61:5:61:15 | RequestData [pointer, Category] | provenance | | | main.go:58:3:58:14 | star expression [Category] | main.go:57:2:57:12 | definition of RequestData [pointer, Category] | provenance | | | main.go:58:4:58:14 | RequestData [pointer, Category] | main.go:58:3:58:14 | star expression [Category] | provenance | | -| main.go:58:28:58:34 | selection of URL | main.go:58:28:58:42 | call to Query | provenance | MaD:808 | +| main.go:58:28:58:34 | selection of URL | main.go:58:28:58:42 | call to Query | provenance | MaD:747 | | main.go:58:28:58:42 | call to Query | main.go:58:28:58:54 | index expression | provenance | | | main.go:58:28:58:54 | index expression | main.go:58:3:58:14 | star expression [Category] | provenance | | | main.go:60:7:61:26 | []type{args} [array] | main.go:60:7:61:26 | call to Sprintf | provenance | MaD:248 | @@ -89,7 +89,7 @@ edges | main.go:61:3:61:25 | selection of Category | main.go:60:7:61:26 | call to Sprintf | provenance | FunctionModel | | main.go:61:4:61:15 | star expression [Category] | main.go:61:3:61:25 | selection of Category | provenance | | | main.go:61:5:61:15 | RequestData [pointer, Category] | main.go:61:4:61:15 | star expression [Category] | provenance | | -| mongoDB.go:40:20:40:30 | call to Referer | mongoDB.go:42:28:42:41 | untrustedInput | provenance | Src:MaD:746 | +| mongoDB.go:40:20:40:30 | call to Referer | mongoDB.go:42:28:42:41 | untrustedInput | provenance | Src:MaD:685 | | mongoDB.go:42:19:42:42 | struct literal | mongoDB.go:50:34:50:39 | filter | provenance | | | mongoDB.go:42:19:42:42 | struct literal | mongoDB.go:61:27:61:32 | filter | provenance | | | mongoDB.go:42:19:42:42 | struct literal | mongoDB.go:63:23:63:28 | filter | provenance | | diff --git a/go/ql/test/query-tests/Security/CWE-089/StringBreak.expected b/go/ql/test/query-tests/Security/CWE-089/StringBreak.expected index 84f7c36e1acc..4caef4a3534d 100644 --- a/go/ql/test/query-tests/Security/CWE-089/StringBreak.expected +++ b/go/ql/test/query-tests/Security/CWE-089/StringBreak.expected @@ -2,10 +2,10 @@ edges | StringBreak.go:10:2:10:40 | ... := ...[0] | StringBreak.go:14:47:14:57 | versionJSON | provenance | | | StringBreakMismatched.go:12:2:12:40 | ... := ...[0] | StringBreakMismatched.go:13:29:13:47 | type conversion | provenance | | | StringBreakMismatched.go:13:13:13:62 | call to Replace | StringBreakMismatched.go:17:26:17:32 | escaped | provenance | | -| StringBreakMismatched.go:13:29:13:47 | type conversion | StringBreakMismatched.go:13:13:13:62 | call to Replace | provenance | MaD:911 | +| StringBreakMismatched.go:13:29:13:47 | type conversion | StringBreakMismatched.go:13:13:13:62 | call to Replace | provenance | MaD:850 | | StringBreakMismatched.go:24:2:24:40 | ... := ...[0] | StringBreakMismatched.go:25:29:25:47 | type conversion | provenance | | | StringBreakMismatched.go:25:13:25:61 | call to Replace | StringBreakMismatched.go:29:27:29:33 | escaped | provenance | | -| StringBreakMismatched.go:25:29:25:47 | type conversion | StringBreakMismatched.go:25:13:25:61 | call to Replace | provenance | MaD:911 | +| StringBreakMismatched.go:25:29:25:47 | type conversion | StringBreakMismatched.go:25:13:25:61 | call to Replace | provenance | MaD:850 | nodes | StringBreak.go:10:2:10:40 | ... := ...[0] | semmle.label | ... := ...[0] | | StringBreak.go:14:47:14:57 | versionJSON | semmle.label | versionJSON | diff --git a/go/ql/test/query-tests/Security/CWE-338/InsecureRandomness/InsecureRandomness.expected b/go/ql/test/query-tests/Security/CWE-338/InsecureRandomness/InsecureRandomness.expected index 18e9ba4abd44..fa8f9a02fed1 100644 --- a/go/ql/test/query-tests/Security/CWE-338/InsecureRandomness/InsecureRandomness.expected +++ b/go/ql/test/query-tests/Security/CWE-338/InsecureRandomness/InsecureRandomness.expected @@ -9,7 +9,7 @@ edges | sample.go:33:2:33:6 | definition of nonce | sample.go:37:25:37:29 | nonce | provenance | | | sample.go:33:2:33:6 | definition of nonce | sample.go:37:32:37:36 | nonce | provenance | | | sample.go:34:12:34:40 | call to New | sample.go:35:14:35:19 | random | provenance | | -| sample.go:35:14:35:19 | random | sample.go:33:2:33:6 | definition of nonce | provenance | MaD:622 | +| sample.go:35:14:35:19 | random | sample.go:33:2:33:6 | definition of nonce | provenance | MaD:561 | | sample.go:55:17:55:42 | call to Intn | sample.go:56:29:56:38 | randNumber | provenance | | | sample.go:56:11:56:40 | type conversion | sample.go:58:32:58:43 | type conversion | provenance | | | sample.go:56:18:56:39 | index expression | sample.go:56:11:56:40 | type conversion | provenance | | diff --git a/go/ql/test/query-tests/Security/CWE-347/MissingJwtSignatureCheck.expected b/go/ql/test/query-tests/Security/CWE-347/MissingJwtSignatureCheck.expected index 57c2fac8135d..1a14ca5e9598 100644 --- a/go/ql/test/query-tests/Security/CWE-347/MissingJwtSignatureCheck.expected +++ b/go/ql/test/query-tests/Security/CWE-347/MissingJwtSignatureCheck.expected @@ -1,16 +1,16 @@ edges -| go-jose.v3.go:25:16:25:20 | selection of URL | go-jose.v3.go:25:16:25:28 | call to Query | provenance | MaD:808 | -| go-jose.v3.go:25:16:25:28 | call to Query | go-jose.v3.go:25:16:25:47 | call to Get | provenance | MaD:815 | +| go-jose.v3.go:25:16:25:20 | selection of URL | go-jose.v3.go:25:16:25:28 | call to Query | provenance | MaD:747 | +| go-jose.v3.go:25:16:25:28 | call to Query | go-jose.v3.go:25:16:25:47 | call to Get | provenance | MaD:754 | | go-jose.v3.go:25:16:25:47 | call to Get | go-jose.v3.go:26:15:26:25 | signedToken | provenance | | | go-jose.v3.go:26:15:26:25 | signedToken | go-jose.v3.go:29:19:29:29 | definition of signedToken | provenance | | | go-jose.v3.go:29:19:29:29 | definition of signedToken | go-jose.v3.go:31:37:31:47 | signedToken | provenance | | -| go-jose.v3.go:31:2:31:48 | ... := ...[0] | go-jose.v3.go:33:12:33:23 | DecodedToken | provenance | Sink:MaD:394 | -| go-jose.v3.go:31:37:31:47 | signedToken | go-jose.v3.go:31:2:31:48 | ... := ...[0] | provenance | MaD:396 | -| golang-jwt-v5.go:28:16:28:20 | selection of URL | golang-jwt-v5.go:28:16:28:28 | call to Query | provenance | MaD:808 | -| golang-jwt-v5.go:28:16:28:28 | call to Query | golang-jwt-v5.go:28:16:28:47 | call to Get | provenance | MaD:815 | +| go-jose.v3.go:31:2:31:48 | ... := ...[0] | go-jose.v3.go:33:12:33:23 | DecodedToken | provenance | Sink:MaD:333 | +| go-jose.v3.go:31:37:31:47 | signedToken | go-jose.v3.go:31:2:31:48 | ... := ...[0] | provenance | MaD:335 | +| golang-jwt-v5.go:28:16:28:20 | selection of URL | golang-jwt-v5.go:28:16:28:28 | call to Query | provenance | MaD:747 | +| golang-jwt-v5.go:28:16:28:28 | call to Query | golang-jwt-v5.go:28:16:28:47 | call to Get | provenance | MaD:754 | | golang-jwt-v5.go:28:16:28:47 | call to Get | golang-jwt-v5.go:29:25:29:35 | signedToken | provenance | | | golang-jwt-v5.go:29:25:29:35 | signedToken | golang-jwt-v5.go:32:29:32:39 | definition of signedToken | provenance | | -| golang-jwt-v5.go:32:29:32:39 | definition of signedToken | golang-jwt-v5.go:34:58:34:68 | signedToken | provenance | Sink:MaD:408 | +| golang-jwt-v5.go:32:29:32:39 | definition of signedToken | golang-jwt-v5.go:34:58:34:68 | signedToken | provenance | Sink:MaD:347 | nodes | go-jose.v3.go:25:16:25:20 | selection of URL | semmle.label | selection of URL | | go-jose.v3.go:25:16:25:28 | call to Query | semmle.label | call to Query | diff --git a/go/ql/test/query-tests/Security/CWE-601/BadRedirectCheck/BadRedirectCheck.expected b/go/ql/test/query-tests/Security/CWE-601/BadRedirectCheck/BadRedirectCheck.expected index 86842f028d9c..117465d63153 100644 --- a/go/ql/test/query-tests/Security/CWE-601/BadRedirectCheck/BadRedirectCheck.expected +++ b/go/ql/test/query-tests/Security/CWE-601/BadRedirectCheck/BadRedirectCheck.expected @@ -12,8 +12,8 @@ edges | main.go:68:17:68:24 | argument corresponding to redirect | main.go:73:20:73:27 | redirect | provenance | | | main.go:68:17:68:24 | definition of redirect | main.go:73:20:73:27 | redirect | provenance | | | main.go:73:9:73:28 | call to Clean | main.go:77:25:77:39 | call to getTarget1 | provenance | | -| main.go:73:20:73:27 | redirect | main.go:73:9:73:28 | call to Clean | provenance | MaD:834 | -| main.go:73:20:73:27 | redirect | main.go:73:9:73:28 | call to Clean | provenance | MaD:834 | +| main.go:73:20:73:27 | redirect | main.go:73:9:73:28 | call to Clean | provenance | MaD:773 | +| main.go:73:20:73:27 | redirect | main.go:73:9:73:28 | call to Clean | provenance | MaD:773 | | main.go:76:19:76:21 | argument corresponding to url | main.go:77:36:77:38 | url | provenance | | | main.go:77:36:77:38 | url | main.go:68:17:68:24 | definition of redirect | provenance | | | main.go:77:36:77:38 | url | main.go:77:25:77:39 | call to getTarget1 | provenance | | diff --git a/go/ql/test/query-tests/Security/CWE-601/OpenUrlRedirect/OpenUrlRedirect.expected b/go/ql/test/query-tests/Security/CWE-601/OpenUrlRedirect/OpenUrlRedirect.expected index c24487ab4918..03a593151be5 100644 --- a/go/ql/test/query-tests/Security/CWE-601/OpenUrlRedirect/OpenUrlRedirect.expected +++ b/go/ql/test/query-tests/Security/CWE-601/OpenUrlRedirect/OpenUrlRedirect.expected @@ -43,11 +43,11 @@ edges | stdlib.go:162:24:162:26 | url | stdlib.go:162:24:162:35 | call to String | provenance | Config | | stdlib.go:173:35:173:39 | selection of URL | stdlib.go:173:35:173:52 | call to RequestURI | provenance | Config | | stdlib.go:173:35:173:52 | call to RequestURI | stdlib.go:173:24:173:52 | ...+... | provenance | Config | -| stdlib.go:182:13:182:33 | call to FormValue | stdlib.go:184:23:184:28 | target | provenance | Src:MaD:743 | +| stdlib.go:182:13:182:33 | call to FormValue | stdlib.go:184:23:184:28 | target | provenance | Src:MaD:682 | | stdlib.go:190:3:190:8 | definition of target | stdlib.go:192:23:192:28 | target | provenance | | | stdlib.go:190:3:190:8 | definition of target | stdlib.go:194:23:194:28 | target | provenance | | | stdlib.go:190:3:190:57 | ... := ...[0] | stdlib.go:190:3:190:8 | definition of target | provenance | | -| stdlib.go:190:36:190:56 | call to FormValue | stdlib.go:190:3:190:57 | ... := ...[0] | provenance | Src:MaD:743 Config | +| stdlib.go:190:36:190:56 | call to FormValue | stdlib.go:190:3:190:57 | ... := ...[0] | provenance | Src:MaD:682 Config | | stdlib.go:192:23:192:28 | implicit dereference | stdlib.go:190:3:190:8 | definition of target | provenance | Config | | stdlib.go:192:23:192:28 | implicit dereference | stdlib.go:192:23:192:33 | selection of Path | provenance | Config | | stdlib.go:192:23:192:28 | target | stdlib.go:192:23:192:28 | implicit dereference | provenance | Config | diff --git a/go/ql/test/query-tests/Security/CWE-640/EmailInjection.expected b/go/ql/test/query-tests/Security/CWE-640/EmailInjection.expected index a1f71c46e203..e0ed89e75a4d 100644 --- a/go/ql/test/query-tests/Security/CWE-640/EmailInjection.expected +++ b/go/ql/test/query-tests/Security/CWE-640/EmailInjection.expected @@ -1,23 +1,23 @@ edges -| EmailBad.go:9:10:9:17 | selection of Header | EmailBad.go:9:10:9:29 | call to Get | provenance | MaD:728 | +| EmailBad.go:9:10:9:17 | selection of Header | EmailBad.go:9:10:9:29 | call to Get | provenance | MaD:667 | | EmailBad.go:9:10:9:29 | call to Get | EmailBad.go:12:56:12:67 | type conversion | provenance | | -| main.go:29:21:29:31 | call to Referer | main.go:31:57:31:78 | type conversion | provenance | Src:MaD:746 | -| main.go:37:21:37:31 | call to Referer | main.go:41:25:41:38 | untrustedInput | provenance | Src:MaD:746 | -| main.go:41:25:41:38 | untrustedInput | main.go:40:3:40:7 | definition of write | provenance | MaD:625 | -| main.go:46:21:46:31 | call to Referer | main.go:52:46:52:59 | untrustedInput | provenance | Src:MaD:746 | -| main.go:46:21:46:31 | call to Referer | main.go:53:52:53:65 | untrustedInput | provenance | Src:MaD:746 | -| main.go:58:21:58:31 | call to Referer | main.go:60:47:60:60 | untrustedInput | provenance | Src:MaD:746 | +| main.go:29:21:29:31 | call to Referer | main.go:31:57:31:78 | type conversion | provenance | Src:MaD:685 | +| main.go:37:21:37:31 | call to Referer | main.go:41:25:41:38 | untrustedInput | provenance | Src:MaD:685 | +| main.go:41:25:41:38 | untrustedInput | main.go:40:3:40:7 | definition of write | provenance | MaD:564 | +| main.go:46:21:46:31 | call to Referer | main.go:52:46:52:59 | untrustedInput | provenance | Src:MaD:685 | +| main.go:46:21:46:31 | call to Referer | main.go:53:52:53:65 | untrustedInput | provenance | Src:MaD:685 | +| main.go:58:21:58:31 | call to Referer | main.go:60:47:60:60 | untrustedInput | provenance | Src:MaD:685 | | main.go:60:14:60:61 | call to NewContent | main.go:63:16:63:22 | content | provenance | | -| main.go:60:47:60:60 | untrustedInput | main.go:60:14:60:61 | call to NewContent | provenance | MaD:457 | -| main.go:68:21:68:31 | call to Referer | main.go:74:47:74:60 | untrustedInput | provenance | Src:MaD:746 | +| main.go:60:47:60:60 | untrustedInput | main.go:60:14:60:61 | call to NewContent | provenance | MaD:396 | +| main.go:68:21:68:31 | call to Referer | main.go:74:47:74:60 | untrustedInput | provenance | Src:MaD:685 | | main.go:74:14:74:61 | call to NewContent | main.go:76:50:76:56 | content | provenance | | | main.go:74:14:74:61 | call to NewContent | main.go:76:59:76:65 | content | provenance | | | main.go:74:14:74:61 | call to NewContent | main.go:77:16:77:22 | content | provenance | | -| main.go:74:47:74:60 | untrustedInput | main.go:74:14:74:61 | call to NewContent | provenance | MaD:457 | -| main.go:82:21:82:31 | call to Referer | main.go:89:37:89:50 | untrustedInput | provenance | Src:MaD:746 | -| main.go:82:21:82:31 | call to Referer | main.go:91:48:91:61 | untrustedInput | provenance | Src:MaD:746 | +| main.go:74:47:74:60 | untrustedInput | main.go:74:14:74:61 | call to NewContent | provenance | MaD:396 | +| main.go:82:21:82:31 | call to Referer | main.go:89:37:89:50 | untrustedInput | provenance | Src:MaD:685 | +| main.go:82:21:82:31 | call to Referer | main.go:91:48:91:61 | untrustedInput | provenance | Src:MaD:685 | | main.go:91:15:91:62 | call to NewContent | main.go:93:16:93:23 | content2 | provenance | | -| main.go:91:48:91:61 | untrustedInput | main.go:91:15:91:62 | call to NewContent | provenance | MaD:457 | +| main.go:91:48:91:61 | untrustedInput | main.go:91:15:91:62 | call to NewContent | provenance | MaD:396 | nodes | EmailBad.go:9:10:9:17 | selection of Header | semmle.label | selection of Header | | EmailBad.go:9:10:9:29 | call to Get | semmle.label | call to Get | diff --git a/go/ql/test/query-tests/Security/CWE-643/XPathInjection.expected b/go/ql/test/query-tests/Security/CWE-643/XPathInjection.expected index 2aaa4d2dae4d..e7fd21bfc039 100644 --- a/go/ql/test/query-tests/Security/CWE-643/XPathInjection.expected +++ b/go/ql/test/query-tests/Security/CWE-643/XPathInjection.expected @@ -1,16 +1,16 @@ edges -| XPathInjection.go:13:14:13:19 | selection of Form | XPathInjection.go:13:14:13:35 | call to Get | provenance | MaD:815 | +| XPathInjection.go:13:14:13:19 | selection of Form | XPathInjection.go:13:14:13:35 | call to Get | provenance | MaD:754 | | XPathInjection.go:13:14:13:35 | call to Get | XPathInjection.go:16:29:16:91 | ...+... | provenance | | -| tst.go:34:14:34:19 | selection of Form | tst.go:34:14:34:35 | call to Get | provenance | MaD:815 | +| tst.go:34:14:34:19 | selection of Form | tst.go:34:14:34:35 | call to Get | provenance | MaD:754 | | tst.go:34:14:34:35 | call to Get | tst.go:37:23:37:85 | ...+... | provenance | | | tst.go:34:14:34:35 | call to Get | tst.go:40:24:40:86 | ...+... | provenance | | | tst.go:34:14:34:35 | call to Get | tst.go:43:24:43:82 | ...+... | provenance | | -| tst.go:48:14:48:19 | selection of Form | tst.go:48:14:48:35 | call to Get | provenance | MaD:815 | +| tst.go:48:14:48:19 | selection of Form | tst.go:48:14:48:35 | call to Get | provenance | MaD:754 | | tst.go:48:14:48:35 | call to Get | tst.go:51:26:51:84 | ...+... | provenance | | | tst.go:48:14:48:35 | call to Get | tst.go:54:29:54:87 | ...+... | provenance | | | tst.go:48:14:48:35 | call to Get | tst.go:57:33:57:91 | ...+... | provenance | | | tst.go:48:14:48:35 | call to Get | tst.go:60:30:60:88 | ...+... | provenance | | -| tst.go:65:14:65:19 | selection of Form | tst.go:65:14:65:35 | call to Get | provenance | MaD:815 | +| tst.go:65:14:65:19 | selection of Form | tst.go:65:14:65:35 | call to Get | provenance | MaD:754 | | tst.go:65:14:65:35 | call to Get | tst.go:68:25:68:83 | ...+... | provenance | | | tst.go:65:14:65:35 | call to Get | tst.go:71:28:71:86 | ...+... | provenance | | | tst.go:65:14:65:35 | call to Get | tst.go:74:25:74:83 | ...+... | provenance | | @@ -19,38 +19,38 @@ edges | tst.go:65:14:65:35 | call to Get | tst.go:83:29:83:87 | ...+... | provenance | | | tst.go:65:14:65:35 | call to Get | tst.go:86:23:86:85 | ...+... | provenance | | | tst.go:65:14:65:35 | call to Get | tst.go:89:22:89:84 | ...+... | provenance | | -| tst.go:94:14:94:19 | selection of Form | tst.go:94:14:94:35 | call to Get | provenance | MaD:815 | +| tst.go:94:14:94:19 | selection of Form | tst.go:94:14:94:35 | call to Get | provenance | MaD:754 | | tst.go:94:14:94:35 | call to Get | tst.go:97:26:97:84 | ...+... | provenance | | | tst.go:94:14:94:35 | call to Get | tst.go:100:29:100:87 | ...+... | provenance | | | tst.go:94:14:94:35 | call to Get | tst.go:103:33:103:91 | ...+... | provenance | | | tst.go:94:14:94:35 | call to Get | tst.go:106:30:106:88 | ...+... | provenance | | -| tst.go:111:14:111:19 | selection of Form | tst.go:111:14:111:35 | call to Get | provenance | MaD:815 | +| tst.go:111:14:111:19 | selection of Form | tst.go:111:14:111:35 | call to Get | provenance | MaD:754 | | tst.go:111:14:111:35 | call to Get | tst.go:114:25:114:87 | ...+... | provenance | | | tst.go:111:14:111:35 | call to Get | tst.go:117:26:117:88 | ...+... | provenance | | -| tst.go:122:14:122:19 | selection of Form | tst.go:122:14:122:35 | call to Get | provenance | MaD:815 | +| tst.go:122:14:122:19 | selection of Form | tst.go:122:14:122:35 | call to Get | provenance | MaD:754 | | tst.go:122:14:122:35 | call to Get | tst.go:126:23:126:126 | ...+... | provenance | | | tst.go:122:14:122:35 | call to Get | tst.go:129:24:129:127 | ...+... | provenance | | | tst.go:122:14:122:35 | call to Get | tst.go:132:27:132:122 | ...+... | provenance | | -| tst.go:123:14:123:19 | selection of Form | tst.go:123:14:123:35 | call to Get | provenance | MaD:815 | +| tst.go:123:14:123:19 | selection of Form | tst.go:123:14:123:35 | call to Get | provenance | MaD:754 | | tst.go:123:14:123:35 | call to Get | tst.go:126:23:126:126 | ...+... | provenance | | | tst.go:123:14:123:35 | call to Get | tst.go:129:24:129:127 | ...+... | provenance | | | tst.go:123:14:123:35 | call to Get | tst.go:132:27:132:122 | ...+... | provenance | | -| tst.go:140:14:140:19 | selection of Form | tst.go:140:14:140:35 | call to Get | provenance | MaD:815 | +| tst.go:140:14:140:19 | selection of Form | tst.go:140:14:140:35 | call to Get | provenance | MaD:754 | | tst.go:140:14:140:35 | call to Get | tst.go:143:27:143:89 | ...+... | provenance | | | tst.go:140:14:140:35 | call to Get | tst.go:146:28:146:90 | ...+... | provenance | | -| tst.go:151:14:151:19 | selection of Form | tst.go:151:14:151:35 | call to Get | provenance | MaD:815 | +| tst.go:151:14:151:19 | selection of Form | tst.go:151:14:151:35 | call to Get | provenance | MaD:754 | | tst.go:151:14:151:35 | call to Get | tst.go:155:33:155:136 | ...+... | provenance | | | tst.go:151:14:151:35 | call to Get | tst.go:158:18:158:121 | ...+... | provenance | | | tst.go:151:14:151:35 | call to Get | tst.go:164:31:164:126 | ...+... | provenance | | | tst.go:151:14:151:35 | call to Get | tst.go:173:21:173:116 | ...+... | provenance | | | tst.go:151:14:151:35 | call to Get | tst.go:182:27:182:122 | ...+... | provenance | | -| tst.go:152:14:152:19 | selection of Form | tst.go:152:14:152:35 | call to Get | provenance | MaD:815 | +| tst.go:152:14:152:19 | selection of Form | tst.go:152:14:152:35 | call to Get | provenance | MaD:754 | | tst.go:152:14:152:35 | call to Get | tst.go:155:33:155:136 | ...+... | provenance | | | tst.go:152:14:152:35 | call to Get | tst.go:158:18:158:121 | ...+... | provenance | | | tst.go:152:14:152:35 | call to Get | tst.go:164:31:164:126 | ...+... | provenance | | | tst.go:152:14:152:35 | call to Get | tst.go:173:21:173:116 | ...+... | provenance | | | tst.go:152:14:152:35 | call to Get | tst.go:182:27:182:122 | ...+... | provenance | | -| tst.go:193:14:193:19 | selection of Form | tst.go:193:14:193:35 | call to Get | provenance | MaD:815 | +| tst.go:193:14:193:19 | selection of Form | tst.go:193:14:193:35 | call to Get | provenance | MaD:754 | | tst.go:193:14:193:35 | call to Get | tst.go:198:23:198:85 | ...+... | provenance | | nodes | XPathInjection.go:13:14:13:19 | selection of Form | semmle.label | selection of Form | diff --git a/go/ql/test/query-tests/Security/CWE-918/RequestForgery.expected b/go/ql/test/query-tests/Security/CWE-918/RequestForgery.expected index dfe10af24ef4..f865e773b5c3 100644 --- a/go/ql/test/query-tests/Security/CWE-918/RequestForgery.expected +++ b/go/ql/test/query-tests/Security/CWE-918/RequestForgery.expected @@ -1,12 +1,12 @@ edges -| RequestForgery.go:8:12:8:34 | call to FormValue | RequestForgery.go:11:24:11:65 | ...+... | provenance | Src:MaD:743 | -| tst.go:10:13:10:35 | call to FormValue | tst.go:14:11:14:17 | tainted | provenance | Src:MaD:743 | -| tst.go:10:13:10:35 | call to FormValue | tst.go:18:12:18:18 | tainted | provenance | Src:MaD:743 | -| tst.go:10:13:10:35 | call to FormValue | tst.go:21:34:21:40 | tainted | provenance | Src:MaD:743 | -| tst.go:10:13:10:35 | call to FormValue | tst.go:24:66:24:72 | tainted | provenance | Src:MaD:743 | -| tst.go:10:13:10:35 | call to FormValue | tst.go:27:11:27:29 | ...+... | provenance | Src:MaD:743 | -| tst.go:10:13:10:35 | call to FormValue | tst.go:29:11:29:40 | ...+... | provenance | Src:MaD:743 | -| tst.go:10:13:10:35 | call to FormValue | tst.go:36:11:36:17 | tainted | provenance | Src:MaD:743 | +| RequestForgery.go:8:12:8:34 | call to FormValue | RequestForgery.go:11:24:11:65 | ...+... | provenance | Src:MaD:682 | +| tst.go:10:13:10:35 | call to FormValue | tst.go:14:11:14:17 | tainted | provenance | Src:MaD:682 | +| tst.go:10:13:10:35 | call to FormValue | tst.go:18:12:18:18 | tainted | provenance | Src:MaD:682 | +| tst.go:10:13:10:35 | call to FormValue | tst.go:21:34:21:40 | tainted | provenance | Src:MaD:682 | +| tst.go:10:13:10:35 | call to FormValue | tst.go:24:66:24:72 | tainted | provenance | Src:MaD:682 | +| tst.go:10:13:10:35 | call to FormValue | tst.go:27:11:27:29 | ...+... | provenance | Src:MaD:682 | +| tst.go:10:13:10:35 | call to FormValue | tst.go:29:11:29:40 | ...+... | provenance | Src:MaD:682 | +| tst.go:10:13:10:35 | call to FormValue | tst.go:36:11:36:17 | tainted | provenance | Src:MaD:682 | | tst.go:35:2:35:2 | definition of u [pointer] | tst.go:36:2:36:2 | u [pointer] | provenance | | | tst.go:36:2:36:2 | implicit dereference | tst.go:35:2:35:2 | definition of u [pointer] | provenance | | | tst.go:36:2:36:2 | implicit dereference | tst.go:36:2:36:2 | u | provenance | | @@ -18,15 +18,15 @@ edges | tst.go:36:11:36:17 | tainted | tst.go:36:2:36:2 | u | provenance | Config | | tst.go:36:11:36:17 | tainted | tst.go:37:11:37:11 | u | provenance | Config | | tst.go:37:11:37:11 | u | tst.go:37:11:37:20 | call to String | provenance | MaD:238 | -| websocket.go:60:21:60:31 | call to Referer | websocket.go:65:27:65:40 | untrustedInput | provenance | Src:MaD:746 | -| websocket.go:74:21:74:31 | call to Referer | websocket.go:78:36:78:49 | untrustedInput | provenance | Src:MaD:746 | -| websocket.go:88:21:88:31 | call to Referer | websocket.go:91:31:91:44 | untrustedInput | provenance | Src:MaD:746 | -| websocket.go:107:21:107:31 | call to Referer | websocket.go:110:15:110:28 | untrustedInput | provenance | Src:MaD:746 | -| websocket.go:126:21:126:31 | call to Referer | websocket.go:129:38:129:51 | untrustedInput | provenance | Src:MaD:746 | -| websocket.go:154:21:154:31 | call to Referer | websocket.go:155:31:155:44 | untrustedInput | provenance | Src:MaD:746 | -| websocket.go:160:21:160:31 | call to Referer | websocket.go:162:31:162:44 | untrustedInput | provenance | Src:MaD:746 | -| websocket.go:195:21:195:31 | call to Referer | websocket.go:197:18:197:31 | untrustedInput | provenance | Src:MaD:746 | -| websocket.go:202:21:202:31 | call to Referer | websocket.go:204:11:204:24 | untrustedInput | provenance | Src:MaD:746 | +| websocket.go:60:21:60:31 | call to Referer | websocket.go:65:27:65:40 | untrustedInput | provenance | Src:MaD:685 | +| websocket.go:74:21:74:31 | call to Referer | websocket.go:78:36:78:49 | untrustedInput | provenance | Src:MaD:685 | +| websocket.go:88:21:88:31 | call to Referer | websocket.go:91:31:91:44 | untrustedInput | provenance | Src:MaD:685 | +| websocket.go:107:21:107:31 | call to Referer | websocket.go:110:15:110:28 | untrustedInput | provenance | Src:MaD:685 | +| websocket.go:126:21:126:31 | call to Referer | websocket.go:129:38:129:51 | untrustedInput | provenance | Src:MaD:685 | +| websocket.go:154:21:154:31 | call to Referer | websocket.go:155:31:155:44 | untrustedInput | provenance | Src:MaD:685 | +| websocket.go:160:21:160:31 | call to Referer | websocket.go:162:31:162:44 | untrustedInput | provenance | Src:MaD:685 | +| websocket.go:195:21:195:31 | call to Referer | websocket.go:197:18:197:31 | untrustedInput | provenance | Src:MaD:685 | +| websocket.go:202:21:202:31 | call to Referer | websocket.go:204:11:204:24 | untrustedInput | provenance | Src:MaD:685 | nodes | RequestForgery.go:8:12:8:34 | call to FormValue | semmle.label | call to FormValue | | RequestForgery.go:11:24:11:65 | ...+... | semmle.label | ...+... | diff --git a/java/kotlin-extractor/src/main/java/com/semmle/util/process/Env.java b/java/kotlin-extractor/src/main/java/com/semmle/util/process/Env.java index 0b4b2a829fb6..2edfbb3e1647 100644 --- a/java/kotlin-extractor/src/main/java/com/semmle/util/process/Env.java +++ b/java/kotlin-extractor/src/main/java/com/semmle/util/process/Env.java @@ -50,10 +50,6 @@ public enum Var { * The location of any caches used by the toolchain, including compilation caches, trap caches, etc. */ SEMMLE_CACHE, - /** - * The location of the toolchain files, including the odasa jar, our queries etc. - */ - SEMMLE_DIST, /** * If running from a git tree, the root of the tree. */ diff --git a/java/ql/lib/change-notes/2024-07-03-env-var-semmle-dist.md b/java/ql/lib/change-notes/2024-07-03-env-var-semmle-dist.md new file mode 100644 index 000000000000..372bed1eb662 --- /dev/null +++ b/java/ql/lib/change-notes/2024-07-03-env-var-semmle-dist.md @@ -0,0 +1,4 @@ +--- +category: breaking +--- +* The Java extractor no longer supports the `SEMMLE_DIST` legacy environment variable. diff --git a/javascript/ql/lib/semmle/javascript/frameworks/helmet/Helmet.Required.Setting.model.yml b/javascript/ql/lib/semmle/javascript/frameworks/helmet/Helmet.Required.Setting.model.yml new file mode 100644 index 000000000000..ab01ec5206df --- /dev/null +++ b/javascript/ql/lib/semmle/javascript/frameworks/helmet/Helmet.Required.Setting.model.yml @@ -0,0 +1,7 @@ +extensions: + - addsTo: + pack: codeql/javascript-queries + extensible: requiredHelmetSecuritySetting + data: + - ["frameguard"] + - ["contentSecurityPolicy"] diff --git a/javascript/ql/src/Security/CWE-693/CUSTOMIZING.md b/javascript/ql/src/Security/CWE-693/CUSTOMIZING.md new file mode 100644 index 000000000000..34ae2851a855 --- /dev/null +++ b/javascript/ql/src/Security/CWE-693/CUSTOMIZING.md @@ -0,0 +1,36 @@ +# Insecure Helmet Configuration - customizations + +You can extend the required [Helmet security settings](https://helmetjs.github.io/) using [data extensions](https://codeql.github.com/docs/codeql-language-guides/customizing-library-models-for-javascript/) in a [CodeQL model pack](https://docs.github.com/en/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/creating-and-working-with-codeql-packs#creating-a-codeql-model-pack). + +They are defaulted to just `frameguard` and `contentSecurityPolicy`, but you can add more using this method, to require them not to be set to `false` (which explicitly disables them) in the Helmet configuration. + +For example, this YAML model can be used inside a CodeQL model pack to require `frameguard` and `contentSecurityPolicy`: + +```yaml +extensions: + - addsTo: + pack: codeql/javascript-all + extensible: requiredHelmetSecuritySetting + data: + - ["frameguard"] + - ["contentSecurityPolicy"] +``` + +Note: Using `frameguard` and `contentSecurityPolicy` is an example: the query already enforces these, so it is not necessary to add it with your own data extension. + +A suitable [model pack](https://docs.github.com/en/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/creating-and-working-with-codeql-packs#creating-a-codeql-model-pack) might be: + +```yaml +name: my-org/javascript-helmet-insecure-config-model-pack +version: 1.0.0 +extensionTargets: + codeql/java-all: '*' +dataExtensions: + - models/**/*.yml +``` + +## References + +- [Helmet security settings](https://helmetjs.github.io/) +- [Customizing library models for javascript](https://codeql.github.com/docs/codeql-language-guides/customizing-library-models-for-javascript/) +- [Creating and working with CodeQL packs](https://docs.github.com/en/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/creating-and-working-with-codeql-packs#creating-a-codeql-model-pack) diff --git a/javascript/ql/src/Security/CWE-693/InsecureHelmet.qhelp b/javascript/ql/src/Security/CWE-693/InsecureHelmet.qhelp new file mode 100644 index 000000000000..c2cacbdf2faf --- /dev/null +++ b/javascript/ql/src/Security/CWE-693/InsecureHelmet.qhelp @@ -0,0 +1,71 @@ + + + +

+ Helmet is a collection of middleware functions for securing Express apps. It sets various HTTP headers to guard against common web vulnerabilities. + + This query detects Helmet misconfigurations that can lead to security vulnerabilities, specifically: +

+ +
    +
  • Disabling frame protection
  • +
  • Disabling Content Security Policy
  • +
+ +

+ Content Security Policy (CSP) helps spot and prevent injection attacks such as Cross-Site Scripting (XSS). + + Removing frame protections exposes an application to attacks such as clickjacking, where an attacker can trick a user into clicking on a button or link on a targeted page when they intended to click on the page carrying out the attack. +

+ +

+ Users of the query can extend the set of required Helmet features by adding additional checks for them, using CodeQL data extensions in a CodeQL model pack. See CUSTOMIZING.md in the query source for more information. +

+ +
+ +

+ To help mitigate these vulnerabilities, ensure that the following Helmet functions are not disabled, and are configured appropriately to your application: +

+ +
    +
  • frameguard
  • +
  • contentSecurityPolicy
  • +
+
+ +

+ The following code snippet demonstrates Helmet configured in an insecure manner: +

+ + + +

+ In this example, the defaults are used, which enables frame protection and a default Content Security Policy. +

+ + + +

+ You can also enable a custom Content Security Policy by passing an object to the contentSecurityPolicy key. For example, taken from the Helmet docs: +

+ + + +
+ +
  • + helmet.js website +
  • +
  • + Content Security Policy (CSP) | MDN +
  • +
  • + Mozilla Web Security Guidelines +
  • +
  • + Protect against clickjacking | MDN +
  • + +
    +
    \ No newline at end of file diff --git a/javascript/ql/src/Security/CWE-693/InsecureHelmet.ql b/javascript/ql/src/Security/CWE-693/InsecureHelmet.ql new file mode 100644 index 000000000000..8f837669ffc3 --- /dev/null +++ b/javascript/ql/src/Security/CWE-693/InsecureHelmet.ql @@ -0,0 +1,47 @@ +/** + * @name Insecure configuration of Helmet security middleware + * @description The Helmet middleware is used to set security-related HTTP headers in Express applications. This query finds instances where the middleware is configured with important security features disabled. + * @kind problem + * @problem.severity error + * @security-severity 7.0 + * @precision high + * @id js/insecure-helmet-configuration + * @tags security + * external/cwe/cwe-693 + * external/cwe/cwe-1021 + */ + +import javascript +import DataFlow +import semmle.javascript.frameworks.ExpressModules + +class HelmetProperty extends DataFlow::Node instanceof DataFlow::PropWrite { + ExpressLibraries::HelmetRouteHandler helmet; + + HelmetProperty() { + this = helmet.(DataFlow::CallNode).getAnArgument().getALocalSource().getAPropertyWrite() + } + + ExpressLibraries::HelmetRouteHandler getHelmet() { result = helmet } + + predicate isFalse() { DataFlow::PropWrite.super.getRhs().mayHaveBooleanValue(false) } + + string getName() { result = DataFlow::PropWrite.super.getPropertyName() } + + predicate isImportantSecuritySetting() { + // read from data extensions to allow enforcing custom settings + // defaults are located in javascript/ql/lib/semmle/frameworks/helmet/Helmet.Required.Setting.model.yml + requiredHelmetSecuritySetting(this.getName()) + } +} + +extensible predicate requiredHelmetSecuritySetting(string name); + +from HelmetProperty helmetProperty, ExpressLibraries::HelmetRouteHandler helmet +where + helmetProperty.isFalse() and + helmetProperty.isImportantSecuritySetting() and + helmetProperty.getHelmet() = helmet +select helmet, + "Helmet security middleware, configured with security setting $@ set to 'false', which disables enforcing that feature.", + helmetProperty, helmetProperty.getName() diff --git a/javascript/ql/src/Security/CWE-693/examples/helmet_custom.js b/javascript/ql/src/Security/CWE-693/examples/helmet_custom.js new file mode 100644 index 000000000000..5b9e25033f22 --- /dev/null +++ b/javascript/ql/src/Security/CWE-693/examples/helmet_custom.js @@ -0,0 +1,10 @@ +app.use( + helmet({ + contentSecurityPolicy: { + directives: { + "script-src": ["'self'", "example.com"], + "style-src": null, + }, + }, + }) +); \ No newline at end of file diff --git a/javascript/ql/src/Security/CWE-693/examples/helmet_default.js b/javascript/ql/src/Security/CWE-693/examples/helmet_default.js new file mode 100644 index 000000000000..98936520dcb7 --- /dev/null +++ b/javascript/ql/src/Security/CWE-693/examples/helmet_default.js @@ -0,0 +1 @@ +app.use(helmet()); \ No newline at end of file diff --git a/javascript/ql/src/Security/CWE-693/examples/helmet_insecure.js b/javascript/ql/src/Security/CWE-693/examples/helmet_insecure.js new file mode 100644 index 000000000000..62852b9f4823 --- /dev/null +++ b/javascript/ql/src/Security/CWE-693/examples/helmet_insecure.js @@ -0,0 +1,6 @@ +const helmet = require('helmet'); + +app.use(helmet({ + frameguard: false, + contentSecurityPolicy: false +})); \ No newline at end of file diff --git a/javascript/ql/src/change-notes/2024-06-19-insecure-helmet-config.md b/javascript/ql/src/change-notes/2024-06-19-insecure-helmet-config.md new file mode 100644 index 000000000000..bee7ccb8fb94 --- /dev/null +++ b/javascript/ql/src/change-notes/2024-06-19-insecure-helmet-config.md @@ -0,0 +1,4 @@ +--- +category: newQuery +--- +* Added a new query, `js/insecure-helmet-configuration`, to detect instances where Helmet middleware is configured with important security features disabled. diff --git a/javascript/ql/test/query-tests/Security/CWE-693/InsecureHelmet.expected b/javascript/ql/test/query-tests/Security/CWE-693/InsecureHelmet.expected new file mode 100644 index 000000000000..2c9407136aa4 --- /dev/null +++ b/javascript/ql/test/query-tests/Security/CWE-693/InsecureHelmet.expected @@ -0,0 +1,2 @@ +| InsecureHelmetBad.js:6:9:9:2 | helmet( ... uard\\n}) | Helmet security middleware, configured with security setting $@ set to 'false', which disables enforcing that feature. | InsecureHelmetBad.js:7:5:7:32 | content ... : false | contentSecurityPolicy | +| InsecureHelmetBad.js:6:9:9:2 | helmet( ... uard\\n}) | Helmet security middleware, configured with security setting $@ set to 'false', which disables enforcing that feature. | InsecureHelmetBad.js:8:5:8:21 | frameguard: false | frameguard | diff --git a/javascript/ql/test/query-tests/Security/CWE-693/InsecureHelmet.qlref b/javascript/ql/test/query-tests/Security/CWE-693/InsecureHelmet.qlref new file mode 100644 index 000000000000..9212b2674fcf --- /dev/null +++ b/javascript/ql/test/query-tests/Security/CWE-693/InsecureHelmet.qlref @@ -0,0 +1 @@ +Security/CWE-693/InsecureHelmet.ql \ No newline at end of file diff --git a/javascript/ql/test/query-tests/Security/CWE-693/InsecureHelmetBad.js b/javascript/ql/test/query-tests/Security/CWE-693/InsecureHelmetBad.js new file mode 100644 index 000000000000..d9257999ef0b --- /dev/null +++ b/javascript/ql/test/query-tests/Security/CWE-693/InsecureHelmetBad.js @@ -0,0 +1,17 @@ +const express = require("express"); +const helmet = require("helmet"); + +const app = express(); + +app.use(helmet({ + contentSecurityPolicy: false, // BAD: switch off default CSP + frameguard: false // BAD: switch off default frameguard +})); + +app.get("/", (req, res) => { + res.send("Hello, world!"); +}); + +app.listen(3000, () => { + console.log("App is listening on port 3000"); +}); diff --git a/javascript/ql/test/query-tests/Security/CWE-693/InsecureHelmetGood.js b/javascript/ql/test/query-tests/Security/CWE-693/InsecureHelmetGood.js new file mode 100644 index 000000000000..609c1fc2763c --- /dev/null +++ b/javascript/ql/test/query-tests/Security/CWE-693/InsecureHelmetGood.js @@ -0,0 +1,14 @@ +const express = require("express"); +const helmet = require("helmet"); + +const app = express(); + +app.use(helmet()); // GOOD: use the defaults + +app.get("/", (req, res) => { + res.send("Hello, world!"); +}); + +app.listen(3000, () => { + console.log("App is listening on port 3000"); +}); diff --git a/python/ql/lib/change-notes/2024-06-24-cookie-header-writes.md b/python/ql/lib/change-notes/2024-06-24-cookie-header-writes.md new file mode 100644 index 000000000000..583e0f44c059 --- /dev/null +++ b/python/ql/lib/change-notes/2024-06-24-cookie-header-writes.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Additional modelling has been added to detect cookie writes from direct writes to the `Set-Cookie` header have been added for several web frameworks. \ No newline at end of file diff --git a/python/ql/lib/semmle/python/Concepts.qll b/python/ql/lib/semmle/python/Concepts.qll index 029f13ee0c2a..20578e26960f 100644 --- a/python/ql/lib/semmle/python/Concepts.qll +++ b/python/ql/lib/semmle/python/Concepts.qll @@ -1134,6 +1134,54 @@ module Http { } } + /** A key-value pair in a literal for a bulk header update, considered as a single header update. */ + private class HeaderBulkWriteDictLiteral extends Http::Server::ResponseHeaderWrite::Range instanceof Http::Server::ResponseHeaderBulkWrite + { + KeyValuePair item; + + HeaderBulkWriteDictLiteral() { + exists(Dict dict | DataFlow::localFlow(DataFlow::exprNode(dict), super.getBulkArg()) | + item = dict.getAnItem() + ) + } + + override DataFlow::Node getNameArg() { result.asExpr() = item.getKey() } + + override DataFlow::Node getValueArg() { result.asExpr() = item.getValue() } + + override predicate nameAllowsNewline() { + Http::Server::ResponseHeaderBulkWrite.super.nameAllowsNewline() + } + + override predicate valueAllowsNewline() { + Http::Server::ResponseHeaderBulkWrite.super.valueAllowsNewline() + } + } + + /** A tuple in a list for a bulk header update, considered as a single header update. */ + private class HeaderBulkWriteListLiteral extends Http::Server::ResponseHeaderWrite::Range instanceof Http::Server::ResponseHeaderBulkWrite + { + Tuple item; + + HeaderBulkWriteListLiteral() { + exists(List list | DataFlow::localFlow(DataFlow::exprNode(list), super.getBulkArg()) | + item = list.getAnElt() + ) + } + + override DataFlow::Node getNameArg() { result.asExpr() = item.getElt(0) } + + override DataFlow::Node getValueArg() { result.asExpr() = item.getElt(1) } + + override predicate nameAllowsNewline() { + Http::Server::ResponseHeaderBulkWrite.super.nameAllowsNewline() + } + + override predicate valueAllowsNewline() { + Http::Server::ResponseHeaderBulkWrite.super.valueAllowsNewline() + } + } + /** * A data-flow node that sets a cookie in an HTTP response. * @@ -1186,6 +1234,27 @@ module Http { } } + /** A write to a `Set-Cookie` header that sets a cookie directly. */ + private class CookieHeaderWrite extends CookieWrite::Range instanceof Http::Server::ResponseHeaderWrite + { + CookieHeaderWrite() { + exists(StringLiteral str | + str.getText().toLowerCase() = "set-cookie" and + DataFlow::exprNode(str) + .(DataFlow::LocalSourceNode) + .flowsTo(this.(Http::Server::ResponseHeaderWrite).getNameArg()) + ) + } + + override DataFlow::Node getNameArg() { none() } + + override DataFlow::Node getHeaderArg() { + result = this.(Http::Server::ResponseHeaderWrite).getValueArg() + } + + override DataFlow::Node getValueArg() { none() } + } + /** * A data-flow node that enables or disables Cross-site request forgery protection * in a global manner. diff --git a/python/ql/lib/semmle/python/frameworks/Aiohttp.qll b/python/ql/lib/semmle/python/frameworks/Aiohttp.qll index 78d269c31d31..517b309594aa 100644 --- a/python/ql/lib/semmle/python/frameworks/Aiohttp.qll +++ b/python/ql/lib/semmle/python/frameworks/Aiohttp.qll @@ -706,6 +706,33 @@ module AiohttpWebModel { override DataFlow::Node getValueArg() { result = value } } + + /** + * A dict-like write to an item of the `headers` attribute on a HTTP response, such as + * `response.headers[name] = value`. + */ + class AiohttpResponseHeaderSubscriptWrite extends Http::Server::ResponseHeaderWrite::Range { + DataFlow::Node index; + DataFlow::Node value; + + AiohttpResponseHeaderSubscriptWrite() { + exists(API::Node i | + value = aiohttpResponseInstance().getMember("headers").getSubscriptAt(i).asSink() and + index = i.asSink() and + // To give `this` a value, we need to choose between either LHS or RHS, + // and just go with the RHS as it is readily available + this = value + ) + } + + override DataFlow::Node getNameArg() { result = index } + + override DataFlow::Node getValueArg() { result = value } + + override predicate nameAllowsNewline() { none() } + + override predicate valueAllowsNewline() { none() } + } } /** diff --git a/python/ql/lib/semmle/python/frameworks/Django.qll b/python/ql/lib/semmle/python/frameworks/Django.qll index 064dba57f92a..b3b027e48ffe 100644 --- a/python/ql/lib/semmle/python/frameworks/Django.qll +++ b/python/ql/lib/semmle/python/frameworks/Django.qll @@ -2239,6 +2239,71 @@ module PrivateDjango { override DataFlow::Node getValueArg() { result = value } } + + /** + * A dict-like write to an item of the `headers` attribute on a HTTP response, such as + * `response.headers[name] = value`. + */ + class DjangoResponseHeaderSubscriptWrite extends Http::Server::ResponseHeaderWrite::Range { + DataFlow::Node index; + DataFlow::Node value; + + DjangoResponseHeaderSubscriptWrite() { + exists(SubscriptNode subscript, DataFlow::AttrRead headerLookup | + // To give `this` a value, we need to choose between either LHS or RHS, + // and just go with the LHS + this.asCfgNode() = subscript + | + headerLookup + .accesses(DjangoImpl::DjangoHttp::Response::HttpResponse::instance(), "headers") and + exists(DataFlow::Node subscriptObj | + subscriptObj.asCfgNode() = subscript.getObject() + | + headerLookup.flowsTo(subscriptObj) + ) and + value.asCfgNode() = subscript.(DefinitionNode).getValue() and + index.asCfgNode() = subscript.getIndex() + ) + } + + override DataFlow::Node getNameArg() { result = index } + + override DataFlow::Node getValueArg() { result = value } + + override predicate nameAllowsNewline() { none() } + + override predicate valueAllowsNewline() { none() } + } + + /** + * A dict-like write to an item of an HTTP response, which is treated as a header write, + * such as `response[headerName] = value` + */ + class DjangoResponseSubscriptWrite extends Http::Server::ResponseHeaderWrite::Range { + DataFlow::Node index; + DataFlow::Node value; + + DjangoResponseSubscriptWrite() { + exists(SubscriptNode subscript | + // To give `this` a value, we need to choose between either LHS or RHS, + // and just go with the LHS + this.asCfgNode() = subscript + | + subscript.getObject() = + DjangoImpl::DjangoHttp::Response::HttpResponse::instance().asCfgNode() and + value.asCfgNode() = subscript.(DefinitionNode).getValue() and + index.asCfgNode() = subscript.getIndex() + ) + } + + override DataFlow::Node getNameArg() { result = index } + + override DataFlow::Node getValueArg() { result = value } + + override predicate nameAllowsNewline() { none() } + + override predicate valueAllowsNewline() { none() } + } } } diff --git a/python/ql/lib/semmle/python/frameworks/FastApi.qll b/python/ql/lib/semmle/python/frameworks/FastApi.qll index 8c958e9343db..0793b4b7d6ab 100644 --- a/python/ql/lib/semmle/python/frameworks/FastApi.qll +++ b/python/ql/lib/semmle/python/frameworks/FastApi.qll @@ -361,28 +361,59 @@ module FastApi { } /** - * A call to `append` on a `headers` of a FastAPI Response, with the `Set-Cookie` - * header-key. + * A call to `append` on a `headers` of a FastAPI Response. */ - private class HeadersAppendCookie extends Http::Server::CookieWrite::Range, + private class HeadersAppend extends Http::Server::ResponseHeaderWrite::Range, DataFlow::MethodCallNode { - HeadersAppendCookie() { - exists(DataFlow::AttrRead headers, DataFlow::Node keyArg | + HeadersAppend() { + exists(DataFlow::AttrRead headers | headers.accesses(instance(), "headers") and - this.calls(headers, "append") and - keyArg in [this.getArg(0), this.getArgByName("key")] and - keyArg.getALocalSource().asExpr().(StringLiteral).getText().toLowerCase() = "set-cookie" + this.calls(headers, "append") ) } - override DataFlow::Node getHeaderArg() { + override DataFlow::Node getNameArg() { result = [this.getArg(0), this.getArgByName("key")] } + + override DataFlow::Node getValueArg() { result in [this.getArg(1), this.getArgByName("value")] } - override DataFlow::Node getNameArg() { none() } + override predicate nameAllowsNewline() { none() } + + override predicate valueAllowsNewline() { none() } + } + + /** + * A dict-like write to an item of the `headers` attribute on a HTTP response, such as + * `response.headers[name] = value`. + */ + class HeaderSubscriptWrite extends Http::Server::ResponseHeaderWrite::Range { + DataFlow::Node index; + DataFlow::Node value; + + HeaderSubscriptWrite() { + exists(SubscriptNode subscript, DataFlow::AttrRead headerLookup | + // To give `this` a value, we need to choose between either LHS or RHS, + // and just go with the LHS + this.asCfgNode() = subscript + | + headerLookup.accesses(instance(), "headers") and + exists(DataFlow::Node subscriptObj | subscriptObj.asCfgNode() = subscript.getObject() | + headerLookup.flowsTo(subscriptObj) + ) and + value.asCfgNode() = subscript.(DefinitionNode).getValue() and + index.asCfgNode() = subscript.getIndex() + ) + } + + override DataFlow::Node getNameArg() { result = index } + + override DataFlow::Node getValueArg() { result = value } + + override predicate nameAllowsNewline() { none() } - override DataFlow::Node getValueArg() { none() } + override predicate valueAllowsNewline() { none() } } } } diff --git a/python/ql/lib/semmle/python/frameworks/Tornado.qll b/python/ql/lib/semmle/python/frameworks/Tornado.qll index 1bd406032962..214f2fb9bad3 100644 --- a/python/ql/lib/semmle/python/frameworks/Tornado.qll +++ b/python/ql/lib/semmle/python/frameworks/Tornado.qll @@ -63,6 +63,50 @@ module Tornado { override string getAsyncMethodName() { none() } } + + /** + * A dict-like write to an item of an `HTTPHeaders` object. + */ + private class TornadoHeaderSubscriptWrite extends Http::Server::ResponseHeaderWrite::Range { + DataFlow::Node index; + DataFlow::Node value; + + TornadoHeaderSubscriptWrite() { + exists(SubscriptNode subscript | + subscript.getObject() = instance().asCfgNode() and + value.asCfgNode() = subscript.(DefinitionNode).getValue() and + index.asCfgNode() = subscript.getIndex() and + this.asCfgNode() = subscript + ) + } + + override DataFlow::Node getNameArg() { result = index } + + override DataFlow::Node getValueArg() { result = value } + + override predicate nameAllowsNewline() { none() } + + override predicate valueAllowsNewline() { none() } + } + + /** + * A call to `HTTPHeaders.add`. + */ + private class TornadoHeadersAppendCall extends Http::Server::ResponseHeaderWrite::Range, + DataFlow::MethodCallNode + { + TornadoHeadersAppendCall() { this.calls(instance(), "add") } + + override DataFlow::Node getNameArg() { result = [this.getArg(0), this.getArgByName("name")] } + + override DataFlow::Node getValueArg() { + result in [this.getArg(1), this.getArgByName("value")] + } + + override predicate nameAllowsNewline() { none() } + + override predicate valueAllowsNewline() { none() } + } } // --------------------------------------------------------------------------- @@ -209,6 +253,25 @@ module Tornado { this.(DataFlow::AttrRead).getAttributeName() = "request" } } + + /** A call to `RequestHandler.set_header` or `RequestHandler.add_header` */ + private class TornadoSetHeaderCall extends Http::Server::ResponseHeaderWrite::Range, + DataFlow::MethodCallNode + { + TornadoSetHeaderCall() { this.calls(instance(), ["set_header", "add_header"]) } + + override DataFlow::Node getNameArg() { + result = [this.getArg(0), this.getArgByName("name")] + } + + override DataFlow::Node getValueArg() { + result in [this.getArg(1), this.getArgByName("value")] + } + + override predicate nameAllowsNewline() { none() } + + override predicate valueAllowsNewline() { none() } + } } /** diff --git a/python/ql/lib/semmle/python/security/dataflow/HttpHeaderInjectionCustomizations.qll b/python/ql/lib/semmle/python/security/dataflow/HttpHeaderInjectionCustomizations.qll index b3fe233629e4..e529d3f29e0f 100644 --- a/python/ql/lib/semmle/python/security/dataflow/HttpHeaderInjectionCustomizations.qll +++ b/python/ql/lib/semmle/python/security/dataflow/HttpHeaderInjectionCustomizations.qll @@ -51,56 +51,6 @@ module HttpHeaderInjection { } } - /** A key-value pair in a literal for a bulk header update, considered as a single header update. */ - // TODO: We could instead consider bulk writes as sinks with an implicit read step of DictionaryKey/DictionaryValue content as needed. - private class HeaderBulkWriteDictLiteral extends Http::Server::ResponseHeaderWrite::Range instanceof Http::Server::ResponseHeaderBulkWrite - { - KeyValuePair item; - - HeaderBulkWriteDictLiteral() { - exists(Dict dict | DataFlow::localFlow(DataFlow::exprNode(dict), super.getBulkArg()) | - item = dict.getAnItem() - ) - } - - override DataFlow::Node getNameArg() { result.asExpr() = item.getKey() } - - override DataFlow::Node getValueArg() { result.asExpr() = item.getValue() } - - override predicate nameAllowsNewline() { - Http::Server::ResponseHeaderBulkWrite.super.nameAllowsNewline() - } - - override predicate valueAllowsNewline() { - Http::Server::ResponseHeaderBulkWrite.super.valueAllowsNewline() - } - } - - /** A tuple in a list for a bulk header update, considered as a single header update. */ - // TODO: We could instead consider bulk writes as sinks with implicit read steps as needed. - private class HeaderBulkWriteListLiteral extends Http::Server::ResponseHeaderWrite::Range instanceof Http::Server::ResponseHeaderBulkWrite - { - Tuple item; - - HeaderBulkWriteListLiteral() { - exists(List list | DataFlow::localFlow(DataFlow::exprNode(list), super.getBulkArg()) | - item = list.getAnElt() - ) - } - - override DataFlow::Node getNameArg() { result.asExpr() = item.getElt(0) } - - override DataFlow::Node getValueArg() { result.asExpr() = item.getElt(1) } - - override predicate nameAllowsNewline() { - Http::Server::ResponseHeaderBulkWrite.super.nameAllowsNewline() - } - - override predicate valueAllowsNewline() { - Http::Server::ResponseHeaderBulkWrite.super.valueAllowsNewline() - } - } - /** * A call to replace line breaks, considered as a sanitizer. */ diff --git a/python/ql/src/experimental/Security/CWE-094/Js2Py.qhelp b/python/ql/src/experimental/Security/CWE-094/Js2Py.qhelp new file mode 100644 index 000000000000..6be0b43d1a1f --- /dev/null +++ b/python/ql/src/experimental/Security/CWE-094/Js2Py.qhelp @@ -0,0 +1,24 @@ + + + +

    + Passing untrusted inputs to a JavaScript interpreter like `Js2Py` can lead to arbitrary + code execution. +

    +
    + +

    This vulnerability can be prevented either by preventing an untrusted user input to flow + to an eval_js call. Or, the impact of this vulnerability can be + significantly reduced by disabling imports from the interepreted code (note that in a + comment the author of the library highlights that Js2Py is still insecure with this + option).

    +
    + +

    In the example below, the Javascript code being evaluated is controlled by the user and + hence leads to arbitrary code execution.

    + +

    This can be fixed by disabling imports before evaluating the user passed buffer.

    + +
    +
    diff --git a/python/ql/src/experimental/Security/CWE-094/Js2Py.ql b/python/ql/src/experimental/Security/CWE-094/Js2Py.ql new file mode 100644 index 000000000000..5dc160077873 --- /dev/null +++ b/python/ql/src/experimental/Security/CWE-094/Js2Py.ql @@ -0,0 +1,38 @@ +/** + * @name JavaScript code execution. + * @description Passing user supplied arguments to a Javascript to Python translation engine such as Js2Py can lead to remote code execution. + * @problem.severity error + * @security-severity 9.3 + * @precision high + * @kind path-problem + * @id py/js2py-rce + * @tags security + * experimental + * external/cwe/cwe-94 + */ + +import python +import semmle.python.ApiGraphs +import semmle.python.dataflow.new.TaintTracking +import semmle.python.dataflow.new.RemoteFlowSources +import semmle.python.Concepts + +module Js2PyFlowConfig implements DataFlow::ConfigSig { + predicate isSource(DataFlow::Node node) { node instanceof RemoteFlowSource } + + predicate isSink(DataFlow::Node node) { + API::moduleImport("js2py").getMember(["eval_js", "eval_js6", "EvalJs"]).getACall().getArg(_) = + node + } +} + +module Js2PyFlow = TaintTracking::Global; + +import Js2PyFlow::PathGraph + +from Js2PyFlow::PathNode source, Js2PyFlow::PathNode sink +where + Js2PyFlow::flowPath(source, sink) and + not exists(API::moduleImport("js2py").getMember("disable_pyimport").getACall()) +select sink, source, sink, "This input to Js2Py depends on a $@.", source.getNode(), + "user-provided value" diff --git a/python/ql/src/experimental/Security/CWE-094/Js2pyBad.py b/python/ql/src/experimental/Security/CWE-094/Js2pyBad.py new file mode 100644 index 000000000000..69791a424628 --- /dev/null +++ b/python/ql/src/experimental/Security/CWE-094/Js2pyBad.py @@ -0,0 +1,4 @@ +@bp.route("/bad") +def bad(): + jk = flask.request.form["jk"] + jk = eval_js(f"{jk} f()") diff --git a/python/ql/src/experimental/Security/CWE-094/Js2pyGood.py b/python/ql/src/experimental/Security/CWE-094/Js2pyGood.py new file mode 100644 index 000000000000..dd034d48bb30 --- /dev/null +++ b/python/ql/src/experimental/Security/CWE-094/Js2pyGood.py @@ -0,0 +1,6 @@ +@bp.route("/good") +def good(): + # disable python imports to prevent execution of malicious code + js2py.disable_pyimport() + jk = flask.request.form["jk"] + jk = eval_js(f"{jk} f()") diff --git a/python/ql/test/experimental/meta/ConceptsTest.qll b/python/ql/test/experimental/meta/ConceptsTest.qll index b552758582b3..473c7c177c7e 100644 --- a/python/ql/test/experimental/meta/ConceptsTest.qll +++ b/python/ql/test/experimental/meta/ConceptsTest.qll @@ -323,8 +323,8 @@ module HttpResponseHeaderWriteTest implements TestSig { string getARelevantTag() { result = [ - "headerWriteNameUnsanitized", "headerWriteNameSanitized", "headerWriteValueUnsanitized", - "headerWriteValueSanitized", "headerWriteBulk" + "headerWriteNameUnsanitized", "headerWriteName", "headerWriteValueUnsanitized", + "headerWriteValue", "headerWriteBulk", "headerWriteBulkUnsanitized" ] } @@ -339,7 +339,7 @@ module HttpResponseHeaderWriteTest implements TestSig { ( if write.nameAllowsNewline() then tag = "headerWriteNameUnsanitized" - else tag = "headerWriteNameSanitized" + else tag = "headerWriteName" ) and value = prettyNodeForInlineTest(node) or @@ -347,7 +347,7 @@ module HttpResponseHeaderWriteTest implements TestSig { ( if write.valueAllowsNewline() then tag = "headerWriteValueUnsanitized" - else tag = "headerWriteValueSanitized" + else tag = "headerWriteValue" ) and value = prettyNodeForInlineTest(node) ) @@ -360,19 +360,20 @@ module HttpResponseHeaderWriteTest implements TestSig { tag = "headerWriteBulk" and value = prettyNodeForInlineTest(node) or + tag = "headerWriteBulkUnsanitized" and ( - if write.nameAllowsNewline() - then tag = "headerWriteNameUnsanitized" - else tag = "headerWriteNameSanitized" - ) and - value = "" - or - ( - if write.valueAllowsNewline() - then tag = "headerWriteValueUnsanitized" - else tag = "headerWriteValueSanitized" - ) and - value = "" + write.nameAllowsNewline() and + not write.valueAllowsNewline() and + value = "name" + or + not write.nameAllowsNewline() and + write.valueAllowsNewline() and + value = "value" + or + write.nameAllowsNewline() and + write.valueAllowsNewline() and + value = "name,value" + ) ) ) ) diff --git a/python/ql/test/experimental/query-tests/Security/CWE-094/Js2Py.expected b/python/ql/test/experimental/query-tests/Security/CWE-094/Js2Py.expected new file mode 100644 index 000000000000..7798cdda143c --- /dev/null +++ b/python/ql/test/experimental/query-tests/Security/CWE-094/Js2Py.expected @@ -0,0 +1,10 @@ +edges +| Js2PyTest.py:9:5:9:6 | ControlFlowNode for jk | Js2PyTest.py:10:18:10:28 | ControlFlowNode for Fstring | provenance | | +| Js2PyTest.py:9:10:9:22 | ControlFlowNode for Attribute | Js2PyTest.py:9:5:9:6 | ControlFlowNode for jk | provenance | AdditionalTaintStep | +nodes +| Js2PyTest.py:9:5:9:6 | ControlFlowNode for jk | semmle.label | ControlFlowNode for jk | +| Js2PyTest.py:9:10:9:22 | ControlFlowNode for Attribute | semmle.label | ControlFlowNode for Attribute | +| Js2PyTest.py:10:18:10:28 | ControlFlowNode for Fstring | semmle.label | ControlFlowNode for Fstring | +subpaths +#select +| Js2PyTest.py:10:18:10:28 | ControlFlowNode for Fstring | Js2PyTest.py:9:10:9:22 | ControlFlowNode for Attribute | Js2PyTest.py:10:18:10:28 | ControlFlowNode for Fstring | This input to Js2Py depends on a $@. | Js2PyTest.py:9:10:9:22 | ControlFlowNode for Attribute | user-provided value | diff --git a/python/ql/test/experimental/query-tests/Security/CWE-094/Js2Py.qlref b/python/ql/test/experimental/query-tests/Security/CWE-094/Js2Py.qlref new file mode 100644 index 000000000000..457bfe2aacca --- /dev/null +++ b/python/ql/test/experimental/query-tests/Security/CWE-094/Js2Py.qlref @@ -0,0 +1 @@ +experimental/Security/CWE-094/Js2Py.ql diff --git a/python/ql/test/experimental/query-tests/Security/CWE-094/Js2PyTest.py b/python/ql/test/experimental/query-tests/Security/CWE-094/Js2PyTest.py new file mode 100644 index 000000000000..f7aae16a9eed --- /dev/null +++ b/python/ql/test/experimental/query-tests/Security/CWE-094/Js2PyTest.py @@ -0,0 +1,10 @@ + +import flask +from js2py import eval_js, disable_pyimport + +bp = flask.Blueprint("app", __name__, url_prefix="/") + +@bp.route("/bad") +def bad(): + jk = flask.request.form["jk"] + jk = eval_js(f"{jk} f()") \ No newline at end of file diff --git a/python/ql/test/experimental/query-tests/Security/CWE-614/CookieInjection.expected b/python/ql/test/experimental/query-tests/Security/CWE-614/CookieInjection.expected index 1b3120c8546c..80dcbae21773 100644 --- a/python/ql/test/experimental/query-tests/Security/CWE-614/CookieInjection.expected +++ b/python/ql/test/experimental/query-tests/Security/CWE-614/CookieInjection.expected @@ -1,4 +1,6 @@ edges +| django_bad.py:27:33:27:67 | ControlFlowNode for Attribute() | django_bad.py:27:30:27:124 | ControlFlowNode for Fstring | provenance | | +| django_bad.py:27:71:27:106 | ControlFlowNode for Attribute() | django_bad.py:27:30:27:124 | ControlFlowNode for Fstring | provenance | | | flask_bad.py:1:26:1:32 | ControlFlowNode for ImportMember | flask_bad.py:1:26:1:32 | ControlFlowNode for request | provenance | | | flask_bad.py:1:26:1:32 | ControlFlowNode for request | flask_bad.py:24:21:24:27 | ControlFlowNode for request | provenance | | | flask_bad.py:1:26:1:32 | ControlFlowNode for request | flask_bad.py:24:49:24:55 | ControlFlowNode for request | provenance | | @@ -12,6 +14,9 @@ edges nodes | django_bad.py:19:21:19:55 | ControlFlowNode for Attribute() | semmle.label | ControlFlowNode for Attribute() | | django_bad.py:20:21:20:56 | ControlFlowNode for Attribute() | semmle.label | ControlFlowNode for Attribute() | +| django_bad.py:27:30:27:124 | ControlFlowNode for Fstring | semmle.label | ControlFlowNode for Fstring | +| django_bad.py:27:33:27:67 | ControlFlowNode for Attribute() | semmle.label | ControlFlowNode for Attribute() | +| django_bad.py:27:71:27:106 | ControlFlowNode for Attribute() | semmle.label | ControlFlowNode for Attribute() | | flask_bad.py:1:26:1:32 | ControlFlowNode for ImportMember | semmle.label | ControlFlowNode for ImportMember | | flask_bad.py:1:26:1:32 | ControlFlowNode for request | semmle.label | ControlFlowNode for request | | flask_bad.py:24:21:24:27 | ControlFlowNode for request | semmle.label | ControlFlowNode for request | @@ -29,6 +34,12 @@ subpaths | django_bad.py:20:21:20:56 | ControlFlowNode for Attribute() | django_bad.py:20:21:20:56 | ControlFlowNode for Attribute() | django_bad.py:20:21:20:56 | ControlFlowNode for Attribute() | Cookie is constructed from a $@,and its httponly flag is not properly set. | django_bad.py:20:21:20:56 | ControlFlowNode for Attribute() | user-supplied input | | django_bad.py:20:21:20:56 | ControlFlowNode for Attribute() | django_bad.py:20:21:20:56 | ControlFlowNode for Attribute() | django_bad.py:20:21:20:56 | ControlFlowNode for Attribute() | Cookie is constructed from a $@,and its samesite flag is not properly set. | django_bad.py:20:21:20:56 | ControlFlowNode for Attribute() | user-supplied input | | django_bad.py:20:21:20:56 | ControlFlowNode for Attribute() | django_bad.py:20:21:20:56 | ControlFlowNode for Attribute() | django_bad.py:20:21:20:56 | ControlFlowNode for Attribute() | Cookie is constructed from a $@,and its secure flag is not properly set. | django_bad.py:20:21:20:56 | ControlFlowNode for Attribute() | user-supplied input | +| django_bad.py:27:30:27:124 | ControlFlowNode for Fstring | django_bad.py:27:33:27:67 | ControlFlowNode for Attribute() | django_bad.py:27:30:27:124 | ControlFlowNode for Fstring | Cookie is constructed from a $@,and its httponly flag is not properly set. | django_bad.py:27:33:27:67 | ControlFlowNode for Attribute() | user-supplied input | +| django_bad.py:27:30:27:124 | ControlFlowNode for Fstring | django_bad.py:27:33:27:67 | ControlFlowNode for Attribute() | django_bad.py:27:30:27:124 | ControlFlowNode for Fstring | Cookie is constructed from a $@,and its samesite flag is not properly set. | django_bad.py:27:33:27:67 | ControlFlowNode for Attribute() | user-supplied input | +| django_bad.py:27:30:27:124 | ControlFlowNode for Fstring | django_bad.py:27:33:27:67 | ControlFlowNode for Attribute() | django_bad.py:27:30:27:124 | ControlFlowNode for Fstring | Cookie is constructed from a $@,and its secure flag is not properly set. | django_bad.py:27:33:27:67 | ControlFlowNode for Attribute() | user-supplied input | +| django_bad.py:27:30:27:124 | ControlFlowNode for Fstring | django_bad.py:27:71:27:106 | ControlFlowNode for Attribute() | django_bad.py:27:30:27:124 | ControlFlowNode for Fstring | Cookie is constructed from a $@,and its httponly flag is not properly set. | django_bad.py:27:71:27:106 | ControlFlowNode for Attribute() | user-supplied input | +| django_bad.py:27:30:27:124 | ControlFlowNode for Fstring | django_bad.py:27:71:27:106 | ControlFlowNode for Attribute() | django_bad.py:27:30:27:124 | ControlFlowNode for Fstring | Cookie is constructed from a $@,and its samesite flag is not properly set. | django_bad.py:27:71:27:106 | ControlFlowNode for Attribute() | user-supplied input | +| django_bad.py:27:30:27:124 | ControlFlowNode for Fstring | django_bad.py:27:71:27:106 | ControlFlowNode for Attribute() | django_bad.py:27:30:27:124 | ControlFlowNode for Fstring | Cookie is constructed from a $@,and its secure flag is not properly set. | django_bad.py:27:71:27:106 | ControlFlowNode for Attribute() | user-supplied input | | flask_bad.py:24:21:24:40 | ControlFlowNode for Subscript | flask_bad.py:1:26:1:32 | ControlFlowNode for ImportMember | flask_bad.py:24:21:24:40 | ControlFlowNode for Subscript | Cookie is constructed from a $@,and its httponly flag is not properly set. | flask_bad.py:1:26:1:32 | ControlFlowNode for ImportMember | user-supplied input | | flask_bad.py:24:21:24:40 | ControlFlowNode for Subscript | flask_bad.py:1:26:1:32 | ControlFlowNode for ImportMember | flask_bad.py:24:21:24:40 | ControlFlowNode for Subscript | Cookie is constructed from a $@,and its samesite flag is not properly set. | flask_bad.py:1:26:1:32 | ControlFlowNode for ImportMember | user-supplied input | | flask_bad.py:24:21:24:40 | ControlFlowNode for Subscript | flask_bad.py:1:26:1:32 | ControlFlowNode for ImportMember | flask_bad.py:24:21:24:40 | ControlFlowNode for Subscript | Cookie is constructed from a $@,and its secure flag is not properly set. | flask_bad.py:1:26:1:32 | ControlFlowNode for ImportMember | user-supplied input | diff --git a/python/ql/test/experimental/query-tests/Security/CWE-614/InsecureCookie.expected b/python/ql/test/experimental/query-tests/Security/CWE-614/InsecureCookie.expected index 2743a8d21167..61f9b9b74692 100644 --- a/python/ql/test/experimental/query-tests/Security/CWE-614/InsecureCookie.expected +++ b/python/ql/test/experimental/query-tests/Security/CWE-614/InsecureCookie.expected @@ -1,9 +1,15 @@ | django_bad.py:6:5:7:52 | ControlFlowNode for Attribute() | Cookie is added without the 'httponly' flag properly set. | | django_bad.py:6:5:7:52 | ControlFlowNode for Attribute() | Cookie is added without the 'samesite' flag properly set. | | django_bad.py:6:5:7:52 | ControlFlowNode for Attribute() | Cookie is added without the 'secure' flag properly set. | +| django_bad.py:13:5:13:26 | ControlFlowNode for Subscript | Cookie is added without the 'httponly' flag properly set. | +| django_bad.py:13:5:13:26 | ControlFlowNode for Subscript | Cookie is added without the 'samesite' flag properly set. | +| django_bad.py:13:5:13:26 | ControlFlowNode for Subscript | Cookie is added without the 'secure' flag properly set. | | django_bad.py:19:5:21:66 | ControlFlowNode for Attribute() | Cookie is added without the 'httponly' flag properly set. | | django_bad.py:19:5:21:66 | ControlFlowNode for Attribute() | Cookie is added without the 'samesite' flag properly set. | | django_bad.py:19:5:21:66 | ControlFlowNode for Attribute() | Cookie is added without the 'secure' flag properly set. | +| django_bad.py:27:5:27:26 | ControlFlowNode for Subscript | Cookie is added without the 'httponly' flag properly set. | +| django_bad.py:27:5:27:26 | ControlFlowNode for Subscript | Cookie is added without the 'samesite' flag properly set. | +| django_bad.py:27:5:27:26 | ControlFlowNode for Subscript | Cookie is added without the 'secure' flag properly set. | | django_good.py:19:5:19:44 | ControlFlowNode for Attribute() | Cookie is added without the 'httponly' flag properly set. | | django_good.py:19:5:19:44 | ControlFlowNode for Attribute() | Cookie is added without the 'samesite' flag properly set. | | django_good.py:19:5:19:44 | ControlFlowNode for Attribute() | Cookie is added without the 'secure' flag properly set. | diff --git a/python/ql/test/experimental/query-tests/Security/CWE-614/django_bad.py b/python/ql/test/experimental/query-tests/Security/CWE-614/django_bad.py index 45cece4390f1..6f1916930e53 100644 --- a/python/ql/test/experimental/query-tests/Security/CWE-614/django_bad.py +++ b/python/ql/test/experimental/query-tests/Security/CWE-614/django_bad.py @@ -7,7 +7,7 @@ def django_response(request): httponly=False, samesite='None') return resp -# This test no longer produces an output due to django header setting methods not being modeled in the main query pack + def django_response(): response = django.http.HttpResponse() response['Set-Cookie'] = "name=value; SameSite=None;" @@ -21,7 +21,7 @@ def django_response(request): secure=False, httponly=False, samesite='None') return resp -# This test no longer produces an output due to django header setting methods not being modeled in the main query pack + def django_response(): response = django.http.HttpResponse() response['Set-Cookie'] = f"{django.http.request.GET.get('name')}={django.http.request.GET.get('value')}; SameSite=None;" diff --git a/python/ql/test/library-tests/frameworks/aiohttp/response_test.py b/python/ql/test/library-tests/frameworks/aiohttp/response_test.py index bc9bc8d3bda2..a40bf0bbc65e 100644 --- a/python/ql/test/library-tests/frameworks/aiohttp/response_test.py +++ b/python/ql/test/library-tests/frameworks/aiohttp/response_test.py @@ -96,7 +96,7 @@ async def streaming_response(request): # $ requestHandler async def setting_cookie(request): # $ requestHandler resp = web.Response(text="foo") # $ HttpResponse mimetype=text/plain responseBody="foo" resp.cookies["key"] = "value" # $ CookieWrite CookieName="key" CookieValue="value" - resp.headers["Set-Cookie"] = "key2=value2" # $ MISSING: CookieWrite CookieRawHeader="key2=value2" + resp.headers["Set-Cookie"] = "key2=value2" # $ headerWriteName="Set-Cookie" headerWriteValue="key2=value2" CookieWrite CookieRawHeader="key2=value2" resp.set_cookie("key3", "value3") # $ CookieWrite CookieName="key3" CookieValue="value3" resp.set_cookie(name="key3", value="value3") # $ CookieWrite CookieName="key3" CookieValue="value3" resp.del_cookie("key4") # $ CookieWrite CookieName="key4" diff --git a/python/ql/test/library-tests/frameworks/django-v2-v3/response_test.py b/python/ql/test/library-tests/frameworks/django-v2-v3/response_test.py index dd78cd510168..7722b4de8e18 100644 --- a/python/ql/test/library-tests/frameworks/django-v2-v3/response_test.py +++ b/python/ql/test/library-tests/frameworks/django-v2-v3/response_test.py @@ -62,7 +62,7 @@ def redirect_through_normal_response(request): resp = HttpResponse() # $ HttpResponse mimetype=text/html resp.status_code = 302 - resp['Location'] = next # $ MISSING: redirectLocation=next + resp['Location'] = next # $ headerWriteName='Location' headerWriteValue=next MISSING: redirectLocation=next resp.content = private # $ MISSING: responseBody=private return resp @@ -72,7 +72,7 @@ def redirect_through_normal_response_new_headers_attr(request): resp = HttpResponse() # $ HttpResponse mimetype=text/html resp.status_code = 302 - resp.headers['Location'] = next # $ MISSING: redirectLocation=next + resp.headers['Location'] = next # $ headerWriteName='Location' headerWriteValue=next MISSING: redirectLocation=next resp.content = private # $ MISSING: responseBody=private return resp @@ -130,8 +130,9 @@ def setting_cookie(request): resp = HttpResponse() # $ HttpResponse mimetype=text/html resp.set_cookie("key", "value") # $ CookieWrite CookieName="key" CookieValue="value" resp.set_cookie(key="key", value="value") # $ CookieWrite CookieName="key" CookieValue="value" - resp.headers["Set-Cookie"] = "key2=value2" # $ MISSING: CookieWrite CookieRawHeader="key2=value2" + resp.headers["Set-Cookie"] = "key2=value2" # $ headerWriteName="Set-Cookie" headerWriteValue="key2=value2" CookieWrite CookieRawHeader="key2=value2" resp.cookies["key3"] = "value3" # $ CookieWrite CookieName="key3" CookieValue="value3" resp.delete_cookie("key4") # $ CookieWrite CookieName="key4" resp.delete_cookie(key="key4") # $ CookieWrite CookieName="key4" + resp["Set-Cookie"] = "key5=value5" # $ headerWriteName="Set-Cookie" headerWriteValue="key5=value5" CookieWrite CookieRawHeader="key5=value5" return resp diff --git a/python/ql/test/library-tests/frameworks/fastapi/response_test.py b/python/ql/test/library-tests/frameworks/fastapi/response_test.py index 9f276338c8cc..2bc26c15fdac 100644 --- a/python/ql/test/library-tests/frameworks/fastapi/response_test.py +++ b/python/ql/test/library-tests/frameworks/fastapi/response_test.py @@ -11,9 +11,9 @@ async def response_parameter(response: Response): # $ requestHandler response.set_cookie("key", "value") # $ CookieWrite CookieName="key" CookieValue="value" response.set_cookie(key="key", value="value") # $ CookieWrite CookieName="key" CookieValue="value" - response.headers.append("Set-Cookie", "key2=value2") # $ CookieWrite CookieRawHeader="key2=value2" - response.headers.append(key="Set-Cookie", value="key2=value2") # $ CookieWrite CookieRawHeader="key2=value2" - response.headers["X-MyHeader"] = "header-value" + response.headers.append("Set-Cookie", "key2=value2") # $ headerWriteName="Set-Cookie" headerWriteValue="key2=value2" CookieWrite CookieRawHeader="key2=value2" + response.headers.append(key="Set-Cookie", value="key2=value2") # $ headerWriteName="Set-Cookie" headerWriteValue="key2=value2" CookieWrite CookieRawHeader="key2=value2" + response.headers["X-MyHeader"] = "header-value" # $ headerWriteName="X-MyHeader" headerWriteValue="header-value" response.status_code = 418 return {"message": "response as parameter"} # $ HttpResponse mimetype=application/json responseBody=Dict @@ -45,7 +45,7 @@ async def response_parameter_custom_type(response: MyXmlResponse): # $ requestHa print(type(response)) assert type(response) == fastapi.responses.Response response.set_cookie("key", "value") # $ CookieWrite CookieName="key" CookieValue="value" - response.headers["Custom-Response-Type"] = "yes, but only after function has run" + response.headers["Custom-Response-Type"] = "yes, but only after function has run" # $ headerWriteName="Custom-Response-Type" headerWriteValue="yes, but only after function has run" xml_data = "FOO" return xml_data # $ HttpResponse responseBody=xml_data mimetype=application/xml diff --git a/python/ql/test/library-tests/frameworks/flask/response_test.py b/python/ql/test/library-tests/frameworks/flask/response_test.py index 1359d2f93810..a1341022c4ec 100644 --- a/python/ql/test/library-tests/frameworks/flask/response_test.py +++ b/python/ql/test/library-tests/frameworks/flask/response_test.py @@ -118,7 +118,7 @@ def response_modification1(): # $requestHandler @app.route("/content-type/response-modification2") # $routeSetup="/content-type/response-modification2" def response_modification2(): # $requestHandler resp = make_response("

    hello

    ") # $HttpResponse mimetype=text/html responseBody="

    hello

    " - resp.headers["content-type"] = "text/plain" # $ headerWriteNameUnsanitized="content-type" headerWriteValueSanitized="text/plain" MISSING: HttpResponse mimetype=text/plain + resp.headers["content-type"] = "text/plain" # $ headerWriteNameUnsanitized="content-type" headerWriteValue="text/plain" MISSING: HttpResponse mimetype=text/plain return resp # $ SPURIOUS: HttpResponse mimetype=text/html responseBody=resp @@ -148,7 +148,7 @@ def Response3(): # $requestHandler @app.route("/content-type/Response4") # $routeSetup="/content-type/Response4" def Response4(): # $requestHandler # note: capitalization of Content-Type does not matter - resp = Response("

    hello

    ", headers={"Content-TYPE": "text/plain"}) # $ headerWriteBulk=Dict headerWriteNameUnsanitized headerWriteValueSanitized HttpResponse responseBody="

    hello

    " SPURIOUS: mimetype=text/html MISSING: mimetype=text/plain + resp = Response("

    hello

    ", headers={"Content-TYPE": "text/plain"}) # $ headerWriteBulk=Dict headerWriteBulkUnsanitized=name headerWriteNameUnsanitized="Content-TYPE" headerWriteValue="text/plain" HttpResponse responseBody="

    hello

    " SPURIOUS: mimetype=text/html MISSING: mimetype=text/plain return resp # $ SPURIOUS: HttpResponse mimetype=text/html responseBody=resp @@ -156,7 +156,7 @@ def Response4(): # $requestHandler def Response5(): # $requestHandler # content_type argument takes priority (and result is text/plain) # note: capitalization of Content-Type does not matter - resp = Response("

    hello

    ", headers={"Content-TYPE": "text/html"}, content_type="text/plain; charset=utf-8") # $ headerWriteBulk=Dict headerWriteNameUnsanitized headerWriteValueSanitized HttpResponse mimetype=text/plain responseBody="

    hello

    " + resp = Response("

    hello

    ", headers={"Content-TYPE": "text/html"}, content_type="text/plain; charset=utf-8") # $ headerWriteBulk=Dict headerWriteBulkUnsanitized=name headerWriteNameUnsanitized="Content-TYPE" headerWriteValue="text/html" HttpResponse mimetype=text/plain responseBody="

    hello

    " return resp # $ SPURIOUS: HttpResponse mimetype=text/html responseBody=resp @@ -164,7 +164,7 @@ def Response5(): # $requestHandler def Response6(): # $requestHandler # mimetype argument takes priority over header (and result is text/plain) # note: capitalization of Content-Type does not matter - resp = Response("

    hello

    ", headers={"Content-TYPE": "text/html"}, mimetype="text/plain") # $ headerWriteBulk=Dict headerWriteNameUnsanitized headerWriteValueSanitized HttpResponse mimetype=text/plain responseBody="

    hello

    " + resp = Response("

    hello

    ", headers={"Content-TYPE": "text/html"}, mimetype="text/plain") # $ headerWriteBulk=Dict headerWriteBulkUnsanitized=name headerWriteNameUnsanitized="Content-TYPE" headerWriteValue="text/html" HttpResponse mimetype=text/plain responseBody="

    hello

    " return resp # $ SPURIOUS: HttpResponse mimetype=text/html responseBody=resp @@ -208,7 +208,7 @@ def setting_cookie(): # $requestHandler resp = make_response() # $ HttpResponse mimetype=text/html resp.set_cookie("key", "value") # $ CookieWrite CookieName="key" CookieValue="value" resp.set_cookie(key="key", value="value") # $ CookieWrite CookieName="key" CookieValue="value" - resp.headers.add("Set-Cookie", "key2=value2") # $ headerWriteNameUnsanitized="Set-Cookie" headerWriteValueSanitized="key2=value2" MISSING: CookieWrite CookieRawHeader="key2=value2" + resp.headers.add("Set-Cookie", "key2=value2") # $ headerWriteNameUnsanitized="Set-Cookie" headerWriteValue="key2=value2" CookieWrite CookieRawHeader="key2=value2" resp.delete_cookie("key3") # $ CookieWrite CookieName="key3" resp.delete_cookie(key="key3") # $ CookieWrite CookieName="key3" return resp # $ SPURIOUS: HttpResponse mimetype=text/html responseBody=resp @@ -220,29 +220,29 @@ def setting_cookie(): # $requestHandler @app.route("/headers") # $routeSetup="/headers" def headers(): # $requestHandler resp1 = Response() # $ HttpResponse mimetype=text/html - resp1.headers["X-MyHeader"] = "a" # $ headerWriteNameUnsanitized="X-MyHeader" headerWriteValueSanitized="a" + resp1.headers["X-MyHeader"] = "a" # $ headerWriteNameUnsanitized="X-MyHeader" headerWriteValue="a" resp2 = make_response() # $ HttpResponse mimetype=text/html - resp2.headers["X-MyHeader"] = "aa" # $ headerWriteNameUnsanitized="X-MyHeader" headerWriteValueSanitized="aa" - resp2.headers.extend({"X-MyHeader2": "b"}) # $ headerWriteBulk=Dict headerWriteNameUnsanitized headerWriteValueSanitized - resp3 = make_response("hello", 200, {"X-MyHeader3": "c"}) # $ HttpResponse mimetype=text/html responseBody="hello" headerWriteBulk=Dict headerWriteNameUnsanitized headerWriteValueSanitized - resp4 = make_response("hello", {"X-MyHeader4": "d"}) # $ HttpResponse mimetype=text/html responseBody="hello" headerWriteBulk=Dict headerWriteNameUnsanitized headerWriteValueSanitized - resp5 = Response(headers={"X-MyHeader5":"e"}) # $ HttpResponse mimetype=text/html headerWriteBulk=Dict headerWriteNameUnsanitized headerWriteValueSanitized + resp2.headers["X-MyHeader"] = "aa" # $ headerWriteNameUnsanitized="X-MyHeader" headerWriteValue="aa" + resp2.headers.extend({"X-MyHeader2": "b"}) # $ headerWriteBulk=Dict headerWriteBulkUnsanitized=name headerWriteNameUnsanitized="X-MyHeader2" headerWriteValue="b" + resp3 = make_response("hello", 200, {"X-MyHeader3": "c"}) # $ HttpResponse mimetype=text/html responseBody="hello" headerWriteBulk=Dict headerWriteBulkUnsanitized=name headerWriteNameUnsanitized="X-MyHeader3" headerWriteValue="c" + resp4 = make_response("hello", {"X-MyHeader4": "d"}) # $ HttpResponse mimetype=text/html responseBody="hello" headerWriteBulk=Dict headerWriteBulkUnsanitized=name headerWriteNameUnsanitized="X-MyHeader4" headerWriteValue="d" + resp5 = Response(headers={"X-MyHeader5":"e"}) # $ HttpResponse mimetype=text/html headerWriteBulk=Dict headerWriteBulkUnsanitized=name headerWriteBulkUnsanitized=name headerWriteNameUnsanitized="X-MyHeader5" headerWriteValue="e" return resp5 # $ SPURIOUS: HttpResponse mimetype=text/html responseBody=resp5 @app.route("/werkzeug-headers") # $routeSetup="/werkzeug-headers" def werkzeug_headers(): # $requestHandler response = Response() # $ HttpResponse mimetype=text/html headers = Headers() - headers.add("X-MyHeader1", "a") # $ headerWriteNameUnsanitized="X-MyHeader1" headerWriteValueSanitized="a" - headers.add_header("X-MyHeader2", "b") # $ headerWriteNameUnsanitized="X-MyHeader2" headerWriteValueSanitized="b" - headers.set("X-MyHeader3", "c") # $ headerWriteNameUnsanitized="X-MyHeader3" headerWriteValueSanitized="c" - headers.setdefault("X-MyHeader4", "d") # $ headerWriteNameUnsanitized="X-MyHeader4" headerWriteValueSanitized="d" - headers.__setitem__("X-MyHeader5", "e") # $ headerWriteNameUnsanitized="X-MyHeader5" headerWriteValueSanitized="e" - headers["X-MyHeader6"] = "f" # $ headerWriteNameUnsanitized="X-MyHeader6" headerWriteValueSanitized="f" - h1 = {"X-MyHeader7": "g"} - headers.extend(h1) # $ headerWriteBulk=h1 headerWriteNameUnsanitized headerWriteValueSanitized - h2 = [("X-MyHeader8", "h")] - headers.extend(h2) # $ headerWriteBulk=h2 headerWriteNameUnsanitized headerWriteValueSanitized + headers.add("X-MyHeader1", "a") # $ headerWriteNameUnsanitized="X-MyHeader1" headerWriteValue="a" + headers.add_header("X-MyHeader2", "b") # $ headerWriteNameUnsanitized="X-MyHeader2" headerWriteValue="b" + headers.set("X-MyHeader3", "c") # $ headerWriteNameUnsanitized="X-MyHeader3" headerWriteValue="c" + headers.setdefault("X-MyHeader4", "d") # $ headerWriteNameUnsanitized="X-MyHeader4" headerWriteValue="d" + headers.__setitem__("X-MyHeader5", "e") # $ headerWriteNameUnsanitized="X-MyHeader5" headerWriteValue="e" + headers["X-MyHeader6"] = "f" # $ headerWriteNameUnsanitized="X-MyHeader6" headerWriteValue="f" + h1 = {"X-MyHeader7": "g"} # $ headerWriteNameUnsanitized="X-MyHeader7" headerWriteValue="g" + headers.extend(h1) # $ headerWriteBulk=h1 headerWriteBulkUnsanitized=name + h2 = [("X-MyHeader8", "h")] # $ headerWriteNameUnsanitized="X-MyHeader8" headerWriteValue="h" + headers.extend(h2) # $ headerWriteBulk=h2 headerWriteBulkUnsanitized=name response.headers = headers return response # $ SPURIOUS: HttpResponse mimetype=text/html responseBody=response diff --git a/python/ql/test/library-tests/frameworks/rest_framework/response_test.py b/python/ql/test/library-tests/frameworks/rest_framework/response_test.py index ec093499df63..3e4f821693bf 100644 --- a/python/ql/test/library-tests/frameworks/rest_framework/response_test.py +++ b/python/ql/test/library-tests/frameworks/rest_framework/response_test.py @@ -28,7 +28,7 @@ def setting_cookie(request): resp = Response() # $ HttpResponse resp.set_cookie("key", "value") # $ CookieWrite CookieName="key" CookieValue="value" resp.set_cookie(key="key4", value="value") # $ CookieWrite CookieName="key4" CookieValue="value" - resp.headers["Set-Cookie"] = "key2=value2" # $ MISSING: CookieWrite CookieRawHeader="key2=value2" + resp.headers["Set-Cookie"] = "key2=value2" # $ headerWriteName="Set-Cookie" headerWriteValue="key2=value2" CookieWrite CookieRawHeader="key2=value2" resp.cookies["key3"] = "value3" # $ CookieWrite CookieName="key3" CookieValue="value3" resp.delete_cookie("key4") # $ CookieWrite CookieName="key4" resp.delete_cookie(key="key4") # $ CookieWrite CookieName="key4" diff --git a/python/ql/test/library-tests/frameworks/rest_framework/testapp/views.py b/python/ql/test/library-tests/frameworks/rest_framework/testapp/views.py index 6affb5dac4b9..6ce06fdba31e 100644 --- a/python/ql/test/library-tests/frameworks/rest_framework/testapp/views.py +++ b/python/ql/test/library-tests/frameworks/rest_framework/testapp/views.py @@ -70,7 +70,7 @@ def cookie_test(request: Request): # $ requestHandler resp = Response("wat") # $ HttpResponse resp.set_cookie("key", "value") # $ CookieWrite CookieName="key" CookieValue="value" resp.set_cookie(key="key4", value="value") # $ CookieWrite CookieName="key4" CookieValue="value" - resp.headers["Set-Cookie"] = "key2=value2" # $ MISSING: CookieWrite CookieRawHeader="key2=value2" + resp.headers["Set-Cookie"] = "key2=value2" # $ headerWriteName="Set-Cookie" headerWriteValue="key2=value2" CookieWrite CookieRawHeader="key2=value2" resp.cookies["key3"] = "value3" # $ CookieWrite CookieName="key3" CookieValue="value3" return resp diff --git a/python/ql/test/library-tests/frameworks/stdlib/wsgiref_simple_server_test.py b/python/ql/test/library-tests/frameworks/stdlib/wsgiref_simple_server_test.py index 6a2031699f42..7327385c0647 100644 --- a/python/ql/test/library-tests/frameworks/stdlib/wsgiref_simple_server_test.py +++ b/python/ql/test/library-tests/frameworks/stdlib/wsgiref_simple_server_test.py @@ -18,7 +18,7 @@ def func(environ, start_response): # $ requestHandler environ, # $ tainted environ["PATH_INFO"], # $ tainted ) - write = start_response("200 OK", [("Content-Type", "text/plain")]) # $ headerWriteBulk=List headerWriteNameUnsanitized headerWriteValueUnsanitized + write = start_response("200 OK", [("Content-Type", "text/plain")]) # $ headerWriteBulk=List headerWriteBulkUnsanitized=name,value headerWriteNameUnsanitized="Content-Type" headerWriteValueUnsanitized="text/plain" write(b"hello") # $ HttpResponse responseBody=b"hello" write(data=b" ") # $ HttpResponse responseBody=b" " @@ -33,16 +33,16 @@ def __init__(self): self.set_app(self.my_method) def my_method(self, _env, start_response): # $ requestHandler - start_response("200 OK", []) # $ headerWriteBulk=List headerWriteNameUnsanitized headerWriteValueUnsanitized + start_response("200 OK", []) # $ headerWriteBulk=List headerWriteBulkUnsanitized=name,value return [b"my_method"] # $ HttpResponse responseBody=List def func2(environ, start_response): # $ requestHandler - headers = wsgiref.headers.Headers([("Content-Type", "text/plain")]) # $ headerWriteBulk=List headerWriteNameUnsanitized headerWriteValueUnsanitized + headers = wsgiref.headers.Headers([("Content-Type", "text/plain")]) # $ headerWriteBulk=List headerWriteBulkUnsanitized=name,value headerWriteNameUnsanitized="Content-Type" headerWriteValueUnsanitized="text/plain" headers.add_header("X-MyHeader", "a") # $ headerWriteNameUnsanitized="X-MyHeader" headerWriteValueUnsanitized="a" headers.setdefault("X-MyHeader2", "b") # $ headerWriteNameUnsanitized="X-MyHeader2" headerWriteValueUnsanitized="b" headers.__setitem__("X-MyHeader3", "c") # $ headerWriteNameUnsanitized="X-MyHeader3" headerWriteValueUnsanitized="c" headers["X-MyHeader4"] = "d" # $ headerWriteNameUnsanitized="X-MyHeader4" headerWriteValueUnsanitized="d" - start_response(status, headers) # $ headerWriteBulk=headers headerWriteNameUnsanitized headerWriteValueUnsanitized + start_response(status, headers) # $ headerWriteBulk=headers headerWriteBulkUnsanitized=name,value return [b"Hello"] # $ HttpResponse responseBody=List case = sys.argv[1] @@ -54,7 +54,7 @@ def func2(environ, start_response): # $ requestHandler elif case == "3": server = MyServer() def func3(_env, start_response): # $ requestHandler - start_response("200 OK", []) # $ headerWriteBulk=List headerWriteNameUnsanitized headerWriteValueUnsanitized + start_response("200 OK", []) # $ headerWriteBulk=List headerWriteBulkUnsanitized=name,value return [b"foo"] # $ HttpResponse responseBody=List server.set_app(func3) elif case == "4": diff --git a/python/ql/test/library-tests/frameworks/tornado/response_test.py b/python/ql/test/library-tests/frameworks/tornado/response_test.py index 1ca37ed773c8..a1054f28dc96 100644 --- a/python/ql/test/library-tests/frameworks/tornado/response_test.py +++ b/python/ql/test/library-tests/frameworks/tornado/response_test.py @@ -24,10 +24,10 @@ def get(self): # $ requestHandler # what matters. self.write("foo") # $ HttpResponse mimetype=text/html responseBody="foo" - self.set_header("Content-Type", "text/plain; charset=utf-8") + self.set_header("Content-Type", "text/plain; charset=utf-8") # $ headerWriteName="Content-Type" headerWriteValue="text/plain; charset=utf-8" def post(self): # $ requestHandler - self.set_header("Content-Type", "text/plain; charset=utf-8") + self.set_header("Content-Type", "text/plain; charset=utf-8") # $ headerWriteName="Content-Type" headerWriteValue="text/plain; charset=utf-8" self.write("foo") # $ HttpResponse responseBody="foo" MISSING: mimetype=text/plain SPURIOUS: mimetype=text/html @@ -67,7 +67,10 @@ def get(self): # $ requestHandler self.write("foo") # $ HttpResponse mimetype=text/html responseBody="foo" self.set_cookie("key", "value") # $ CookieWrite CookieName="key" CookieValue="value" self.set_cookie(name="key", value="value") # $ CookieWrite CookieName="key" CookieValue="value" - self.set_header("Set-Cookie", "key2=value2") # $ MISSING: CookieWrite CookieRawHeader="key2=value2" + self.set_header("Set-Cookie", "key2=value2") # $ headerWriteName="Set-Cookie" headerWriteValue="key2=value2" CookieWrite CookieRawHeader="key2=value2" + self.add_header("Set-Cookie", "key3=value3") # $ headerWriteName="Set-Cookie" headerWriteValue="key3=value3" CookieWrite CookieRawHeader="key3=value3" + self.request.headers.add("Set-Cookie", "key4=value4") # $ headerWriteName="Set-Cookie" headerWriteValue="key4=value4" CookieWrite CookieRawHeader="key4=value4" + self.request.headers["Set-Cookie"] = "key5=value5" # $ headerWriteName="Set-Cookie" headerWriteValue="key5=value5" CookieWrite CookieRawHeader="key5=value5" def make_app(): diff --git a/shared/ssa/codeql/ssa/Ssa.qll b/shared/ssa/codeql/ssa/Ssa.qll index 4e61d61efa71..87811b005be2 100644 --- a/shared/ssa/codeql/ssa/Ssa.qll +++ b/shared/ssa/codeql/ssa/Ssa.qll @@ -1163,4 +1163,511 @@ module Make Input> { ) } } + + /** Provides the input to `DataFlowIntegration`. */ + signature module DataFlowIntegrationInputSig { + /** + * An expression with a value. That is, we expect these expressions to be + * represented in the data flow graph. + */ + class Expr { + /** Gets a textual representation of this expression. */ + string toString(); + + /** Holds if the `i`th node of basic block `bb` evaluates this expression. */ + predicate hasCfgNode(BasicBlock bb, int i); + } + + /** + * Gets a read of SSA definition `def`. + * + * Override this with a cached version when applicable. + */ + default Expr getARead(Definition def) { + exists(SourceVariable v, BasicBlock bb, int i | + ssaDefReachesRead(v, def, bb, i) and + variableRead(bb, i, v, true) and + result.hasCfgNode(bb, i) + ) + } + + /** Holds if SSA definition `def` assigns `value` to the underlying variable. */ + predicate ssaDefAssigns(WriteDefinition def, Expr value); + + /** A parameter. */ + class Parameter { + /** Gets a textual representation of this parameter. */ + string toString(); + + /** Gets the location of this parameter. */ + Location getLocation(); + } + + /** Holds if SSA definition `def` initializes parameter `p` at function entry. */ + predicate ssaDefInitializesParam(WriteDefinition def, Parameter p); + + /** + * Holds if flow should be allowed into uncertain SSA definition `def` from + * previous definitions or reads. + */ + default predicate allowFlowIntoUncertainDef(UncertainWriteDefinition def) { none() } + + /** A (potential) guard. */ + class Guard { + /** Gets a textual representation of this guard. */ + string toString(); + + /** Holds if the `i`th node of basic block `bb` evaluates this guard. */ + predicate hasCfgNode(BasicBlock bb, int i); + } + + /** Holds if `guard` controls block `bb` upon evaluating to `branch`. */ + predicate guardControlsBlock(Guard guard, BasicBlock bb, boolean branch); + + /** Gets an immediate conditional successor of basic block `bb`, if any. */ + BasicBlock getAConditionalBasicBlockSuccessor(BasicBlock bb, boolean branch); + } + + /** + * Constructs the type `Node` and associated value step relations, which are + * intended to be included in the `DataFlow::Node` type and local step relations. + * + * Additionally, this module also provides a barrier guards implementation. + */ + module DataFlowIntegration { + private import codeql.util.Boolean + + pragma[nomagic] + private predicate adjacentDefReachesReadExt( + DefinitionExt def, SourceVariable v, BasicBlock bb1, int i1, BasicBlock bb2, int i2 + ) { + adjacentDefReadExt(def, v, bb1, i1, bb2, i2) and + ( + def.definesAt(v, bb1, i1, _) + or + variableRead(bb1, i1, v, true) + ) + or + exists(BasicBlock bb3, int i3 | + adjacentDefReachesReadExt(def, v, bb1, i1, bb3, i3) and + variableRead(bb3, i3, v, false) and + adjacentDefReadExt(def, v, bb3, i3, bb2, i2) + ) + } + + pragma[nomagic] + private predicate adjacentDefReachesUncertainReadExt( + DefinitionExt def, SourceVariable v, BasicBlock bb1, int i1, BasicBlock bb2, int i2 + ) { + adjacentDefReachesReadExt(def, v, bb1, i1, bb2, i2) and + variableRead(bb2, i2, v, false) + } + + /** + * Holds if the reference to `def` at index `i` in basic block `bb` can reach + * another definition `next` of the same underlying source variable, without + * passing through another write or non-pseudo read. + * + * The reference is either a read of `def` or `def` itself. + */ + pragma[nomagic] + private predicate lastRefBeforeRedefExt( + DefinitionExt def, SourceVariable v, BasicBlock bb, int i, BasicBlock input, + DefinitionExt next + ) { + lastRefRedefExt(def, v, bb, i, input, next) and + not variableRead(bb, i, v, false) + or + exists(BasicBlock bb0, int i0 | + lastRefRedefExt(def, v, bb0, i0, input, next) and + adjacentDefReachesUncertainReadExt(def, v, bb, i, bb0, i0) + ) + } + + /** Same as `adjacentDefReadExt`, but skips uncertain reads. */ + pragma[nomagic] + private predicate adjacentDefSkipUncertainReadsExt( + DefinitionExt def, SourceVariable v, BasicBlock bb1, int i1, BasicBlock bb2, int i2 + ) { + adjacentDefReachesReadExt(def, v, bb1, i1, bb2, i2) and + variableRead(bb2, i2, v, true) + } + + pragma[nomagic] + private predicate adjacentReadPairExt(DefinitionExt def, ReadNode read1, ReadNode read2) { + exists(SourceVariable v, BasicBlock bb1, int i1, BasicBlock bb2, int i2 | + read1.readsAt(bb1, i1, v) and + adjacentDefSkipUncertainReadsExt(def, v, bb1, i1, bb2, i2) and + read2.readsAt(bb2, i2, v) + ) + } + + final private class DefinitionExtFinal = DefinitionExt; + + /** An SSA definition into which another SSA definition may flow. */ + private class SsaInputDefinitionExt extends DefinitionExtFinal { + SsaInputDefinitionExt() { + this instanceof PhiNode + or + this instanceof PhiReadNode + or + DfInput::allowFlowIntoUncertainDef(this) + } + + /** Holds if `def` may flow into this definition via basic block `input`. */ + predicate hasInputFromBlock( + DefinitionExt def, SourceVariable v, BasicBlock bb, int i, BasicBlock input + ) { + lastRefBeforeRedefExt(def, v, bb, i, input, this) + } + } + + private module Cached { + cached + newtype TNode = + TParamNode(DfInput::Parameter p) { DfInput::ssaDefInitializesParam(_, p) } or + TExprNode(DfInput::Expr e, Boolean isPost) { + e = DfInput::getARead(_) + or + DfInput::ssaDefAssigns(_, e) and + isPost = false + } or + TSsaDefinitionNode(DefinitionExt def) or + TSsaInputNode(SsaInputDefinitionExt def, BasicBlock input) { + def.hasInputFromBlock(_, _, _, _, input) + } + + cached + Definition getAPhiInputDef(SsaInputNode n) { + exists(SsaInputDefinitionExt phi, BasicBlock bb | + phi.hasInputFromBlock(result, _, _, _, bb) and + n.isInputInto(phi, bb) + ) + } + } + + private import Cached + + /** + * A data flow node that we need to reference in the value step relation. + * + * Note that only the `SsaNode` subclass is expected to be added as additional + * nodes in `DataFlow::Node`. The other subclasses are expected to already be + * present and are included here in order to reference them in the step relation. + */ + abstract private class NodeImpl extends TNode { + /** Gets the location of this node. */ + abstract Location getLocation(); + + /** Gets a textual representation of this node. */ + abstract string toString(); + } + + final class Node = NodeImpl; + + /** A parameter node. */ + private class ParameterNodeImpl extends NodeImpl, TParamNode { + private DfInput::Parameter p; + + ParameterNodeImpl() { this = TParamNode(p) } + + /** Gets the underlying parameter. */ + DfInput::Parameter getParameter() { result = p } + + override string toString() { result = p.toString() } + + override Location getLocation() { result = p.getLocation() } + } + + final class ParameterNode = ParameterNodeImpl; + + /** A (post-update) expression node. */ + abstract private class ExprNodePreOrPostImpl extends NodeImpl, TExprNode { + DfInput::Expr e; + boolean isPost; + + ExprNodePreOrPostImpl() { this = TExprNode(e, isPost) } + + /** Gets the underlying expression. */ + DfInput::Expr getExpr() { result = e } + + override Location getLocation() { + exists(BasicBlock bb, int i | + e.hasCfgNode(bb, i) and + result = bb.getNode(i).getLocation() + ) + } + } + + final class ExprNodePreOrPost = ExprNodePreOrPostImpl; + + /** An expression node. */ + private class ExprNodeImpl extends ExprNodePreOrPostImpl { + ExprNodeImpl() { isPost = false } + + override string toString() { result = e.toString() } + } + + final class ExprNode = ExprNodeImpl; + + /** A post-update expression node. */ + private class ExprPostUpdateNodeImpl extends ExprNodePreOrPostImpl { + ExprPostUpdateNodeImpl() { isPost = true } + + /** Gets the pre-update expression node. */ + ExprNode getPreUpdateNode() { result = TExprNode(e, false) } + + override string toString() { result = e.toString() + " [postupdate]" } + } + + final class ExprPostUpdateNode = ExprPostUpdateNodeImpl; + + private class ReadNodeImpl extends ExprNodeImpl { + private BasicBlock bb_; + private int i_; + private SourceVariable v_; + + ReadNodeImpl() { + variableRead(bb_, i_, v_, true) and + this.getExpr().hasCfgNode(bb_, i_) + } + + SourceVariable getVariable() { result = v_ } + + pragma[nomagic] + predicate readsAt(BasicBlock bb, int i, SourceVariable v) { + bb = bb_ and + i = i_ and + v = v_ + } + } + + final private class ReadNode = ReadNodeImpl; + + /** A synthesized SSA data flow node. */ + abstract private class SsaNodeImpl extends NodeImpl { + /** Gets the underlying SSA definition. */ + abstract DefinitionExt getDefinitionExt(); + } + + final class SsaNode = SsaNodeImpl; + + /** An SSA definition, viewed as a node in a data flow graph. */ + private class SsaDefinitionExtNodeImpl extends SsaNodeImpl, TSsaDefinitionNode { + private DefinitionExt def; + + SsaDefinitionExtNodeImpl() { this = TSsaDefinitionNode(def) } + + override DefinitionExt getDefinitionExt() { result = def } + + override Location getLocation() { result = def.getLocation() } + + override string toString() { result = def.toString() } + } + + final class SsaDefinitionExtNode = SsaDefinitionExtNodeImpl; + + /** + * A node that represents an input to an SSA phi (read) definition. + * + * This allows for barrier guards to filter input to phi nodes. For example, in + * + * ```rb + * x = taint + * if x != "safe" then + * x = "safe" + * end + * sink x + * ``` + * + * the `false` edge out of `x != "safe"` guards the input from `x = taint` into the + * `phi` node after the condition. + * + * It is also relevant to filter input into phi read nodes: + * + * ```rb + * x = taint + * if b then + * if x != "safe1" then + * return + * end + * else + * if x != "safe2" then + * return + * end + * end + * + * sink x + * ``` + * + * both inputs into the phi read node after the outer condition are guarded. + */ + private class SsaInputNodeImpl extends SsaNodeImpl, TSsaInputNode { + private SsaInputDefinitionExt def_; + private BasicBlock input_; + + SsaInputNodeImpl() { this = TSsaInputNode(def_, input_) } + + /** Holds if this node represents input into SSA definition `def` via basic block `input`. */ + predicate isInputInto(DefinitionExt def, BasicBlock input) { + def = def_ and + input = input_ + } + + override SsaInputDefinitionExt getDefinitionExt() { result = def_ } + + override Location getLocation() { result = input_.getNode(input_.length() - 1).getLocation() } + + override string toString() { result = "[input] " + def_.toString() } + } + + final class SsaInputNode = SsaInputNodeImpl; + + /** + * Holds if `nodeFrom` is a node for SSA definition `def`, which can input + * node `nodeTo`. + */ + pragma[nomagic] + private predicate inputFromDef( + DefinitionExt def, SsaDefinitionExtNode nodeFrom, SsaInputNode nodeTo + ) { + exists(SourceVariable v, BasicBlock bb, int i, BasicBlock input, SsaInputDefinitionExt next | + next.hasInputFromBlock(def, v, bb, i, input) and + def = nodeFrom.getDefinitionExt() and + def.definesAt(v, bb, i, _) and + nodeTo = TSsaInputNode(next, input) + ) + } + + /** + * Holds if `nodeFrom` is a last read of SSA definition `def`, which + * can reach input node `nodeTo`. + */ + pragma[nomagic] + private predicate inputFromRead(DefinitionExt def, ReadNode nodeFrom, SsaInputNode nodeTo) { + exists(SourceVariable v, BasicBlock bb, int i, BasicBlock input, SsaInputDefinitionExt next | + next.hasInputFromBlock(def, v, bb, i, input) and + nodeFrom.readsAt(bb, i, v) and + nodeTo = TSsaInputNode(next, input) + ) + } + + pragma[nomagic] + private predicate firstReadExt(DefinitionExt def, ReadNode read) { + exists(SourceVariable v, BasicBlock bb1, int i1, BasicBlock bb2, int i2 | + def.definesAt(v, bb1, i1, _) and + adjacentDefSkipUncertainReadsExt(def, v, bb1, i1, bb2, i2) and + read.readsAt(bb2, i2, v) + ) + } + + /** + * Holds if there is a local flow step from `nodeFrom` to `nodeTo`. + * + * `isUseStep` is `true` when `nodeFrom` is a (post-update) read node and + * `nodeTo` is a read node or phi (read) node. + */ + predicate localFlowStep(DefinitionExt def, Node nodeFrom, Node nodeTo, boolean isUseStep) { + ( + // Flow from assignment into SSA definition + DfInput::ssaDefAssigns(def, nodeFrom.(ExprNode).getExpr()) + or + // Flow from parameter into entry definition + DfInput::ssaDefInitializesParam(def, nodeFrom.(ParameterNode).getParameter()) + ) and + nodeTo.(SsaDefinitionExtNode).getDefinitionExt() = def and + isUseStep = false + or + // Flow from SSA definition to first read + def = nodeFrom.(SsaDefinitionExtNode).getDefinitionExt() and + firstReadExt(def, nodeTo) and + isUseStep = false + or + // Flow from (post-update) read to next read + adjacentReadPairExt(def, [nodeFrom, nodeFrom.(ExprPostUpdateNode).getPreUpdateNode()], nodeTo) and + nodeFrom != nodeTo and + isUseStep = true + or + // Flow into phi (read) SSA definition node from def + inputFromDef(def, nodeFrom, nodeTo) and + isUseStep = false + or + // Flow into phi (read) SSA definition node from (post-update) read + inputFromRead(def, [nodeFrom, nodeFrom.(ExprPostUpdateNode).getPreUpdateNode()], nodeTo) and + isUseStep = true + or + // Flow from input node to def + nodeTo.(SsaDefinitionExtNode).getDefinitionExt() = def and + def = nodeFrom.(SsaInputNode).getDefinitionExt() and + isUseStep = false + } + + /** Holds if the value of `nodeTo` is given by `nodeFrom`. */ + predicate localMustFlowStep(DefinitionExt def, Node nodeFrom, Node nodeTo) { + ( + // Flow from assignment into SSA definition + DfInput::ssaDefAssigns(def, nodeFrom.(ExprNode).getExpr()) + or + // Flow from parameter into entry definition + DfInput::ssaDefInitializesParam(def, nodeFrom.(ParameterNode).getParameter()) + ) and + nodeTo.(SsaDefinitionExtNode).getDefinitionExt() = def + or + // Flow from SSA definition to read + nodeFrom.(SsaDefinitionExtNode).getDefinitionExt() = def and + nodeTo.(ExprNode).getExpr() = DfInput::getARead(def) + } + + /** + * Holds if the guard `g` validates the expression `e` upon evaluating to `branch`. + * + * The expression `e` is expected to be a syntactic part of the guard `g`. + * For example, the guard `g` might be a call `isSafe(x)` and the expression `e` + * the argument `x`. + */ + signature predicate guardChecksSig(DfInput::Guard g, DfInput::Expr e, boolean branch); + + /** + * Provides a set of barrier nodes for a guard that validates an expression. + * + * This is expected to be used in `isBarrier`/`isSanitizer` definitions + * in data flow and taint tracking. + */ + module BarrierGuard { + pragma[nomagic] + private predicate guardChecksSsaDef(DfInput::Guard g, Definition def, boolean branch) { + guardChecks(g, DfInput::getARead(def), branch) + } + + /** Gets a node that is safely guarded by the given guard check. */ + pragma[nomagic] + Node getABarrierNode() { + exists(DfInput::Guard g, boolean branch, Definition def, BasicBlock bb | + guardChecksSsaDef(g, def, branch) + | + // guard controls a read + exists(DfInput::Expr e | + e = DfInput::getARead(def) and + e.hasCfgNode(bb, _) and + DfInput::guardControlsBlock(g, bb, branch) and + result.(ExprNode).getExpr() = e + ) + or + // guard controls input block to a phi node + exists(SsaInputDefinitionExt phi | + def = getAPhiInputDef(result) and + result.(SsaInputNode).isInputInto(phi, bb) + | + DfInput::guardControlsBlock(g, bb, branch) + or + exists(int last | + last = bb.length() - 1 and + g.hasCfgNode(bb, last) and + DfInput::getAConditionalBasicBlockSuccessor(bb, branch) = phi.getBasicBlock() + ) + ) + ) + } + } + } }