@@ -66,70 +66,41 @@ class BIGNUM extends FunctionCall {
6666// BN_CTX *BN_CTX_new(void);
6767class BN_CTX_new extends CustomAllocator {
6868 BN_CTX_new ( ) {
69- this .getName ( ) = "BN_CTX_new" and
70- dealloc instanceof BN_CTX_free
71- }
72- }
73-
74- // BN_CTX *BN_CTX_secure_new(void);
75- class BN_CTX_secure_new extends CustomAllocator {
76- BN_CTX_secure_new ( ) {
77- this .getName ( ) = "BN_CTX_secure_new" and
69+ this .getQualifiedName ( ) .matches ( "BN\\_CTX_new%" )
70+ or
71+ this .getQualifiedName ( ) .matches ( "BN\\_CTX\\_secure\\_new%" ) and
7872 dealloc instanceof BN_CTX_free
7973 }
8074}
8175
8276// void BN_CTX_free(BN_CTX *c);
8377class BN_CTX_free extends CustomDeallocator {
84- BN_CTX_free ( ) { this .getName ( ) = "BN_CTX_free" }
78+ BN_CTX_free ( ) { this .getQualifiedName ( ) = "BN_CTX_free" }
8579
8680 override int getPointer ( ) { result = 0 }
8781}
8882
8983// void BN_CTX_start(BN_CTX *ctx);
90- class BN_CTX_start extends Expr {
91- BN_CTX_start ( ) {
92- exists ( FunctionCall fc |
93- fc = this and
94- fc .getTarget ( ) .getName ( ) = "BN_CTX_start"
95- )
96- }
84+ class BN_CTX_start extends FunctionCall {
85+ BN_CTX_start ( ) { this .getTarget ( ) .getName ( ) = "BN_CTX_start" }
9786
98- Expr getContext ( ) { result = this .( FunctionCall ) . getArgument ( 0 ) }
87+ Expr getContext ( ) { result = this .getArgument ( 0 ) }
9988}
10089
10190// void BN_CTX_end(BN_CTX *ctx);
102- class BN_CTX_end extends Expr {
103- BN_CTX_end ( ) {
104- exists ( FunctionCall fc |
105- fc = this and
106- fc .getTarget ( ) .getName ( ) = "BN_CTX_end"
107- )
108- }
91+ class BN_CTX_end extends FunctionCall {
92+ BN_CTX_end ( ) { this .getTarget ( ) .getName ( ) = "BN_CTX_end" }
10993
110- Expr getContext ( ) { result = this .( FunctionCall ) . getArgument ( 0 ) }
94+ Expr getContext ( ) { result = this .getArgument ( 0 ) }
11195}
11296
11397// BIGNUM *BN_CTX_get(BN_CTX *ctx);
114- class BN_CTX_get extends Expr {
115- BN_CTX_get ( ) {
116- exists ( FunctionCall fc |
117- fc = this and
118- fc .getTarget ( ) .getName ( ) = "BN_CTX_get"
119- )
120- }
98+ class BN_CTX_get extends FunctionCall {
99+ BN_CTX_get ( ) { this .getTarget ( ) .getName ( ) = "BN_CTX_get" }
121100
122- Expr getContext ( ) { result = this .( FunctionCall ) . getArgument ( 0 ) }
101+ Expr getContext ( ) { result = this .getArgument ( 0 ) }
123102}
124103
125- class BN_CTX extends Expr {
126- BN_CTX ( ) {
127- exists ( FunctionCall fc |
128- fc = this and
129- (
130- fc .getTarget ( ) instanceof BN_CTX_new or
131- fc .getTarget ( ) instanceof BN_CTX_secure_new
132- )
133- )
134- }
104+ class BN_CTX extends FunctionCall {
105+ BN_CTX ( ) { this .getTarget ( ) instanceof BN_CTX_new }
135106}
0 commit comments