Project

General

Profile

Bug #11185 ยป 0001-openssl-use-RB_GC_GUARD-instead-of-volatile.patch

normalperson (Eric Wong), 05/27/2015 12:50 AM

View differences:

ext/openssl/ossl_asn1.c
ossl_asn1_traverse(VALUE self, VALUE obj)
{
unsigned char *p;
volatile VALUE tmp;
VALUE tmp;
long len, read = 0, offset = 0;
obj = ossl_to_der_if_possible(obj);
......
p = (unsigned char *)RSTRING_PTR(tmp);
len = RSTRING_LEN(tmp);
ossl_asn1_decode0(&p, len, &offset, 0, 1, &read);
RB_GC_GUARD(tmp);
int_ossl_decode_sanity_check(len, read, offset);
return Qnil;
}
......
{
VALUE ret;
unsigned char *p;
volatile VALUE tmp;
VALUE tmp;
long len, read = 0, offset = 0;
obj = ossl_to_der_if_possible(obj);
......
p = (unsigned char *)RSTRING_PTR(tmp);
len = RSTRING_LEN(tmp);
ret = ossl_asn1_decode0(&p, len, &offset, 0, 0, &read);
RB_GC_GUARD(tmp);
int_ossl_decode_sanity_check(len, read, offset);
return ret;
}
......
VALUE ary, val;
unsigned char *p;
long len, tmp_len = 0, read = 0, offset = 0;
volatile VALUE tmp;
VALUE tmp;
obj = ossl_to_der_if_possible(obj);
tmp = rb_str_new4(StringValue(obj));
......
read += tmp_read;
tmp_len -= tmp_read;
}
RB_GC_GUARD(tmp);
int_ossl_decode_sanity_check(len, read, offset);
return ary;
}
-
    (1-1/1)