@@ -119,6 +119,10 @@ private cached newtype HCBase =
119119 or
120120 HC_DeleteArrayExpr ( HashCons child ) { mk_DeleteArrayExpr ( child , _) }
121121 or
122+ HC_ThrowExpr ( HashCons child ) { mk_ThrowExpr ( child , _) }
123+ or
124+ HC_ReThrowExpr ( )
125+ or
122126 // Any expression that is not handled by the cases above is
123127 // given a unique number based on the expression itself.
124128 HC_Unanalyzable ( Expr e ) { not analyzableExpr ( e , _) }
@@ -228,6 +232,8 @@ class HashCons extends HCBase {
228232 if this instanceof HC_ClassAggregateLiteral then result = "ClassAggreagateLiteral" else
229233 if this instanceof HC_DeleteExpr then result = "DeleteExpr" else
230234 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
231237 result = "error"
232238 }
233239
@@ -828,6 +834,23 @@ private predicate mk_ArrayAggregateLiteral(Type t, HC_Array hca, ArrayAggregateL
828834 )
829835}
830836
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+
831854/** Gets the hash-cons of expression `e`. */
832855cached HashCons hashCons ( Expr e ) {
833856 exists ( int val , Type t
@@ -946,6 +969,16 @@ cached HashCons hashCons(Expr e) {
946969 result = HC_DeleteArrayExpr ( child )
947970 )
948971 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
949982 (
950983 mk_Nullptr ( e ) and
951984 result = HC_Nullptr ( )
@@ -987,5 +1020,7 @@ predicate analyzableExpr(Expr e, string kind) {
9871020 ( analyzableClassAggregateLiteral ( e ) and kind = "ClassAggregateLiteral" ) or
9881021 ( analyzableArrayAggregateLiteral ( e ) and kind = "ArrayAggregateLiteral" ) or
9891022 ( 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" )
9911026}
0 commit comments