@@ -255,7 +255,7 @@ class HashCons extends HCBase {
255
255
if this instanceof HC_TypeidType then result = "TypeidType" else
256
256
if this instanceof HC_TypeidExpr then result = "TypeidExpr" else
257
257
if this instanceof HC_ArrayAggregateLiteral then result = "ArrayAggregateLiteral" else
258
- if this instanceof HC_ClassAggregateLiteral then result = "ClassAggreagateLiteral " else
258
+ if this instanceof HC_ClassAggregateLiteral then result = "ClassAggregateLiteral " else
259
259
if this instanceof HC_DeleteExpr then result = "DeleteExpr" else
260
260
if this instanceof HC_DeleteArrayExpr then result = "DeleteArrayExpr" else
261
261
if this instanceof HC_ThrowExpr then result = "ThrowExpr" else
@@ -464,7 +464,7 @@ private predicate mk_Deref(HashCons p, PointerDereferenceExpr deref) {
464
464
465
465
private predicate analyzableNonmemberFunctionCall ( FunctionCall fc ) {
466
466
forall ( int i |
467
- exists ( fc .getArgument ( i ) ) |
467
+ i in [ 0 .. fc .getNumberOfArguments ( ) - 1 ] |
468
468
strictcount ( fc .getArgument ( i ) .getFullyConverted ( ) ) = 1
469
469
) and
470
470
strictcount ( fc .getTarget ( ) ) = 1 and
@@ -487,7 +487,7 @@ private predicate mk_NonmemberFunctionCall(Function fcn, HC_Args args, FunctionC
487
487
488
488
private predicate analyzableExprCall ( ExprCall ec ) {
489
489
forall ( int i |
490
- exists ( ec .getArgument ( i ) ) |
490
+ i in [ 0 .. ec .getNumberOfArguments ( ) - 1 ] |
491
491
strictcount ( ec .getArgument ( i ) .getFullyConverted ( ) ) = 1
492
492
) and
493
493
strictcount ( ec .getExpr ( ) .getFullyConverted ( ) ) = 1
@@ -508,7 +508,7 @@ private predicate mk_ExprCall(HashCons hc, HC_Args args, ExprCall ec) {
508
508
private predicate analyzableMemberFunctionCall (
509
509
FunctionCall fc ) {
510
510
forall ( int i |
511
- exists ( fc .getArgument ( i ) ) |
511
+ i in [ 0 .. fc .getNumberOfArguments ( ) - 1 ] |
512
512
strictcount ( fc .getArgument ( i ) .getFullyConverted ( ) ) = 1
513
513
) and
514
514
strictcount ( fc .getTarget ( ) ) = 1 and
@@ -573,11 +573,15 @@ private predicate mk_ArgConsInner(HashCons head, HC_Args tail, int i, HC_Args li
573
573
*/
574
574
private predicate analyzableAllocatorArgZero ( ErrorExpr e ) {
575
575
exists ( NewOrNewArrayExpr new |
576
- new .getAllocatorCall ( ) .getChild ( 0 ) = e
576
+ new .getAllocatorCall ( ) .getChild ( 0 ) = e and
577
+ strictcount ( new .getType ( ) .getUnspecifiedType ( ) ) = 1
577
578
)
579
+ and
580
+ strictcount ( NewOrNewArrayExpr new | new .getAllocatorCall ( ) .getChild ( 0 ) = e ) = 1
578
581
}
579
582
580
583
private predicate mk_AllocatorArgZero ( Type t , ErrorExpr e ) {
584
+ analyzableAllocatorArgZero ( e ) and
581
585
exists ( NewOrNewArrayExpr new |
582
586
new .getAllocatorCall ( ) .getChild ( 0 ) = e and
583
587
t = new .getType ( ) .getUnspecifiedType ( )
@@ -767,7 +771,9 @@ private predicate analyzableClassAggregateLiteral(ClassAggregateLiteral cal) {
767
771
forall ( int i |
768
772
exists ( cal .getChild ( i ) ) |
769
773
strictcount ( cal .getChild ( i ) .getFullyConverted ( ) ) = 1 and
770
- strictcount ( Field f | cal .getChild ( i ) = cal .getFieldExpr ( f ) ) = 1
774
+ strictcount ( Field f | cal .getChild ( i ) = cal .getFieldExpr ( f ) ) = 1 and
775
+ strictcount ( Field f , int j |
776
+ cal .getFieldExpr ( f ) = cal .getChild ( i ) and j = f .getInitializationOrder ( ) ) = 1
771
777
)
772
778
}
773
779
@@ -791,10 +797,12 @@ private predicate analyzableArrayAggregateLiteral(ArrayAggregateLiteral aal) {
791
797
forall ( int i |
792
798
exists ( aal .getChild ( i ) ) |
793
799
strictcount ( aal .getChild ( i ) .getFullyConverted ( ) ) = 1
794
- )
800
+ ) and
801
+ strictcount ( aal .getType ( ) .getUnspecifiedType ( ) ) = 1
795
802
}
796
803
797
804
private predicate mk_ArrayCons ( Type t , int i , HashCons hc , HC_Array hca , ArrayAggregateLiteral aal ) {
805
+ analyzableArrayAggregateLiteral ( aal ) and
798
806
t = aal .getType ( ) .getUnspecifiedType ( ) and
799
807
hc = hashCons ( aal .getChild ( i ) ) and
800
808
(
@@ -935,7 +943,7 @@ cached HashCons hashCons(Expr e) {
935
943
result = HC_MemberFunctionCall ( fcn , qual , args )
936
944
)
937
945
or
938
- // works around an extractor issue class
946
+ // works around an extractor issue
939
947
exists ( Type t
940
948
| mk_AllocatorArgZero ( t , e ) and
941
949
result = HC_AllocatorArgZero ( t )
@@ -972,6 +980,11 @@ cached HashCons hashCons(Expr e) {
972
980
)
973
981
or
974
982
exists ( Type t
983
+ | mk_UuidofOperator ( t , e ) and
984
+ result = HC_UuidofOperator ( t )
985
+ )
986
+ or
987
+ exists ( Type t
975
988
| mk_AlignofType ( t , e ) and
976
989
result = HC_AlignofType ( t )
977
990
)
0 commit comments