From 98099d379605810a060b30fa642818788c9ca0db Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 7 Apr 2023 11:54:25 +0900 Subject: [PATCH] Register global variables before assignment --- ext/openssl/ossl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/openssl/ossl.c b/ext/openssl/ossl.c index 6c532aca9..71ddcb9f0 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