File tree Expand file tree Collapse file tree 4 files changed +7
-3
lines changed
lib/semmle/code/cpp/ir/implementation/raw/internal Expand file tree Collapse file tree 4 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -4147,7 +4147,7 @@ private predicate exprImmediatelyDiscarded(Expr expr) {
4147
4147
exists ( ExprStmt s |
4148
4148
s = expr .getParent ( ) and
4149
4149
not exists ( StmtExpr se | s = se .getStmt ( ) .( BlockStmt ) .getLastStmt ( ) ) and
4150
- not exists ( Conversion c | c = expr .getConversion * ( ) and not isTransparentConversion ( c ) )
4150
+ not exists ( expr .getConversion ( ) )
4151
4151
)
4152
4152
or
4153
4153
exists ( CommaExpr c | c .getLeftOperand ( ) = expr )
Original file line number Diff line number Diff line change @@ -42,8 +42,8 @@ void test_aggregate_literal() {
42
42
void test_postfix_crement (int *p, int q) {
43
43
p++; // $ asExpr="... ++" asIndirectExpr="... ++" asExpr=p asIndirectExpr=p
44
44
q++; // $ asExpr="... ++" asExpr=q
45
- (p++); // $ numberOfNodes ="... ++: 2" numberOfIndirectNodes ="... ++: 2 " asExpr="... ++" asIndirectExpr="... ++"
46
- (q++); // $ numberOfNodes ="... ++: 2 " asExpr="... ++"
45
+ (p++); // $ asExpr ="... ++" asIndirectExpr ="... ++" asExpr="p( ... ++) " asIndirectExpr="p(* ... ++) "
46
+ (q++); // $ asExpr ="... ++" asExpr="q( ... ++) "
47
47
(void )(p++); // $ asExpr="p(... ++)" asIndirectExpr="p(*... ++)"
48
48
(void )(q++); // $ asExpr="q(... ++)"
49
49
(void )p++; // $ asExpr="p(... ++)" asIndirectExpr="p(*... ++)"
Original file line number Diff line number Diff line change @@ -20184,11 +20184,13 @@ ir.cpp:
20184
20184
# 2731| r2731_3(int) = Constant[1] :
20185
20185
# 2731| r2731_4(int *) = PointerAdd[4] : r2731_2, r2731_3
20186
20186
# 2731| m2731_5(int *) = Store[p] : &:r2731_1, r2731_4
20187
+ # 2731| r2731_6(int *) = CopyValue : r2731_2
20187
20188
# 2732| r2732_1(glval<int>) = VariableAddress[q] :
20188
20189
# 2732| r2732_2(int) = Load[q] : &:r2732_1, m2730_5
20189
20190
# 2732| r2732_3(int) = Constant[1] :
20190
20191
# 2732| r2732_4(int) = Add : r2732_2, r2732_3
20191
20192
# 2732| m2732_5(int) = Store[q] : &:r2732_1, r2732_4
20193
+ # 2732| r2732_6(int) = CopyValue : r2732_2
20192
20194
# 2733| r2733_1(glval<int *>) = VariableAddress[p] :
20193
20195
# 2733| r2733_2(int *) = Load[p] : &:r2733_1, m2731_5
20194
20196
# 2733| r2733_3(int) = Constant[1] :
Original file line number Diff line number Diff line change @@ -18343,11 +18343,13 @@ ir.cpp:
18343
18343
# 2731| r2731_3(int) = Constant[1] :
18344
18344
# 2731| r2731_4(int *) = PointerAdd[4] : r2731_2, r2731_3
18345
18345
# 2731| mu2731_5(int *) = Store[p] : &:r2731_1, r2731_4
18346
+ # 2731| r2731_6(int *) = CopyValue : r2731_2
18346
18347
# 2732| r2732_1(glval<int>) = VariableAddress[q] :
18347
18348
# 2732| r2732_2(int) = Load[q] : &:r2732_1, ~m?
18348
18349
# 2732| r2732_3(int) = Constant[1] :
18349
18350
# 2732| r2732_4(int) = Add : r2732_2, r2732_3
18350
18351
# 2732| mu2732_5(int) = Store[q] : &:r2732_1, r2732_4
18352
+ # 2732| r2732_6(int) = CopyValue : r2732_2
18351
18353
# 2733| r2733_1(glval<int *>) = VariableAddress[p] :
18352
18354
# 2733| r2733_2(int *) = Load[p] : &:r2733_1, ~m?
18353
18355
# 2733| r2733_3(int) = Constant[1] :
You can’t perform that action at this time.
0 commit comments