@@ -119,6 +119,10 @@ private cached newtype HCBase =
119
119
or
120
120
HC_DeleteArrayExpr ( HashCons child ) { mk_DeleteArrayExpr ( child , _) }
121
121
or
122
+ HC_ThrowExpr ( HashCons child ) { mk_ThrowExpr ( child , _) }
123
+ or
124
+ HC_ReThrowExpr ( )
125
+ or
122
126
// Any expression that is not handled by the cases above is
123
127
// given a unique number based on the expression itself.
124
128
HC_Unanalyzable ( Expr e ) { not analyzableExpr ( e , _) }
@@ -228,6 +232,8 @@ class HashCons extends HCBase {
228
232
if this instanceof HC_ClassAggregateLiteral then result = "ClassAggreagateLiteral" else
229
233
if this instanceof HC_DeleteExpr then result = "DeleteExpr" else
230
234
if this instanceof HC_DeleteArrayExpr then result = "DeleteArrayExpr" else
235
+ if this instanceof HC_ThrowExpr then result = "ThrowExpr" else
236
+ if this instanceof HC_ReThrowExpr then result = "ReThrowExpr" else
231
237
result = "error"
232
238
}
233
239
@@ -828,6 +834,23 @@ private predicate mk_ArrayAggregateLiteral(Type t, HC_Array hca, ArrayAggregateL
828
834
)
829
835
}
830
836
837
+ private predicate analyzableThrowExpr ( ThrowExpr te ) {
838
+ strictcount ( te .getExpr ( ) .getFullyConverted ( ) ) = 1
839
+ }
840
+
841
+ private predicate mk_ThrowExpr ( HashCons hc , ThrowExpr te ) {
842
+ analyzableThrowExpr ( te ) and
843
+ hc .getAnExpr ( ) = te .getExpr ( ) .getFullyConverted ( )
844
+ }
845
+
846
+ private predicate analyzableReThrowExpr ( ReThrowExpr rte ) {
847
+ any ( )
848
+ }
849
+
850
+ private predicate mk_ReThrowExpr ( ReThrowExpr te ) {
851
+ any ( )
852
+ }
853
+
831
854
/** Gets the hash-cons of expression `e`. */
832
855
cached HashCons hashCons ( Expr e ) {
833
856
exists ( int val , Type t
@@ -946,6 +969,16 @@ cached HashCons hashCons(Expr e) {
946
969
result = HC_DeleteArrayExpr ( child )
947
970
)
948
971
or
972
+ exists ( HashCons child
973
+ | mk_ThrowExpr ( child , e ) and
974
+ result = HC_ThrowExpr ( child )
975
+ )
976
+ or
977
+ (
978
+ mk_ReThrowExpr ( e ) and
979
+ result = HC_ReThrowExpr ( )
980
+ )
981
+ or
949
982
(
950
983
mk_Nullptr ( e ) and
951
984
result = HC_Nullptr ( )
@@ -987,5 +1020,7 @@ predicate analyzableExpr(Expr e, string kind) {
987
1020
( analyzableClassAggregateLiteral ( e ) and kind = "ClassAggregateLiteral" ) or
988
1021
( analyzableArrayAggregateLiteral ( e ) and kind = "ArrayAggregateLiteral" ) or
989
1022
( analyzableDeleteExpr ( e ) and kind = "DeleteExpr" ) or
990
- ( analyzableDeleteArrayExpr ( e ) and kind = "DeleteArrayExpr" )
1023
+ ( analyzableDeleteArrayExpr ( e ) and kind = "DeleteArrayExpr" ) or
1024
+ ( analyzableThrowExpr ( e ) and kind = "ThrowExpr" ) or
1025
+ ( analyzableReThrowExpr ( e ) and kind = "ReThrowExpr" )
991
1026
}
0 commit comments