Skip to content

Commit fc3c750

Browse files
committed
C++: accept test output
1 parent cd1403b commit fc3c750

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

cpp/ql/src/semmle/code/cpp/valuenumbering/HashCons.qll

+3-4
Original file line numberDiff line numberDiff line change
@@ -748,14 +748,13 @@ private predicate mk_FieldCons(Class c, int i, Field f, HashCons hc, HC_Fields h
748748
cal.getType().getUnspecifiedType() = c and
749749
exists(Expr e |
750750
e = cal.getFieldExpr(f).getFullyConverted() and
751-
e = cal.getChild(i).getFullyConverted() and
751+
f.getInitializationOrder() = i and
752752
hc = hashCons(e) and
753753
(
754754
exists(HashCons head, Field f2, HC_Fields tail |
755755
hcf = HC_FieldCons(c, i-1, f2, head, tail) and
756-
cal.getChild(i-1).getFullyConverted() = cal.getFieldExpr(f2).getFullyConverted() and
756+
f2.getInitializationOrder() = i-1 and
757757
mk_FieldCons(c, i-1, f2, head, tail, cal)
758-
759758
)
760759
or
761760
i = 0 and
@@ -777,7 +776,7 @@ private predicate mk_ClassAggregateLiteral(Class c, HC_Fields hcf, ClassAggregat
777776
c = cal.getType().getUnspecifiedType() and
778777
(
779778
exists(HC_Fields tail, Expr e, Field f |
780-
e = cal.getChild(cal.getNumChild() - 1).getFullyConverted() and
779+
f.getInitializationOrder() = cal.getNumChild() - 1 and
781780
e = cal.getFieldExpr(f).getFullyConverted() and
782781
hcf = HC_FieldCons(c, cal.getNumChild() - 1, f, hashCons(e), tail) and
783782
mk_FieldCons(c, cal.getNumChild() - 1, f, hashCons(e), tail, cal)

cpp/ql/test/library-tests/valuenumbering/HashCons/HashCons.expected

-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@
111111
| test.cpp:269:3:269:19 | {...} | 269:c3-c19 270:c3-c19 |
112112
| test.cpp:273:3:273:12 | new[] | 273:c3-c12 274:c3-c12 |
113113
| test.cpp:273:11:273:11 | x | 273:c11-c11 274:c11-c11 |
114-
| test.cpp:284:15:287:3 | {...} | 284:c15-c3 288:c15-c3 |
115114
| test.cpp:299:3:299:9 | throw ... | 299:c3-c9 300:c3-c9 |
116115
| test.cpp:301:3:301:9 | throw ... | 301:c3-c9 302:c3-c9 |
117116
| test.cpp:303:3:303:7 | re-throw exception | 303:c3-c7 304:c3-c7 |

0 commit comments

Comments
 (0)