aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-04-07 11:54:25 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-04-07 11:54:25 +0900
commit98099d379605810a060b30fa642818788c9ca0db (patch)
treeb07782a4c430d9388e7a85bd226a4a8cd992bc21
parenta14055a9cf46d88bd1c02437d5d3737f366dd36f (diff)
downloadruby-openssl-98099d379605810a060b30fa642818788c9ca0db.tar.gz
Register global variables before assignment
-rw-r--r--ext/openssl/ossl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/openssl/ossl.c b/ext/openssl/ossl.c
index 6c532aca..71ddcb9f 100644
--- a/ext/openssl/ossl.c
+++ b/ext/openssl/ossl.c
@@ -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);
/*
@@ -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