mirror of
https://github.com/github/codeql.git
synced 2026-05-04 05:05:12 +02:00
Merge branch 'master' into cpp340a
So as to get to change-notes/1.21/analysis-cpp.md
This commit is contained in:
@@ -6627,3 +6627,783 @@ ir.cpp:
|
||||
# 988| Type = double
|
||||
# 988| Value = 1.0
|
||||
# 988| ValueCategory = prvalue
|
||||
# 1009| EmptyStruct& EmptyStruct::operator=(EmptyStruct const&)
|
||||
# 1009| params:
|
||||
#-----| 0: p#0
|
||||
#-----| Type = const EmptyStruct &
|
||||
# 1009| EmptyStruct& EmptyStruct::operator=(EmptyStruct&&)
|
||||
# 1009| params:
|
||||
#-----| 0: p#0
|
||||
#-----| Type = EmptyStruct &&
|
||||
# 1011| void EmptyStructInit()
|
||||
# 1011| params:
|
||||
# 1011| body: { ... }
|
||||
# 1012| 0: declaration
|
||||
# 1012| 0: definition of s
|
||||
# 1012| Type = EmptyStruct
|
||||
# 1012| init: initializer for s
|
||||
# 1012| expr: {...}
|
||||
# 1012| Type = EmptyStruct
|
||||
# 1012| ValueCategory = prvalue
|
||||
# 1013| 1: return ...
|
||||
# 1015| (lambda [] type at line 1015, col. 12)& (lambda [] type at line 1015, col. 12)::operator=((lambda [] type at line 1015, col. 12) const&)
|
||||
# 1015| params:
|
||||
#-----| 0: p#0
|
||||
#-----| Type = const lambda [] type at line 1015, col. 12 &
|
||||
# 1015| void (lambda [] type at line 1015, col. 12)::(constructor)((lambda [] type at line 1015, col. 12) const&)
|
||||
# 1015| params:
|
||||
#-----| 0: p#0
|
||||
#-----| Type = const lambda [] type at line 1015, col. 12 &
|
||||
# 1015| void (lambda [] type at line 1015, col. 12)::(constructor)((lambda [] type at line 1015, col. 12)&&)
|
||||
# 1015| params:
|
||||
#-----| 0: p#0
|
||||
#-----| Type = lambda [] type at line 1015, col. 12 &&
|
||||
# 1015| initializations:
|
||||
# 1015| body: { ... }
|
||||
# 1015| 0: return ...
|
||||
# 1015| void (lambda [] type at line 1015, col. 12)::(constructor)()
|
||||
# 1015| params:
|
||||
# 1015| void (lambda [] type at line 1015, col. 12)::_FUN()
|
||||
# 1015| params:
|
||||
# 1015| void (lambda [] type at line 1015, col. 12)::operator()() const
|
||||
# 1015| params:
|
||||
# 1015| body: { ... }
|
||||
# 1015| 0: return ...
|
||||
# 1015| void(* (lambda [] type at line 1015, col. 12)::operator void (*)()() const)()
|
||||
# 1015| params:
|
||||
#-----| body: { ... }
|
||||
# 1015| 0: return ...
|
||||
# 1015| 0: _FUN
|
||||
# 1015| Type = ..(*)(..)
|
||||
# 1015| ValueCategory = prvalue(load)
|
||||
# 1017| void Lambda(int, String const&)
|
||||
# 1017| params:
|
||||
# 1017| 0: x
|
||||
# 1017| Type = int
|
||||
# 1017| 1: s
|
||||
# 1017| Type = const String &
|
||||
# 1017| body: { ... }
|
||||
# 1018| 0: declaration
|
||||
# 1018| 0: definition of lambda_empty
|
||||
# 1018| Type = decltype([...](...){...})
|
||||
# 1018| init: initializer for lambda_empty
|
||||
# 1018| expr: [...](...){...}
|
||||
# 1018| Type = decltype([...](...){...})
|
||||
# 1018| ValueCategory = prvalue
|
||||
# 1019| 1: ExprStmt
|
||||
# 1019| 0: call to operator()
|
||||
# 1019| Type = char
|
||||
# 1019| Value = 65
|
||||
# 1019| ValueCategory = prvalue
|
||||
# 1019| -1: (const lambda [] type at line 1018, col. 23)...
|
||||
# 1019| Conversion = glvalue conversion
|
||||
# 1019| Type = const lambda [] type at line 1018, col. 23
|
||||
# 1019| ValueCategory = lvalue
|
||||
# 1019| expr: lambda_empty
|
||||
# 1019| Type = decltype([...](...){...})
|
||||
# 1019| ValueCategory = lvalue
|
||||
# 1019| 0: (float)...
|
||||
# 1019| Conversion = integral to floating point conversion
|
||||
# 1019| Type = float
|
||||
# 1019| Value = 0.0
|
||||
# 1019| ValueCategory = prvalue
|
||||
# 1019| expr: 0
|
||||
# 1019| Type = int
|
||||
# 1019| Value = 0
|
||||
# 1019| ValueCategory = prvalue
|
||||
# 1020| 2: declaration
|
||||
# 1020| 0: definition of lambda_ref
|
||||
# 1020| Type = decltype([...](...){...})
|
||||
# 1020| init: initializer for lambda_ref
|
||||
# 1020| expr: [...](...){...}
|
||||
# 1020| Type = decltype([...](...){...})
|
||||
# 1020| ValueCategory = prvalue
|
||||
# 1020| 0: {...}
|
||||
# 1020| Type = decltype([...](...){...})
|
||||
# 1020| ValueCategory = prvalue
|
||||
# 1020| .s: (reference to)
|
||||
# 1020| Type = const String &
|
||||
# 1020| ValueCategory = prvalue
|
||||
# 1020| expr: (reference dereference)
|
||||
# 1020| Type = const String
|
||||
# 1020| ValueCategory = lvalue
|
||||
#-----| expr: s
|
||||
#-----| Type = const String &
|
||||
#-----| ValueCategory = prvalue(load)
|
||||
#-----| .x: (reference to)
|
||||
#-----| Type = int &
|
||||
#-----| ValueCategory = prvalue
|
||||
#-----| expr: x
|
||||
#-----| Type = int
|
||||
#-----| ValueCategory = lvalue
|
||||
# 1021| 3: ExprStmt
|
||||
# 1021| 0: call to operator()
|
||||
# 1021| Type = char
|
||||
# 1021| ValueCategory = prvalue
|
||||
# 1021| -1: (const lambda [] type at line 1020, col. 21)...
|
||||
# 1021| Conversion = glvalue conversion
|
||||
# 1021| Type = const lambda [] type at line 1020, col. 21
|
||||
# 1021| ValueCategory = lvalue
|
||||
# 1021| expr: lambda_ref
|
||||
# 1021| Type = decltype([...](...){...})
|
||||
# 1021| ValueCategory = lvalue
|
||||
# 1021| 0: (float)...
|
||||
# 1021| Conversion = integral to floating point conversion
|
||||
# 1021| Type = float
|
||||
# 1021| Value = 1.0
|
||||
# 1021| ValueCategory = prvalue
|
||||
# 1021| expr: 1
|
||||
# 1021| Type = int
|
||||
# 1021| Value = 1
|
||||
# 1021| ValueCategory = prvalue
|
||||
# 1022| 4: declaration
|
||||
# 1022| 0: definition of lambda_val
|
||||
# 1022| Type = decltype([...](...){...})
|
||||
# 1022| init: initializer for lambda_val
|
||||
# 1022| expr: call to (constructor)
|
||||
# 1022| Type = void
|
||||
# 1022| ValueCategory = prvalue
|
||||
# 1022| 0: (reference to)
|
||||
# 1022| Type = lambda [] type at line 1022, col. 21 &
|
||||
# 1022| ValueCategory = prvalue
|
||||
# 1022| expr: [...](...){...}
|
||||
# 1022| Type = decltype([...](...){...})
|
||||
# 1022| ValueCategory = prvalue
|
||||
# 1022| 0: {...}
|
||||
# 1022| Type = decltype([...](...){...})
|
||||
# 1022| ValueCategory = prvalue
|
||||
#-----| .s: call to String
|
||||
#-----| Type = void
|
||||
#-----| ValueCategory = prvalue
|
||||
#-----| .x: x
|
||||
#-----| Type = int
|
||||
#-----| ValueCategory = prvalue(load)
|
||||
# 1023| 5: ExprStmt
|
||||
# 1023| 0: call to operator()
|
||||
# 1023| Type = char
|
||||
# 1023| ValueCategory = prvalue
|
||||
# 1023| -1: (const lambda [] type at line 1022, col. 21)...
|
||||
# 1023| Conversion = glvalue conversion
|
||||
# 1023| Type = const lambda [] type at line 1022, col. 21
|
||||
# 1023| ValueCategory = lvalue
|
||||
# 1023| expr: lambda_val
|
||||
# 1023| Type = decltype([...](...){...})
|
||||
# 1023| ValueCategory = lvalue
|
||||
# 1023| 0: (float)...
|
||||
# 1023| Conversion = integral to floating point conversion
|
||||
# 1023| Type = float
|
||||
# 1023| Value = 2.0
|
||||
# 1023| ValueCategory = prvalue
|
||||
# 1023| expr: 2
|
||||
# 1023| Type = int
|
||||
# 1023| Value = 2
|
||||
# 1023| ValueCategory = prvalue
|
||||
# 1024| 6: declaration
|
||||
# 1024| 0: definition of lambda_ref_explicit
|
||||
# 1024| Type = decltype([...](...){...})
|
||||
# 1024| init: initializer for lambda_ref_explicit
|
||||
# 1024| expr: [...](...){...}
|
||||
# 1024| Type = decltype([...](...){...})
|
||||
# 1024| ValueCategory = prvalue
|
||||
# 1024| 0: {...}
|
||||
# 1024| Type = decltype([...](...){...})
|
||||
# 1024| ValueCategory = prvalue
|
||||
# 1024| .s: (reference to)
|
||||
# 1024| Type = const String &
|
||||
# 1024| ValueCategory = prvalue
|
||||
# 1024| expr: (reference dereference)
|
||||
# 1024| Type = const String
|
||||
# 1024| ValueCategory = lvalue
|
||||
# 1024| expr: s
|
||||
# 1024| Type = const String &
|
||||
# 1024| ValueCategory = prvalue(load)
|
||||
# 1025| 7: ExprStmt
|
||||
# 1025| 0: call to operator()
|
||||
# 1025| Type = char
|
||||
# 1025| ValueCategory = prvalue
|
||||
# 1025| -1: (const lambda [] type at line 1024, col. 30)...
|
||||
# 1025| Conversion = glvalue conversion
|
||||
# 1025| Type = const lambda [] type at line 1024, col. 30
|
||||
# 1025| ValueCategory = lvalue
|
||||
# 1025| expr: lambda_ref_explicit
|
||||
# 1025| Type = decltype([...](...){...})
|
||||
# 1025| ValueCategory = lvalue
|
||||
# 1025| 0: (float)...
|
||||
# 1025| Conversion = integral to floating point conversion
|
||||
# 1025| Type = float
|
||||
# 1025| Value = 3.0
|
||||
# 1025| ValueCategory = prvalue
|
||||
# 1025| expr: 3
|
||||
# 1025| Type = int
|
||||
# 1025| Value = 3
|
||||
# 1025| ValueCategory = prvalue
|
||||
# 1026| 8: declaration
|
||||
# 1026| 0: definition of lambda_val_explicit
|
||||
# 1026| Type = decltype([...](...){...})
|
||||
# 1026| init: initializer for lambda_val_explicit
|
||||
# 1026| expr: call to (constructor)
|
||||
# 1026| Type = void
|
||||
# 1026| ValueCategory = prvalue
|
||||
# 1026| 0: (reference to)
|
||||
# 1026| Type = lambda [] type at line 1026, col. 30 &
|
||||
# 1026| ValueCategory = prvalue
|
||||
# 1026| expr: [...](...){...}
|
||||
# 1026| Type = decltype([...](...){...})
|
||||
# 1026| ValueCategory = prvalue
|
||||
# 1026| 0: {...}
|
||||
# 1026| Type = decltype([...](...){...})
|
||||
# 1026| ValueCategory = prvalue
|
||||
#-----| .s: call to String
|
||||
#-----| Type = void
|
||||
#-----| ValueCategory = prvalue
|
||||
# 1027| 9: ExprStmt
|
||||
# 1027| 0: call to operator()
|
||||
# 1027| Type = char
|
||||
# 1027| ValueCategory = prvalue
|
||||
# 1027| -1: (const lambda [] type at line 1026, col. 30)...
|
||||
# 1027| Conversion = glvalue conversion
|
||||
# 1027| Type = const lambda [] type at line 1026, col. 30
|
||||
# 1027| ValueCategory = lvalue
|
||||
# 1027| expr: lambda_val_explicit
|
||||
# 1027| Type = decltype([...](...){...})
|
||||
# 1027| ValueCategory = lvalue
|
||||
# 1027| 0: (float)...
|
||||
# 1027| Conversion = integral to floating point conversion
|
||||
# 1027| Type = float
|
||||
# 1027| Value = 4.0
|
||||
# 1027| ValueCategory = prvalue
|
||||
# 1027| expr: 4
|
||||
# 1027| Type = int
|
||||
# 1027| Value = 4
|
||||
# 1027| ValueCategory = prvalue
|
||||
# 1028| 10: declaration
|
||||
# 1028| 0: definition of lambda_mixed_explicit
|
||||
# 1028| Type = decltype([...](...){...})
|
||||
# 1028| init: initializer for lambda_mixed_explicit
|
||||
# 1028| expr: [...](...){...}
|
||||
# 1028| Type = decltype([...](...){...})
|
||||
# 1028| ValueCategory = prvalue
|
||||
# 1028| 0: {...}
|
||||
# 1028| Type = decltype([...](...){...})
|
||||
# 1028| ValueCategory = prvalue
|
||||
# 1028| .s: (reference to)
|
||||
# 1028| Type = const String &
|
||||
# 1028| ValueCategory = prvalue
|
||||
# 1028| expr: (reference dereference)
|
||||
# 1028| Type = const String
|
||||
# 1028| ValueCategory = lvalue
|
||||
# 1028| expr: s
|
||||
# 1028| Type = const String &
|
||||
# 1028| ValueCategory = prvalue(load)
|
||||
# 1028| .x: x
|
||||
# 1028| Type = int
|
||||
# 1028| ValueCategory = prvalue(load)
|
||||
# 1029| 11: ExprStmt
|
||||
# 1029| 0: call to operator()
|
||||
# 1029| Type = char
|
||||
# 1029| ValueCategory = prvalue
|
||||
# 1029| -1: (const lambda [] type at line 1028, col. 32)...
|
||||
# 1029| Conversion = glvalue conversion
|
||||
# 1029| Type = const lambda [] type at line 1028, col. 32
|
||||
# 1029| ValueCategory = lvalue
|
||||
# 1029| expr: lambda_mixed_explicit
|
||||
# 1029| Type = decltype([...](...){...})
|
||||
# 1029| ValueCategory = lvalue
|
||||
# 1029| 0: (float)...
|
||||
# 1029| Conversion = integral to floating point conversion
|
||||
# 1029| Type = float
|
||||
# 1029| Value = 5.0
|
||||
# 1029| ValueCategory = prvalue
|
||||
# 1029| expr: 5
|
||||
# 1029| Type = int
|
||||
# 1029| Value = 5
|
||||
# 1029| ValueCategory = prvalue
|
||||
# 1030| 12: declaration
|
||||
# 1030| 0: definition of r
|
||||
# 1030| Type = int
|
||||
# 1030| init: initializer for r
|
||||
# 1030| expr: ... - ...
|
||||
# 1030| Type = int
|
||||
# 1030| ValueCategory = prvalue
|
||||
# 1030| 0: x
|
||||
# 1030| Type = int
|
||||
# 1030| ValueCategory = prvalue(load)
|
||||
# 1030| 1: 1
|
||||
# 1030| Type = int
|
||||
# 1030| Value = 1
|
||||
# 1030| ValueCategory = prvalue
|
||||
# 1031| 13: declaration
|
||||
# 1031| 0: definition of lambda_inits
|
||||
# 1031| Type = decltype([...](...){...})
|
||||
# 1031| init: initializer for lambda_inits
|
||||
# 1031| expr: [...](...){...}
|
||||
# 1031| Type = decltype([...](...){...})
|
||||
# 1031| ValueCategory = prvalue
|
||||
# 1031| 0: {...}
|
||||
# 1031| Type = decltype([...](...){...})
|
||||
# 1031| ValueCategory = prvalue
|
||||
# 1031| .s: (reference to)
|
||||
# 1031| Type = const String &
|
||||
# 1031| ValueCategory = prvalue
|
||||
# 1031| expr: (reference dereference)
|
||||
# 1031| Type = const String
|
||||
# 1031| ValueCategory = lvalue
|
||||
# 1031| expr: s
|
||||
# 1031| Type = const String &
|
||||
# 1031| ValueCategory = prvalue(load)
|
||||
# 1031| .x: x
|
||||
# 1031| Type = int
|
||||
# 1031| ValueCategory = prvalue(load)
|
||||
# 1031| .i: ... + ...
|
||||
# 1031| Type = int
|
||||
# 1031| ValueCategory = prvalue
|
||||
# 1031| 0: x
|
||||
# 1031| Type = int
|
||||
# 1031| ValueCategory = prvalue(load)
|
||||
# 1031| 1: 1
|
||||
# 1031| Type = int
|
||||
# 1031| Value = 1
|
||||
# 1031| ValueCategory = prvalue
|
||||
# 1031| .j: (reference to)
|
||||
# 1031| Type = int &
|
||||
# 1031| ValueCategory = prvalue
|
||||
# 1031| expr: r
|
||||
# 1031| Type = int
|
||||
# 1031| ValueCategory = lvalue
|
||||
# 1032| 14: ExprStmt
|
||||
# 1032| 0: call to operator()
|
||||
# 1032| Type = char
|
||||
# 1032| ValueCategory = prvalue
|
||||
# 1032| -1: (const lambda [] type at line 1031, col. 23)...
|
||||
# 1032| Conversion = glvalue conversion
|
||||
# 1032| Type = const lambda [] type at line 1031, col. 23
|
||||
# 1032| ValueCategory = lvalue
|
||||
# 1032| expr: lambda_inits
|
||||
# 1032| Type = decltype([...](...){...})
|
||||
# 1032| ValueCategory = lvalue
|
||||
# 1032| 0: (float)...
|
||||
# 1032| Conversion = integral to floating point conversion
|
||||
# 1032| Type = float
|
||||
# 1032| Value = 6.0
|
||||
# 1032| ValueCategory = prvalue
|
||||
# 1032| expr: 6
|
||||
# 1032| Type = int
|
||||
# 1032| Value = 6
|
||||
# 1032| ValueCategory = prvalue
|
||||
# 1033| 15: return ...
|
||||
# 1018| (void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23)& (void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23)::operator=((void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23) const&)
|
||||
# 1018| params:
|
||||
#-----| 0: p#0
|
||||
#-----| Type = const lambda [] type at line 1018, col. 23 &
|
||||
# 1018| void (void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23) const&)
|
||||
# 1018| params:
|
||||
#-----| 0: p#0
|
||||
#-----| Type = const lambda [] type at line 1018, col. 23 &
|
||||
# 1018| void (void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23)&&)
|
||||
# 1018| params:
|
||||
#-----| 0: p#0
|
||||
#-----| Type = lambda [] type at line 1018, col. 23 &&
|
||||
# 1018| initializations:
|
||||
# 1018| body: { ... }
|
||||
# 1018| 0: return ...
|
||||
# 1018| void (void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23)::(constructor)()
|
||||
# 1018| params:
|
||||
# 1018| char (void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23)::_FUN(float)
|
||||
# 1018| params:
|
||||
# 1018| 0: f
|
||||
# 1018| Type = float
|
||||
# 1018| char (void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23)::operator()(float) const
|
||||
# 1018| params:
|
||||
# 1018| 0: f
|
||||
# 1018| Type = float
|
||||
# 1018| body: { ... }
|
||||
# 1018| 0: return ...
|
||||
# 1018| 0: 65
|
||||
# 1018| Type = char
|
||||
# 1018| Value = 65
|
||||
# 1018| ValueCategory = prvalue
|
||||
# 1018| char(* (void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23)::operator char (*)(float)() const)(float)
|
||||
# 1018| params:
|
||||
#-----| body: { ... }
|
||||
# 1018| 0: return ...
|
||||
# 1018| 0: _FUN
|
||||
# 1018| Type = ..(*)(..)
|
||||
# 1018| ValueCategory = prvalue(load)
|
||||
# 1020| (void Lambda(int, String const&))::(lambda [] type at line 1020, col. 21)& (void Lambda(int, String const&))::(lambda [] type at line 1020, col. 21)::operator=((void Lambda(int, String const&))::(lambda [] type at line 1020, col. 21) const&)
|
||||
# 1020| params:
|
||||
#-----| 0: p#0
|
||||
#-----| Type = const lambda [] type at line 1020, col. 21 &
|
||||
# 1020| void (void Lambda(int, String const&))::(lambda [] type at line 1020, col. 21)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1020, col. 21) const&)
|
||||
# 1020| params:
|
||||
#-----| 0: p#0
|
||||
#-----| Type = const lambda [] type at line 1020, col. 21 &
|
||||
# 1020| void (void Lambda(int, String const&))::(lambda [] type at line 1020, col. 21)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1020, col. 21)&&)
|
||||
# 1020| params:
|
||||
#-----| 0: p#0
|
||||
#-----| Type = lambda [] type at line 1020, col. 21 &&
|
||||
# 1020| initializations:
|
||||
# 1020| 0: constructor init of field s
|
||||
# 1020| Type = const String &
|
||||
# 1020| ValueCategory = prvalue
|
||||
# 1020| 0: Unknown literal
|
||||
# 1020| Type = const String &
|
||||
# 1020| ValueCategory = prvalue
|
||||
# 1020| 1: constructor init of field x
|
||||
# 1020| Type = int &
|
||||
# 1020| ValueCategory = prvalue
|
||||
# 1020| 0: Unknown literal
|
||||
# 1020| Type = int &
|
||||
# 1020| ValueCategory = prvalue
|
||||
# 1020| body: { ... }
|
||||
# 1020| 0: return ...
|
||||
# 1020| void (void Lambda(int, String const&))::(lambda [] type at line 1020, col. 21)::(constructor)()
|
||||
# 1020| params:
|
||||
# 1020| char (void Lambda(int, String const&))::(lambda [] type at line 1020, col. 21)::operator()(float) const
|
||||
# 1020| params:
|
||||
# 1020| 0: f
|
||||
# 1020| Type = float
|
||||
# 1020| body: { ... }
|
||||
# 1020| 0: return ...
|
||||
# 1020| 0: access to array
|
||||
# 1020| Type = char
|
||||
# 1020| ValueCategory = prvalue(load)
|
||||
# 1020| 0: call to c_str
|
||||
# 1020| Type = const char *
|
||||
# 1020| ValueCategory = prvalue
|
||||
# 1020| -1: (reference dereference)
|
||||
# 1020| Type = const String
|
||||
# 1020| ValueCategory = lvalue
|
||||
#-----| expr: s
|
||||
#-----| Type = const String &
|
||||
#-----| ValueCategory = prvalue(load)
|
||||
#-----| -1: this
|
||||
#-----| Type = const lambda [] type at line 1020, col. 21 *
|
||||
#-----| ValueCategory = prvalue(load)
|
||||
# 1020| 1: (reference dereference)
|
||||
# 1020| Type = int
|
||||
# 1020| ValueCategory = prvalue(load)
|
||||
#-----| expr: x
|
||||
#-----| Type = int &
|
||||
#-----| ValueCategory = prvalue(load)
|
||||
#-----| -1: this
|
||||
#-----| Type = const lambda [] type at line 1020, col. 21 *
|
||||
#-----| ValueCategory = prvalue(load)
|
||||
# 1022| (void Lambda(int, String const&))::(lambda [] type at line 1022, col. 21)& (void Lambda(int, String const&))::(lambda [] type at line 1022, col. 21)::operator=((void Lambda(int, String const&))::(lambda [] type at line 1022, col. 21) const&)
|
||||
# 1022| params:
|
||||
#-----| 0: p#0
|
||||
#-----| Type = const lambda [] type at line 1022, col. 21 &
|
||||
# 1022| void (void Lambda(int, String const&))::(lambda [] type at line 1022, col. 21)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1022, col. 21) const&)
|
||||
# 1022| params:
|
||||
#-----| 0: p#0
|
||||
#-----| Type = const lambda [] type at line 1022, col. 21 &
|
||||
# 1022| void (void Lambda(int, String const&))::(lambda [] type at line 1022, col. 21)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1022, col. 21)&&)
|
||||
# 1022| params:
|
||||
#-----| 0: p#0
|
||||
#-----| Type = lambda [] type at line 1022, col. 21 &&
|
||||
# 1022| initializations:
|
||||
# 1022| 0: constructor init of field s
|
||||
# 1022| Type = const String
|
||||
# 1022| ValueCategory = prvalue
|
||||
# 1022| 0: call to String
|
||||
# 1022| Type = void
|
||||
# 1022| ValueCategory = prvalue
|
||||
# 1022| 1: constructor init of field x
|
||||
# 1022| Type = int
|
||||
# 1022| ValueCategory = prvalue
|
||||
# 1022| 0: Unknown literal
|
||||
# 1022| Type = int
|
||||
# 1022| ValueCategory = prvalue
|
||||
# 1022| body: { ... }
|
||||
# 1022| 0: return ...
|
||||
# 1022| void (void Lambda(int, String const&))::(lambda [] type at line 1022, col. 21)::(constructor)()
|
||||
# 1022| params:
|
||||
# 1022| void (void Lambda(int, String const&))::(lambda [] type at line 1022, col. 21)::~<unnamed>()
|
||||
# 1022| params:
|
||||
#-----| body: { ... }
|
||||
#-----| 0: return ...
|
||||
# 1022| destructions:
|
||||
# 1022| 0: destructor field destruction of s
|
||||
# 1022| Type = const String
|
||||
# 1022| ValueCategory = prvalue
|
||||
# 1022| 0: call to ~String
|
||||
# 1022| Type = void
|
||||
# 1022| ValueCategory = prvalue
|
||||
# 1022| -1: s
|
||||
# 1022| Type = const String
|
||||
# 1022| ValueCategory = lvalue
|
||||
# 1022| char (void Lambda(int, String const&))::(lambda [] type at line 1022, col. 21)::operator()(float) const
|
||||
# 1022| params:
|
||||
# 1022| 0: f
|
||||
# 1022| Type = float
|
||||
# 1022| body: { ... }
|
||||
# 1022| 0: return ...
|
||||
# 1022| 0: access to array
|
||||
# 1022| Type = char
|
||||
# 1022| ValueCategory = prvalue(load)
|
||||
# 1022| 0: call to c_str
|
||||
# 1022| Type = const char *
|
||||
# 1022| ValueCategory = prvalue
|
||||
#-----| -1: s
|
||||
#-----| Type = const String
|
||||
#-----| ValueCategory = lvalue
|
||||
#-----| -1: this
|
||||
#-----| Type = const lambda [] type at line 1022, col. 21 *
|
||||
#-----| ValueCategory = prvalue(load)
|
||||
#-----| 1: x
|
||||
#-----| Type = int
|
||||
#-----| ValueCategory = prvalue(load)
|
||||
#-----| -1: this
|
||||
#-----| Type = const lambda [] type at line 1022, col. 21 *
|
||||
#-----| ValueCategory = prvalue(load)
|
||||
# 1024| (void Lambda(int, String const&))::(lambda [] type at line 1024, col. 30)& (void Lambda(int, String const&))::(lambda [] type at line 1024, col. 30)::operator=((void Lambda(int, String const&))::(lambda [] type at line 1024, col. 30) const&)
|
||||
# 1024| params:
|
||||
#-----| 0: p#0
|
||||
#-----| Type = const lambda [] type at line 1024, col. 30 &
|
||||
# 1024| void (void Lambda(int, String const&))::(lambda [] type at line 1024, col. 30)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1024, col. 30) const&)
|
||||
# 1024| params:
|
||||
#-----| 0: p#0
|
||||
#-----| Type = const lambda [] type at line 1024, col. 30 &
|
||||
# 1024| void (void Lambda(int, String const&))::(lambda [] type at line 1024, col. 30)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1024, col. 30)&&)
|
||||
# 1024| params:
|
||||
#-----| 0: p#0
|
||||
#-----| Type = lambda [] type at line 1024, col. 30 &&
|
||||
# 1024| initializations:
|
||||
# 1024| 0: constructor init of field s
|
||||
# 1024| Type = const String &
|
||||
# 1024| ValueCategory = prvalue
|
||||
# 1024| 0: Unknown literal
|
||||
# 1024| Type = const String &
|
||||
# 1024| ValueCategory = prvalue
|
||||
# 1024| body: { ... }
|
||||
# 1024| 0: return ...
|
||||
# 1024| void (void Lambda(int, String const&))::(lambda [] type at line 1024, col. 30)::(constructor)()
|
||||
# 1024| params:
|
||||
# 1024| char (void Lambda(int, String const&))::(lambda [] type at line 1024, col. 30)::operator()(float) const
|
||||
# 1024| params:
|
||||
# 1024| 0: f
|
||||
# 1024| Type = float
|
||||
# 1024| body: { ... }
|
||||
# 1024| 0: return ...
|
||||
# 1024| 0: access to array
|
||||
# 1024| Type = char
|
||||
# 1024| ValueCategory = prvalue(load)
|
||||
# 1024| 0: call to c_str
|
||||
# 1024| Type = const char *
|
||||
# 1024| ValueCategory = prvalue
|
||||
# 1024| -1: (reference dereference)
|
||||
# 1024| Type = const String
|
||||
# 1024| ValueCategory = lvalue
|
||||
#-----| expr: s
|
||||
#-----| Type = const String &
|
||||
#-----| ValueCategory = prvalue(load)
|
||||
#-----| -1: this
|
||||
#-----| Type = const lambda [] type at line 1024, col. 30 *
|
||||
#-----| ValueCategory = prvalue(load)
|
||||
# 1024| 1: 0
|
||||
# 1024| Type = int
|
||||
# 1024| Value = 0
|
||||
# 1024| ValueCategory = prvalue
|
||||
# 1026| (void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30)& (void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30)::operator=((void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30) const&)
|
||||
# 1026| params:
|
||||
#-----| 0: p#0
|
||||
#-----| Type = const lambda [] type at line 1026, col. 30 &
|
||||
# 1026| void (void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30) const&)
|
||||
# 1026| params:
|
||||
#-----| 0: p#0
|
||||
#-----| Type = const lambda [] type at line 1026, col. 30 &
|
||||
# 1026| void (void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30)&&)
|
||||
# 1026| params:
|
||||
#-----| 0: p#0
|
||||
#-----| Type = lambda [] type at line 1026, col. 30 &&
|
||||
# 1026| initializations:
|
||||
# 1026| 0: constructor init of field s
|
||||
# 1026| Type = const String
|
||||
# 1026| ValueCategory = prvalue
|
||||
# 1026| 0: call to String
|
||||
# 1026| Type = void
|
||||
# 1026| ValueCategory = prvalue
|
||||
# 1026| body: { ... }
|
||||
# 1026| 0: return ...
|
||||
# 1026| void (void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30)::(constructor)()
|
||||
# 1026| params:
|
||||
# 1026| void (void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30)::~<unnamed>()
|
||||
# 1026| params:
|
||||
#-----| body: { ... }
|
||||
#-----| 0: return ...
|
||||
# 1026| destructions:
|
||||
# 1026| 0: destructor field destruction of s
|
||||
# 1026| Type = const String
|
||||
# 1026| ValueCategory = prvalue
|
||||
# 1026| 0: call to ~String
|
||||
# 1026| Type = void
|
||||
# 1026| ValueCategory = prvalue
|
||||
# 1026| -1: s
|
||||
# 1026| Type = const String
|
||||
# 1026| ValueCategory = lvalue
|
||||
# 1026| char (void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30)::operator()(float) const
|
||||
# 1026| params:
|
||||
# 1026| 0: f
|
||||
# 1026| Type = float
|
||||
# 1026| body: { ... }
|
||||
# 1026| 0: return ...
|
||||
# 1026| 0: access to array
|
||||
# 1026| Type = char
|
||||
# 1026| ValueCategory = prvalue(load)
|
||||
# 1026| 0: call to c_str
|
||||
# 1026| Type = const char *
|
||||
# 1026| ValueCategory = prvalue
|
||||
#-----| -1: s
|
||||
#-----| Type = const String
|
||||
#-----| ValueCategory = lvalue
|
||||
#-----| -1: this
|
||||
#-----| Type = const lambda [] type at line 1026, col. 30 *
|
||||
#-----| ValueCategory = prvalue(load)
|
||||
# 1026| 1: 0
|
||||
# 1026| Type = int
|
||||
# 1026| Value = 0
|
||||
# 1026| ValueCategory = prvalue
|
||||
# 1028| (void Lambda(int, String const&))::(lambda [] type at line 1028, col. 32)& (void Lambda(int, String const&))::(lambda [] type at line 1028, col. 32)::operator=((void Lambda(int, String const&))::(lambda [] type at line 1028, col. 32) const&)
|
||||
# 1028| params:
|
||||
#-----| 0: p#0
|
||||
#-----| Type = const lambda [] type at line 1028, col. 32 &
|
||||
# 1028| void (void Lambda(int, String const&))::(lambda [] type at line 1028, col. 32)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1028, col. 32) const&)
|
||||
# 1028| params:
|
||||
#-----| 0: p#0
|
||||
#-----| Type = const lambda [] type at line 1028, col. 32 &
|
||||
# 1028| void (void Lambda(int, String const&))::(lambda [] type at line 1028, col. 32)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1028, col. 32)&&)
|
||||
# 1028| params:
|
||||
#-----| 0: p#0
|
||||
#-----| Type = lambda [] type at line 1028, col. 32 &&
|
||||
# 1028| initializations:
|
||||
# 1028| 0: constructor init of field s
|
||||
# 1028| Type = const String &
|
||||
# 1028| ValueCategory = prvalue
|
||||
# 1028| 0: Unknown literal
|
||||
# 1028| Type = const String &
|
||||
# 1028| ValueCategory = prvalue
|
||||
# 1028| 1: constructor init of field x
|
||||
# 1028| Type = int
|
||||
# 1028| ValueCategory = prvalue
|
||||
# 1028| 0: Unknown literal
|
||||
# 1028| Type = int
|
||||
# 1028| ValueCategory = prvalue
|
||||
# 1028| body: { ... }
|
||||
# 1028| 0: return ...
|
||||
# 1028| void (void Lambda(int, String const&))::(lambda [] type at line 1028, col. 32)::(constructor)()
|
||||
# 1028| params:
|
||||
# 1028| char (void Lambda(int, String const&))::(lambda [] type at line 1028, col. 32)::operator()(float) const
|
||||
# 1028| params:
|
||||
# 1028| 0: f
|
||||
# 1028| Type = float
|
||||
# 1028| body: { ... }
|
||||
# 1028| 0: return ...
|
||||
# 1028| 0: access to array
|
||||
# 1028| Type = char
|
||||
# 1028| ValueCategory = prvalue(load)
|
||||
# 1028| 0: call to c_str
|
||||
# 1028| Type = const char *
|
||||
# 1028| ValueCategory = prvalue
|
||||
# 1028| -1: (reference dereference)
|
||||
# 1028| Type = const String
|
||||
# 1028| ValueCategory = lvalue
|
||||
#-----| expr: s
|
||||
#-----| Type = const String &
|
||||
#-----| ValueCategory = prvalue(load)
|
||||
#-----| -1: this
|
||||
#-----| Type = const lambda [] type at line 1028, col. 32 *
|
||||
#-----| ValueCategory = prvalue(load)
|
||||
#-----| 1: x
|
||||
#-----| Type = int
|
||||
#-----| ValueCategory = prvalue(load)
|
||||
#-----| -1: this
|
||||
#-----| Type = const lambda [] type at line 1028, col. 32 *
|
||||
#-----| ValueCategory = prvalue(load)
|
||||
# 1031| (void Lambda(int, String const&))::(lambda [] type at line 1031, col. 23)& (void Lambda(int, String const&))::(lambda [] type at line 1031, col. 23)::operator=((void Lambda(int, String const&))::(lambda [] type at line 1031, col. 23) const&)
|
||||
# 1031| params:
|
||||
#-----| 0: p#0
|
||||
#-----| Type = const lambda [] type at line 1031, col. 23 &
|
||||
# 1031| void (void Lambda(int, String const&))::(lambda [] type at line 1031, col. 23)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1031, col. 23) const&)
|
||||
# 1031| params:
|
||||
#-----| 0: p#0
|
||||
#-----| Type = const lambda [] type at line 1031, col. 23 &
|
||||
# 1031| void (void Lambda(int, String const&))::(lambda [] type at line 1031, col. 23)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1031, col. 23)&&)
|
||||
# 1031| params:
|
||||
#-----| 0: p#0
|
||||
#-----| Type = lambda [] type at line 1031, col. 23 &&
|
||||
# 1031| initializations:
|
||||
# 1031| 0: constructor init of field s
|
||||
# 1031| Type = const String &
|
||||
# 1031| ValueCategory = prvalue
|
||||
# 1031| 0: Unknown literal
|
||||
# 1031| Type = const String &
|
||||
# 1031| ValueCategory = prvalue
|
||||
# 1031| 1: constructor init of field x
|
||||
# 1031| Type = int
|
||||
# 1031| ValueCategory = prvalue
|
||||
# 1031| 0: Unknown literal
|
||||
# 1031| Type = int
|
||||
# 1031| ValueCategory = prvalue
|
||||
# 1031| 2: constructor init of field i
|
||||
# 1031| Type = int
|
||||
# 1031| ValueCategory = prvalue
|
||||
# 1031| 0: Unknown literal
|
||||
# 1031| Type = int
|
||||
# 1031| ValueCategory = prvalue
|
||||
# 1031| 3: constructor init of field j
|
||||
# 1031| Type = int &
|
||||
# 1031| ValueCategory = prvalue
|
||||
# 1031| 0: Unknown literal
|
||||
# 1031| Type = int &
|
||||
# 1031| ValueCategory = prvalue
|
||||
# 1031| body: { ... }
|
||||
# 1031| 0: return ...
|
||||
# 1031| void (void Lambda(int, String const&))::(lambda [] type at line 1031, col. 23)::(constructor)()
|
||||
# 1031| params:
|
||||
# 1031| char (void Lambda(int, String const&))::(lambda [] type at line 1031, col. 23)::operator()(float) const
|
||||
# 1031| params:
|
||||
# 1031| 0: f
|
||||
# 1031| Type = float
|
||||
# 1031| body: { ... }
|
||||
# 1031| 0: return ...
|
||||
# 1031| 0: access to array
|
||||
# 1031| Type = char
|
||||
# 1031| ValueCategory = prvalue(load)
|
||||
# 1031| 0: call to c_str
|
||||
# 1031| Type = const char *
|
||||
# 1031| ValueCategory = prvalue
|
||||
# 1031| -1: (reference dereference)
|
||||
# 1031| Type = const String
|
||||
# 1031| ValueCategory = lvalue
|
||||
#-----| expr: s
|
||||
#-----| Type = const String &
|
||||
#-----| ValueCategory = prvalue(load)
|
||||
#-----| -1: this
|
||||
#-----| Type = const lambda [] type at line 1031, col. 23 *
|
||||
#-----| ValueCategory = prvalue(load)
|
||||
# 1031| 1: ... - ...
|
||||
# 1031| Type = int
|
||||
# 1031| ValueCategory = prvalue
|
||||
# 1031| 0: ... + ...
|
||||
# 1031| Type = int
|
||||
# 1031| ValueCategory = prvalue
|
||||
#-----| 0: x
|
||||
#-----| Type = int
|
||||
#-----| ValueCategory = prvalue(load)
|
||||
#-----| -1: this
|
||||
#-----| Type = const lambda [] type at line 1031, col. 23 *
|
||||
#-----| ValueCategory = prvalue(load)
|
||||
# 1031| 1: i
|
||||
# 1031| Type = int
|
||||
# 1031| ValueCategory = prvalue(load)
|
||||
#-----| -1: this
|
||||
#-----| Type = const lambda [] type at line 1031, col. 23 *
|
||||
#-----| ValueCategory = prvalue(load)
|
||||
# 1031| 1: (reference dereference)
|
||||
# 1031| Type = int
|
||||
# 1031| ValueCategory = prvalue(load)
|
||||
# 1031| expr: j
|
||||
# 1031| Type = int &
|
||||
# 1031| ValueCategory = prvalue(load)
|
||||
#-----| -1: this
|
||||
#-----| Type = const lambda [] type at line 1031, col. 23 *
|
||||
#-----| ValueCategory = prvalue(load)
|
||||
|
||||
@@ -1006,4 +1006,47 @@ void OperatorDeleteArray() {
|
||||
}
|
||||
#endif
|
||||
|
||||
struct EmptyStruct {};
|
||||
|
||||
void EmptyStructInit() {
|
||||
EmptyStruct s = {};
|
||||
}
|
||||
|
||||
auto lam = []() {};
|
||||
|
||||
void Lambda(int x, const String& s) {
|
||||
auto lambda_empty = [](float f) { return 'A'; };
|
||||
lambda_empty(0);
|
||||
auto lambda_ref = [&](float f) { return s.c_str()[x]; };
|
||||
lambda_ref(1);
|
||||
auto lambda_val = [=](float f) { return s.c_str()[x]; };
|
||||
lambda_val(2);
|
||||
auto lambda_ref_explicit = [&s](float f) { return s.c_str()[0]; };
|
||||
lambda_ref_explicit(3);
|
||||
auto lambda_val_explicit = [s](float f) { return s.c_str()[0]; };
|
||||
lambda_val_explicit(4);
|
||||
auto lambda_mixed_explicit = [&s, x](float f) { return s.c_str()[x]; };
|
||||
lambda_mixed_explicit(5);
|
||||
int r = x - 1;
|
||||
auto lambda_inits = [&s, x, i = x + 1, &j = r](float f) { return s.c_str()[x + i - j]; };
|
||||
lambda_inits(6);
|
||||
}
|
||||
|
||||
#if 0 // Explicit capture of `this` requires possible extractor fixes.
|
||||
|
||||
struct LambdaContainer {
|
||||
int x;
|
||||
|
||||
void LambdaMember(const String& s) {
|
||||
auto lambda_implicit_this = [=](float f) { return s.c_str()[x]; };
|
||||
lambda_implicit_this(1);
|
||||
auto lambda_explicit_this_byref = [this, &s](float f) { return s.c_str()[x]; };
|
||||
lambda_explicit_this_byref(2);
|
||||
auto lambda_explicit_this_bycopy = [*this, &s](float f) { return s.c_str()[x]; };
|
||||
lambda_explicit_this_bycopy(3);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// semmle-extractor-options: -std=c++17
|
||||
|
||||
@@ -4366,3 +4366,447 @@ ir.cpp:
|
||||
# 987| v0_21(void) = ReturnValue : r0_20, mu0_2
|
||||
# 987| v0_22(void) = UnmodeledUse : mu*
|
||||
# 987| v0_23(void) = ExitFunction :
|
||||
|
||||
# 1011| void EmptyStructInit()
|
||||
# 1011| Block 0
|
||||
# 1011| v0_0(void) = EnterFunction :
|
||||
# 1011| mu0_1(unknown) = AliasedDefinition :
|
||||
# 1011| mu0_2(unknown) = UnmodeledDefinition :
|
||||
# 1012| r0_3(glval<EmptyStruct>) = VariableAddress[s] :
|
||||
# 1012| mu0_4(EmptyStruct) = Uninitialized[s] : r0_3
|
||||
# 1013| v0_5(void) = NoOp :
|
||||
# 1011| v0_6(void) = ReturnVoid :
|
||||
# 1011| v0_7(void) = UnmodeledUse : mu*
|
||||
# 1011| v0_8(void) = ExitFunction :
|
||||
|
||||
# 1015| void (lambda [] type at line 1015, col. 12)::(constructor)((lambda [] type at line 1015, col. 12)&&)
|
||||
# 1015| Block 0
|
||||
# 1015| v0_0(void) = EnterFunction :
|
||||
# 1015| mu0_1(unknown) = AliasedDefinition :
|
||||
# 1015| mu0_2(unknown) = UnmodeledDefinition :
|
||||
# 1015| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
|
||||
#-----| r0_4(glval<lambda [] type at line 1015, col. 12 &&>) = VariableAddress[p#0] :
|
||||
#-----| mu0_5(lambda [] type at line 1015, col. 12 &&) = InitializeParameter[p#0] : r0_4
|
||||
# 1015| v0_6(void) = NoOp :
|
||||
# 1015| v0_7(void) = ReturnVoid :
|
||||
# 1015| v0_8(void) = UnmodeledUse : mu*
|
||||
# 1015| v0_9(void) = ExitFunction :
|
||||
|
||||
# 1015| void (lambda [] type at line 1015, col. 12)::operator()() const
|
||||
# 1015| Block 0
|
||||
# 1015| v0_0(void) = EnterFunction :
|
||||
# 1015| mu0_1(unknown) = AliasedDefinition :
|
||||
# 1015| mu0_2(unknown) = UnmodeledDefinition :
|
||||
# 1015| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
|
||||
# 1015| v0_4(void) = NoOp :
|
||||
# 1015| v0_5(void) = ReturnVoid :
|
||||
# 1015| v0_6(void) = UnmodeledUse : mu*
|
||||
# 1015| v0_7(void) = ExitFunction :
|
||||
|
||||
# 1015| void(* (lambda [] type at line 1015, col. 12)::operator void (*)()() const)()
|
||||
# 1015| Block 0
|
||||
# 1015| v0_0(void) = EnterFunction :
|
||||
# 1015| mu0_1(unknown) = AliasedDefinition :
|
||||
# 1015| mu0_2(unknown) = UnmodeledDefinition :
|
||||
# 1015| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
|
||||
# 1015| r0_4(glval<..(*)(..)>) = VariableAddress[#return] :
|
||||
# 1015| r0_5(glval<..(*)(..)>) = FunctionAddress[_FUN] :
|
||||
# 1015| mu0_6(..(*)(..)) = Store : r0_4, r0_5
|
||||
# 1015| r0_7(glval<..(*)(..)>) = VariableAddress[#return] :
|
||||
# 1015| v0_8(void) = ReturnValue : r0_7, mu0_2
|
||||
# 1015| v0_9(void) = UnmodeledUse : mu*
|
||||
# 1015| v0_10(void) = ExitFunction :
|
||||
|
||||
# 1017| void Lambda(int, String const&)
|
||||
# 1017| Block 0
|
||||
# 1017| v0_0(void) = EnterFunction :
|
||||
# 1017| mu0_1(unknown) = AliasedDefinition :
|
||||
# 1017| mu0_2(unknown) = UnmodeledDefinition :
|
||||
# 1017| r0_3(glval<int>) = VariableAddress[x] :
|
||||
# 1017| mu0_4(int) = InitializeParameter[x] : r0_3
|
||||
# 1017| r0_5(glval<String &>) = VariableAddress[s] :
|
||||
# 1017| mu0_6(String &) = InitializeParameter[s] : r0_5
|
||||
# 1018| r0_7(glval<decltype([...](...){...})>) = VariableAddress[lambda_empty] :
|
||||
# 1018| r0_8(glval<decltype([...](...){...})>) = VariableAddress[#temp1018:23] :
|
||||
# 1018| mu0_9(decltype([...](...){...})) = Uninitialized[#temp1018:23] : r0_8
|
||||
# 1018| r0_10(decltype([...](...){...})) = Load : r0_8, mu0_2
|
||||
# 1018| mu0_11(decltype([...](...){...})) = Store : r0_7, r0_10
|
||||
# 1019| r0_12(char) = Constant[65] :
|
||||
# 1020| r0_13(glval<decltype([...](...){...})>) = VariableAddress[lambda_ref] :
|
||||
# 1020| r0_14(glval<decltype([...](...){...})>) = VariableAddress[#temp1020:21] :
|
||||
# 1020| mu0_15(decltype([...](...){...})) = Uninitialized[#temp1020:21] : r0_14
|
||||
# 1020| r0_16(glval<String &>) = FieldAddress[s] : r0_14
|
||||
#-----| r0_17(glval<String &>) = VariableAddress[s] :
|
||||
#-----| r0_18(String &) = Load : r0_17, mu0_2
|
||||
# 1020| mu0_19(String &) = Store : r0_16, r0_18
|
||||
# 1020| r0_20(glval<int &>) = FieldAddress[x] : r0_14
|
||||
#-----| r0_21(glval<int>) = VariableAddress[x] :
|
||||
#-----| mu0_22(int &) = Store : r0_20, r0_21
|
||||
# 1020| r0_23(decltype([...](...){...})) = Load : r0_14, mu0_2
|
||||
# 1020| mu0_24(decltype([...](...){...})) = Store : r0_13, r0_23
|
||||
# 1021| r0_25(glval<decltype([...](...){...})>) = VariableAddress[lambda_ref] :
|
||||
# 1021| r0_26(glval<decltype([...](...){...})>) = Convert : r0_25
|
||||
# 1021| r0_27(glval<unknown>) = FunctionAddress[operator()] :
|
||||
# 1021| r0_28(float) = Constant[1.0] :
|
||||
# 1021| r0_29(char) = Call : r0_27, this:r0_26, r0_28
|
||||
# 1021| mu0_30(unknown) = ^CallSideEffect : mu0_2
|
||||
# 1022| r0_31(glval<decltype([...](...){...})>) = VariableAddress[lambda_val] :
|
||||
# 1022| r0_32(glval<unknown>) = FunctionAddress[(constructor)] :
|
||||
# 1022| r0_33(glval<decltype([...](...){...})>) = VariableAddress[#temp1022:21] :
|
||||
# 1022| mu0_34(decltype([...](...){...})) = Uninitialized[#temp1022:21] : r0_33
|
||||
# 1022| r0_35(glval<String>) = FieldAddress[s] : r0_33
|
||||
#-----| r0_36(glval<unknown>) = FunctionAddress[String] :
|
||||
#-----| v0_37(void) = Call : r0_36, this:r0_35
|
||||
#-----| mu0_38(unknown) = ^CallSideEffect : mu0_2
|
||||
# 1022| r0_39(glval<int>) = FieldAddress[x] : r0_33
|
||||
#-----| r0_40(glval<int>) = VariableAddress[x] :
|
||||
#-----| r0_41(int) = Load : r0_40, mu0_2
|
||||
#-----| mu0_42(int) = Store : r0_39, r0_41
|
||||
# 1022| r0_43(decltype([...](...){...})) = Load : r0_33, mu0_2
|
||||
# 1022| v0_44(void) = Call : r0_32, this:r0_31, r0_43
|
||||
# 1022| mu0_45(unknown) = ^CallSideEffect : mu0_2
|
||||
# 1023| r0_46(glval<decltype([...](...){...})>) = VariableAddress[lambda_val] :
|
||||
# 1023| r0_47(glval<decltype([...](...){...})>) = Convert : r0_46
|
||||
# 1023| r0_48(glval<unknown>) = FunctionAddress[operator()] :
|
||||
# 1023| r0_49(float) = Constant[2.0] :
|
||||
# 1023| r0_50(char) = Call : r0_48, this:r0_47, r0_49
|
||||
# 1023| mu0_51(unknown) = ^CallSideEffect : mu0_2
|
||||
# 1024| r0_52(glval<decltype([...](...){...})>) = VariableAddress[lambda_ref_explicit] :
|
||||
# 1024| r0_53(glval<decltype([...](...){...})>) = VariableAddress[#temp1024:30] :
|
||||
# 1024| mu0_54(decltype([...](...){...})) = Uninitialized[#temp1024:30] : r0_53
|
||||
# 1024| r0_55(glval<String &>) = FieldAddress[s] : r0_53
|
||||
# 1024| r0_56(glval<String &>) = VariableAddress[s] :
|
||||
# 1024| r0_57(String &) = Load : r0_56, mu0_2
|
||||
# 1024| mu0_58(String &) = Store : r0_55, r0_57
|
||||
# 1024| r0_59(decltype([...](...){...})) = Load : r0_53, mu0_2
|
||||
# 1024| mu0_60(decltype([...](...){...})) = Store : r0_52, r0_59
|
||||
# 1025| r0_61(glval<decltype([...](...){...})>) = VariableAddress[lambda_ref_explicit] :
|
||||
# 1025| r0_62(glval<decltype([...](...){...})>) = Convert : r0_61
|
||||
# 1025| r0_63(glval<unknown>) = FunctionAddress[operator()] :
|
||||
# 1025| r0_64(float) = Constant[3.0] :
|
||||
# 1025| r0_65(char) = Call : r0_63, this:r0_62, r0_64
|
||||
# 1025| mu0_66(unknown) = ^CallSideEffect : mu0_2
|
||||
# 1026| r0_67(glval<decltype([...](...){...})>) = VariableAddress[lambda_val_explicit] :
|
||||
# 1026| r0_68(glval<unknown>) = FunctionAddress[(constructor)] :
|
||||
# 1026| r0_69(glval<decltype([...](...){...})>) = VariableAddress[#temp1026:30] :
|
||||
# 1026| mu0_70(decltype([...](...){...})) = Uninitialized[#temp1026:30] : r0_69
|
||||
# 1026| r0_71(glval<String>) = FieldAddress[s] : r0_69
|
||||
#-----| r0_72(glval<unknown>) = FunctionAddress[String] :
|
||||
#-----| v0_73(void) = Call : r0_72, this:r0_71
|
||||
#-----| mu0_74(unknown) = ^CallSideEffect : mu0_2
|
||||
# 1026| r0_75(decltype([...](...){...})) = Load : r0_69, mu0_2
|
||||
# 1026| v0_76(void) = Call : r0_68, this:r0_67, r0_75
|
||||
# 1026| mu0_77(unknown) = ^CallSideEffect : mu0_2
|
||||
# 1027| r0_78(glval<decltype([...](...){...})>) = VariableAddress[lambda_val_explicit] :
|
||||
# 1027| r0_79(glval<decltype([...](...){...})>) = Convert : r0_78
|
||||
# 1027| r0_80(glval<unknown>) = FunctionAddress[operator()] :
|
||||
# 1027| r0_81(float) = Constant[4.0] :
|
||||
# 1027| r0_82(char) = Call : r0_80, this:r0_79, r0_81
|
||||
# 1027| mu0_83(unknown) = ^CallSideEffect : mu0_2
|
||||
# 1028| r0_84(glval<decltype([...](...){...})>) = VariableAddress[lambda_mixed_explicit] :
|
||||
# 1028| r0_85(glval<decltype([...](...){...})>) = VariableAddress[#temp1028:32] :
|
||||
# 1028| mu0_86(decltype([...](...){...})) = Uninitialized[#temp1028:32] : r0_85
|
||||
# 1028| r0_87(glval<String &>) = FieldAddress[s] : r0_85
|
||||
# 1028| r0_88(glval<String &>) = VariableAddress[s] :
|
||||
# 1028| r0_89(String &) = Load : r0_88, mu0_2
|
||||
# 1028| mu0_90(String &) = Store : r0_87, r0_89
|
||||
# 1028| r0_91(glval<int>) = FieldAddress[x] : r0_85
|
||||
# 1028| r0_92(glval<int>) = VariableAddress[x] :
|
||||
# 1028| r0_93(int) = Load : r0_92, mu0_2
|
||||
# 1028| mu0_94(int) = Store : r0_91, r0_93
|
||||
# 1028| r0_95(decltype([...](...){...})) = Load : r0_85, mu0_2
|
||||
# 1028| mu0_96(decltype([...](...){...})) = Store : r0_84, r0_95
|
||||
# 1029| r0_97(glval<decltype([...](...){...})>) = VariableAddress[lambda_mixed_explicit] :
|
||||
# 1029| r0_98(glval<decltype([...](...){...})>) = Convert : r0_97
|
||||
# 1029| r0_99(glval<unknown>) = FunctionAddress[operator()] :
|
||||
# 1029| r0_100(float) = Constant[5.0] :
|
||||
# 1029| r0_101(char) = Call : r0_99, this:r0_98, r0_100
|
||||
# 1029| mu0_102(unknown) = ^CallSideEffect : mu0_2
|
||||
# 1030| r0_103(glval<int>) = VariableAddress[r] :
|
||||
# 1030| r0_104(glval<int>) = VariableAddress[x] :
|
||||
# 1030| r0_105(int) = Load : r0_104, mu0_2
|
||||
# 1030| r0_106(int) = Constant[1] :
|
||||
# 1030| r0_107(int) = Sub : r0_105, r0_106
|
||||
# 1030| mu0_108(int) = Store : r0_103, r0_107
|
||||
# 1031| r0_109(glval<decltype([...](...){...})>) = VariableAddress[lambda_inits] :
|
||||
# 1031| r0_110(glval<decltype([...](...){...})>) = VariableAddress[#temp1031:23] :
|
||||
# 1031| mu0_111(decltype([...](...){...})) = Uninitialized[#temp1031:23] : r0_110
|
||||
# 1031| r0_112(glval<String &>) = FieldAddress[s] : r0_110
|
||||
# 1031| r0_113(glval<String &>) = VariableAddress[s] :
|
||||
# 1031| r0_114(String &) = Load : r0_113, mu0_2
|
||||
# 1031| mu0_115(String &) = Store : r0_112, r0_114
|
||||
# 1031| r0_116(glval<int>) = FieldAddress[x] : r0_110
|
||||
# 1031| r0_117(glval<int>) = VariableAddress[x] :
|
||||
# 1031| r0_118(int) = Load : r0_117, mu0_2
|
||||
# 1031| mu0_119(int) = Store : r0_116, r0_118
|
||||
# 1031| r0_120(glval<int>) = FieldAddress[i] : r0_110
|
||||
# 1031| r0_121(glval<int>) = VariableAddress[x] :
|
||||
# 1031| r0_122(int) = Load : r0_121, mu0_2
|
||||
# 1031| r0_123(int) = Constant[1] :
|
||||
# 1031| r0_124(int) = Add : r0_122, r0_123
|
||||
# 1031| mu0_125(int) = Store : r0_120, r0_124
|
||||
# 1031| r0_126(glval<int &>) = FieldAddress[j] : r0_110
|
||||
# 1031| r0_127(glval<int>) = VariableAddress[r] :
|
||||
# 1031| mu0_128(int &) = Store : r0_126, r0_127
|
||||
# 1031| r0_129(decltype([...](...){...})) = Load : r0_110, mu0_2
|
||||
# 1031| mu0_130(decltype([...](...){...})) = Store : r0_109, r0_129
|
||||
# 1032| r0_131(glval<decltype([...](...){...})>) = VariableAddress[lambda_inits] :
|
||||
# 1032| r0_132(glval<decltype([...](...){...})>) = Convert : r0_131
|
||||
# 1032| r0_133(glval<unknown>) = FunctionAddress[operator()] :
|
||||
# 1032| r0_134(float) = Constant[6.0] :
|
||||
# 1032| r0_135(char) = Call : r0_133, this:r0_132, r0_134
|
||||
# 1032| mu0_136(unknown) = ^CallSideEffect : mu0_2
|
||||
# 1033| v0_137(void) = NoOp :
|
||||
# 1017| v0_138(void) = ReturnVoid :
|
||||
# 1017| v0_139(void) = UnmodeledUse : mu*
|
||||
# 1017| v0_140(void) = ExitFunction :
|
||||
|
||||
# 1018| void (void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23)&&)
|
||||
# 1018| Block 0
|
||||
# 1018| v0_0(void) = EnterFunction :
|
||||
# 1018| mu0_1(unknown) = AliasedDefinition :
|
||||
# 1018| mu0_2(unknown) = UnmodeledDefinition :
|
||||
# 1018| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
|
||||
#-----| r0_4(glval<lambda [] type at line 1018, col. 23 &&>) = VariableAddress[p#0] :
|
||||
#-----| mu0_5(lambda [] type at line 1018, col. 23 &&) = InitializeParameter[p#0] : r0_4
|
||||
# 1018| v0_6(void) = NoOp :
|
||||
# 1018| v0_7(void) = ReturnVoid :
|
||||
# 1018| v0_8(void) = UnmodeledUse : mu*
|
||||
# 1018| v0_9(void) = ExitFunction :
|
||||
|
||||
# 1018| char (void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23)::operator()(float) const
|
||||
# 1018| Block 0
|
||||
# 1018| v0_0(void) = EnterFunction :
|
||||
# 1018| mu0_1(unknown) = AliasedDefinition :
|
||||
# 1018| mu0_2(unknown) = UnmodeledDefinition :
|
||||
# 1018| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
|
||||
# 1018| r0_4(glval<float>) = VariableAddress[f] :
|
||||
# 1018| mu0_5(float) = InitializeParameter[f] : r0_4
|
||||
# 1018| r0_6(glval<char>) = VariableAddress[#return] :
|
||||
# 1018| r0_7(char) = Constant[65] :
|
||||
# 1018| mu0_8(char) = Store : r0_6, r0_7
|
||||
# 1018| r0_9(glval<char>) = VariableAddress[#return] :
|
||||
# 1018| v0_10(void) = ReturnValue : r0_9, mu0_2
|
||||
# 1018| v0_11(void) = UnmodeledUse : mu*
|
||||
# 1018| v0_12(void) = ExitFunction :
|
||||
|
||||
# 1018| char(* (void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23)::operator char (*)(float)() const)(float)
|
||||
# 1018| Block 0
|
||||
# 1018| v0_0(void) = EnterFunction :
|
||||
# 1018| mu0_1(unknown) = AliasedDefinition :
|
||||
# 1018| mu0_2(unknown) = UnmodeledDefinition :
|
||||
# 1018| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
|
||||
# 1018| r0_4(glval<..(*)(..)>) = VariableAddress[#return] :
|
||||
# 1018| r0_5(glval<..(*)(..)>) = FunctionAddress[_FUN] :
|
||||
# 1018| mu0_6(..(*)(..)) = Store : r0_4, r0_5
|
||||
# 1018| r0_7(glval<..(*)(..)>) = VariableAddress[#return] :
|
||||
# 1018| v0_8(void) = ReturnValue : r0_7, mu0_2
|
||||
# 1018| v0_9(void) = UnmodeledUse : mu*
|
||||
# 1018| v0_10(void) = ExitFunction :
|
||||
|
||||
# 1020| char (void Lambda(int, String const&))::(lambda [] type at line 1020, col. 21)::operator()(float) const
|
||||
# 1020| Block 0
|
||||
# 1020| v0_0(void) = EnterFunction :
|
||||
# 1020| mu0_1(unknown) = AliasedDefinition :
|
||||
# 1020| mu0_2(unknown) = UnmodeledDefinition :
|
||||
# 1020| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
|
||||
# 1020| r0_4(glval<float>) = VariableAddress[f] :
|
||||
# 1020| mu0_5(float) = InitializeParameter[f] : r0_4
|
||||
# 1020| r0_6(glval<char>) = VariableAddress[#return] :
|
||||
#-----| r0_7(lambda [] type at line 1020, col. 21 *) = CopyValue : r0_3
|
||||
#-----| r0_8(glval<String &>) = FieldAddress[s] : r0_7
|
||||
#-----| r0_9(String &) = Load : r0_8, mu0_2
|
||||
# 1020| r0_10(glval<unknown>) = FunctionAddress[c_str] :
|
||||
# 1020| r0_11(char *) = Call : r0_10, this:r0_9
|
||||
# 1020| mu0_12(unknown) = ^CallSideEffect : mu0_2
|
||||
#-----| r0_13(lambda [] type at line 1020, col. 21 *) = CopyValue : r0_3
|
||||
#-----| r0_14(glval<int &>) = FieldAddress[x] : r0_13
|
||||
#-----| r0_15(int &) = Load : r0_14, mu0_2
|
||||
# 1020| r0_16(int) = Load : r0_15, mu0_2
|
||||
# 1020| r0_17(char *) = PointerAdd[1] : r0_11, r0_16
|
||||
# 1020| r0_18(char) = Load : r0_17, mu0_2
|
||||
# 1020| mu0_19(char) = Store : r0_6, r0_18
|
||||
# 1020| r0_20(glval<char>) = VariableAddress[#return] :
|
||||
# 1020| v0_21(void) = ReturnValue : r0_20, mu0_2
|
||||
# 1020| v0_22(void) = UnmodeledUse : mu*
|
||||
# 1020| v0_23(void) = ExitFunction :
|
||||
|
||||
# 1022| void (void Lambda(int, String const&))::(lambda [] type at line 1022, col. 21)::~<unnamed>()
|
||||
# 1022| Block 0
|
||||
# 1022| v0_0(void) = EnterFunction :
|
||||
# 1022| mu0_1(unknown) = AliasedDefinition :
|
||||
# 1022| mu0_2(unknown) = UnmodeledDefinition :
|
||||
# 1022| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
|
||||
#-----| v0_4(void) = NoOp :
|
||||
# 1022| r0_5(glval<String>) = FieldAddress[s] : r0_3
|
||||
# 1022| r0_6(glval<unknown>) = FunctionAddress[~String] :
|
||||
# 1022| v0_7(void) = Call : r0_6, this:r0_5
|
||||
# 1022| mu0_8(unknown) = ^CallSideEffect : mu0_2
|
||||
# 1022| v0_9(void) = ReturnVoid :
|
||||
# 1022| v0_10(void) = UnmodeledUse : mu*
|
||||
# 1022| v0_11(void) = ExitFunction :
|
||||
|
||||
# 1022| char (void Lambda(int, String const&))::(lambda [] type at line 1022, col. 21)::operator()(float) const
|
||||
# 1022| Block 0
|
||||
# 1022| v0_0(void) = EnterFunction :
|
||||
# 1022| mu0_1(unknown) = AliasedDefinition :
|
||||
# 1022| mu0_2(unknown) = UnmodeledDefinition :
|
||||
# 1022| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
|
||||
# 1022| r0_4(glval<float>) = VariableAddress[f] :
|
||||
# 1022| mu0_5(float) = InitializeParameter[f] : r0_4
|
||||
# 1022| r0_6(glval<char>) = VariableAddress[#return] :
|
||||
#-----| r0_7(lambda [] type at line 1022, col. 21 *) = CopyValue : r0_3
|
||||
#-----| r0_8(glval<String>) = FieldAddress[s] : r0_7
|
||||
# 1022| r0_9(glval<unknown>) = FunctionAddress[c_str] :
|
||||
# 1022| r0_10(char *) = Call : r0_9, this:r0_8
|
||||
# 1022| mu0_11(unknown) = ^CallSideEffect : mu0_2
|
||||
#-----| r0_12(lambda [] type at line 1022, col. 21 *) = CopyValue : r0_3
|
||||
#-----| r0_13(glval<int>) = FieldAddress[x] : r0_12
|
||||
#-----| r0_14(int) = Load : r0_13, mu0_2
|
||||
# 1022| r0_15(char *) = PointerAdd[1] : r0_10, r0_14
|
||||
# 1022| r0_16(char) = Load : r0_15, mu0_2
|
||||
# 1022| mu0_17(char) = Store : r0_6, r0_16
|
||||
# 1022| r0_18(glval<char>) = VariableAddress[#return] :
|
||||
# 1022| v0_19(void) = ReturnValue : r0_18, mu0_2
|
||||
# 1022| v0_20(void) = UnmodeledUse : mu*
|
||||
# 1022| v0_21(void) = ExitFunction :
|
||||
|
||||
# 1024| char (void Lambda(int, String const&))::(lambda [] type at line 1024, col. 30)::operator()(float) const
|
||||
# 1024| Block 0
|
||||
# 1024| v0_0(void) = EnterFunction :
|
||||
# 1024| mu0_1(unknown) = AliasedDefinition :
|
||||
# 1024| mu0_2(unknown) = UnmodeledDefinition :
|
||||
# 1024| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
|
||||
# 1024| r0_4(glval<float>) = VariableAddress[f] :
|
||||
# 1024| mu0_5(float) = InitializeParameter[f] : r0_4
|
||||
# 1024| r0_6(glval<char>) = VariableAddress[#return] :
|
||||
#-----| r0_7(lambda [] type at line 1024, col. 30 *) = CopyValue : r0_3
|
||||
#-----| r0_8(glval<String &>) = FieldAddress[s] : r0_7
|
||||
#-----| r0_9(String &) = Load : r0_8, mu0_2
|
||||
# 1024| r0_10(glval<unknown>) = FunctionAddress[c_str] :
|
||||
# 1024| r0_11(char *) = Call : r0_10, this:r0_9
|
||||
# 1024| mu0_12(unknown) = ^CallSideEffect : mu0_2
|
||||
# 1024| r0_13(int) = Constant[0] :
|
||||
# 1024| r0_14(char *) = PointerAdd[1] : r0_11, r0_13
|
||||
# 1024| r0_15(char) = Load : r0_14, mu0_2
|
||||
# 1024| mu0_16(char) = Store : r0_6, r0_15
|
||||
# 1024| r0_17(glval<char>) = VariableAddress[#return] :
|
||||
# 1024| v0_18(void) = ReturnValue : r0_17, mu0_2
|
||||
# 1024| v0_19(void) = UnmodeledUse : mu*
|
||||
# 1024| v0_20(void) = ExitFunction :
|
||||
|
||||
# 1026| void (void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30)&&)
|
||||
# 1026| Block 0
|
||||
# 1026| v0_0(void) = EnterFunction :
|
||||
# 1026| mu0_1(unknown) = AliasedDefinition :
|
||||
# 1026| mu0_2(unknown) = UnmodeledDefinition :
|
||||
# 1026| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
|
||||
#-----| r0_4(glval<lambda [] type at line 1026, col. 30 &&>) = VariableAddress[p#0] :
|
||||
#-----| mu0_5(lambda [] type at line 1026, col. 30 &&) = InitializeParameter[p#0] : r0_4
|
||||
# 1026| r0_6(glval<String>) = FieldAddress[s] : r0_3
|
||||
# 1026| r0_7(glval<unknown>) = FunctionAddress[String] :
|
||||
# 1026| v0_8(void) = Call : r0_7, this:r0_6
|
||||
# 1026| mu0_9(unknown) = ^CallSideEffect : mu0_2
|
||||
# 1026| v0_10(void) = NoOp :
|
||||
# 1026| v0_11(void) = ReturnVoid :
|
||||
# 1026| v0_12(void) = UnmodeledUse : mu*
|
||||
# 1026| v0_13(void) = ExitFunction :
|
||||
|
||||
# 1026| void (void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30)::~<unnamed>()
|
||||
# 1026| Block 0
|
||||
# 1026| v0_0(void) = EnterFunction :
|
||||
# 1026| mu0_1(unknown) = AliasedDefinition :
|
||||
# 1026| mu0_2(unknown) = UnmodeledDefinition :
|
||||
# 1026| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
|
||||
#-----| v0_4(void) = NoOp :
|
||||
# 1026| r0_5(glval<String>) = FieldAddress[s] : r0_3
|
||||
# 1026| r0_6(glval<unknown>) = FunctionAddress[~String] :
|
||||
# 1026| v0_7(void) = Call : r0_6, this:r0_5
|
||||
# 1026| mu0_8(unknown) = ^CallSideEffect : mu0_2
|
||||
# 1026| v0_9(void) = ReturnVoid :
|
||||
# 1026| v0_10(void) = UnmodeledUse : mu*
|
||||
# 1026| v0_11(void) = ExitFunction :
|
||||
|
||||
# 1026| char (void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30)::operator()(float) const
|
||||
# 1026| Block 0
|
||||
# 1026| v0_0(void) = EnterFunction :
|
||||
# 1026| mu0_1(unknown) = AliasedDefinition :
|
||||
# 1026| mu0_2(unknown) = UnmodeledDefinition :
|
||||
# 1026| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
|
||||
# 1026| r0_4(glval<float>) = VariableAddress[f] :
|
||||
# 1026| mu0_5(float) = InitializeParameter[f] : r0_4
|
||||
# 1026| r0_6(glval<char>) = VariableAddress[#return] :
|
||||
#-----| r0_7(lambda [] type at line 1026, col. 30 *) = CopyValue : r0_3
|
||||
#-----| r0_8(glval<String>) = FieldAddress[s] : r0_7
|
||||
# 1026| r0_9(glval<unknown>) = FunctionAddress[c_str] :
|
||||
# 1026| r0_10(char *) = Call : r0_9, this:r0_8
|
||||
# 1026| mu0_11(unknown) = ^CallSideEffect : mu0_2
|
||||
# 1026| r0_12(int) = Constant[0] :
|
||||
# 1026| r0_13(char *) = PointerAdd[1] : r0_10, r0_12
|
||||
# 1026| r0_14(char) = Load : r0_13, mu0_2
|
||||
# 1026| mu0_15(char) = Store : r0_6, r0_14
|
||||
# 1026| r0_16(glval<char>) = VariableAddress[#return] :
|
||||
# 1026| v0_17(void) = ReturnValue : r0_16, mu0_2
|
||||
# 1026| v0_18(void) = UnmodeledUse : mu*
|
||||
# 1026| v0_19(void) = ExitFunction :
|
||||
|
||||
# 1028| char (void Lambda(int, String const&))::(lambda [] type at line 1028, col. 32)::operator()(float) const
|
||||
# 1028| Block 0
|
||||
# 1028| v0_0(void) = EnterFunction :
|
||||
# 1028| mu0_1(unknown) = AliasedDefinition :
|
||||
# 1028| mu0_2(unknown) = UnmodeledDefinition :
|
||||
# 1028| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
|
||||
# 1028| r0_4(glval<float>) = VariableAddress[f] :
|
||||
# 1028| mu0_5(float) = InitializeParameter[f] : r0_4
|
||||
# 1028| r0_6(glval<char>) = VariableAddress[#return] :
|
||||
#-----| r0_7(lambda [] type at line 1028, col. 32 *) = CopyValue : r0_3
|
||||
#-----| r0_8(glval<String &>) = FieldAddress[s] : r0_7
|
||||
#-----| r0_9(String &) = Load : r0_8, mu0_2
|
||||
# 1028| r0_10(glval<unknown>) = FunctionAddress[c_str] :
|
||||
# 1028| r0_11(char *) = Call : r0_10, this:r0_9
|
||||
# 1028| mu0_12(unknown) = ^CallSideEffect : mu0_2
|
||||
#-----| r0_13(lambda [] type at line 1028, col. 32 *) = CopyValue : r0_3
|
||||
#-----| r0_14(glval<int>) = FieldAddress[x] : r0_13
|
||||
#-----| r0_15(int) = Load : r0_14, mu0_2
|
||||
# 1028| r0_16(char *) = PointerAdd[1] : r0_11, r0_15
|
||||
# 1028| r0_17(char) = Load : r0_16, mu0_2
|
||||
# 1028| mu0_18(char) = Store : r0_6, r0_17
|
||||
# 1028| r0_19(glval<char>) = VariableAddress[#return] :
|
||||
# 1028| v0_20(void) = ReturnValue : r0_19, mu0_2
|
||||
# 1028| v0_21(void) = UnmodeledUse : mu*
|
||||
# 1028| v0_22(void) = ExitFunction :
|
||||
|
||||
# 1031| char (void Lambda(int, String const&))::(lambda [] type at line 1031, col. 23)::operator()(float) const
|
||||
# 1031| Block 0
|
||||
# 1031| v0_0(void) = EnterFunction :
|
||||
# 1031| mu0_1(unknown) = AliasedDefinition :
|
||||
# 1031| mu0_2(unknown) = UnmodeledDefinition :
|
||||
# 1031| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
|
||||
# 1031| r0_4(glval<float>) = VariableAddress[f] :
|
||||
# 1031| mu0_5(float) = InitializeParameter[f] : r0_4
|
||||
# 1031| r0_6(glval<char>) = VariableAddress[#return] :
|
||||
#-----| r0_7(lambda [] type at line 1031, col. 23 *) = CopyValue : r0_3
|
||||
#-----| r0_8(glval<String &>) = FieldAddress[s] : r0_7
|
||||
#-----| r0_9(String &) = Load : r0_8, mu0_2
|
||||
# 1031| r0_10(glval<unknown>) = FunctionAddress[c_str] :
|
||||
# 1031| r0_11(char *) = Call : r0_10, this:r0_9
|
||||
# 1031| mu0_12(unknown) = ^CallSideEffect : mu0_2
|
||||
#-----| r0_13(lambda [] type at line 1031, col. 23 *) = CopyValue : r0_3
|
||||
#-----| r0_14(glval<int>) = FieldAddress[x] : r0_13
|
||||
#-----| r0_15(int) = Load : r0_14, mu0_2
|
||||
#-----| r0_16(lambda [] type at line 1031, col. 23 *) = CopyValue : r0_3
|
||||
# 1031| r0_17(glval<int>) = FieldAddress[i] : r0_16
|
||||
# 1031| r0_18(int) = Load : r0_17, mu0_2
|
||||
# 1031| r0_19(int) = Add : r0_15, r0_18
|
||||
#-----| r0_20(lambda [] type at line 1031, col. 23 *) = CopyValue : r0_3
|
||||
# 1031| r0_21(glval<int &>) = FieldAddress[j] : r0_20
|
||||
# 1031| r0_22(int &) = Load : r0_21, mu0_2
|
||||
# 1031| r0_23(int) = Load : r0_22, mu0_2
|
||||
# 1031| r0_24(int) = Sub : r0_19, r0_23
|
||||
# 1031| r0_25(char *) = PointerAdd[1] : r0_11, r0_24
|
||||
# 1031| r0_26(char) = Load : r0_25, mu0_2
|
||||
# 1031| mu0_27(char) = Store : r0_6, r0_26
|
||||
# 1031| r0_28(glval<char>) = VariableAddress[#return] :
|
||||
# 1031| v0_29(void) = ReturnValue : r0_28, mu0_2
|
||||
# 1031| v0_30(void) = UnmodeledUse : mu*
|
||||
# 1031| v0_31(void) = ExitFunction :
|
||||
|
||||
@@ -371,3 +371,56 @@ void test12(bool cond)
|
||||
free(z); // GOOD
|
||||
}
|
||||
}
|
||||
|
||||
// ---
|
||||
|
||||
class MyBuffer13
|
||||
{
|
||||
public:
|
||||
MyBuffer13(int size)
|
||||
{
|
||||
buffer = (char *)malloc(size * sizeof(char));
|
||||
}
|
||||
|
||||
~MyBuffer13()
|
||||
{
|
||||
free(buffer); // GOOD
|
||||
}
|
||||
|
||||
char *getBuffer() // note: this should not be considered an allocation function
|
||||
{
|
||||
return buffer;
|
||||
}
|
||||
|
||||
private:
|
||||
char *buffer;
|
||||
};
|
||||
|
||||
class MyPointer13
|
||||
{
|
||||
public:
|
||||
MyPointer13(char *_pointer) : pointer(_pointer)
|
||||
{
|
||||
}
|
||||
|
||||
MyPointer13(MyBuffer13 &buffer) : pointer(buffer.getBuffer())
|
||||
{
|
||||
}
|
||||
|
||||
char *getPointer() // note: this should not be considered an allocation function
|
||||
{
|
||||
return pointer;
|
||||
}
|
||||
|
||||
private:
|
||||
char *pointer;
|
||||
};
|
||||
|
||||
void test13()
|
||||
{
|
||||
MyBuffer13 myBuffer(100);
|
||||
MyPointer13 myPointer2(myBuffer);
|
||||
MyPointer13 myPointer3(new char[100]);
|
||||
|
||||
delete myPointer3.getPointer(); // GOOD
|
||||
}
|
||||
|
||||
@@ -265,3 +265,30 @@ int negative_zero(double dbl) {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nan(double x) {
|
||||
if (x < 0.0) {
|
||||
return 100;
|
||||
}
|
||||
else if (x >= 0.0) { // GOOD [x could be NaN]
|
||||
return 200;
|
||||
}
|
||||
else {
|
||||
return 300;
|
||||
}
|
||||
}
|
||||
|
||||
int nan2(double x) {
|
||||
if (x == x) {
|
||||
// If x compares with anything at all, it's not NaN
|
||||
if (x < 0.0) {
|
||||
return 100;
|
||||
}
|
||||
else if (x >= 0.0) { // BAD [Always true]
|
||||
return 200;
|
||||
}
|
||||
else {
|
||||
return 300;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,5 +32,6 @@
|
||||
| PointlessComparison.c:129:12:129:16 | ... > ... | Comparison is always false because a <= 3. |
|
||||
| PointlessComparison.c:197:7:197:11 | ... < ... | Comparison is always false because x >= 0. |
|
||||
| PointlessComparison.c:264:12:264:22 | ... >= ... | Comparison is always true because dbl >= 0 and -0 >= - .... |
|
||||
| PointlessComparison.c:287:14:287:21 | ... >= ... | Comparison is always true because x >= 0. |
|
||||
| RegressionTests.cpp:57:7:57:22 | ... <= ... | Comparison is always true because * ... <= 4294967295. |
|
||||
| Templates.cpp:9:10:9:24 | ... <= ... | Comparison is always true because local <= 32767. |
|
||||
|
||||
@@ -66,3 +66,17 @@ int regression_test_01(unsigned long bb) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
int containsIfDef(int x) {
|
||||
int result = 0;
|
||||
if (x > 0) {
|
||||
result = 1;
|
||||
}
|
||||
#if _CONDITION
|
||||
if (x < 0) {
|
||||
result = -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
return result >= 0;
|
||||
}
|
||||
@@ -40,4 +40,6 @@ void test(int i, const char *str)
|
||||
printf("%2$.*4$f", 0, num, 0, precision); // GOOD [FALSE POSITIVE]
|
||||
printf("%2$.*4$f", num, 0, precision); // BAD (too few format arguments) [INCORRECT MESSAGE]
|
||||
}
|
||||
|
||||
printf("%@ %i %i", 1, 2); // GOOD
|
||||
}
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
| tests.cpp:18:15:18:22 | Hello | This argument should be of type 'char *' but is of type 'char16_t *' |
|
||||
| tests.cpp:19:15:19:22 | Hello | This argument should be of type 'char *' but is of type 'wchar_t *' |
|
||||
| tests.cpp:25:17:25:23 | Hello | This argument should be of type 'wchar_t *' but is of type 'char *' |
|
||||
| tests.cpp:26:17:26:24 | Hello | This argument should be of type 'wchar_t *' but is of type 'char16_t *' |
|
||||
| tests.cpp:30:17:30:24 | Hello | This argument should be of type 'char *' but is of type 'char16_t *' |
|
||||
| tests.cpp:31:17:31:24 | Hello | This argument should be of type 'char *' but is of type 'wchar_t *' |
|
||||
| tests.cpp:33:36:33:42 | Hello | This argument should be of type 'char16_t *' but is of type 'char *' |
|
||||
| tests.cpp:35:36:35:43 | Hello | This argument should be of type 'char16_t *' but is of type 'wchar_t *' |
|
||||
| tests.cpp:38:36:38:43 | Hello | This argument should be of type 'char *' but is of type 'char16_t *' |
|
||||
| tests.cpp:39:36:39:43 | Hello | This argument should be of type 'char *' but is of type 'wchar_t *' |
|
||||
| tests.cpp:26:17:26:24 | Hello | This argument should be of type 'char *' but is of type 'char16_t *' |
|
||||
| tests.cpp:27:17:27:24 | Hello | This argument should be of type 'char *' but is of type 'wchar_t *' |
|
||||
| tests.cpp:29:17:29:23 | Hello | This argument should be of type 'wchar_t *' but is of type 'char *' |
|
||||
| tests.cpp:30:17:30:24 | Hello | This argument should be of type 'wchar_t *' but is of type 'char16_t *' |
|
||||
| tests.cpp:34:36:34:43 | Hello | This argument should be of type 'char *' but is of type 'char16_t *' |
|
||||
| tests.cpp:35:36:35:43 | Hello | This argument should be of type 'char *' but is of type 'wchar_t *' |
|
||||
| tests.cpp:37:36:37:42 | Hello | This argument should be of type 'char16_t *' but is of type 'char *' |
|
||||
| tests.cpp:39:36:39:43 | Hello | This argument should be of type 'char16_t *' but is of type 'wchar_t *' |
|
||||
| tests.cpp:42:37:42:44 | Hello | This argument should be of type 'char *' but is of type 'char16_t *' |
|
||||
| tests.cpp:43:37:43:44 | Hello | This argument should be of type 'char *' but is of type 'wchar_t *' |
|
||||
| tests.cpp:45:37:45:43 | Hello | This argument should be of type 'char16_t *' but is of type 'char *' |
|
||||
| tests.cpp:47:37:47:44 | Hello | This argument should be of type 'char16_t *' but is of type 'wchar_t *' |
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
| tests.cpp:8:5:8:10 | printf | char | char16_t, wchar_t | char16_t, wchar_t |
|
||||
| tests.cpp:9:5:9:11 | wprintf | wchar_t | char | wchar_t |
|
||||
| tests.cpp:10:5:10:12 | swprintf | char16_t | char | char16_t |
|
||||
| tests.cpp:8:5:8:10 | printf | char | char | char16_t, wchar_t | char16_t, wchar_t |
|
||||
| tests.cpp:9:5:9:11 | wprintf | wchar_t | char | wchar_t | wchar_t |
|
||||
| tests.cpp:10:5:10:12 | swprintf | char16_t | char | char16_t | char16_t |
|
||||
|
||||
@@ -3,6 +3,7 @@ import cpp
|
||||
from FormattingFunction f
|
||||
select
|
||||
f,
|
||||
concat(f.getFormatCharType().toString(), ", "),
|
||||
concat(f.getDefaultCharType().toString(), ", "),
|
||||
concat(f.getNonDefaultCharType().toString(), ", "),
|
||||
concat(f.getWideCharType().toString(), ", ")
|
||||
|
||||
@@ -22,19 +22,27 @@ void tests() {
|
||||
printf("%S", u"Hello"); // GOOD
|
||||
printf("%S", L"Hello"); // GOOD
|
||||
|
||||
wprintf(L"%s", "Hello"); // BAD: expecting wchar_t
|
||||
wprintf(L"%s", u"Hello"); // BAD: expecting wchar_t
|
||||
wprintf(L"%s", L"Hello"); // GOOD
|
||||
wprintf(L"%s", "Hello"); // GOOD
|
||||
wprintf(L"%s", u"Hello"); // BAD: expecting char
|
||||
wprintf(L"%s", L"Hello"); // BAD: expecting char
|
||||
|
||||
wprintf(L"%S", "Hello"); // GOOD
|
||||
wprintf(L"%S", u"Hello"); // BAD: expecting char
|
||||
wprintf(L"%S", L"Hello"); // BAD: expecting char
|
||||
wprintf(L"%S", "Hello"); // BAD: expecting wchar_t
|
||||
wprintf(L"%S", u"Hello"); // BAD: expecting wchar_t
|
||||
wprintf(L"%S", L"Hello"); // GOOD
|
||||
|
||||
swprintf(buffer, BUF_SIZE, u"%s", "Hello"); // BAD: expecting char16_t
|
||||
swprintf(buffer, BUF_SIZE, u"%s", u"Hello"); // GOOD
|
||||
swprintf(buffer, BUF_SIZE, u"%s", L"Hello"); // BAD: expecting char16_t
|
||||
swprintf(buffer, BUF_SIZE, u"%s", "Hello"); // GOOD
|
||||
swprintf(buffer, BUF_SIZE, u"%s", u"Hello"); // BAD: expecting char
|
||||
swprintf(buffer, BUF_SIZE, u"%s", L"Hello"); // BAD: expecting char
|
||||
|
||||
swprintf(buffer, BUF_SIZE, u"%S", "Hello"); // GOOD
|
||||
swprintf(buffer, BUF_SIZE, u"%S", u"Hello"); // BAD: expecting char
|
||||
swprintf(buffer, BUF_SIZE, u"%S", L"Hello"); // BAD: expecting char
|
||||
swprintf(buffer, BUF_SIZE, u"%S", "Hello"); // BAD: expecting char16_t
|
||||
swprintf(buffer, BUF_SIZE, u"%S", u"Hello"); // GOOD
|
||||
swprintf(buffer, BUF_SIZE, u"%S", L"Hello"); // BAD: expecting char16_t
|
||||
|
||||
swprintf(buffer, BUF_SIZE, u"%hs", "Hello"); // GOOD
|
||||
swprintf(buffer, BUF_SIZE, u"%hs", u"Hello"); // BAD: expecting char
|
||||
swprintf(buffer, BUF_SIZE, u"%hs", L"Hello"); // BAD: expecting char
|
||||
|
||||
swprintf(buffer, BUF_SIZE, u"%ls", "Hello"); // BAD: expecting char16_t
|
||||
swprintf(buffer, BUF_SIZE, u"%ls", u"Hello"); // GOOD
|
||||
swprintf(buffer, BUF_SIZE, u"%ls", L"Hello"); // BAD: expecting char16_t
|
||||
}
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
| printf.cpp:33:31:33:37 | test | This argument should be of type 'char *' but is of type 'char16_t *' |
|
||||
| printf.cpp:45:29:45:35 | test | This argument should be of type 'char *' but is of type 'char16_t *' |
|
||||
| printf.cpp:52:29:52:35 | test | This argument should be of type 'char16_t *' but is of type 'wchar_t *' |
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
| printf.cpp:15:5:15:12 | swprintf | char16_t | char | char16_t |
|
||||
| printf.cpp:15:5:15:12 | swprintf | char | char16_t | char16_t |
|
||||
| printf.cpp:26:5:26:11 | sprintf | char | char16_t | char16_t |
|
||||
|
||||
@@ -30,7 +30,7 @@ int sprintf(char *dest, char *format, ...);
|
||||
void test1() {
|
||||
WCHAR string[20];
|
||||
|
||||
swprintf(string, u"test %s", u"test"); // GOOD
|
||||
swprintf(string, u"test %s", u"test"); // BAD: `char16_t` string parameter read as `char` string
|
||||
}
|
||||
|
||||
void test2() {
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
| printf1.h:45:18:45:20 | ull | This argument should be of type 'unsigned int' but is of type 'unsigned long long' |
|
||||
| printf1.h:46:18:46:20 | ull | This argument should be of type 'unsigned int' but is of type 'unsigned long long' |
|
||||
| printf1.h:47:19:47:21 | ull | This argument should be of type 'unsigned int' but is of type 'unsigned long long' |
|
||||
| printf1.h:126:18:126:19 | wc | This argument should be of type 'char *' but is of type 'wchar_t *' |
|
||||
| printf1.h:127:18:127:18 | c | This argument should be of type 'wchar_t *' but is of type 'char *' |
|
||||
| real_world.h:61:21:61:22 | & ... | This argument should be of type 'int *' but is of type 'short *' |
|
||||
| real_world.h:62:22:62:23 | & ... | This argument should be of type 'short *' but is of type 'int *' |
|
||||
| real_world.h:63:22:63:24 | & ... | This argument should be of type 'short *' but is of type 'unsigned int *' |
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
| common.h:12:12:12:17 | printf | char | wchar_t | wchar_t |
|
||||
| common.h:15:12:15:18 | wprintf | wchar_t | char | wchar_t |
|
||||
| common.h:15:12:15:18 | wprintf | char | wchar_t | wchar_t |
|
||||
| format.h:4:13:4:17 | error | char | wchar_t | wchar_t |
|
||||
| real_world.h:8:12:8:18 | fprintf | char | wchar_t | wchar_t |
|
||||
| real_world.h:33:6:33:12 | msg_out | char | wchar_t | wchar_t |
|
||||
|
||||
@@ -119,3 +119,11 @@ void test_chars(char c, wchar_t wc, wint_t wt)
|
||||
wprintf(L"%C", wc); // GOOD (converts to wint_t)
|
||||
wprintf(L"%C", wt); // GOOD
|
||||
}
|
||||
|
||||
void test_ws(char *c, wchar_t *wc)
|
||||
{
|
||||
wprintf(L"%s", c); // GOOD
|
||||
wprintf(L"%s", wc); // BAD
|
||||
wprintf(L"%S", c); // BAD
|
||||
wprintf(L"%S", wc); // GOOD
|
||||
}
|
||||
|
||||
@@ -17,8 +17,11 @@
|
||||
| printf1.h:74:19:74:22 | C_ST | This argument should be of type 'ssize_t' but is of type 'unsigned long long' |
|
||||
| printf1.h:75:19:75:28 | sizeof(<expr>) | This argument should be of type 'ssize_t' but is of type 'unsigned long long' |
|
||||
| printf1.h:84:23:84:35 | ... - ... | This argument should be of type 'ssize_t' but is of type 'long long' |
|
||||
| printf1.h:125:18:125:18 | c | This argument should be of type '__wchar_t *' but is of type 'char *' |
|
||||
| printf1.h:128:18:128:19 | wc | This argument should be of type 'char *' but is of type '__wchar_t *' |
|
||||
| real_world.h:61:21:61:22 | & ... | This argument should be of type 'int *' but is of type 'short *' |
|
||||
| real_world.h:62:22:62:23 | & ... | This argument should be of type 'short *' but is of type 'int *' |
|
||||
| real_world.h:63:22:63:24 | & ... | This argument should be of type 'short *' but is of type 'unsigned int *' |
|
||||
| real_world.h:64:22:64:24 | & ... | This argument should be of type 'short *' but is of type 'signed int *' |
|
||||
| wide_string.h:25:18:25:20 | c | This argument should be of type 'char' but is of type 'char *' |
|
||||
| wide_string.h:29:19:29:22 | c | This argument should be of type 'wchar_t' but is of type '__wchar_t *' |
|
||||
|
||||
@@ -119,3 +119,11 @@ void test_chars(char c, wchar_t wc, wint_t wt)
|
||||
wprintf(L"%C", wc); // BAD [NOT DETECTED]
|
||||
wprintf(L"%C", wt); // BAD [NOT DETECTED]
|
||||
}
|
||||
|
||||
void test_ws(char *c, wchar_t *wc, wint_t *wt)
|
||||
{
|
||||
wprintf(L"%s", c); // BAD
|
||||
wprintf(L"%s", wc); // GOOD
|
||||
wprintf(L"%S", c); // GOOD
|
||||
wprintf(L"%S", wc); // BAD
|
||||
}
|
||||
|
||||
@@ -26,5 +26,5 @@ void test_wchar4(char c, const char cc, wchar_t wc, const wchar_t wcc) {
|
||||
printf("%wc", wc); // GOOD
|
||||
printf("%wc", wcc); // GOOD
|
||||
printf("%wc", L'c'); // GOOD
|
||||
printf("%wc", L"c"); // BAD [NOT DETECTED]
|
||||
printf("%wc", L"c"); // BAD
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
| test.cpp:42:31:42:36 | call to malloc | This allocation size is derived from $@ and might overflow | test.cpp:39:21:39:24 | argv | user input (argv) |
|
||||
| test.cpp:43:38:43:63 | ... * ... | This allocation size is derived from $@ and might overflow | test.cpp:39:21:39:24 | argv | user input (argv) |
|
||||
| test.cpp:48:25:48:30 | call to malloc | This allocation size is derived from $@ and might overflow | test.cpp:39:21:39:24 | argv | user input (argv) |
|
||||
| test.cpp:49:17:49:30 | new[] | This allocation size is derived from $@ and might overflow | test.cpp:39:21:39:24 | argv | user input (argv) |
|
||||
| test.cpp:52:35:52:60 | ... * ... | This allocation size is derived from $@ and might overflow | test.cpp:39:21:39:24 | argv | user input (argv) |
|
||||
| test.cpp:55:11:55:24 | new[] | This allocation size is derived from $@ and might overflow | test.cpp:39:21:39:24 | argv | user input (argv) |
|
||||
@@ -0,0 +1 @@
|
||||
Security/CWE/CWE-190/TaintedAllocationSize.ql
|
||||
@@ -0,0 +1,58 @@
|
||||
// Associated with CWE-190: Integer Overflow or Wraparound. http://cwe.mitre.org/data/definitions/190.html
|
||||
|
||||
typedef unsigned long size_t;
|
||||
typedef struct {} FILE;
|
||||
|
||||
void *malloc(size_t size);
|
||||
void *realloc(void *ptr, size_t size);
|
||||
int atoi(const char *nptr);
|
||||
|
||||
struct MyStruct
|
||||
{
|
||||
char data[256];
|
||||
};
|
||||
|
||||
namespace std
|
||||
{
|
||||
template<class charT> struct char_traits;
|
||||
|
||||
template <class charT, class traits = char_traits<charT> >
|
||||
class basic_istream /*: virtual public basic_ios<charT,traits> - not needed for this test */ {
|
||||
public:
|
||||
basic_istream<charT,traits>& operator>>(int& n);
|
||||
};
|
||||
|
||||
typedef basic_istream<char> istream;
|
||||
|
||||
extern istream cin;
|
||||
}
|
||||
|
||||
int getTainted() {
|
||||
int i;
|
||||
|
||||
std::cin >> i;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
int tainted = atoi(argv[1]);
|
||||
|
||||
MyStruct *arr1 = (MyStruct *)malloc(sizeof(MyStruct)); // GOOD
|
||||
MyStruct *arr2 = (MyStruct *)malloc(tainted); // BAD
|
||||
MyStruct *arr3 = (MyStruct *)malloc(tainted * sizeof(MyStruct)); // BAD
|
||||
MyStruct *arr4 = (MyStruct *)malloc(getTainted() * sizeof(MyStruct)); // BAD [NOT DETECTED]
|
||||
MyStruct *arr5 = (MyStruct *)malloc(sizeof(MyStruct) + tainted); // BAD [NOT DETECTED]
|
||||
|
||||
int size = tainted * 8;
|
||||
char *chars1 = (char *)malloc(size); // BAD
|
||||
char *chars2 = new char[size]; // BAD
|
||||
char *chars3 = new char[8]; // GOOD
|
||||
|
||||
arr1 = (MyStruct *)realloc(arr1, sizeof(MyStruct) * tainted); // BAD
|
||||
|
||||
size = 8;
|
||||
chars3 = new char[size]; // GOOD [FALSE POSITIVE]
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -8,6 +8,3 @@
|
||||
| test.c:14:15:14:28 | maxConnections | $@ flows to here and is used in arithmetic, potentially causing an underflow. | test.c:11:29:11:32 | argv | User-provided value |
|
||||
| test.c:44:7:44:10 | len2 | $@ flows to here and is used in arithmetic, potentially causing an underflow. | test.c:41:17:41:20 | argv | User-provided value |
|
||||
| test.c:54:7:54:10 | len3 | $@ flows to here and is used in arithmetic, potentially causing an underflow. | test.c:51:17:51:20 | argv | User-provided value |
|
||||
| test.c:74:7:74:10 | len5 | $@ flows to here and is used in arithmetic, potentially causing an underflow. | test.c:71:19:71:22 | argv | User-provided value |
|
||||
| test.c:84:7:84:10 | len6 | $@ flows to here and is used in arithmetic, potentially causing an underflow. | test.c:81:19:81:22 | argv | User-provided value |
|
||||
| test.c:94:7:94:10 | len7 | $@ flows to here and is used in arithmetic, potentially causing an underflow. | test.c:91:19:91:22 | argv | User-provided value |
|
||||
|
||||
@@ -71,7 +71,7 @@ int main(int argc, char** argv) {
|
||||
len5 = strlen(argv[1]);
|
||||
while (len5)
|
||||
{
|
||||
len5--; // GOOD: can't underflow [FALSE POSITIVE]
|
||||
len5--; // GOOD: can't underflow
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ int main(int argc, char** argv) {
|
||||
len6 = strlen(argv[1]);
|
||||
while (len6 != 0)
|
||||
{
|
||||
len6--; // GOOD: can't underflow [FALSE POSITIVE]
|
||||
len6--; // GOOD: can't underflow
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ int main(int argc, char** argv) {
|
||||
len7 = strlen(argv[1]);
|
||||
while ((len7) && (1))
|
||||
{
|
||||
len7--; // GOOD: can't underflow [FALSE POSITIVE]
|
||||
len7--; // GOOD: can't underflow
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
struct QObject {
|
||||
QObject(QObject *parent);
|
||||
void setParent(QObject *parent);
|
||||
};
|
||||
|
||||
struct DerivedFromQObject : public QObject {
|
||||
DerivedFromQObject(QObject *parent);
|
||||
};
|
||||
|
||||
class MyQtUser {
|
||||
DerivedFromQObject *noParent, *constructorParent, *laterParent;
|
||||
|
||||
MyQtUser(QObject *parent) {
|
||||
// This object sets its parent pointer to null and thus must be deleted
|
||||
// manually.
|
||||
noParent = new DerivedFromQObject(nullptr); // BAD [NOT DETECTED]
|
||||
|
||||
// This object does not need to be deleted because it will be deleted by
|
||||
// its parent object when the time is right.
|
||||
constructorParent = new DerivedFromQObject(parent); // GOOD
|
||||
|
||||
laterParent = new DerivedFromQObject(nullptr); // GOOD
|
||||
laterParent->setParent(parent);
|
||||
}
|
||||
};
|
||||
@@ -73,3 +73,39 @@ public:
|
||||
|
||||
int *a, *b, *c;
|
||||
};
|
||||
|
||||
class MyClass7
|
||||
{
|
||||
public:
|
||||
MyClass7()
|
||||
{
|
||||
}
|
||||
|
||||
bool open()
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
void close()
|
||||
{
|
||||
// ...
|
||||
}
|
||||
};
|
||||
|
||||
class myClass7Test
|
||||
{
|
||||
public:
|
||||
myClass7Test()
|
||||
{
|
||||
success = mc7.open(); // GOOD
|
||||
}
|
||||
|
||||
~myClass7Test()
|
||||
{
|
||||
mc7.close();
|
||||
}
|
||||
|
||||
private:
|
||||
MyClass7 mc7;
|
||||
bool success;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user