Skip to content

Commit

Permalink
Merge pull request #613 from nobu/global_variable
Browse files Browse the repository at this point in the history
Register global variables before assignment
  • Loading branch information
nobu authored Apr 7, 2023
2 parents a14055a + 98099d3 commit 6182ac0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/openssl/ossl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1170,8 +1170,8 @@ Init_openssl(void)
/*
* Init main module
*/
mOSSL = rb_define_module("OpenSSL");
rb_global_variable(&mOSSL);
mOSSL = rb_define_module("OpenSSL");
rb_define_singleton_method(mOSSL, "fixed_length_secure_compare", ossl_crypto_fixed_length_secure_compare, 2);

/*
Expand Down Expand Up @@ -1208,12 +1208,12 @@ Init_openssl(void)
rb_define_module_function(mOSSL, "fips_mode", ossl_fips_mode_get, 0);
rb_define_module_function(mOSSL, "fips_mode=", ossl_fips_mode_set, 1);

rb_global_variable(&eOSSLError);
/*
* Generic error,
* common for all classes under OpenSSL module
*/
eOSSLError = rb_define_class_under(mOSSL,"OpenSSLError",rb_eStandardError);
rb_global_variable(&eOSSLError);

/*
* Init debug core
Expand Down

0 comments on commit 6182ac0

Please sign in to comment.