diff options
author | Jeremy Evans <code@jeremyevans.net> | 2018-07-13 14:30:09 -0700 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2018-07-13 14:30:09 -0700 |
commit | 16156285b62e5395e25eec478b66d1cd4c4db412 (patch) | |
tree | 353c9e86ca3662a838aa9a05cd193e639e797d87 | |
parent | fdcda971a26895ea5c5015a90671ee73039d55e8 (diff) | |
download | ruby-openssl-16156285b62e5395e25eec478b66d1cd4c4db412.tar.gz |
Move rb_global_variable call to directly after assignment
While I'm guessing the INT2NUM calls all generate Fixnums and not Bignums,
it's unwise to rely on that. Calling rb_global_variable directly after
assignment is the pattern used in ossl.c, and it's probably best to do
that here as well.
-rw-r--r-- | ext/openssl/ossl_asn1.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c index fb05e038..7198ec8e 100644 --- a/ext/openssl/ossl_asn1.c +++ b/ext/openssl/ossl_asn1.c @@ -1823,6 +1823,7 @@ do{\ rb_define_method(cASN1EndOfContent, "to_der", ossl_asn1eoc_to_der, 0); class_tag_map = rb_hash_new(); + rb_global_variable(&class_tag_map); rb_hash_aset(class_tag_map, cASN1EndOfContent, INT2NUM(V_ASN1_EOC)); rb_hash_aset(class_tag_map, cASN1Boolean, INT2NUM(V_ASN1_BOOLEAN)); rb_hash_aset(class_tag_map, cASN1Integer, INT2NUM(V_ASN1_INTEGER)); @@ -1846,7 +1847,6 @@ do{\ rb_hash_aset(class_tag_map, cASN1GeneralString, INT2NUM(V_ASN1_GENERALSTRING)); rb_hash_aset(class_tag_map, cASN1UniversalString, INT2NUM(V_ASN1_UNIVERSALSTRING)); rb_hash_aset(class_tag_map, cASN1BMPString, INT2NUM(V_ASN1_BMPSTRING)); - rb_global_variable(&class_tag_map); id_each = rb_intern_const("each"); } |